on 02-18-2007 12:27 PM
Hi,
I have a sourc structure like this:
-<ListOfNPAccountNP>
-<NPAccount>
-<ListOfNPAccount_BusinessAddress>
-<NPAccount_BusinessAddress>
some fields
-</NPAccount_BusinessAddress>
-</ListOfNPAccount_BusinessAddress>
-<ListOfNPAccount_Industry>
-<NPAccount_Industry>
<b> -<ThampsonCode>S11111</ThamsonCode></b> -</NPAccount_Industry>
-<NPAccount_Industry>
<b> -<ThampsonCode>T22222</ThamsonCode></b> -</NPAccount_Industry>
-<NPAccount_Industry>
<b> -<ThampsonCode>Y33333</ThamsonCode></b> -</NPAccount_Industry>
-</ListOfNPAccount_Industry>
-<ListOfBackOfficeAccountRelationship>
-<BackOfficeAccountRelationship>
some fields
-</BackOfficeAccountRelationship>
-</ListOfBackOfficeAccountRelationship>
-</NPAccount>
-</ListOfNPAccountNP>
The structure (item level) in bold and the field 'ThampsonCode' is repeating max three times. I need to map with target SAP fields Code1, Code2 & Code3, which are at header level. Here the condition i need to check is, if that field's starting letter is "S" then i need to map with "code1", if it is "T" then "code2", if it is "Y" then "Code3".
I have achieved this with a graphical mapping, that is working absolutely fine even for one code, two codes, three codes or even for blank fields. But the problem is, since these fields are not mandatory either sides, sometimes the source is ignoring the structure in that case, i am getting my xml file tag as <b><ListOfNpAccount_Industry/></b> resulting to Mapping Error
I have designed my mapping as "if CODE start with 'S' then CODE else blank- > removecontext -> sort descend -> copy value -> TARGET.
Plz let me know, still I can achieve this with graphical mapping adding some more functions, if not, suggest me a UDF.
Hi Vijaya,
if it is working fine with a blank source value you could use the standard function mapWithDefault at the beginning and use a blank value as the default, so if the value is missing in the source you get the default value and build your logic upon this.
Kind Regards,
Sergio
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
If it not working , and your target field is having 1.1 occurr, then please try to map with mapwithdefault GM function.
Regards
Chilla..
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
You have tried by adding mapWithDefault which Replaces empty contexts in the inbound queue with a default value, which you specify in the function properties. Please see this help for some information on this:
http://help.sap.com/saphelp_nw04/helpdata/en/2c/2d8c4024d26e1de10000000a1550b0/content.htm
---Satish
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
79 | |
9 | |
9 | |
7 | |
7 | |
7 | |
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.