cancel
Showing results for 
Search instead for 
Did you mean: 

Mapping Logic to create target Segments

Former Member
0 Kudos

Hi all,

My output TXT file has been created in this format

Header

Line

Line

Trailer

Trailer

But i would like to have in this way

Header

Line

Trailer

Line

Trailer

Could any one please suggest me how to achieve this

Should i change my structure any thing??

Regards

Edited by: Suman gupta on Nov 4, 2010 5:27 PM

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

The below source structure is wrong

Header

Line

Line

Trailer

Trailer

It should be either like..

Header

Line

Line

Trailer

OR

Header

Line

Trailer

Header

Line

Trailer

Former Member
0 Kudos

Sarvesh,

Thanks for replying. Sorry i might be confused you.This is the target structure only.

Actual Target structure is

Header( one time only)

Line(Repeats)

Trailer(Repeats)

From input file i have the file with one header and 2 Lines and 2 Trailers, then when i test my mapping i got like this.

Header

Line

Line

Trailer

Trailer

But actually i want to create TXT file like this

Header

Line

Trailer

Line

Trailer

Regards

Edited by: Suman gupta on Nov 4, 2010 7:28 PM

Former Member
0 Kudos

My Source structure is like this

Header(1:1)

Line(1:9999)

Trailer1:9999)

Input file is with 1 header, 2 Lines and 2 Trailers

Header

Line

Line

Trailer

Trailer

I want to get the output as

Header

Line

Trailer

Line

Trailer

Please let me know how to do this in mapping

Regards

Suman

justin_santhanam
Active Contributor
0 Kudos

Are you creating the text file(using Content Coversion) in the receiver adapter - can you confirm this?

raj.

Former Member
0 Kudos

Yes Raj, i am creating TXT file with Fixed Lengths

Regards

justin_santhanam
Active Contributor
0 Kudos

Great! Then follow the below steps if it looks reasonable to you.

Your source structure is fine. But the target structure has to be like the below one:

Source:

Header(1:1)

Line(1:9999)

Trailer1:9999)

Target:

Header(1:1)

Detail(1.9999)

Line(1:1)

Trailer1:1)

Now do the direct mapping between source and target. Map Line to Detail and Line to Line and Trailer to Trailer.

Now please see Shabz blog to achieve the same functionality as he mentioned [here|http://www.sdn.sap.com/irj/scn/weblogs?blog=/pub/wlg/7053] [original link is broken] [original link is broken] [original link is broken]; .

In the blog, check after his Note: this is exactly your structure.

Hope it helps!

Former Member
0 Kudos

Raj,

I changed my target structure as you said and able to disply them as expected.

I will try to create the TXT file aslo and let you know

Thanks

Regards

Answers (0)