Skip to Content

Java Mapping for SOAP sender text to xml requirement

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 -


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.


Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • May 04, 2017 at 07:34 AM

    Hi Vijay,

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

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



    Add comment
    10|10000 characters needed characters exceeded

  • May 04, 2017 at 11:06 AM

    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.



    Add comment
    10|10000 characters needed characters exceeded