on 12-13-2006 5:50 AM
Hi ,
Currently, i have scenario like N..1 mapping
Source field :
i have segment E1ADRM1 ( occurence 0..99 )in that two field partner_id and partner_q.
target Field : I1NPT00 (0..1)
i have PHSHTO and PHSOTO
my condition is if partner_q has pass value "WE" than value is pass to PHSHTO
my condition is if partner_q has pass value "AG" than value is pass to PHSOTO
on target side there is occurence 1..1.
i developed logic , it's working fine, but the problem is if first condition satisfy
than it will not ask for second conditions.
like i have two E1ADRM1 segment , first segment contains "WE" and second contains "AG" but if first condition satisfy it will not ask for second:
While i required in every repeting segment, it;s check conditions...
waiting for positive reply.....
regards
Bhaumik
Hello Bhaumik,
You can develop both mappings (the one for PHSHTO and the one for PHSOTO) completely independently. You may apply a typical filter mapping (you'll find an example in SWCV SAP BASIS, namespace <i>http://sap.com/xi/XI/System/Patterns</i>.
You simply have to take care of the occurrence of both target fields. You wrote that it is set to 1..1 which might create problems at runtime if the filter removes values. In this case you probably have to apply a defaulft value (mapWithDefault).
Best regards
Joachim
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
We can make it check for all occurences of E1ADRM1, but whats the logic on the target side.
Will each occurence of E1ADRM1 create a I1NPT00?
If thats the case, you need to change the context of E1ADRM1 in your logic itsel. I think it should work.
Regards,
P.Venkat
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Bhaumik,
TO add the 2 condtions, right click on your target node / element,select option "duplicate subtree" in the mapping editor. Now, add each condition to each node.
Regards,
Bhavesh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Bhaumik...
It is loke accepting the source in an array and the output is also a array....
That case you have complete contol of all the source occurance for the fields .. which will be passed on to your Que funcion as a que / or array..
you have to loop through them and build up the output que / array....
Cheers,
Himadri
hi
i used que mapping
but the problem is E1ADRM1 segment is repeat, in that partner_q and partnet_id value is also chage
so i want to check if partner_q is equals WE than map with PHSHTO
otherwise if partner_q is equals AG than map with PHSOTO
but in both tyme partner ID value is different...
so i will try que mapping it put same partner_id into PHSOTO and PHSHTO
while i want different value....
waiting for your positive reply
Bhaumik,
For que mapping set the context of partner_q and partner ID at the idoc level ---(This will bring in all the values from all the repiting segments)
Inside the function in a loop check for partner_q is equals WE and populate the output as you require... and you can set a flag here to note that first condition satisfied.....
If the first condition is not satisfied then check for the second condition...
You basically have to form the programming logic here...
Cheers,
Himadri
but E1ADRM1 segment is repeit
<E1ADRM1 SEGMENT="">
<PARTNER_Q>WE<PARTNER_Q>
<ADDRESS_T/>
<PARTNER_ID>1001<PARTNER_ID>
</E1ADRM1>
<E1ADRM1 SEGMENT="">
<PARTNER_Q>AG<PARTNER_Q>
<ADDRESS_T/>
<PARTNER_ID>1002<PARTNER_ID>
</E1ADRM1>
i want to map these field to I1NPT00 (occurence 1..1)
in that there is two fields like
PHSHTO
PHSOTO
So if partner_q is equals WE pass partner_id
So if partner_q is equals AG pass partner_id
So i write function and write logic also but E1ADRM1 is diffrent node , that;'s why it i am confuge
I hope that i explain my question properly ,
and also waiting for all positive reply
Bhaumik,
It is difficult to tell the exact logic -- however:
1) You need to map PHSHTO PHSOTO separately...
2) Even if there are multiple segments E1ADRM1 you need only one pair of PHSHTO and PHSOTO in the target is that right... ? Then you pass only one output to the target....
There is an alternative of using the global container as well...
Cheers,
Himadri
Hi Himadri,
one source you understand perfectly, but on target side INPT00 ( node) and in that there is two node PHSHTO , PHSOTO and i have to map with
E1ADRM1 -> check partner_q if "WE" : send partner_id -> PHSHTO
E1ADRM1 -> check partner_q if "AG" : send partner_id -> PHSOTO
and B'se of E1ADRM1 segment is repeated partner_id value is different...
if you have any dought on my question , please let me know
waiting for your reply
Bhaumik
That case you have to go for que mapping...with inputs partner_id and partner_q..
and for the logic inside the code...
Cheers,
Himadri
Changed the input field names.. .. )
Message was edited by:
Himadri Chakraborty
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
93 | |
11 | |
10 | |
9 | |
9 | |
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.