cancel
Showing results for 
Search instead for 
Did you mean: 

If else condition not working as exoected for multiple line items

0 Kudos

Hi All,

If else condition is used for a target field at line item level, Condition checks a field at header level in source structure based on that a constant value is mapped to target.

For single line item the logic works but for multiple line items the target field is not getting populated.

I tried the node functions, remove context, split by value by nothing works.

Also tried using fixed value mapping but same issue exist.

Please suggest

Thanks

vinoth

Accepted Solutions (1)

Accepted Solutions (1)

former_member187587
Contributor
0 Kudos

Answers (6)

Answers (6)

former_member187587
Contributor
0 Kudos

Following my suggestion,

go to the EDIFACT segment that you use for creation of the E1EDP01 in the IDoc (my guess it is G_SSG5 (LIN).

use the UNB value as the first parameter to the useOnAsMany() (in the node functions methods) then use the G_SSG5 as the second and third inputs...from there add your existing rule.

In this way the rule will be checked for each line using the UNB single value.

former_member187587
Contributor
0 Kudos

Try and use the useOneAsMany() method in order to duplicate the header value to match the amount of item level values.

markangelo_dihiansan
Active Contributor
0 Kudos

Hi Vinoth,

The if Else in message mapping needs to have equal number of items for the if, then and else statements to function correctly.

Regards,

Mark

vicky20691
Active Contributor
0 Kudos

Hi Vinoth,

Simple question - at the target side have you mapped constant to parent node or child node

If your target structure is -

<header>

          <item/>

</header>

and you have mapped  constant to item, then do map it to header too.

If header is not mapped to something the whole structure will not populate.. For better understanding pls post screenshots as your reqmt is bit unclear.

Regards,

Vikas

0 Kudos

Hi Vikas,

At target side, header filed is also mapped. but still not working for multiple line items

Harish
Active Contributor
0 Kudos

Hi,

Can you please provide the display queue screenshot and mapping screenshot?

try to put the below expression in init function in functions tab

retainlastValueofPreviousContext=true;



regards,

Harish

0 Kudos

Hi Harish,

Mapping and Display queue screenshots are added below,

Thanks

Vinoth

former_member237514
Participant
0 Kudos

Hi Vinoth,

Once try  with change context for the source field.

0 Kudos

Hi Kavitha,

I tried using remove context after source field. but still not working.

Thanks

Vinoth