cancel
Showing results for 
Search instead for 
Did you mean: 

JDBC TO IDOC MAPPING PROBLEM

Former Member
0 Kudos

Hi

we have a scenario from JDBC to idoc , the idoc is WPUUMS01 for aggregated sales data in retail scenario. As per the reqmnt ,

for a particular location_code we need a single idoc , if lineitems are multiple , segments should be added in the same idoc .

Idoc should change when location_code changes .

now when we are doing the mapping we are gettting as many iodcs generated as the no of locations_code

rgds

arun

Accepted Solutions (1)

Accepted Solutions (1)

rajasekhar_reddy14
Active Contributor
0 Kudos

Hi Arun,

wt is the problem are you facing,..???you dint mentioned anything....you said its working fine...then what is the problem

Regards,

Raj

Former Member
0 Kudos

Probem:

Idoc should change when location_code changes .

but we are gettting as many iodcs generated as the no of locations_code

lineitem should be added in the segments within the same idoc and new idoc should be generated on the change of location_code

we have done bothe the changes in the MM and interface mapping and as a result of that we are getting multiple idocs generated ,

pl suggest

rgds

arun

Former Member
0 Kudos

Hello,

Do your mapping like this..

location_code ----> RemoveContext ---> Sort -----> SplitByValue (on value change) ---> CollapseContext ----> IDOC

Regards,

Sarvesh

Former Member
0 Kudos

Hi Sarvesh ,

Thanks for ur reply , the logic has worked

one more problem is yet to be sorted , when same LOCATION_CODE is coming for different lineitems , segments should be added under the same idoc.

At present with the above logic , idocs are getting segregated on the basis of LOCATION CODE , BUT when the lineitems are repeating for the same LOCATIONCODE , line items are not getting added to the particular idoc .

I've added a sample payload of sender as well as receiver with three LOCATION_CODES -1000, 1001,1001

in the target payload we are getting two idocs with LOCATION_CODES -1000, 1001

LOCATION_CODE is mapped with idoc also its mapped with SNDRPRN in the header segment EDI_DC40 of idoc

XML OF THE SENDER SIDE :

ns:MT_OB_AGGSALES xmlns:ns="http://AGGSALES_IB_NS">

row>

Location_Code>1000</Location_Code>

Date>20091208</Date>

Currency>INR</Currency>

Sku_Code>500083</Sku_Code>

Batch>B1</Batch>

Total_Sales_Value>500</Total_Sales_Value>

Total_Sales_qty>1</Total_Sales_qty>

Sign_for_qty>-</Sign_for_qty>

IsRecordRead>Y</IsRecordRead>

Sign_for_value>+</Sign_for_value>

Sales_UOM>EA</Sales_UOM>

FieldGroup>BATCH</FieldGroup>

row>

row>

Location_Code>1001</Location_Code>

Date>20091208</Date>

Currency>INR</Currency>

Sku_Code>500083</Sku_Code>

Batch>B1</Batch>

Total_Sales_Value>500</Total_Sales_Value>

Total_Sales_qty>1</Total_Sales_qty>

Sign_for_qty>-</Sign_for_qty>

IsRecordRead>Y</IsRecordRead>

Sign_for_value>+</Sign_for_value>

Sales_UOM>EA</Sales_UOM>

FieldGroup>BATCH</FieldGroup>

row>

row>

Location_Code>1001</Location_Code>

Date>20091208</Date>

Currency>INR</Currency>

Sku_Code>500084</Sku_Code>

Batch>B1</Batch>

Total_Sales_Value>500</Total_Sales_Value>

Total_Sales_qty>1</Total_Sales_qty>

Sign_for_qty>-</Sign_for_qty>

IsRecordRead>Y</IsRecordRead>

Sign_for_value>+</Sign_for_value>

Sales_UOM>EA</Sales_UOM>

FieldGroup>BATCH</FieldGroup>

row>

ns:MT_OB_AGGSALES>

TARGET XML

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

