cancel
Showing results for 
Search instead for 
Did you mean: 

Creating Multiple IDOCs and Line Items based on Posting date from file

sridharreddy_kondam
Active Contributor
0 Kudos

Hi All,

My scenario is File to IDOC(MBGMCR01)...

Need your suggestions and help on how to go with this...

Source file structure is

DC61|2009-03-15|000000000001200051|00000005.00|200|0001|1234|

DC61|2009-03-15|000000000001200363|00000001.00|300|0001|1234|

DC61|2009-03-15|000000000001200334|00000002.00|400|0001|1234|

DC61|2009-03-16|000000000001201145|00000001.00|200|0001|1234|

DC61|2009-03-16|000000000001201086|00000002.00|100|0001|1234|

DC61|2009-03-17|000000000001200051|00000003.00|200|0001|1234|

DC61|2009-03-17|000000000001200052|00000003.00|200|0001|1234|

DC61|2009-03-17|000000000001200053|00000003.00|200|0001|1234|

DC61|2009-03-18|000000000001200056|00000003.00|200|0001|1234|

And target IDOC(MBGMCR01) is

IDOC (0u202699999)

E1BP2017_GM_ITEM_CREATE(0u2026999999)

Date

For Each new Posting date(column 2) of the source a new idoc to be created and the corresponding records of each posting date to be added to E1BP2017_GM_ITEM_CREATE

The out put for the above should be like this

IDOC(2009-03-15)

E1BP2017_GM_ITEM_CREATE=2009-03-15

E1BP2017_GM_ITEM_CREATE=2009-03-15

E1BP2017_GM_ITEM_CREATE=2009-03-15

IDOC(2009-03-16)

E1BP2017_GM_ITEM_CREATE=2009-03-16

E1BP2017_GM_ITEM_CREATE=2009-03-16

IDOC(2009-03-17)

E1BP2017_GM_ITEM_CREATE =2009-03-17

E1BP2017_GM_ITEM_CREATE=2009-03-17

E1BP2017_GM_ITEM_CREATE=2009-03-17

IDOC(2009-03-18)

E1BP2017_GM_ITEM_CREATE=2009-03-18

Will be thank ful if any one gives a hint....

Thanks and regards,

Sridhar

Accepted Solutions (0)

Answers (2)

Answers (2)

sridharreddy_kondam
Active Contributor
0 Kudos

Hi i solved

Mapped the date field->splitbyValue(ValueChanged)>CollapseContext> IDOC

and then

Date field >splitbyValue(ValueChanged)>CollapseContext-->E1BP2017_GM_ITEM_CREATE

Working

Thanks a lot

Former Member
0 Kudos

You can achieve this in mapping by using "context change" for IDoc segment creation based on the date.

Regards,

Kai

sridharreddy_kondam
Active Contributor
0 Kudos

Hi Kai,

Do an UDF to be used to take note of the the Posting date changed and then create new IDOC or can we use the Standard Node Functions. I have used spitbby value and tried but cannot...

Regards,

sridhar

Former Member
0 Kudos

I think the standard should provide the required function here:

http://help.sap.com/saphelp_erp2004/helpdata/en/bd/ca1105c81c6742a0f8c8d49f8834bf/content.htm

As soon as the date value changes, a new IDoc segment should be created. So SplitByValue should do this!

sridharreddy_kondam
Active Contributor
0 Kudos

Hi Kim,

I already tried using splitbyValue() but couldnt...

My Source structure is like this

MT_IAR 1..1

IAR_Recordset 1..1

IAR_Details 0...Unbounded

Inv_adj_date

How can i check the date when it is changed....?

Regards,

Sridhar

Former Member
0 Kudos

Can you post some details on your mapping looks like or how you tried to use the splitByValue?

sridharreddy_kondam
Active Contributor
0 Kudos

Hello Kai,

I had given all the source and structure details... Hope can you please recheck...

Regards,

Sridhar

Former Member
0 Kudos

I rather meant a picture of your mapping - anyways. Hope this is correct:

Your souce structure:

<MT_IAR>

<IAR_Recordset>

<IAR_Details>

<Inv_adj_date>

...

</IAR_Details>

<IAR_Details>

<Inv_adj_date>

...

</IAR_Details>

.....

Than mapping should be like this:

<Inv_adj_date> ==> SplitbyValue ==> IDOC

Please confirm this doesn't work.