on 11-20-2007 2:31 PM
Hello,
IDOC - File
The source IDOC structure is :
+ZIDOC
++IDOC
+++E1ABC1
++++BELNR (fields of segment E1ABC1)
++++GEWEI (fields of segment E1ABC1)
++++ABLAD (fields of segment E1ABC1)
+++E1EDP01
++++SPTYP (fields of segment E1EDP01)
++++ZITEMMM (Custom IDOC segment)
+++++abcd (fields of custom IDOC segment)
+++++xyza (fields of custom IDOC segment)
+++++itemno (fields of custom IDOC segment)
On the target side, I have mapped Item(1...unbounded)
with node E1EDPO1 and the no of occurances of E1EDPO1, those many no of item lines are being produced
but I have only one field , BELNR which is from the segment E1ABC1. This is populating only for the first occurance.
its not being repeated for the next item records(item2, item3, item4... so on)
now I have to populate the same BELNR data in all the item fields
How can I acheive it?
Is there any standard function to achieve the same?
regards,
Nikhil.
Hi nikhil,
<i><b>I followed as you instructed and placed BELNR,E1EDP01, E1ABC1 as the 3 inputs</b></i>
The second & third inputs are not the Segments, u need to give one field from the segment of E1EDP01 like SPTYP, the same field need to give as 3rd input. And change the context of 2nd input to the context of first input..
Try this and let me know. It will defenately works.
Cheers
Veera
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi nikhil,
>>> <i>This is because I have to populate 3 more such fields from different segments</i>
You can fallow the same for 3 fields.Here u need to ensure that the first input field occurs only once and need to identify the field which is occurs no.of times.
Refer the following link .
http://help.sap.com/saphelp_nw2004s/helpdata/en/ef/df564b6aa24fc9ab0d685460747de5/frameset.htm
Cheers
Veera
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
HI nikhil,
the inputs of useOneAsmany functions like, 1st input is BELNR, Identify the mandatory field which is always populate in the segment E1EDP01 and give that field as 2nd input, let me say for eg:SPTYP , and 3rd input is also SPTYP. Change the context of Second input to the context of first input.in your case the second input context need to be set E1ABC1.
By doing this you can get the value BELNR, how many no.of times the value SPTYP occurs in payload.
Hope it helps to solve u r problem. And let me know u r proceedings.
Cheers
Veera
>>>Reward Points,if it is needful.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Veera,
I followed as you instructed and placed BELNR,E1EDP01, E1ABC1 as the 3 inputs
it throwed the follwoing error.
The message is: Exception:[com.sap.aii.mappingtool.tf3.IllegalInstanceException: Too many values in second queue in function useOneAsMany. It must have over all contexts the same number of values as third queue] in class com.sap.aii.mappingtool.flib3.NodeFunctions method useOneAsMany[, , ]
Nikhil.
try using useOneAsMany from node functions
1st parameter will be BELNR,
2nd & 3rd will be E1EDPO1.. these 2 will have different context...
refer this blog for useOneAsMany
/people/sravya.talanki2/blog/2005/12/08/message-mapping-simplified-150-part-ii
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
The source DT is mentined above.
The receiver DT is in the following way :
+MT_CR_AT
++RECV
+++Header
++++field1
++++field2
++++field3
++++field4
+++Orderitm
++++field1
++++field2
++++field3
++++field4
+++Orderchild
++++field1
++++field2
++++field3
++++field4
Now i want one of the 4 fileds of the reciever segment(from Orderitm and Orderchild) to be mapped to the BELNR of the E1ABC1
used "UseOneAsMany"
with BELNR and E1EDPO1 and E1EDPO1 as 3 inputs according to Mugdha
not working
Nikhil.
Hi Nikhil,
The source structure is very clear.
Cant understand the target structure.
If you would just give that too ,will try solving the problem!!
Regards,
Manju.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi
I think for your needs it is enough to use the standard function CopyValue
BELNR -> CopyValue[0] -> item
Best,
Daniele
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
> Daniele,
> the copyvalue thing is not working out
> thanks anyways
Hi Nikhil,
that's weird, if the source field (BELNR) and segment (E1ABC1) occur exactly once, then copyvalue should work.
Be sure you were not testing it with the "Display Queue" tool but use the "Strat transformation" button to perform the whole mapping.
regards,
Daniele
HI,
Use the std function useofmany or write an UDF.
Input: a=E1EDP01 which repeats many times
b=BELNR repeats only once
take the value of a in one context.
for(i=0;i<a.length;i++)
{
result.addValue(b(0));
}
This functions repeats the value of b as many time your a value is repeating.
Thanks and Regards,
Chirag Gohil.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
87 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.