cancel
Showing results for 
Search instead for 
Did you mean: 

XML to PLAIN - urgent help needed

Former Member
0 Kudos

Hello everybody!

I have a ftp receiver adapter; in this adapter a xml file should be converted to a plain text file.

The structure looks like this:

<ns0:MFG_ORDERS xmlns:ns0="urn:test.com:edi:test">

<HEADER>

<So_recordtype>SOHD</So_recordtype>

<So_nbr>07096111</So_nbr>

<So_cust>0210</So_cust>

<So_bill>0210</So_bill>

<So_ship>0210</So_ship>

<So_date>20060516</So_date>

</HEADER>

<LINEITEMS>

<Sod_recordtype>SOLI</Sod_recordtype>

<Sod_line>001</Sod_line>

<Sod_part>BO2224-88916000</Sod_part>

<Sod_qty_ord>000100,00</Sod_qty_ord>

<Sod_um>PCE</Sod_um>

<LINEITEMTEXTS>

<Solt_recordtype>SOLT</Solt_recordtype>

<Solt_nbr>07096111</Solt_nbr>

<Solt_line>00001</Solt_line>

<Solt_counter>01</Solt_counter>

<Solt_text>001 1 Line Item Text Example</Solt_text>

</LINEITEMTEXTS>

<LINEITEMTEXTS>

<Solt_recordtype>SOLT</Solt_recordtype>

<Solt_nbr>07096111</Solt_nbr>

<Solt_line>00001</Solt_line>

<Solt_counter>02</Solt_counter>

<Solt_text>001 2 Line Item Text Example</Solt_text>

</LINEITEMTEXTS>

</LINEITEMS>

</ns0:MFG_ORDERS>

After conversion it should look like this:

SOHD......

SOLI....

SOLT...

SOLT...

My problem is that the "LINEITEMTEXTS"-segments are subsegments of the "LINEITEMS"-segment which is not converted properly.

Can anybody help me?

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi Moorthy,

yes, I would need the following output:

FIELD1FIELD2FIELD3....

without any separators between the fields.

Kind regards

Christian

Former Member
0 Kudos

Chris

As far as my knowledge goes you should specify either fieldfixedlengths or fieldseparator. It is mandatory. You can check about this in:

http://help.sap.com/saphelp_nw04s/helpdata/en/2c/181077dd7d6b4ea6a8029b20bf7e55/content.htm

The other option is to go for a delimited one or fixed length type.

Regards,

---Satish

Former Member
0 Kudos

Hi Moorthy,

thank you very much for your quick help.

I configured the communciation adapter according to your tips and the output was really better.

As you know I have to specify either the the fixed lengths or the field separators. Otherwise I receive the error message "Parameter 'HEADER.fieldFixedLengths' or 'HEADER.fieldSeparator' is missing". As I do not want to work with fixed lengths I would prefer the field separators.

This is how it looks at the moment (with defined field separator " " (blank); first separator after "SOLT", second after "07096111", ...):

SOLT 07096111 00001 02 001 2 Line Item Text Example Line 2

This is how it should look like:

SOLT070961110000102001 2 Line Item Text Example Line 2

Do you know if/how it is possible to specify a field separator without content that all fields are just in one row without any (visible) separator?

Kind regards

Christian

Former Member
0 Kudos

Pichler

You should specify at least either .fieldFixedLength or a .fieldSeparator. The best way in your scenario is give only one space in fieldSeparator and give an endSepartor 5 spaces. Then your output will be like:

SOLT 07096111 00001 02 001 2 Line Item Text Example Line 2

or you specify a comma as fieldSeparator and endSeparator as 5Spaces. Then your output will look like:

SOLT,07096111,00001,02,001,2 Line Item Text Example Line 2

Regards,

---Satish

moorthy
Active Contributor
0 Kudos

Hi Chris,

<i>Do you know if/how it is possible to specify a field separator without content that all fields are just in one row without any (visible) separator?</i>

Whay you mean ? Is you require all the nodes (not fields ) in one line,,, Can you elaborate me more..

What is the output required..

Thanks,

Moorthy

Former Member
0 Kudos

Hi chris,

try giving the field separator as "".

field1.fieldSeparator ""

just try this

regards

jithesh

moorthy
Active Contributor
0 Kudos

Hi Chris,

Record Structure HEADER,LINEITEMS,LINEITEMTEXTS

HEADER.fieldSeparator 'nl'

HEADER.endSeparator 'nl'

LINEITEMS.fieldSeparator 'nl'

LINEITEMS.endSeparator 'nl'

LINEITEMTEXTS.fieldSepartor 'nl'

LINEITEMTEXTS.endSeparator 'nl'

If you want any field separator give accordingly. BTW what is the output you are getting..

For more-

http://help.sap.com/saphelp_nw2004s/helpdata/en/d2/bab440c97f3716e10000000a155106/frameset.htm

Just check this,

Thanks,

Moorthy