Skip to Content
0

SQL to SOAP Scenario in SAP PI

Jan 03 at 12:27 PM

66

avatar image
Former Member

Hello Experts, i am in a middle of project where i have to develop a integration scenarion where i have to extract data from an SQL table ( not SAP ) & then send the extracted data to a webservice.

The first part i have accomplished however after extracting data i have pass all the data as a CSV value to a element of the target structure.

thanks

priyesh shah

10 |10000 characters needed characters left characters exceeded

Hi,

Why is it need to squeeze all source value into target structure? Shall the target structure be more structured?

0
Former Member

Hi Chan, it is the requirement & the team is very rigid .can alter it.

thanks

0
* Please Login or Register to Answer, Follow or Comment.

1 Answer

Raghuraman S Jan 05 at 04:43 AM
0

Can you please share the XML generated after DB query.

Show 1 Share
10 |10000 characters needed characters left characters exceeded
Former Member

let me frame my question again, we have JDBC to SOAP Scenario where We have successfully extracted Data from an SQL Table using JDBC Adapater , we are using a SOAP Receiver Channel to send the data in a below format

<Data>COL1;COL2;.......;COL18

DATA1[1];DATA2[1];......;DATA18[1]

DATA1[2];DATA2[2];......;DATA18[2]

</Data>

For this i had created a UDF function however the function only seems to process a single row of data not multiple.

public void FN_UDFConCat(String[] rowCount, String[] COL1, String[] COL2, String[] COL3, String[] COL4,.. STRING COL18, ResultList result, Container container) throws StreamTransformationException{

String delimiter = " ; ";

String columnHeader = "COL1;COL2;COL3;.......COL18";

String newLineCharacter = "\n";

String finalOutput = " ";

String value;

int i = 0;

finalOutput = columnHeader + newLineCharacter ;

//value = "IN";

//MappingTrace mt = container.getTrace();

for ( i = 0; i < rowCount.length; i ++)

{

//mt.addInfo(value);

finalOutput = finalOutput +

COL1[i] + delimiter +

COL2[i] + delimiter +

COL3[i] + delimiter +

COL4[i] + delimiter +

COL4[i] + delimiter +

COL5[i] + delimiter +

COL6[i] + delimiter +

COL7[i] + delimiter +

COL8[i] + delimiter +

COL9[i] + delimiter +

COl10[i] + delimiter +

COl11[i] + delimiter +

COl12[i] + delimiter +

COl13[i] + delimiter +

COL14[i] + delimiter +

COl15[i] + delimiter +

COl16[i] + delimiter +

COl17[i] + delimiter +

COL18[i] + delimiter +newLineCharacter;

}

result.addValue(finalOutput); }

0