cancel
Showing results for 
Search instead for 
Did you mean: 

Regarding E1EDKA1-->PARVW condition problem

sridharreddy_kondam
Active Contributor
0 Kudos

Hi All,

Need your help...

Source is IDOC(Orders.Orders05) and target is File...

<b>Source</b>

E1EDKA1 PARVW = "AG" IHREZ = ""

E1EDKA1

PARVW = "WE"

IHREZ = ""

E1EDKA1

<b>PARVW = "LF"</b>

IHREZ = ""

E1EDKA1

PARVW = "ZI"

IHREZ = ""

<b> Target</b>

ZBGM (1..1)

CODE (0..1)

(Note ZBGM segment occ is 1..1)

The condition is

If E1EDKA1-->PARVW = "LF" and

E1EDKA1-->IHREZ = ""

then CODE = "9"

Else

CODE = "42" .

I had written an UDF

for the above condition for source PARVW field and target CODE field....

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

{

if((PARVW<i>.equals("LF")) && IHREZ<i>.equals(""))

{

result.addValue("9");

return ;

}

else

{

result.addValue("42");

} }

If i test by field level by clicking Display QUeue i am getting the as per my requirement <b>value as 9</b> for the third segmet value...(output i am getting 42 42 9)

But when i test by going to TEST tab the target CODE field value is 42 ... Mean it is testing once only and reading first segment value i.e for the first occurence PARVW = AG ....

How to get the required value for my actual req... ...

Please suggest....

Thanks and Regards,

Sridhar Reddy

Message was edited by:

sridhar reddy kondam

Accepted Solutions (0)

Answers (3)

Answers (3)

sridharreddy_kondam
Active Contributor
0 Kudos

Hi The Problem is solved,

I had just used <b>Sort</b> Function and now its working...

Thanks and Regards,

prabhu_s2
Active Contributor
0 Kudos

seems to be cardinality issue of the elements. E1EDKA1 is 0..unb but code is 0..1

recheck its occurence and test

sridharreddy_kondam
Active Contributor
0 Kudos

Hi Prabhu,

I need only one value either 9 or 42 based on the condition...

So if PARVW = LF and IHREZ = "" then the field CODE should be populated with 9...

And i think some where i am missing something... may be the cardinality ... is it?

And i had mapped PARVW to CODE field and a constant to BGM segment..

THanks and Regards,

sridhar reddy

Message was edited by:

sridhar reddy kondam

prabhu_s2
Active Contributor
0 Kudos

sridar

the issue is with cardinality. The source node has occured 3 as per ur post and its last value is 42. so the parsing is done thrice as E1EDKA1 is mapped to CODE. in this case the last value is populated to code as per ur condition. change the cardinality of CODE to 0..unb and test the mapping. it shud work

prabhu_s2
Active Contributor
0 Kudos

since code occurence is 0..1 u will have only once result populated when testing the message mapping.