Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Good Movement Inbound Interface Using IDoc

Former Member
0 Likes
6,000

Hi everyone,

I need help to create inbound interface for good movements using IDoc. I'm using XI as middleware. Here the functional design specification :

1. Good movements that will be considered :

- Good Receipt for PO

- Other Good Receipt

- Good Issues

- Transfer (Material to Material)

- Transfer (Plant to Plant)

- Reverse good movement document

- Physical inventory count difference

2. Using standard IDoc (Message Type - MBGMCR ; Basic Type : MBGMCR03)

3. Bapi that will be used is : BAPI_GOODSMVT_CREATE & BAPI_GOODSMVT_CANCEL

4. For physical inventory count differences using IDoc

- MATERIALPHYSINV_CREATEMULTIP01,

- MATERIALPHYSINV_COUNT01

- MATERIALPHYSINV_POSTDIFFEREN01

My Question is :

1. How we differentiate type of good movements ? (look point 1)

2. What process code that we must used? Is we need to create custom process code ?

3. Is we need create custom FM for process code ?

4. How we combine BAPI_GOODSMVT_CREATE & BAPI_GOODSMVT_CANCEL in one FM ?

5. At point 4 in specification, i need to using another idocs for physical count difference. Is this idoc can't combined with idoc MBGMCR ? How we use these idoc ?

Thank you and Regards,

Satria

Hi everyone,

I need help to create inbound interface for good movements using IDoc. I'm using XI as middleware. Here the functional design specification :

1. Good movements that will be considered :

- Good Receipt for PO

- Other Good Receipt

- Good Issues

- Transfer (Material to Material)

- Transfer (Plant to Plant)

- Reverse good movement document

- Physical inventory count difference

2. Using standard IDoc (Message Type - MBGMCR ; Basic Type : MBGMCR03)

3. Bapi that will be used is : BAPI_GOODSMVT_CREATE & BAPI_GOODSMVT_CANCEL

4. For physical inventory count differences using IDoc

- MATERIALPHYSINV_CREATEMULTIP01,

- MATERIALPHYSINV_COUNT01

- MATERIALPHYSINV_POSTDIFFEREN01

My Question is :

1. How we differentiate type of good movements ? (look point 1)

2. What process code that we must used? Is we need to create custom process code ?

3. Is we need create custom FM for process code ?

4. How we combine BAPI_GOODSMVT_CREATE & BAPI_GOODSMVT_CANCEL in one FM ?

5. At point 4 in specification, i need to using another idocs for physical count difference. Is this idoc can't combined with idoc MBGMCR ? How we use these idoc ?

Thank you and Regards,

Satria

2 REPLIES 2
Read only

Former Member
0 Likes
3,608

Hi Satria,

A lot of questions.... here we go:

"1. How we differentiate type of good movements ? (look point 1)"

- I'm ussing ECC 5 and i don't have the basic type MBGMCR03 (only 02) but from my experience with 01 and 02 it's probably the same: in the idoc u'll find a segment called "E1BP2017_GM_CODE". According to the code u enter here (01,...,07) u can differentiate the the GM (goods movements) types. U'll find good documentation in transaction BAPI (don't worry, the BAPI and the IDOC work exactly the same and everything that is written there works for the idoc as well): look for the GoodsMovement object (u can look for it in the hierarchical tab - Materials Management -> Inventory Management -> GoodsMovement, or in the alphabetical tab directly by its name) and click on the method CreateFromData. Switch to documentation tab (when the CreateFromData is highlighted) and u'll get the documentation u need (the explanation on the GM_code is 2-3 pages down).

"2. What process code that we must used? Is we need to create custom process code ?"

- If u map the data fully into the idoc using the XI message mapping and define the ports between XI and ECC so the idoc enters and is processed immediately then there's no need to use any other code.

"3. Is we need create custom FM for process code ?"

- Read my answer for question No. 2. If u use the idocs as-is, u don't need any code and any FM.

"4. How we combine BAPI_GOODSMVT_CREATE & BAPI_GOODSMVT_CANCEL in one FM ?"

- In general u have 2 choices: u can use MBGMCR for all goods issue/movements/whatever and use MBGMCA (mbgmca01) for cancel (again - documentation u can find in method Cancel of object GoodsMovement in BAPI transaction as i mentioned before, it is very similar in the idoc), that is if u can use different destinations in the XI mapping (if u can distinguish the posting from the canceling and fill the right idoc) according the input that comes.

The other chioce is to combine the BAPI_GOODSMVT_CREATE & BAPI_GOODSMVT_CANCEL in the same code (and in the code choose between them according the input). This u can do either by developping a new idoc (in order to fill it from XI and save history etc.) or writing FM - which won't save history of what happened like an idoc but will work as well (i think u have to write it as abap proxy class/method so u can call it from XI). There u can write anything that will check if u need posting or canceling of the goods movement.

Of course in the 2nd chioce u <b>do</b> have to write code, so my answers in 2 & 3 do not refer this option.

"5. At point 4 in specification, i need to using another idocs for physical count difference. Is this idoc can't combined with idoc MBGMCR ? How we use these idoc ?"

- On how to use these 3 idocs - u can look again in trans.BAPI, this time in object MaterialPhysInv (look in Materials Management -> Inventory Management -> MaterialPhysInv), methods CreateMultiple & Count & PostDifferences (quite the same as the idocs u mentioned). If u just fill the idocs in XI (no code/FM writing) then u can't combine them. If, like in Q.4, u wish to write code/FM, u can choose again - developping a new idoc or a FM. Inside u can also choose: use the code to fill the standard idocs (those u mentioned) or call the equivalent BAPIs (the ones i mentioned in trans.BAPI - they do the same thing).

The bottom line is if u choose to write/develop something - u can combine everything u asked about, but it <b>will</b> be very complicated. Or u can do it all only by filling standard idocs in XI... your choice.

Good luck.

Pls reward points

Igal

Read only

0 Likes
3,608

Hi Igal,

Thanks for your answer, I have understand point 1,2 and 3. In point 4, I have understand how to use both of them. I'm using BAPI_GOODSMVT_CANCEL if GM_CODE = "06" (Reversal good movements). The problem is i can't find data that needed for export parameter FM from segments of IDOC MBGMCR03 (MATERIALDOCUMENT,MATDOCUMENTYEAR and GOODSMVT_PSTNG_DATE). How i find this three data from segments of IDoc MBGMCR03?

For point 5, do you mean i need to create another 3 Idoc again? For your information, i don't developed XI because i'm in ABAP Team. My XI Team is work in London and i work in indonesia and until now i haven't speak with them about XI setting. I never touch XI before, what information that i need from them and what information which they needed? Sorry i'm add another question again _ Thank you for your great help Igal

Regards,

Satria