cancel
Showing results for 
Search instead for 
Did you mean: 

Splitting Idoc

Former Member
0 Kudos

Hi,

There is single Idoc coming in and i need to split it to 'N', where N will be in the coming in Idoc itself. I am able to generate the multiple Idoc Instances, but not able to copy the same Idoc data into Multiple Idoc Instances.

I am afraid to use the Global variables as the no of Idoc elments are huge..

Pls share your Xperiences..

Rgds

Kishore

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi Kishore,

I hope you can do this with OneasMany Standard Node function. Just map this result to the Idoc element[top node] at target side and this element must have the occurence 0...n or 1..n. and Pass the element which has the N number in the source field as second and third parameters to this standard function.

Idoc->

<i> NElment-></i> -


> OneAsMany() -


> Target Idoc[Occurence 0..n or 1..n]

NElement->

Please try this way. OR

<b>Idoc Packaging:</b>IDoc packaging is a technique used to generate, for example, many IDocs from a unique source structure as an XML document.

In the Message Mapping you can use an External Definitions as Message Type instead of the SAP imported IDoc Message Type. This external definition is the same of the IDoc Message Type, but it has a different occurrence proprierty of the field IDOC. The occurrence will be 1...unbounded instead of 1..1. Next, it is important to use the real SAP imported IDoc Message Type in the Interface Mapping component"

"Consider a file to IDOC scnario, where 1 file will contain multiple IDOCs.So, you need to send these multiple IDOC s to R3 system.

Now, one way would be to use a BPM, but a better way is to use the PACKAGINg where these multiple IDOCs are packaged as one IDOC and then on R3 , there are unpacked into multiple IDOCs. Wondering how to do this. it is simple. Just check this note on service marketplace, 814393.

It means one file will have corresponding data to create multiple Idocs.

For e.g You have a file like this.

Header,1,2

Item,hello,...

Item,kitti....

Item,...

In this file you have one header, and mulitple Line Items. But business requirement is to post the mulitple idocs for each occurence of ""Item"". That means , you are posting multiple idocs of same Idoc type from one file

Refer the link:/people/sravya.talanki2/blog/2005/12/09/xiidoc-message-packages

Warm Regards,

Vijay

Message was edited by:

Gangisetty Vijaya Bhaskarudu

Former Member
0 Kudos

Hi Vijay,

this Use s Many funtions is not coming as handy to me..

i followed the note 814393 for packing the Idocs...Thats not exactly what i want...

Here i changed the Idoc occurance to Unbound..but for this unbound Idoc I need to replicate the Data coming from single Idoc ...I need to regenarate the complete Idoc structure with single Idoc data..Like as followed....

Source Idoc

Data1 Values

Name1----


> Ram

Initial -


>A,B,C

Target Idoc:

Data1 Values

Name1----


> Ram

Initial -


>A

Data1

Name1----


> Ram

Initial -


>B

Data1

Name1----


> Ram

Initial -


>C

Prasanthi,

Its tedious to store all the fields in Idoc into a global var/container..

Rgds

Kishore

Former Member
0 Kudos

Hi Kishore,

You need to do same kind of mapping for each field under that Idoc with OneAsMany, then only it will produce the Target fields as many you want.

You can achieve by this way.

Warm Regards,

Vijay

Former Member
0 Kudos

Hi VIjay,

i tried this options ..but no luck...

any other things ?

Rgds

Kishore

Former Member
0 Kudos

Tell me what is happing. Just check the Queus of the all the fields and How you are doing. If possible please send me the Queues information with screen shots to my Id b4vijay@gmail.com. Atleast by seeing them i can tell provide you the solution because for such kind of issues it is very difficult to get the exact answer, we need to try with Trail and Error method and find the solution.

Warm Regards,

Vijay

prasanthi_chavala
Active Contributor
0 Kudos

Hi Kishore,

If i am not wrong you are trying to generate 'N' idocs at the target side from the source idoc which have 'N' records. Then you can go for idoc packaging.

Regards,

Prasanthi.

Former Member
0 Kudos

Hi Prasanthi

in the Idoc there would be one Field which will have multi occurence Ex: plant will come like Plnt1,Plnt2..PlnN. The rest of data is same & is for single IDoc.

Now i want to genarate the same IDoc N times with each plant in the Input Idoc.

Yeah...I am trying for the packing only...But not able to replicate same IDoc data in the multiple instances.

Appriciate ur help..

Kishore

prasanthi_chavala
Active Contributor
0 Kudos

Hi Kishore,

You can write a small UDF (type context) and store the values of all plant codes in the variable and map this UDF to splitbyvalue user defined fuction and then to target element.

Then you can get the desired requirement.

Regards,

Prasanthi.