cancel
Showing results for 
Search instead for 
Did you mean: 

Force mapping of field in Idoc segment

Former Member
0 Kudos

Hello all,

I need to do following for the E1EDKA1 segment mapping of an INVOIC.INVOIC01 IDOC:

Depending on the value of PARVW field, fill the target PARTN field:

- if PARVW = RS or LF ==> place a fixed value in the PARTN field

- all other values of PARVW ==> value of PARTN from the source E1EDK1 segment

The "Occurences" setting of the PARTN is 0..1 I have multiple E1EDKA1 segments in the source IDOC and the mapping results are:

- If PARVW is different of RS or LF: OK, PARTN filled in or not depending if present in source segment

- if PARVW = RF or LF: OK if PARTN is present in source, then target is filled with fixed value

- if PARVW = RF or LF: NOT OK if PARTN is not filled in source, then PARTN missing in target

In my papping I use an If-Then-Else for the PARTN field mapping. How can I have the PARTN field in the target for PARVW=LR or LF only if the source doesn't have one without changing the Occurences setting?

Kind regards,

Ulrich Delvaux

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi suvarna,

Actually what I want is if PARVW = LR or LF that the target PARTN is filled with a fixed value independent of the existence if PARTN in the source. However if PARVW is different, then PARTN can be mapped to PARTN if it exists, if not I don't care.

Kind regards,

Ulrich

Former Member
0 Kudos

Hi ,

Ok then do like this pass both PARVW and PARTN to your UDF and do the following

if (((PARVW. equalsIgnoreCase("LR"))||((PARVW. equalsIgnoreCase("LF")))

{

return the fix value whtaever you want to set;

}

else

{

if (!(PARTN .equals("null")))

return PARTN ;

}

Thanks ,

Suvarna

former_member192892
Active Contributor
0 Kudos

Hi Ulrich,

Create a UDF with two arguments,

inside the UDF do this

Argument a = PARVW and Argument b = PARTN

function(Stringa,Stringb,Cntainer)

{

String output = "Some value you need to assign";

if(!a.equalsIgnoreCase("LR")&&!a.equalsIgnoreCase("LF"))

{

output = b;

}

return output;

}

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi Suvarna,

I'm testing your solution, do I need to specify in my UDF any Imports? Also for the UDF does the Cache setting (Value, Context or queue) matter?

Kind regards,

Ulrich

Former Member
0 Kudos

Hi ,

YOur question please correct me if i understood wrongly

You want to map PARTN field in the target if PARVW is not equal to LR or LF

Then two options write UDF and pass source as PARVW and check

if ((!(PARVW. equalsIgnoreCase("LR"))||(!(PARVW. equalsIgnoreCase("LF")))

{

return PARVW ;

}

and in your granphics mapping PARVW ---> UDF say it's name is checkPARVW --->PARTN

Or else you can achieve this by using graphical options if for check values and and for checking the result for both check conditions .

Thanks ,

suvarna

Award pts if it helps .