cancel
Showing results for 
Search instead for 
Did you mean: 

Real time idoc to file scenario - URGENT!

Former Member
0 Kudos

Hi all,

I have a real time idoc to file scenario with the idoc structure as below:

WP_PLU03

IDOC

Begin

EDI_DC40

E1WPA01

E1WPA02

......

Now as can be seen, EDI_DC40 is the header record common for the eniter idoc. But the segment E1WPA01 will repeat for each item sent from R/3. E1WPA01 in turn has many segments within it whcih corresponds to that one item.

Now the problem i am facing is, I did the mapping for all required fields from E1WPA01 to my file structure and it works fine if i send one 1 instance of E1WPA01. But when i send multiple instance of E1WPA01 for each item, my result in teh file should be 1 line of record for each E1WPA01. But this doesnt happen. It takes allE1WPA01 as 1 and gives only one record in the file.

How can this be overcome? this is a very common requirments? did i miss anything in the configuration?

Thnaks,

Yash

Accepted Solutions (1)

Accepted Solutions (1)

cdumont69
Contributor
0 Kudos

Hello,

You just need to put the parent context in your mapping.

Here you can find the solution :

http://help.sap.com/saphelp_nw70/helpdata/en/42/f7293b2dbe1a71e10000000a422035/frameset.htm

Regards,

Chris

Edited by: Christophe DUMONT on Dec 26, 2007 2:51 PM

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Yash !

Check your target data/message type to see if each element has the right occurance defined. You should have a parent element with occurance 0..unbounded for example, with simple elements within to allow the mapping to create one simple element for each occurance of the mapped data.

Regards,

Matias

ps: please award points if helpful.

Former Member
0 Kudos

Hi Matias,

Now i am able to get different records in my target file for each item in the source idoc. I mapped the serment E1WPA01 (0...9999) to the Root(0 to unbounded) of my target structure and it worked. Under Root there are no other substructure as its a simple structure unlike idocs.

But now i have a different problem all together. For all fields with simple mapping, the value in each records are coming fine but for those fields (2-3 of them) which has some complex mapping using UDF,node function and some computaion based on multiple occarence of subsegments with E1WPA01 (advanced UDFs using array) what it does is it collects all fields from the source IDOC irrective of E1WPA01, does one computation and puts in the first record. In other records those fileds are left blank. What is desired is it takes all multiple occurance of subsegments within each E1WPA01 and put it accordingly in each record.

I hope you got my problem. if not, please give me you mail id and i will send you the screen shots of the configuration.

Please suggest a solution.

Thanks in adance.

Yash

Former Member
0 Kudos

Hi Yash !

You should be using an advanced UDF that receives and emits the complete queue, that is, receives multiple values and returns multiple values, all in form of string arrays. Then inside your UDFs, you should fill that returning string array accordingly with the requiered values, and next to the udf, you will need to manage contexts with "split by value" or " remove contexts" as you need.

Are you using "ResultList.CC" constant, for example to place a context change between each the returning array elements?

To send screenshots, I recommend you to go to imageshack.us, upload them there and post here the link.

Regards,

Matias.

Edited by: Matias Denker on Dec 26, 2007 11:48 AM

Former Member
0 Kudos

Hi Matias,

I have two instances (may be much more than 2) of the same segment in the idoc (E1WPA01) and each instance should create a new root in the target message structure as in the link below

Link: [http://img299.imageshack.us/my.php?image=image3ct6.png]

I have mapped the segment E1WPA01 with the root like this:

Link: [http://img176.imageshack.us/my.php?image=image2of6.png]

Hence it creates 1 root for each segment. But for complex mappings such as:

Link: [http://img337.imageshack.us/my.php?image=image1yu1.png]

the 2 input parameter to the UDF - KONDART and KONDWERT - the queue can be seen. the problem which i m facing here is in this queue, values from both the instnace of the segment E1WPA01 is taken together where each instance should be processed seperately. The first 4 values in the top queue(till VKP0) belongs to the filed KONDART of the 1st isntance of the segment and the 1st 4 values of the below queue (till 17) belongs to the field KONDWERT. Similarly the remaining belogns to the other segment. My logic in UDF is built taking only one instance at a time. Is there anyway i can distinguish between the two instance within my UDF?

I hope u understand my problem here.

Thanks,

Yash

Former Member
0 Kudos

Hi Yash !

Check this blog:

/people/riyaz.sayyad/blog/2006/04/23/introduction-to-context-handling-in-message-mapping

And try different variants of context in your mapping, and let me know if you see any changes.

Regards,

Matias.

Former Member
0 Kudos

Hi Matias,

I have resolved the problem now. I had to write 2 advnace UDFs for than and use node functions. The mapping came out to be a bit complex but its working perfectly fine.

Thanks for your help.

Regards,

Yash