cancel
Showing results for 
Search instead for 
Did you mean: 

Repeat header segment in txt File

Former Member
0 Kudos

Hi All expert

I am working on scenario IDOC to File in IDOC parent segment come in one time and chilled segment repeated number of time but have different value in each time

In output I want to repeat header segment as per number of child segment

IDOC structure after loading data look like

<E1CABNM> header

<E1CAWNM> item

<E1CAWNM> item

<E1CAWNM> item

<E1CAWNM> item

<E1CAWNM> item

<E1CAWNM> item

<E1CAWNM> item

<E1CAWNM> item

<E1CAWNM> item

Now I want output file like

<E1CABNM> header <E1CAWNM> item

<E1CABNM> header <E1CAWNM> item

<E1CABNM> header <E1CAWNM> item

<E1CABNM> header <E1CAWNM> item

<E1CABNM> header <E1CAWNM> item

<E1CABNM> header <E1CAWNM> item

Thanks

Amit Shivhare

Accepted Solutions (0)

Answers (5)

Answers (5)

vijay_b4
Active Contributor
0 Kudos

Hi Amit,

You can achieve this by using Node Functions:

<E1CAWNM> item -- remove contexts -- split by value --<E1CABNM> header

Dont forget to set the properties for Split by value as each value.

Remove Contexts:

Used to remove all the contexts

Reward points if this helps

Regards

Pragathi.

Former Member
0 Kudos

Hi,

U can achieve this by using node functions,

1)Map your parent node as,

<E1CAWNM> (Item) --> RemoveContext --> <E1CABNM> (Header)

2)Map your child node as,

<E1CAWNM> (Item) --> SplitByValue(EachValue) --> <E1CAWNM> (Item)

Occurance of both child and parent node should be unbounded.

Regards,

Rohit.

Reward points if helpful.

Former Member
0 Kudos

Hello Friend,

For this purpose you can you One as Many function.

Or if you find it difficult to understand then create one UDF check the item count and then insert the context as many times as you want in output.

Any of the both will work.

Regards,

Shripad

Former Member
0 Kudos

hi check the below link and drill downfor node functions

http://help.sap.com/saphelp_nw04/helpdata/en/43/c4cdfc334824478090739c04c4a249/content.htm

Check this weblog where claus have mentioned with examples:

/people/claus.wallacher/blog/2006/04/17/replication-of-nodes-using-the-graphical-mapping-tool

/people/claus.wallacher/blog/2006/06/29/message-splitting-using-the-graphical-mapping-tool

/people/claus.wallacher/blog/2006/08/15/duplicating-subtrees-and-numbering-them-using-the-graphical-mapping-tool

Also check this weblogs:

/people/sravya.talanki2/blog/2005/08/16/message-mapping-simplified--part-i

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

Note: reward points if solution found helpfull

Regards

Chandrakanth.k

shivhare
Active Contributor
0 Kudos

Hi Chandra

thanks Chndra my problem solved

this blog is very useful

/people/claus.wallacher/blog/2006/04/17/replication-of-nodes-using-the-graphical-mapping-tool

Thanks

Amit Shivhare

Former Member
0 Kudos

hi,

you can achieve this by using the NODE functions

collapse context,

split by value

remove context

Note: reward points if solution found helpfull

Regards

Chandrakanth.k