cancel
Showing results for 
Search instead for 
Did you mean: 

flat file to idoc - mapping

Former Member
0 Kudos

Gurus,

I have a flat txt file of following format

Doc# Whse Item Matnr date code

3256999 WH20 1001 861927 09/12/200713:24 9596 2

3256999 WH20 1002 861928 09/12/200713:24 9596 2

3256999 WH20 1003 861929 09/12/200713:24 9596 2

3257169 WH20 2000 861964 09/12/200713:24 9596 2

The first 2 columns are header fields rest all are item fields. How do i map this to an Idoc, so as to move doc# and whse to header segment and rest of columns to add multiple item segments on the same idoc ? So for above file i should get 2 idocs only.

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

You can navigate thru these links to get more information:

/people/sravya.talanki2/blog/2005/12/08/message-mapping-simplified-150-part-ii

http://help.sap.com/saphelp_nw04/helpdata/en/ef/df564b6aa24fc9ab0d685460747de5/frameset.htm

http://help.sap.com/saphelp_nw04/helpdata/en/ee/bf9640dc522f28e10000000a1550b0/frameset.htm

Do your want the source and target structures to resemble the structures below?

Source:-

<source_file>

-


<row_1>

-


<item_a>

-


<item_b>

-


<item_c>

-


</row_1>

-


<row_2>

-


<item_p>

-


<item_q>

-


<item_r>

-


</row_2>

-


<row_3>

-


<item_x>

-


<item_y>

-


<item_z>

-


</row_3>

</source_file>

Target:-

<target_idoc>

-


<item_a>

-


<item_b>

-


<item_c>

-


<item_p>

-


<item_q>

-


<item_r>

-


<item_x>

-


<item_y>

-


<item_z>

</target_idoc>

If so, then all you need to do is to use the node function: "remove context" for all the items under your rows. In other words,do the following mapping:-

*source_file mapped to target_idoc

*map each of the items under all the three rows in the following way:-

"source item" mapped to "remove context" (node function) mapped to (corresponding) "target item".

Also check the occurences for each of your variables in both source and target structures.

/people/ravikumar.allampallam/blog/2005/03/03/creating-purchase-order-idoc-through-xi

Regard's

-Prabhakar.A

Former Member
0 Kudos

My source structure is TXT file as follow:

each line is for a delivery/item data.

Delid Whse Delitm Matnr date Shipid

3256999 WH20 1001 861927 09/12/200713:24 95962

3256999 WH20 1002 861928 09/12/200713:24 95962

3256999 WH20 1003 861929 09/12/200713:24 95962

3257169 WH20 2000 861964 09/12/200713:24 95962

Target structure is idoc ZTPSSHT01:

This idoc was generated using tcode BDBG, for custom BAPI FM. The segments are actually the table parameters of idoc.

All the header data goes into ZE1TPSHI01, imagine it as internal table of structure

SHPID

SHPTYP

CARRID

WARHSE

Item related data goes into segment ZE1TPSHI01, imagine it as internal table of

SHPID

SHPITM

DELID

DELITM

LIFEX

BOLNR

Former Member
0 Kudos

Hi,

Provide your source & target structures and mapping conditions to mapping the flat file structure to an IDoc.

Cheers

Veera

former_member214364
Active Contributor
0 Kudos

Hi BRamchan,

could you pleasesend your source and target IDOC structures.

Thanks,

Jag