Hello Gideon,
you have two options:
a) Just put a variable of name DOCUMENT_NUMBER into the pipeline, before you invoke
pub.sap.client:invoke. This Service will pick it up automatically from the pipeline.
b) A more convenient way is: go to Adapters → SAP → Lookup and create an “RFC Outbound Map” for EDI_DOCUMENT_OPEN_FOR_READ (and the other ones as well).
Then instead of pub.sap.client:invoke use this generated Outbound Map. It will display the inputs/outputs of that function module in the pipeline neatly.
One more tip: these three EDI_** function modules will probably use SAP internal user session memory. Therefore you will need to use lockSession/releaseSession as follows:
- invoke pub.sap.client:lockSession
(reserves an RFC connection from the pool for your exclusive usage)
- invoke EDI_DOCUMENT_OPEN_FOR_READ
- invoke EDI_SEGMENTS_GET_ALL
- invoke EDI_DOCUMENT_CLOSE_READ
- invoke pub.sap.client:releaseSession
(releases the connection back to the pool and resets the user session inside SAP)
If you are using Java, do the “releaseSession” in a finally block! That way you can be sure that it will always be executed (avoiding ugly connection leaks).
Lanzelot
#Flow-and-Java-services#webMethods#Integration-Server-and-ESB