Skip to Content
0
Former Member
Jan 13, 2006 at 05:56 PM

DEBMAS text mapping

182 Views

Hi all,

we send DEBMAS-IDocs out of a SAP 4.7 system to XI. The target is a MS SQL db (connected via JDBC), where the segments are mapped into several tables.

I have difficulties to map texts from IDoc to SQL-table. In the SQL-DB there is only one table for customer texts, so I have to flatten header and line information in one structure in the target table.

That worked fine until in one IDoc there came a delete request for one text and one or more insert requests for other texts. I used the function "useOneAsMany" to copy the header information to the table and combined it with the line information. But because there is no line sent with the delete request the function caused an error: there are more contexts on header level than on item level.

Example:

In the IDoc are three texts, the first has to be deleted, the others have to be created. The first has no lines, the others have multiple lines.

How can I map that?

Example with data:

<E1KNA1H SEGMENT="1">

<MSGFN>003</MSGFN> /* delete function */

<TDOBJECT>KNA1</TDOBJECT>

<TDNAME>0000021321</TDNAME>

<TDID>9010</TDID>

<TDSPRASISO>EN</TDSPRASISO>

</E1KNA1H>

<E1KNA1H SEGMENT="1">

<MSGFN>005</MSGFN>

<TDOBJECT>KNA1</TDOBJECT>

<TDNAME>0000021321</TDNAME>

<TDID>9025</TDID>

<TDSPRASISO>EN</TDSPRASISO>

<E1KNA1L SEGMENT="1">

<MSGFN>005</MSGFN>

<TDFORMAT>*</TDFORMAT>

<TDLINE>Textline 1</TDLINE>

</E1KNA1L>

<E1KNA1L SEGMENT="1">

<MSGFN>005</MSGFN>

<TDFORMAT>*</TDFORMAT>

<TDLINE>Textline 2</TDLINE>

</E1KNA1L>

</E1KNA1H>

<E1KNA1H SEGMENT="1">

<MSGFN>005</MSGFN>

<TDOBJECT>KNA1</TDOBJECT>

<TDNAME>0000021321</TDNAME>

<TDID>9080</TDID>

<TDSPRASISO>EN</TDSPRASISO>

<E1KNA1L SEGMENT="1">

<MSGFN>005</MSGFN>

<TDFORMAT>*</TDFORMAT>

<TDLINE>EFTA 1</TDLINE>

</E1KNA1L>

<E1KNA1L SEGMENT="1">

<MSGFN>005</MSGFN>

<TDFORMAT>*</TDFORMAT>

<TDLINE>EFTA 2</TDLINE>

</E1KNA1L>

<E1KNA1L SEGMENT="1">

<MSGFN>005</MSGFN>

<TDFORMAT>*</TDFORMAT>

<TDLINE>EFTA 3</TDLINE>

</E1KNA1L>

</E1KNA1H>

The result should be as follows:

Action -- Customer -- Text -- ID -- SPRAS -- LINE -- TEXT

DELETE -- 0000021321 -- KNA1 -- 9010 -- EN

INSERT -- 0000021321 -- KNA1 -- 9025 -- EN -- 1 -- Textline 1

INSERT -- 0000021321 -- KNA1 -- 9025 -- EN -- 2 -- Textline 2

INSERT -- 0000021321 -- KNA1 -- 9080 -- EN -- 1 -- EFTA1

INSERT -- 0000021321 -- KNA1 -- 9080 -- EN -- 2 -- EFTA2

INSERT -- 0000021321 -- KNA1 -- 9080 -- EN -- 2 -- EFTA3

Any idea?

Best regards

Lars