cancel
Showing results for 
Search instead for 
Did you mean: 

PI : Idoc to JDBC scenario : repeating segments mapping issue

Former Member
0 Kudos

Experts

Please help.

Question reg. mapping for ECC idoc to JDBC scenario.

I am using the ORDRSP idoc which has multiple segments as below.

IDOC -> multiple E1EDK14 segments with 2 fields (QUALF and ORGID)

Depending on the value of the QUALF field i need to populate the column in my target structure.

QUALF 001 => Colmn a

QUALF 002 => Colmn b

For now my graphical mapping is very simple - QUALF => column a (done just to find out how PI mapping works)

What happens in my case, is the PI Payload shows all the E1EDK14 segments however only the value 006 present in the first occurence goes into the target column.

How do I repeat a mapping between QUALF and target col. for multiple occurences of the same segment?

Please can you guide me reg. use of context, loop over segment, UDF = which will be the best solution to achieve this?

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi.

Use Function - UseOneAsMany to repeat

Qual------>

E1EDK--


> UseOneAsMany--


>ColumnA

E1EDK--->

Former Member
0 Kudos

Hi

Please could you elaborate so that I can understand properly how to do it.

I am new hence request you to go over the detail.

Regards

Former Member
0 Kudos

Hi

I do not want to repeat the value in the target col. What I want to do is

If E1EDKA14 = qualf is 001 send E1EDKA14-orgid to col A

If E1EDKA14-qualf is 002 send E1EDKA14-orgid to col B

Right now only the first occurence of the E1EDKA14 segment gets considered and value goes in the col A

The second occurrence does not get considered at all.

Former Member
0 Kudos

Hi

What do you want exactly?

How do I repeat a mapping between QUALF and target col. for multiple occurences of the same segment?

Because if if the first segment comes the value and if you want to replicate in all Target ColumnA. you can use the function

Regards

Former Member
0 Kudos

Hi,

While giving condition, you need to change the context level of Qualf to the root node. Try this.

Former Member
0 Kudos

Hi

I have changed the context of the field QUALF to IDOC. Will test that.

What I do not understand is this : If the message has multiple E1EDKA14 segments then each segment should pass through the mappings defined.

However in my case it is happening only for the first occurence of the segment

Former Member
0 Kudos

Example of what I see in the paylod.

- <E1EDK14 SEGMENT="1">

<QUALF>006</QUALF>

<ORGID>01</ORGID>

</E1EDK14>

- <E1EDK14 SEGMENT="1">

<QUALF>007</QUALF>

<ORGID>01</ORGID>

</E1EDK14>

If you see the first node, that 006 value goes and sits in the target col a.

However the E1EDK14 segment with 007 value for QUALF does not pass through the mapping and hence the target col b stays blank.

Former Member
0 Kudos

Hi

Can you put the expected result as you want?

Because I think is simple the mapping rule.

Regards.

Former Member
0 Kudos

Expected result should be as below

E1EDKA14 => QUALF = 001 (first occurence - this segment has occurrence 0...12 in SAP ECC)

=> ORGID = ABC col A = ABC (first column of target structure)

E1EDKA14 => QUALF = 002 (second occurrence )

=> ORGID = DEF col B = DEF (second column of target structure)

Edited by: gary jojo on Dec 5, 2011 6:50 PM

Former Member
0 Kudos

Hi Try this and let me know


QUALF ------
"001"---------Equals ----IfWithOutElse----------------->ColumA
ORGId-------->-----------then



QUALF ------
"002"---------Equals ----IfWithOutElse----------------->ColumB
ORGId-------------------then

Regards

Luis

Former Member
0 Kudos

Hi

I have done the mapping as suggested. However only the first occurence of the idoc segment is considered.

Also this is a sales order idoc - thus the sales order has 2 line items.

I checked the records in the target structure and the jdbc query gets fired only for the first line item.

Why does the second line item segment E1EDP01 does not get considered?

PLEASE HELP

Former Member
0 Kudos

Hi.

A question How do you map the target element root of ColA and ColB?

E1EDK14 -


>E1EDP01 ?

Regards.

Former Member
0 Kudos

Hi

My mapping is as below. I will take an example of a sales order that has 2 line items 00010, 00020. The payload is as follows

I see this payload in the SXMB_MONI transaction => Receiver grouping => Payloads

- <ZORDRES>

- <IDOC BEGIN="1">

+ <EDI_DC40 SEGMENT="1">

+ <E1EDK01 SEGMENT="1">

+ <E1EDK14 SEGMENT="1">

<QUALF>006</QUALF>

<ORGID>01</ORGID>

</E1EDK14>

+ <E1EDK14 SEGMENT="1">

<QUALF>007</QUALF>

<ORGID>01</ORGID>

</E1EDK14>+ <E1EDK03 SEGMENT="1">