WPUUMS01><IDOC BEGIN="1"><EDI_DC40 SEGMENT="1">

TABNAM>EDI_DC40</TABNAM>

DIRECT>2</DIRECT>

IDOCTYP>WPUUMS01</IDOCTYP>

MESTYP>WPUUMS</MESTYP>

SNDPOR>SAPXID</SNDPOR>

SNDPRT>KU</SNDPRT>

SNDPRN>1000</SNDPRN>

RCVPOR>SAPDEV</RCVPOR>

RCVPRT>KU</RCVPRT>

RCVPRN>1000</RCVPRN>

EDI_DC40>

E1WPU01 SEGMENT="1">

BELEGDATUM>20091208</BELEGDATUM>

BELEGWAERS>INR</BELEGWAERS>

E1WPU02 SEGMENT="1">

ARTNR>500083</ARTNR>

VORZMENGE>-</VORZMENGE>

VORZWERT>+</VORZWERT>

UMSWERT>500</UMSWERT>

SALES_UOM>EA</SALES_UOM>

E1WXX01 SEGMENT="1">

FLDGRP>BATCH</FLDGRP>

FLDVAL>B1</FLDVAL>

E1WXX01></E1WPU02>

E1WPU01>

IDOC><IDOC BEGIN="1">

EDI_DC40 SEGMENT="1">

TABNAM>EDI_DC40</TABNAM>

DIRECT>2</DIRECT>

IDOCTYP>WPUUMS01</IDOCTYP>

MESTYP>WPUUMS</MESTYP>

SNDPOR>SAPXID</SNDPOR>

SNDPRT>KU</SNDPRT>

SNDPRN>1001</SNDPRN>

RCVPOR>SAPDEV</RCVPOR>

RCVPRT>KU</RCVPRT>

RCVPRN>1001</RCVPRN>

EDI_DC40>

E1WPU01 SEGMENT="1">

BELEGDATUM>20091208</BELEGDATUM>

BELEGWAERS>INR</BELEGWAERS>

E1WPU02 SEGMENT="1">

ARTNR>500083</ARTNR>

VORZMENGE>-</VORZMENGE>

VORZWERT>+</VORZWERT>

UMSWERT>500</UMSWERT>

SALES_UOM>EA</SALES_UOM>

E1WXX01 SEGMENT="1">

FLDGRP>BATCH</FLDGRP>

FLDVAL>B1</FLDVAL>

E1WXX01></E1WPU02>

E1WPU01>

IDOC></WPUUMS01>

thanks for ur support

rgds

arun

Former Member
0 Kudos

Ok, for that do your mapping like this..

Location_Code>RemoveContext>Sort>SplitByValue(on value change)>E1WPU01

Regards,

Sarvesh

Former Member
0 Kudos

Hi Sarvesh,

Thanks for ur needful help....my problem solved.

Regards,

Arun

Former Member
0 Kudos

Hi Experts,

When the Purchase_order_type is coming like HIGH,REGULAR,NEW,BOUNCED. In this case i need to generate 2 idoc, based on HIGH is one and Other than HIGH is one, even though if it's REGULAR,NEW,BOUNCED.

I can't generate. pl suggest

rgds

Arun

Former Member
0 Kudos

For this you have to creat the External Defintion of that IDOC. So take the XSD of IDOC and paste it on notepade then change the occurence 0..unbounded and then create the External Definition and then use this external definition instead to std. IDOC.

Example: In your IDOC xsd (in notepad) add the maxOccurs="unbounded" as shown in below example.

<xsd:element name="IDOC" type="ACC_GL_POSTING.ACC_GL_POSTING01" maxOccurs="unbounded" />

Regards,

Sarvesh

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi,

You need to set Occurence for target Idoc message as 0..Unbounded. Within message mapping you can do this from Message tab -> find Occurence option at Target message. Also within Interfce mapping for Target Interface set Occurence 0..Unbounded.

map unique no.of location codes to Node WPUUMS01 to populate no.of Idocs and Apply your mapping rules.

Cheers

Veera