cancel
Showing results for 
Search instead for 
Did you mean: 

Problem with Idoc Mapping

Former Member
0 Kudos

Hi,

Target field is : Bank Address 1:

Source mapping: it is a Idoc with the following requirements

IF E1IDB02 BA-FIIKWAER = CNY and LEN(E1IDB02 BB-FIIBKNAM)<=11

then MID(E1IDB02 BB-FIIBKNAM,2,10)

IF E1IDB02 BA-FIIKWAER = CNY and LEN(E1IDB02 BB-FIIBKNAM)>11

then MID(E1IDB02 BB-FIIBKNAM,12,11)

IF E1IDB02 BA-FIIKWAER <> CNY and LEN(E1IDB02 BB-FIIBKNAM)<=35

then MID(E1IDB02 BB-STRAS,1,35)

IF E1IDB02 BA-FIIKWAER <> CNY and LEN(E1IDB02 BB-FIIBKNAM)>35

then MID(E1IDB02 BB-FIIBKNAM,36,35)

E1IDB02 -- is a segment name with occurence 1..1

BA and BB are the qualifiers

FIIBKNAM is the field name.

I am unable to map this as the condition has to be given with two qualifiers at a time.

Can some one help me out on this. Can we define the UDF where we can store this information as temporary variable. If UDF can be defined, please let me know with the details.

Regards,

Manoj

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Thnaks for your support

Former Member
0 Kudos

Hi Manoj,

You can try using graphical funciton..

E1IDB02 BA-FIIKWAER = CNY(use constant to store this value)

LEN(E1IDB02 BB-FIIBKNAM)<=11 (use greater than less than function) -


>AND( use and operator between these two)

else repeat the same according to the condition and map to receiver field--->MID(E1IDB02 BB-FIIBKNAM,2,10)

Hope i am clear.

Please try with this..if you struck in middle,please let me know.

Thanks and Regards,

Chandu.

Message was edited by:

Chandu

Former Member
0 Kudos

Hi Chandu and Chilla,

Thanks for your inputs.

But the isseue here is , when i am testing, every time the source consider only the first input with qualifier BA and giving a output as blank every time.

The reason is the occurence of this segment and Idoc is 1..1

Regards,

Manoj

Former Member
0 Kudos

Hi Manojkumar,

Change the source filed <b>context</b>. In mapping editor select the source field and right click and select context ( which is root to that source field). select the node of having occurance 0...unbounded or 1..unbounded.

I guess it should work fine...try this and let me know.

Thanks and Regards,

Chandu.

Former Member
0 Kudos

HI,

Yes, but you have to write your own UDF ,

but i can give example use this to solve your problem.

IF E1IDB02 BA-FIIKWAER = CNY

then MID(E1EDKA1 BE-NAME1,12,11)

1)

input E1EDKA1 BE-NAME1,E1IDB02 BA-FIIKWAER

if (E1IDB02 BA-FIIKWAER = CNY) {

return substring(E1EDKA1 BE-NAME1,12,11);

}

2)

input E1EDKA1 BE-NAME1,E1IDB02 BA-FIIKWAER

IF (E1IDB02 BA-FIIKWAER <> CNY ) && ( (E1EDKA1 BE-NAME1).length<=35)

{

return substring(E1EDKA1 BE-STRAS,1,35);

}

3)

IF (E1IDB02 BA-FIIKWAER <> CNY) && ((E1EDKA1 BE-NAME1).length>35)

{

return substring(E1EDKA1 BE-NAME1,36,35);

}

Before map this first map with same level of empty constant and concat it, if it is empty,later map with substring.

Regards

Chilla