cancel
Showing results for 
Search instead for 
Did you mean: 

message mapping issue in idoc to jdbc scenario

Former Member
0 Kudos

We have a scenario of idoc->XI-JDBC

the below given segment may get repeated , as shown below ,

E1EDP19[2]--idoc segment

QUALF---003

IDTNR---01000123(Bar Code No)

E1EDP19[3]--idoc segment

QUALF---003

IDTNR---20500000000034(EAN No)

Reqd mapping

if QUALF=003

THEN IDTNR----->Bar_code_Number_EAN

Now IDTNR has to be mapped with Bar_code_Number_EAN for the segment which comes last

Pl suggest how to map using graphical mapping for the above scenario.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

is this question correct? QUAL 003 should come only once under E1EDP19???

What is your target structure.. I don't think if there will be any issue in doing graphical mapping because it seems straight forward..

Former Member
0 Kudos

Hi Sarvesh

The question is very correct

The below given segment may get repeated , as shown below , QUALF is repeated with every segment.

sender structure

E1EDP19[1]--idoc segment

QUALF---002

IDTNR---01000123(Bar Code No)

E1EDP19[2]--idoc segment

QUALF---003

IDTNR---01000123(Bar Code No)

E1EDP19[3]--idoc segment

QUALF---003

IDTNR---20500000000034(EAN No)

Target mapping

if QUALF=002

THEN IDTNR----->Articel_No

No issue when QUALF=002

but when QUALF=003, segment E1EDP19 may be repeated , when its repeated

target mapping

IDTNR-------> Bar_code_Number_EAN , IDTNR has to be from last repeated segment.

rgds

mojib

justin_santhanam
Active Contributor
0 Kudos

Mohammad,

Try the below code

get two inputs - qualf, idtnr (cache Context- Queue)


String temp;
for(int i=0;i<qualf.length;i++)
{
if(qualf<i>.equals("003"))
{
temp = idtnr<i>;
}
}

result.addValue(temp);

Former Member
0 Kudos

Ok fine, in that case you need to write the UDF. I gues the UDF code given by Raj should work for you.

Former Member
0 Kudos

Hi Sarvesh

The question is very correct

For every repetition of idoc segment E1EDP19, QUALF is repeated

the below given segment may get repeated , as shown below ,

sender structure

E1EDP19[2]--idoc segment

QUALF---002

IDTNR---01000123(Bar Code No)

E1EDP19[2]--idoc segment

QUALF---003

IDTNR---01000123(Bar Code No)

E1EDP19[3]--idoc segment

QUALF---003

IDTNR---20500000000034(EAN No)

Target mapping

if QUALF=002

THEN IDTNR--->Article_No this is the direct mapping so , no issues

if if QUALF=003

THEN IDTNR----->Bar_code_Number_EAN

Now IDTNR has to be mapped with Bar_code_Number_EAN for the segment which comes last

Hope the reqmnt is more clear

rgds

mojib

justin_santhanam
Active Contributor
0 Kudos

Mohammad,

Did you tried my code?

~raj.

Former Member
0 Kudos

Raj,

I m working on it , once I finish I'll close the thread with points awarded

Thanks

mojib

Former Member
0 Kudos

The following code , I've put in the UDFmapBarcodEAN

Cache:queue

public void mapBarcodEAN(String[] QUALF,String[] IDTNR,ResultList result,Container container){

String temp=" ";

for(int i=0;i<QUALF.length;i++)

{

if(QUALF<i>.equals("003"))

{

temp =IDTNR<i>;

}

}

result.addValue(temp);

I m getting the following error :

RuntimeException in Message-Mapping transformation: Runtime exception during processing target field mapping /ns0:MT_IB_INVOICE/STATEMENTNAME/si_invoice_header/ACCESS/Bar_code_Number_EAN. The message is: Exception:[java.lang.ArrayIndexOutOfBoundsException: 2] in class com.sap.xi.tf._MM_INVOICE_ method mapBarcodEAN$[, com.sap.aii.mappingtool.flib3.IfWithoutElse@130f9ee0]

Pl help ..

rgds

justin_santhanam
Active Contributor
0 Kudos

Mojib,

Did you got the error resolved? or still you need help on it?

~raj.

Former Member
0 Kudos

Hi Raj ,

The current mapping works fine if the parent segment E1EDP01 is only one but if that gets repeated then the last value of IDTNR is getting populated in the target side, very clearly i m giving the source and target structure and the mapping done using the UDF

Source structure
E1EDP01
       E1EDP19[1]--idoc segment
              QUALF---002
              IDTNR---01000123(Bar Code No)
       E1EDP19[2]--idoc segment
              QUALF---003
              IDTNR---01000123(Bar Code No)

       E1EDP19[3]--idoc segment
           QUALF---003
           IDTNR---20500000000030(EAN No)

E1EDP01
     E1EDP19[1]--idoc segment
                QUALF---002
                IDTNR---01000123(Bar Code No)
     E1EDP19[2]--idoc segment
               QUALF---003
               IDTNR---01000123(Bar Code No)

      E1EDP19[3]--idoc segment
             QUALF---003
             IDTNR---20500000000031(EAN No)

E1EDP01
       E1EDP19[1]--idoc segment
               QUALF---002
                IDTNR---01000123(Bar Code No)
      E1EDP19[2]--idoc segment
              QUALF---003
              IDTNR---01000123(Bar Code No)

     E1EDP19[3]--idoc segment
          QUALF---003
          IDTNR---20500000000032(EAN No)

Target mapping

if QUALF=002

THEN IDTNR--->Article_No this is the direct mapping so , no issues

if QUALF=003

THEN IDTNR----->Bar_code_Number_EAN, now this IDTNR should get repeated every time the segment E1EDP01 gets repeated , currently only the last value form all the IDTNR is coming to the target side.

The current mapping works fine if the parent segment E1EDP01 is only one

Target structure

Access1
IDTNR--> Bar_code_Number_EAN( value is 20500000000030)

Access2
IDTNR--> Bar_code_Number_EAN( value is 20500000000031)

Access3
IDTNR--> Bar_code_Number_EAN( value is 20500000000032)

Current mapping

If QUALF = 003 
                Then  QUALF ---->
                                                 mapBarCodeEAN---->Bar_code_Num_EAN
If QUALF = 003 
                Then  IDTNR ---->

Context of QUALF is set to E1EDP01

Context of IDTNR is set to E1EDP01

thanks for your personalised help

rgds

mojib

Edited by: mohammad mojib ur rahman on Apr 9, 2010 1:30 PM

Answers (3)

Answers (3)

Former Member
0 Kudos

Thanks all for your support

rgds

mojib

Former Member
0 Kudos

some hitch has come thats why I've reopened

Former Member
0 Kudos

Raj ,

can u please look into the above reqmnt , its urgnet

rgds

mojib

justin_santhanam
Active Contributor
0 Kudos

Mojib,

I'm not getting your requirement. You want only the last value of IDTNR correct? then what's the issue with it?

~raj.

VijayKonam
Active Contributor
0 Kudos

Write a UDF and compare the qualifier with 003. Get the last string value in a loop. I do not think just graphical mapping would be sufficient.

VJ