cancel
Showing results for 
Search instead for 
Did you mean: 

help with mapping

Former Member
0 Kudos

Source structure:

+IDOC

++E1EDP01

+++ZSEG (SEGMENT)

++++quantity

+++ZSEG (SEGMENT)

++++quantity

+++ZSEG (SEGMENT)

++++quantity

+++EDP19 (SEGMENT)

++++QUALF(001)

++++IDTNR(mat_name)

+++EDP19 (SEGMENT)

++++QUALF(002)

++++IDTNR(mat_name)

+++EDP19 (SEGMENT)

++++QUALF(003)

++++IDTNR(mat_name)

+++EDP19 (SEGMENT)

++E1EDP01 (II occurance of of EDP01)

+++ZSEG (SEGMENT)

++++quantity

+++ZSEG (SEGMENT)

++++quantity

+++ZSEG (SEGMENT)

++++quantity

+++EDP19 (SEGMENT)

++++QUALF(001)

++++IDTNR(mat_name)

+++EDP19 (SEGMENT)

++++QUALF(002)

++++IDTNR(mat_name)

+++EDP19 (SEGMENT)

++++QUALF(003)

++++IDTNR(mat_name)

+++EDP19 (SEGMENT)

EDP19 can have QUALF values from 001 to 003.

I have to pick up IDTNR value from EDP19 for which QUALF == 002 and send to prt-name

Target structure:

Loc (SEGMENT)(mapping -> if quantity > 0 > createif)

+name

+prt (SEGMENT)(mapped to a constant )

++name (get mat_name from EDP19 for which QUALF == 002 )

++item (SEGMENT)(mapped to a constant )

+++quantity (get quantity for ZSEG )

my target structure will be produced when the quantity is > 0.

in the above case, there are 3 ZSEG and each has one Quantity.

if only one of them is > 0 then it will generate only one target structure.

My requirement is ...

I am facing some problem while populating prt-name (from IDTNR of EDP19 ) for the structure of Zseg whose quantity is > 0

if anyone got same kind of requirement earlier, help me

thanks and regards,

Nikhil.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi

Compare (equalsString)

IDTNR(Set context to E1EDP01)

with '002' .

If the above are equal then map (IfWithoutElse)

QUALF(Set context to E1EDP01)

to the target field

prt-name

rgds

Arun

Former Member
0 Kudos

I did the same way now and its not working out

remember that im generating the target structures based on the quantity value (greater than 0 ) and i shud populate the part-name of equal context that they belong to

now with ur advice, it will send all possible values

lets conside the above example

Suppose I have 6 Zsegments

Zsegment (quantity = 0 ) prt-name -> abcd1

Zsegment (quantity = 0 ) prt-name -> abcd1

Zsegment (quantity = 10 ) prt-name -> abcd1

Zsegment (quantity = 0 ) prt-name -> xyz1

Zsegment (quantity = 20 ) prt-name -> xyz1

Zsegment (quantity = 0 ) prt-name -> xyz1

now I will have 2 records as the target structures.

but the abcd1 is there for both

it should be like...

actual o/p:

partname : abcd1

+qty : 10

partname : xyz1

+qty : 20

current o/p :

partname : abcd1

+qty : 10

partname : abcd1

+qty : 20

nikhil.

Former Member
0 Kudos

Hi

Try this

This is my understanding

Input

++E1EDP01

+++ZSEG (SEGMENT)

++++quantity = 100

+++ZSEG (SEGMENT)

++++quantity = 0

+++ZSEG (SEGMENT)

++++quantity = 300

+++EDP19 (SEGMENT)

++++QUALF(001)

++++IDTNR(mat_name) = mat1

+++EDP19 (SEGMENT)

++++QUALF(002)

++++IDTNR(mat_name) = mat2.0

++++QUALF(002)

++++IDTNR(mat_name) = mat2.1

++++QUALF(002)

++++IDTNR(mat_name) = mat2.2

+++EDP19 (SEGMENT)

++++QUALF(003)

++++IDTNR(mat_name) = mat3

Mapping

Loc (SEGMENT)(mapping -> if quantity(Set context to E1EDP01) > 0 > createif)

+name

+prt (SEGMENT)(mapped to a constant )

++name ( [If Quantity(Set context to E1EDP01) > 0 ] and [Compare (equalsString) [ QUALF(Set context to E1EDP01) with '002']]

If both are TRUE then map (IfWithoutElse)

IDTNR(Set context to E1EDP01) )

++item (SEGMENT)(mapped to a constant )

+++quantity (get quantity for ZSEG(Set context to E1EDP01) map only non zeros)

Output

Loc

+name

+prt

++name = mat2.0

++item

+++quantity = 100

Loc

+name

+prt

++name = mat2.2

++item

+++quantity = 300

Correct me if i am wrong.

Also the mapping will fail if the no of (non-zero qunatity) and QUALF=002(IDTNR) occurence are not equal in one E1EDP01 segment.

rgds,

Arun

Former Member
0 Kudos

its working

Nikhil.

Answers (0)