Skip to Content

SQL to SOAP Scenario in SAP PI

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

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Jan 05 at 04:43 AM

    Can you please share the XML generated after DB query.

    Add comment
    10|10000 characters needed characters exceeded

    • 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); }