Skip to Content
avatar image
Former Member

SAP PI file adatper

Hi,

Can you please help in file adapter handling of pipe line separated values.

I need to handle the last field of pipe line separated values if the value is empty.

I have configured in sftp file adapter module and in the module I have newlinesepertaor is 'nl'. How to handle if the last filed vaue is empty.

Regards

Mohan

Add comment
10|10000 characters needed characters exceeded

  • Former Member

    eg: Pipe lile seperator file looks as below (field Header and val is values. Field5 value is empty which I need to handle in sftp adapter module.

    field1|field2|field3|field4|field5

    val1||val3|val4|

    val5||val6|val7|

    Case2: val1||val3|val4|val5 (works fine if end of the field has value)

  • Get RSS Feed

8 Answers

  • Best Answer
    avatar image
    Former Member
    Jan 23, 2017 at 12:01 PM

    Hi Raghuram,

    "xml.missingLastFields - add" worked. Now missing feild is taking empty value.

    Thanks you very much.

    Regards

    Mohan

    Add comment
    10|10000 characters needed characters exceeded

  • Jan 20, 2017 at 04:04 AM

    Try the below parameter

    xml.<StructureName>.missingLastFields

    Reference link

    https://blogs.sap.com/2014/09/24/fcc-parameter-reference-for-messagetransformbean-module/

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Jan 20, 2017 at 05:29 AM

    Hi Raghuram,

    I tried to use below parameter in sftp adapter. But its not working

    xml.REFNUM.missingLastFields - add/ignore (Indiviaully both parameter values used)

    add - Outbound structure contains all fields from the configuration; the fields missing in the inbound structure are empty. (Does this ignore the empty field value of field5)

    output should be as below:

    <field1>val1</field1>

    <field2/>

    <field3>val3</field3>

    <field4>val4</field4>

    <field5/>

    Attached is sttp adapter module screen shot:

    sftp-module-parameters.png

    Regards

    Mohan S

    Add comment
    10|10000 characters needed characters exceeded

  • Jan 20, 2017 at 06:18 AM

    Hello Mohan,

    Try changing your conversion type to StructPlain2XML and

    xml.REFNUM.missingLastFields to add --- To add the missing fields as Blank in XML.

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Jan 20, 2017 at 08:04 AM

    Hi Rahuraman,

    If I try to use StructPlain2XML then I need to use xml.recordsetStructure, else file will not pick up the file.

    I think for xml.recordsetStructure need to define each structurename, and configure the structure separately. Looks becoming complex as I have many fields. As file did'n pick up and it expect to define recordsetStructure.

    Can you please help on this.

    Regards

    Mohan S

    Add comment
    10|10000 characters needed characters exceeded

  • Jan 20, 2017 at 10:04 AM

    Hello Mohan,

    Then try like this.

    xml.missingLastFields to add ,can you post how the structure looks like .

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Jan 20, 2017 at 12:03 PM

    Hi Mohan,

    Can you plz share ur DT structure? both sender and recvr

    Thanks-Karthi

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Jan 20, 2017 at 12:04 PM

    Hi Mohan,

    Pls also share the screenshot of ur FCC tab..

    Thanks-Karthi

    Add comment
    10|10000 characters needed characters exceeded