on 11-08-2007 12:23 PM
Hi All,
I have a scenario like this
Source:
Organisation(0...Unbound)
->TAG019(0...Unbound)
-> Custno(1..1)
-> System ID(1..1)
Now in the target I have a field called SORTL which needs to be filled with Custno, when SystemID is "2".
and one more thing is I am creating IDOC's only when SystemID is "1"
Example:
Organisation(0...Unbound) value
->TAG019(0...Unbound)
-> Custno(1..1) XYZ
-> System ID(1..1) 1
->TAG019(0...Unbound)
-> Custno(1..1) Test
-> System ID(1..1) 2
Then I need to create IDOC for systemID "1" which is working
and I need to pass the Value "Test" of Custno, when SystemID is "2" to SORTL(which is my target)....which is mot happening.
I have written an UDF for this which is working fine when the scenario is like above.
public void createSortL(String[] a,String[] b,ResultList result,Container container){
for(int i=0;i<a.length;i++){
if(a<i>.equals("2")){
result.addValue(b<i>);
}
}
return;
But it fails when the scenario is other way.like this when 2 comes first, where i need to pass XYZ.
Organisation(0...Unbound) value
->TAG019(0...Unbound)
-> Custno(1..1) XYZ
-> System ID(1..1) 2
->TAG019(0...Unbound)
-> Custno(1..1) Test
-> System ID(1..1) 1
can u please let me know wht is wrong?
Regards,
Chaitanya.
Hi Kumar,
I'm not sure what you'd like to do. Can you please provide a sample source XML message and the expected target XML message? Maybe it'll become more clear.
BR
Holger
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Holger,
Here is the source xml
<?xml version="1.0" encoding="UTF-8"?>
<Root>
<MessageHeader>
<MessageID>
<MessageIDSystem>SCV</MessageIDSystem>
<MessageIDType>FE</MessageIDType>
<MessageIDIdentifier>CUSTOMER_MASTER</MessageIDIdentifier>
</MessageID>
<MessageReleaseNo>0004</MessageReleaseNo>
<MessageVersionNo>00</MessageVersionNo>
<MessageOrigApplID>SCV</MessageOrigApplID>
<MessageDestApplID>BROKER</MessageDestApplID>
<MessageInterfaceID>IDD088</MessageInterfaceID>
</MessageHeader>
<MessageBody>
<SCVData>
<SCVHeader>
<SCVMessageId>SCVFE004</SCVMessageId>
<SCVMessageVersion>000004</SCVMessageVersion>
<MessageSendTime>2007-10-17 01:08:42</MessageSendTime>
<MessageSequenceNumber>13220833</MessageSequenceNumber>
<NumberOfRecords>9</NumberOfRecords>
<ErrorCode>0</ErrorCode>
<ErrorDescription/>
</SCVHeader>
<ORGANISATION>
<TAG001>
<SCVEntity>ORGANISATION</SCVEntity>
<SCVAction>UPDATE</SCVAction>
<ChangeTime>2007-10-17 01:08:42</ChangeTime>
</TAG001>
<TAG019>
<LegacyCustNoID>1</LegacyCustNoID>
<custNo>5049001112</custNo>
<legacyCustNo>NZ9001112</legacyCustNo>
<previousLegacyCustNo/>
<legacySystemId>1</legacySystemId>
</TAG019>
<TAG019>
<LegacyCustNoID>1</LegacyCustNoID>
<custNo>5049001112</custNo>
<b> <legacyCustNo>NZ;OCEANBID;HQ</legacyCustNo></b>
<previousLegacyCustNo/>
<b><legacySystemId>2</legacySystemId></b>
</TAG019>
</ORGANISATION>
</SCVData>
</MessageBody>
</Root>
Now if u see the bold section, when LegacysystemID is 2 then I need to pass legacyCustNo to target field SORTL.. With my code it is working fine in this case, but when the TAG019 with LegacySystemID "2" occurs first then I am not getting the required Value.
Regards,
CK
Hi Chirag,
I have used this code, and Iam getting this error..
if(a.equals("2"));
{
result.addValue(b);
}
Source code has syntax error:
/usr/sap/XD1/DVEBMGS81/j2ee/cluster/server0/./temp/classpath_resolver/Map4741f7208dfd11dc90620018714e8238/source/com/sap/xi/tf/_IDD088_SCV_to_SAP_LOC_ORG_MM_.java:1478: addValue(java.lang.String) in com.sap.aii.mappingtool.tf3.rt.ResultList cannot be applied to (java.lang.String[])
result.addValue(b);
^
1 error
Please let me know what is wrong.
Rgds,
Kumar
Hi
I changed the code to
for(int i=0;i<a.length;i++){
if(a(i).equals("2")){
result.addValue(b(i));
}
}
this is working fine when the LegSystemID is 2 and when it occurs in the 2nd TAG019
But when I have TAG019 with LegSystemID -"2" first then it doesnot work..
any idea on this.
Rgds,
Kumar
Message was edited by:
Kumar
Hi I will get the source as
Orgnaisation
-> TAG019 Values
-> Legcustno Customer1
-> LegSysID 1
-> TAG019
-> Legcustno Customer2
-> LegSysID 2
I am creating idoc for each TAG019 where LegSysId is 1 and populating the LegCustno of TAG019 where LegSysId is 2. to my target.
The above scenario is working fine with the UDF.
But if the scenario is vice versa like
Orgnaisation
-> TAG019 Values
-> Legcustno Customer1
<b> -> LegSysID 2</b>
-> TAG019
-> Legcustno Customer2
<b> -> LegSysID 1</b>
Then my target field is not populated.
Rgds,
Kumar
Hi
we are not generating any IDOC's when the legacy system id is "2".
if I have a TAG019 with LegSysId "1"
and another TAG019 with LegSysID "2"
then I am creating an idoc only for TAG019 with LegSysID "1" and populating the value of LegCustno from TAG019 of LegSysID "2" in target(SORTL)
and when I donot have a TAG019 with LegSysId "2" then I am not populating any value in the Target.
Rgds,
Kumar
Yes you are partly correct.
we are generating an IDOC when LegSysID is "1" and if it also contains another TAG019 with LegSysID 2 then we are populating the value of LegCustno from this tag to the target.
if another TAG019 with LegSysId "2" doesnot exists then we simply leave the field blank.
Rgds,
Kumar
With your sample file: you have two nodes <TAG019>, one of it has SystemId 1 and one of it has SystemId 2.
Your target file: you'd like to combine these two TAG019 nodes to just one IDoc structure, correct?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
85 | |
10 | |
10 | |
10 | |
7 | |
6 | |
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.