on 08-30-2013 3:51 PM
Hi All,
I am facing a very wierd behaviour of the IF then ELSE function in a mapping.
Condition to be checked: if GDS_id = 1, then (condition 1 - RFC lookup ) ElSE (condition 2 - JDBC Lookup followed by an RFC lookup).
Issue: The input payload is 0-unbounded with a possibility of a different GDS_id values.
Case 1 :
As shown below, in case the input payload has 3 repitions of the RECORD, with the Fit set having GDS_ID = 01, the mapping runs perfectly fine . All the If then Else branches are getting executed.
Case 2:
Where as iF the first GDS_ID != 01 (not 01) , thenthe target value is not getting populated properly .
I have tried all the possibilities and combinations but i am unable to resolve this. Please help.
Attached the screen shot of the message mapping, and sample test results of both the use cases.
---------------------------------------------------------------------
For instance, below is a sample payload:
----------------------------------
<?xml version="1.0" encoding="UTF-8"?>
<ns0:mt_EMERGO_common xmlns:ns0="http://sabreEMERGO_common.com">
<Record>
<booking_date>08012013</booking_date>
<iata_code>2325540</iata_code>
<gds_id>01</gds_id>
<pos_code>RD3A</pos_code>
<gds_code>01</gds_code>
<net_booking>11</net_booking>
</Record>
<Record>
<booking_date>08012013</booking_date>
<iata_code>2325540</iata_code>
<gds_id>02</gds_id>
<pos_code>54S8 </pos_code>
<gds_code>02</gds_code>
<net_booking>11</net_booking>
</Record>
</ns0:mt_EMERGO_common>
----------------------------------
Hi All,
I have changed the message mapping like below. Even though i am not getting my target filed as value. As per my requirement if GDS_ID=01 then perform the RFC lookup and pass the value to target fields KUNNR and else GDS_ID=02 then perform the JDBC LOOKUP and JDBC LOOKUP output to RFClookup .RFC LOOKUP output pass to my target field KUNNR.
Result of my mapping is 1st record only populated KURNNR in Target side and 2nd record not showing as KUNNR filed in target side .But I have taken look on display queue in If then else out showing 2 values but it is not passing to target filed.
Please provide any suggestion to resolve this issue.
Please find the mapping logic:
Please find the test screen:
Please find the test Data:
<?xml version="1.0" encoding="UTF-8"?>
<ns0:mt_EMERGO_common xmlns:ns0="http://sabreEMERGO_common.com">
<Record>
<booking_date>08012013</booking_date>
<iata_code>2325540</iata_code>
<gds_id>02</gds_id>
<pos_code>54S8 </pos_code>
<gds_code>AA</gds_code>
<net_booking>11</net_booking>
</Record>
<Record>
<booking_date>08012013</booking_date>
<iata_code>2325540</iata_code>
<gds_id>01</gds_id>
<pos_code>RD3A</pos_code>
<gds_code>AA</gds_code>
<net_booking>11</net_booking>
</Record>
</ns0:mt_EMERGO_common>
Regards,
Ramesh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Ramesh,
the reason of KUNNR not getting populated is obvious.
if then else is behaving as it is supposed to....You have 2 values of gds_id with a context change while then and else construct just generates one value after remove context. it should have 2 values with a context change. the first value in case of gds_id 02 generates the value since it has values in then and else queue while for gds_id 01, there is no corresponding value to generate the output.
Please do as stated below:
If your RFC can take multiple values in a context and return a table, then pass POS_CODE(context Record) to the RFC and then do a split by value and pass to then construct.
follow a similar approach for the else construct.
Few questions:
<pos_code>54S8 </pos_code> and <pos_code>RD3A</pos_code>. what is the expected RFC look up output.
Also what is the output expected from JDBC look up and then subsequent output from RFC.
Once you have sorted these 2 questions, the mapping will give you desired output.
Ambrish
Hi Ambrish/Praveen,
Thanks for your reply!!
I have changed the message mapping according suggested by you, now it is working with if 1st record is GDS_ID=02 and 2nd Record is GDS_ID=01 .Mapping successfully processed to generate the Target records with KUNNR. But if I tested with 1st record is GDS_ID=01 and 2nd Record is GDS_ID=02 then Mapping not processed successfully generate the Target 2nd records with KUNNR.
Please provide your suggestion to resolve this issue.
Please find the below screen mapping logic:
Please find the below successful test screen and test data.
Please find the below unsuccessful generated KUNNR record for the 2nd record.I checked the dispaly queues in If then esle display the ifout as two valuers but not transfored to traget field KUNNR.Please suggessted me how to reslove issue
Regards,
Ramesh
Message was edited by: Ramesh Gulipalli
I am not sure why you are doing split by value and then remove context in the else part after RFC look up.
Please understand the concept that both then and else part should have similar (in your test case 2) outputs with context change and then corresponding value will pass on the target based on true or false.
should not be a hit and trial..
Ambrish
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
HI Praveen,
Still i am facing the same issue.Please suggest me and find the below screen for dispaly queues.
Test data screen shot below.
If i gave the test data with 1st rrecord is GDs ID =01 and 2nd record is GDS ID=02 then mapping working successfully.Please find the below screen shoot.
Regards,
Ramesh
hi Ramesh,
As per my understanding the the RFC lookup for true case is giving first null value hence during mapwithDefault the a blank node is generating. Now the question is why is the null value coming.If you will do a display queue on the pos_code you will notice both the values going as input (RD3A and 54S8). Hence in the RFC when RD3A is going its giving a null value. You can get it confirmed by doing a display queue at RFC.
Now my suggestion would be put a if(withoutelse) before first RFC lookup and pass only those pass_code which (gas_ID=01).
Hope this helps.
thanks and regards,
Praveen T
Hi Ramesh,
As spotted by Ambrish and Aaron, I see the same thing that the Collapse context will collapse the complete queue value but top one and therefore you will run the if condition only once.
That is why you find values for first queue the second repetition of your source structure wont be checked as required.
Regards,
Nipun
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Right click your If condition and show the output of your queue (Display Queue). Do this at different points along your mapping and pay close attention to the context as Ambrish suggests.For example, look at the light grey, dark grey, and blue colors and make sure they line up as you would expect. You can collapse the context to get it at the right level of your output.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Ramesh,
One potential issue I see is that in else branch, I don't see a collapseContext while in if and then I see collapseContext is applied.
Is that an issue ?
Ambrish
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
84 | |
10 | |
10 | |
9 | |
7 | |
6 | |
5 | |
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.