Skip to Content
0
Former Member
Jul 20, 2005 at 08:53 AM

Mapping JDBC -> IDOC

38 Views

Hi,

In my scenario, data is fetched from database and passed on to an SAP R/3 Idoc COSMAS01.

I could figured out, that the main problem is in the mapping.

In my design I have put source structure which is exactly the same as database structure and mapped it to target structure.

Source structure:

MT_COSMAS_JDBC

resultset

row

HKEY

HAC

HUST

...

target structure

COSMAS01

IDOC

Begin

E1CSKSM

Kostl

Land1

....

Graphical MAPPING:

HKEY -> Kostl

HAC -> Land1

......

My first problem is to define the right database structure:

When I configure the JDBC sender adapter with the documentname “resultset”, I become the following xml-structure in the SXMB_MONI:

<?xml version="1.0" encoding="utf-8" ?>

- <resultset>

- <row>

<HKEY>130003328</HKEY>

<HGDATB>99999999</HGDATB>

<HGDATV>20050301</HGDATV>

<HUSRID>MIDDELA</HUSRID>

<HAC />

......

</row>

</resultset>

When I add the documentnamespace: http://xxxxx.de/XI/JDBC/COSMAS, I become the following xml structure in the SXMB_MONI:

<?xml version="1.0" encoding="utf-8" ?>

- http://xxx.de/XI/JDBC/COSMAS">

- <row>

<HKEY>130003328</HKEY>

<HGDATB>99999999</HGDATB>

<HGDATV>20050301</HGDATV>

<HUSRID>MIDDELA</HUSRID>

<HAC />

......

</row>

</ns:resultset>

After this I tested my mapping with both xml structures (upload: xxxx.xml)

The result was, that the mapped fields doesn’t appear in the IDOC structure. Only the constants in my mapping appear in this Idoc structure.

Are there some help for an JDBC -> IDOC Mapping?

If there are multiple rows in the source structure, have I to do XLST Mapping??

Example 2 rows -> creating 2 IDOCS COSMAS01 ??

- <resultset>

- <row>

<HKEY>130003328</HKEY>

<HGDATB>99999999</HGDATB>

<HGDATV>20050301</HGDATV>

<HUSRID>XXXXX</HUSRID>

<HAC />

......

</row>

- <row>

<HKEY>130004444</HKEY>

<HGDATB>99999999</HGDATB>

<HGDATV>20050301</HGDATV>

<HUSRID>XXXXXX</HUSRID>

<HAC />

......

</row>

</resultset>

Thanks

Christoph