Skip to Content
0

SAP PI file adatper

Jan 19, 2017 at 05:58 PM

149

avatar image
Former Member

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

10 |10000 characters needed characters left 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)

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

8 Answers

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

Hi Raghuram,

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

Thanks you very much.

Regards

Mohan

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

Great Mohan,

The you have to mark my answer as correct. ;)

0
Raghuraman S Jan 20, 2017 at 04:04 AM
0

Try the below parameter

xml.<StructureName>.missingLastFields

Reference link

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

Share
10 |10000 characters needed characters left characters exceeded
avatar image
Former Member Jan 20, 2017 at 05:29 AM
0

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


Share
10 |10000 characters needed characters left characters exceeded
Raghuraman S Jan 20, 2017 at 06:18 AM
0

Hello Mohan,

Try changing your conversion type to StructPlain2XML and

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

Share
10 |10000 characters needed characters left characters exceeded
avatar image
Former Member Jan 20, 2017 at 08:04 AM
0

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

Share
10 |10000 characters needed characters left characters exceeded
Raghuraman S Jan 20, 2017 at 10:04 AM
0

Hello Mohan,

Then try like this.

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

Share
10 |10000 characters needed characters left characters exceeded
avatar image
Former Member Jan 20, 2017 at 12:03 PM
0

Hi Mohan,

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

Thanks-Karthi

Share
10 |10000 characters needed characters left characters exceeded
avatar image
Former Member Jan 20, 2017 at 12:04 PM
0

Hi Mohan,

Pls also share the screenshot of ur FCC tab..

Thanks-Karthi

Share
10 |10000 characters needed characters left characters exceeded