cancel
Showing results for 
Search instead for 
Did you mean: 

Message Mapping

Former Member
0 Kudos

Hi All,

Very Good morning.

In my message mapping i map the

RFC response structure(Source Structure) map to JDBC insert structures(target)

in target JDBC structure i took two Statement insert tags. Because i need to insert two tables.

{My RFC response structure
*********************************
_-PG-_1E_SCMDB.response     1..1
    DOC_DATA                            0..1
      item                                       0..Unbounded
        VBELN                                0..1
        SUBMI                                 0..1
        BSTNK                                0..1
        ITEMS                                  0..1
           item                                  0..Unbounded     
             POSNR                           0..1
             MATNR                           0..1
             ARKTX                           0..1

Target JDBC structure
***********************************
RESPONSE_MT                         1..1
  StatementName1                     1..1
    dbTableName                         1..1
       action                                 optional ( attribute)---INSERT
       table                                    1..1                       --- XI_SAP_HEDEARDATA
       access                                0.. unbounded
          VBELN                              0..1
          SUBMI                               0..1
          BSTNK                              0..1
  StatementName2                      1..1
    dbTableName                          1..1
       action                                   optional (attribute)--INSERT
       table                                     1..1                       -- XI_SAP_ITEMDATA
       access                                 0..unbounded
          VBELN                               0..1
          POSNR                               0..1
          MATNR                               0..1
          ARKTX                                0..1

VBELN filed is foreign key relation ship two tables.So i can map two statements

VBELN is map to VBELN in first statement and also as second VBELN in the Second statement

SUBMI is map to SUBMI ,BSTNK is map to BSTNK...in POSNR is map to POSNR, MATNR is map to MATNR.....

I will continue to next message

Thank you very much

Sateesh

Edited by: sateesh kumar .N on May 25, 2010 9:11 AM

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

I approached XSLT mapping here.Thank you very much your support

Former Member
0 Kudos

Continution

here my problem is: As per as RFC response structure First "item" tag having o to unbounded and second "item" tag also o to Unbounded..

for example: my XML data structure is like below this
<_-PG-_1E_SCMDB.response>
  <DOC_DATA>
    <item>                                     
        <VBELN>ABC</VBELN>                               
        <SUBMI>12</SUBMI>
        <BSTNK>XY</BSTNK>
        <ITEMS>
           <item>
             <POSNR>A</POSNR>
             <MATNR>AAA</MATNR>
             <ARKTX>xbxgg</ARKTX>
           </item>
           <item>
             <POSNR>B</POSNR>
             <MATNR>BBB</MATNR>
             <ARKTX>jjhhjh</ARKTX>
           </item>
        </ITEMS>
    </item>
    <item>  
        <VBELN>XYZ</VBELN>                               
        <SUBMI>13</SUBMI>
        <BSTNK>MX</BSTNK>
        <ITEMS>
           <item>
             <POSNR>C</POSNR>
             <MATNR>CCC</MATNR>
             <ARKTX>jhukjk</ARKTX>
           </item>
           <item>
             <POSNR>D</POSNR>
             <MATNR>DDD</MATNR>
             <ARKTX>iouho</ARKTX>
           </item>
        </ITEMS>
    </item>  
 </DOC_DATA>
</_-PG-_1E_SCMDB.response>              

When i got above structure from RFC i got  mapping result in target below
<StatementName1>
   <action>INSERT</action>
   <table>XI_SAP_HEADERDATA</table>
   <access>                                
          <VBELN>ABC</VBELN>
          <SUBMI>12</SUBMI>                               
          <BSTNK>XY</BSTNK>
   </access>
   <access>                                
          <VBELN>XYZ</VBELN>
          <SUBMI>13</SUBMI>                               
          <BSTNK>MX</BSTNK>
   </access>
</StatementName1>                               
<StatementName2>                                
    <action>INSERT</action>
    <table>XI_SAP_ITEMDATA</table>
    <access>                                
          <VBELN>ABC</VBELN>                              
          <POSNR>A</POSNR>
          <MATNR>AAA</MATNR>
          <ARKTX>xbxgg</ARKTX>
   </access>
   <access>                                
          <VBELN>XYZ</VBELN>       ..........Here i am excepted ABC value                       
          <POSNR>B</POSNR>
          <MATNR>BBB</MATNR>
          <ARKTX>jjhhjh</ARKTX>
   </access>

and after that no remaing Item tags are not coming

Can you please guide me how i can map here?

Former Member
0 Kudos

Hi Satheesh,

> and after that no remaing Item tags are not coming

Change the context of the Statement2 and check

Now which context is pointing to the statement2?

Regards

Ramesh

Former Member
0 Kudos

Hi Ramesh,

Thanks for your reply,

Statement1 get result what i am excetpting.

But Statement2 not except the result.

But i am excepting the result is below:

<StatementName1>
   <action>INSERT</action>
   <table>XI_SAP_HEADERDATA</table>
   <access>                                
          <VBELN>ABC</VBELN>
          <SUBMI>12</SUBMI>                               
          <BSTNK>XY</BSTNK>
   </access>
   <access>                                
          <VBELN>XYZ</VBELN>
          <SUBMI>13</SUBMI>                               
          <BSTNK>MX</BSTNK>
   </access>
</StatementName1>                               
<StatementName2>                                
    <action>INSERT</action>
    <table>XI_SAP_ITEMDATA</table>
    <access>                                
          <VBELN>ABC</VBELN>                              
          <POSNR>A</POSNR>
          <MATNR>AAA</MATNR>
          <ARKTX>xbxgg</ARKTX>
   </access>
   <access>     
          <VBELN>ABC</VBELN>                                                 
          <POSNR>B</POSNR>
          <MATNR>BBB</MATNR>
          <ARKTX>jjhhjh</ARKTX>
   </access>
   <access>     
          <VBELN>XYZ</VBELN>                                                 
          <POSNR>C</POSNR>
          <MATNR>CCC</MATNR>
          <ARKTX>jhukjk</ARKTX> 
   </access>
      <access>     
          <VBELN>XYZ</VBELN>                                                 
          <POSNR>D</POSNR>
          <MATNR>DDD</MATNR>
          <ARKTX>iouho</ARKTX>
   </access>
</StatementName2>

Thank you very much.

Sateesh

Edited by: sateesh kumar .N on May 25, 2010 9:57 AM

Former Member
0 Kudos

For Statement2 which field you have mentioned in the source side, that field context you change and check

Ramesh

Former Member
0 Kudos

Hi Ramesh,

I change the context of VBELN filed in Source side. Still i am getting same result.

Kindly suggest is their any UDF is required?

Thank you veyr much.

Sateesh

Former Member
0 Kudos

Hi,

You given the item 0..unbound as two times, so change that name at any one place.

Use the sender side data type like below

DOC_DATA 0..1

Header 0..Unbounded

VBELN 0..1

SUBMI 0..1

BSTNK 0..1

ITEMS 0..1

item 0..Unbounded

POSNR 0..1

MATNR 0..1

ARKTX 0..1

and for the StatementName2 map item node from sender side. now change the item context to Header and check

Regards

Ramesh

Former Member
0 Kudos

Hello Ramesh,

according to you that i tried to change that, Still I am n't excepted result.

Can you please guide me..

Thank you