on 09-03-2008 4:57 PM
Hi experts,
I have a scenario where my source is an IDOC.
The problem is that I have a segment called E1EDKA1 that is duplicated several times. In the different segments duplicated, I have a field that can have different values and according to the value of this field, I have to map different fields of the concerned segment E1EDKA1 to different targets.
Does anyone know what would be the best approach to do that?
Any help would be appreciated,
Regards,
Jamal
Hi,
thanks.
I tried with the if function, the problem is since the segment is duplicated, it only takes the values in the first segment.
Example:
In my Idoc, I have the segment E1EDKA1 that has 5 fields :
E1EDKA1
>>PARVW
>>NAME1
>>NAME2
>>STRAS
>>ORT01
This segment can be duplicated (occurence 0..99).
Let's say I have an Idoc with 3 times E1EDKA1, then I would have:
E1EDKA1
>>AB
>>NAME1
>>NAME2
>>STRAS
>>ORT01
E1EDKA1
>>CD
>>NAME1
>>NAME2
>>STRAS
>>ORT01
E1EDKA1
>>EF
>>NAME1
>>NAME2
>>STRAS
>>ORT01
My problem is the following :
if PARVW = AB, then NAME1 needs to go in the target field NAME1.
if PARVW = CD, then NAME2 needs to go in the target field NAME2 (without paying attention to the other fields).
if PARVW = EF, then STRAS needs to go in the target field STRAS (without paying attention to the other fields).
and so on..
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
>>it only takes the values in the first segment.
You need to use copyValue standard function to repeat values multiple times on receiver side.
Oops my bad,didn't realize your source is IDOC,i thought your receiver is IDOC,sorry about that
Thanx
Aamir
Edited by: Aamir Suhail on Sep 3, 2008 11:56 AM
Edited by: Aamir Suhail on Sep 3, 2008 12:02 PM
Hi,
Try the following :
if PARVW == AB then NAME1 ( important : set the context of PARVW and NAME to a node above E1EDKNA1 segment )
if PARVW == CD then NAME2 ( important : set the context of PARVW and NAME to a node above E1EDKNA1 segment )
if PARVW == EF then STRAS( important : set the context of PARVW and STRAS to a node above E1EDKNA1 segment )
Try chaning the contexts if proper NAME1 was not populated
Which IDOC are u using?
regards,
Venkat.
Hi Radek,
Correct me and let me know where it would show unexpected results?
Changing contexts to the segment above E1EDKNA1 would act same like removeContexts and it will not have any contexts to remove from the Queue [ I mentioned the same in Mapping image ]
I believe we dont need removeContexts here after the Contexts is changed.
Moreover if E1EDKNA1 is located under one of the line items, changing the context to line item would work, which will fail with removeContexts
mapWithDefault was used assuming one of the NAME1, NAME2, STRAS have 1....1 occurance, which might throw error message if no condition is satisfied
In the worst case, even if E1EDKNA1 does not appear in source IDOC or if PARVW do not have one of the AB,CD, EF it will dispaly default values
Regards,
Venkat.
Hi Venkat,
thanks a million, it works now!!!
I put the same context to both entries and it works as you said
again, thanks for your help, I'll let you know
regards,
jamal
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
>>I have a field that can have different values and according to the value of this field
All the duplicated segments are independent of each other,so simply use If-Else conditions in all of them and keep on mapping the segements/elements as per your requirement.
Lets say you have ten fields in a certain E1EDKA1 and all these need to be filled based upon a certain value in E1EDKA1,the just give the same If-else condition in all of them.
Thanx
Aamir
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
HI,
Two ways to do it.
1) Using graphical mapping use the equals constant ifwithoutelse functions.
2) Write the advance UDF where again u wil check the condition using java and map the target field.
can u give one example of ur requirement.
chirag
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
86 | |
10 | |
10 | |
9 | |
7 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.