Skip to Content
0
Aug 01, 2020 at 07:49 AM

Passing CSV data as webservice input

70 Views

Hi,

I have a requirement where to a certain SAP MII transaction, I shall get input in the following format

1234,3456,5436/ABCD,EFGH,IJKL,/1111,2222,3333

Every '/' denotes end of the row and the column values are separated by commas (,)

I need to pass each row as a webservice line item with each column corresponding to a particular field in the service item payload.

The service input structure is as follows

<?xml version="1.0" encoding="UTF-8"?>

<ns1:receiptCreation xmlns:ns1="<SERVICE METADATA>" xmlns="<SERVICE METADATA>">

<ns1:receiptlist>

<ns1:receipt>

<ns1:item>

<ns1:CURRENT_RATE/>

<ns1:MWDOMAIN/>

<ns1:PART_CATEGORY/>

</ns1:item>

</ns1:receipt>

</ns1:receiptlist>

</ns1:receiptCreation>

Therefore, I am trying to create three instances of <ns1:item> in my service call from the data passed to the transaction.

I have used a String_List_to_XML_Parser with Delimiter '/' to isolate the rows.

However, I am struggling with iterating over each row and map the fields to its corresponding service input?

Can anyone direct me as to how do I approach this?