cancel
Showing results for 
Search instead for 
Did you mean: 

Node creation based on value mapping

Former Member
0 Kudos

Dear experts,

I am integrating SAP ECC to SAP TM where i have downloaded standard content  in which one input file has multiple stage and one IDOC is getting triggered

but client wants that for each stage there should be one IDOC triggered and corresponding stage should come in that.

I have changed IDOC occurance and imported  XSD

Now i am able to generate multiple IDOC only additional party field is not getting generated properly

My mapping is as below: 2 values 5 and 6 are coming based on that WE and LF should get pass and it should create 2 nodes on receiver side

till the node If without else values are flowing properly but if i see the queue for remove context this shows only one value WE 3 times.

This WE is coming 3 times because i have 3 stages in incoming field so 3 IDOC will get generated

Here value should come as WE 3 times and LF 3 times.

Please suggest me what should i change in this mapping...

Thanks

Sandeep Sharma

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

It is the default behavior of "if" function.Nothing wrong in it.

Replace with small udf.

Regards

Venkat

Former Member
0 Kudos

Hi venkat ,

What UDF ?

Can you give me any sample UDF which will work in this situation?

thanks

Former Member
0 Kudos

Hi Sharma,

Did you tried the above logic ? If it is not working then let me know i will write a small udf for you.

Regards

Venkat

Former Member
0 Kudos

Hi venkat

This mapping is not working

Former Member
0 Kudos

Hi,

Replace ifwithoutelse std  fn with below udf.pass TStage and RCode values by removing the context as inputs.

Use the below sample udf .Change the below code if you require.

public void Test( String[] TStage, String[] RCode,ResultList result, Container container) throws StreamTransformationException{

int counter= RCode.length;

int count = TStage.length;

for(int i =0;i<count;i++)

{

for(int j=0;j<counter;j++)

{

result.addValue(RCode[j]);

}

result.addValue(ResultList.CC);

}

O/P:

WE

LF

---

WE

LF

---

WE

LF

Regards

Venkat

Former Member
0 Kudos

this worked with few node functions.

Thanks a lot

Answers (1)

Answers (1)

gagandeep_batra
Active Contributor
0 Kudos

Hi Sharama,

there might be a issue with context, check the context for "transportation stage" because you are using splitbyvalue for rolecode then you are using if-else condition so please check the context for that and also paste the full mapping screenshot below if-else also.

Regards

Gagan

Former Member
0 Kudos

Hi Gagan

since there are 3 transportation stage so 3 iDOcs should  be craeted. Here 3 values 'WE '  are coming thats is perfect  but i am expecting 3 values LF also .

Mapping  is here below

Former Member
0 Kudos

Hi,

Change the logic as below.

insert split by value (each value) after exists condition of Transportationstage and insert remove context for 2nd i/p of "if then" condition.

split by value (each value)----> if then--

remove context  ----------------/

Regards

Venkat

Former Member
0 Kudos

Hi I tried the logic but not working

My requirement is there may come no of Transportaion stages in in the sender payload . Based on those stages no of Idocs should get triggered . Say for ex here in this payload 3 Transportaion stages

i am able to create 3 idocs based on Transporatation stage. Inside each stage E1ADRM4 node should be there.That i am able to do

Now there is extension to this requirement:\

There is another field additional party is coming. Based on occurrence of  additional party, inside each IDoc those many no of nodes  E1ADRM4 should be created .

Here in my case inside 3 idocs:  since i have 2 additional parties coming in sender payload so in each payload 2 E1ADRM4 node should get created.

This additional party is mapped to subnode of E1ADRM4 node

Please suggest how to go