Skip to Content
0

Java Mapping for SOAP sender text to xml requirement

May 04, 2017 at 06:44 AM

88

avatar image

The requirement is third party server is sending text file using SOAP adapter as attachments. We can't use File adapter or any other adapter apart of SOAP adapter due to third party server limitation.

The file need to be picked up by PO using SOAP attachments and need to be mapped to SAP idoc.

Due to soap sender , we need to use Java mapping here to convert text document to XML. Can anyone please provide java mapping for below file -

44,20160203,63584,23600004,3
45,20140303,1101032,23600004,3

There can be N number of lines starting from 44 or 45 or 46.

Target XML fields one can name as A,B,C,D,E under node MessageDetails.

Regards

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

2 Answers

Mark Dihiansan May 04, 2017 at 07:34 AM
0

Hi Vijay,

No need to use Java Mapping, you can use a UDF to read the text file.

https://archive.sap.com/discussions/thread/1341089

Create the target structure. Afterwards, once you have extracted the text contents, map it to the target structure.

Regards,

Mark

Share
10 |10000 characters needed characters left characters exceeded
avatar image
Former Member May 04, 2017 at 11:06 AM
0

Hi Vijay,

You can easily read the attachment using InputAttachment method in JAVA mapping. Use Collection to store the value and then create your output accordingly. This is really very easy when the attachment is containing xml data and you will get multiple blog in SCN to refer the code.

But, as your input is a text file and I am assuming that data is here with some separator. I shall suggest you, to create 2 separate scenarios.

1) One is SOAP to file scenario (NFS) - In the sender channel use module - PayloadSwapBean and store the file in AL11. Simple pass through scenario.

2) File to IDOC scenario - Use FCC to read the file. Your xml will be created for you by file adapter without the hassle of JAVA mapping and map to the idoc accordingly.

Thanks,

Apu

Share
10 |10000 characters needed characters left characters exceeded