Variant 5
COMMUNICATION RECEIVE ID id ...BUFFER f ...DATAINFO d ...STATUSINFO s.
Additions
1. ... RETURNCODE rc
2. ... LENGTH leng
3. ... RECEIVED m
4. ... HOLD
2. ... LENGTH leng
3. ... RECEIVED m
4. ... HOLD
Effect
Receives data in the field f . If no length is explicitly defined, the amount of data accepted depends on the length of the field. The fields d and s contain information about the receive process. You can address the contents of these using symbolic names in the include program RSCPICDF . The field d indicates whether the data was received in its entirety. The status field s informs the RECEIVE user of the status of the program. Here, it is important to know whether the program is in receive status or send status. It is, for example, not possible to send data if the program is in receive status.
Addition 1
... RETURNCODE rc
Effect
Stores the return code in the field rc .
Addition 2
... LENGTH leng
Effect
Receives data only in the specified length leng .
Addition 3
... RECEIVED m
Effect
After the call, m contains the number of bytes received by the partner program.
Addition 4
... HOLD
Effect
Normally, data is received asynchronously, i.e. the system performs a rollout. However, this may not be desirable if, for example, the data is received in a SELECT loop, the database cursor is lost due to the rollout and the loop is terminated. To prevent a rollout, you can use the addition HOLD . Then, the SAP process waits until the data has been received and is thus available for use by other users.
Note
The fields d , s and m which contain information about the outcome of the call must be of type X with length 4.
Example
FORM CPIC_EXAMPLE.
TYPES: CONVERSATION_ID(8) TYPE C,
RETURN_CODE LIKE SY-SUBRC,
C_INFO(4) TYPE X.
DATA: CONVID TYPE CONVERSATION_ID,
CPIC_RC TYPE RETURN_CODE,
RECORD(80) TYPE C,
DINFO TYPE C_INFO,
SINFO TYPE C_INFO.
INCLUDE RSCPICDF.
COMMUNICATION ACCEPT ID CONVID
RETURNCODE CPIC_RC.
IF CPIC_RC NE CM_OK.
EXIT.
ENDIF.
COMMUNICATION RECEIVE ID CONVID
BUFFER RECORD
STATUSINFO SINFO
DATAINFO DINFO
RETURNCODE CPIC_RC.
IF CPIC_RC NE CM_OK.
EXIT.
ENDIF.
ENDFORM. 29.4 RELATED POST COMMUNICATION SYNTAX PART THERE sap internet transaction architecture SAP internet transaction application components Mysap market place introduction Customer interface in mysap market place
No comments :
Post a Comment