+ <E1EDK03 SEGMENT="1">

+ <E1EDK03 SEGMENT="1">

+ <E1EDK03 SEGMENT="1">

+ <E1EDKA1 SEGMENT="1">

+ <E1EDKA1 SEGMENT="1">

+ <E1EDKA1 SEGMENT="1">

+ <E1EDKA1 SEGMENT="1">

+ <E1EDKA1 SEGMENT="1">

+ <E1EDK02 SEGMENT="1">

+ <E1EDK02 SEGMENT="1">

+ <E1EDK17 SEGMENT="1">

+ <E1EDK18 SEGMENT="1">

+ <E1EDK18 SEGMENT="1">

+ <E1EDP01 SEGMENT="1">

<POSEX>000010</POSEX>

+ <E1EDP01 SEGMENT="1">

<POSEX>000020</POSEX>

</E1EDP01>+ <E1EDS01 SEGMENT="1">

<SUMID>001</SUMID>

<SUMME>2</SUMME>

</E1EDS01>

+ <E1EDS01 SEGMENT="1">

<SUMID>002</SUMID>

<SUMME>1100.00</SUMME>

<SUNIT>GBP</SUNIT>

</E1EDS01>

</IDOC>

</ZORDRES>

There are 2 problems. First one which I discovered after posting the query. I can see only the line item 10 in the query that gets contructed in PI to insert the data into the target jdbc table. Please see jdbc receiver communication channel log below

If you see above there are 2 E1EDP01 segments for line 00010, 00020.

INSERT INTO tblOItem (IDocDate, IDocTime, SalesOrderNo, ItemNo, Plant, ItemCategory, UnitSellPrice, QuantityOrdered, QuantityAllocated, ScheduledDeliveryDate) VALUES (20111206, 135530, 0015002085, 000010, 0086, ZTAN, 0.00, 1.000, 1.000, 20111201)

My source and target mappings are as below.

ZSALORD

IDOC

BEGIN

E1EDK01

E1EDP01

POSEX =============> SalOrdItm table column itemno

My target side structure (idoc to jdbc scenario is as follows)

I have mapped the E1EDP01 to Statement - I thought this will build one query per line item (per occurence of E1EDP01) but this is not working.

MT_OITEM

Statement

dbtablename ============> SalOrdItm

action =================> Insert

table

access

Itemno (this is one of the columns from the table)

The occurence of E1EDP01 is 0..9999999 while the occurence of Statement node is 1...unbounded.

Please is there any email address where I can send you screen shots if the above is not clear.

I need to get this interface delivered as soon as possible but am STUCK.

Edited by: gary jojo on Dec 6, 2011 3:06 PM

Former Member
0 Kudos

>>I checked the records in the target structure and the jdbc query gets fired only for the first line item

I guess u r mapping "E1EDP01" segment to "access" node on the target structure??

Former Member
0 Kudos

Yes. Please can you suggest what the mapping should be.

Please also go through my post above and suggest solution.

Edited by: gary jojo on Dec 6, 2011 3:14 PM

Former Member
0 Kudos

>>I have mapped the E1EDP01 to Statement

set "access" node occ as 1..unbounded...and then map "E1EDP01" segment to "access"

Former Member
0 Kudos

I have done the change now.

Should anything me mapped to the statement node? What should be the occ of the statement node? Currently it is 1.

However I still see one insert query fired in the log for line item 10.

Do you have any sample document where an idoc has multiple line items and you have sent it successfully through PI to target database.

Can you share the mapping or help me find out the issue

Edited by: gary jojo on Dec 6, 2011 4:32 PM

Former Member
0 Kudos

Hi Gary.

Can you upload any picture of your mapping www.freeimagehosting. net/ or imageshack.us/

Regards.

Former Member
0 Kudos

Hi,

You also map the E1EDP01 segement with conditions like Qualf.

Former Member
0 Kudos

Hi Folks

Based on inputs seen here I figured out that the target structure was getting generated only for the first line since I was not using "UseasMany" functionality in some of my mappings.

Now when I test the idoc payload in the TEST tab I can see the statement structure repeating twice and I can see that the access structure beneath it has data for line item 00010 and data for line item 00020 respectively.

However when I see the comm channel log for the jdbc receiver comm channel I still see one insert statement only.

INSERT INTO tblSales (IDocDate, IDocTime, SalesOrderNo, ItemNo, Plant, ItemCategory, UnitSellPrice, QuantityOrdered, QuantityAllocated, ScheduledDeliveryDate) VALUES (20111206, 174004, 0015002085, 000010, 9999, XXX, 0.00, 1.000, 1.000, 20111201)

The test tab showed 2 inserts but actual test does not show insert for line item 00020.Something not working beyond test mapping - not working when I test it with an actual idoc from ECC through PI

What could be missing>?

Former Member
0 Kudos

Thank you. Your solution worked for me.