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

BAPI which can provide functionality of MIGO

Former Member
0 Likes
969

Hi ABAP Gurus ,

We are having following business scenario.

Create Stock Transport Order - > Create OBD - > Create Shipment - > Make Goods reciept at recieving godown (MIGO).

We are trying to find a <b>BAPI which can give same functionality as that of MIGO transaction</b>.

Has anyone done this before ? Please help.

Thanx in advance .......

Regards,

Laxman Nayak.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
884

the gm_Code is the domain of the associated type of the fieldname in the bapi ( called GOODSMVT_CODE ) which can contain the values in table T158G to execute the possible transactions of the bapi.

Good luck,

D. Krijger

Hi ABAP Gurus ,

We are having following business scenario.

Create Stock Transport Order - > Create OBD - > Create Shipment - > Make Goods reciept at recieving godown (MIGO).

We are trying to find a <b>BAPI which can give same functionality as that of MIGO transaction</b>.

Has anyone done this before ? Please help.

Thanx in advance .......

Regards,

Laxman Nayak.

5 REPLIES 5
Read only

Former Member
0 Likes
884

You can use BAPI_GOODSMVT_CREATE( I am not looking at the system right now, so if it is not correct try with pattern BAPIGOODSCREATE*).

It has good documentation.

Srinivas

Read only

0 Likes
884

Thanx to everybody who has answered to my Query . That was very prompt of you........

Mr Srinivas ,

I tried the following code

&----


*& Report ZMIGO_BAPI *

*& *

&----


*& *

*& *

&----


REPORT ZMIGO_BAPI .

**********HEADER DATA FOR MIGO

********MATERIAL DOCUMENT HEADER DATA

DATA : WA_MAT_HD LIKE BAPI2017_GM_HEAD_01 ,

*****GOODS MOVEMENT CODE

W_GMCODE LIKE BAPI2017_GM_CODE,

*****TEST RUN

W_TEST LIKE BAPI2017_GM_GEN-TESTRUN.

*******ITEM DATA FOR MIGO

DATA : IT_MIGOITEM LIKE BAPI2017_GM_ITEM_CREATE OCCURS 10 WITH HEADER

LINE.

DATA : IT_MESSAGES LIKE BAPIRET2 OCCURS 10 WITH HEADER LINE.

PERFORM F00_BUILD_DATA.

&----


*& Form F00_BUILD_DATA

&----


  • text

----


  • --> p1 text

  • <-- p2 text

----


FORM F00_BUILD_DATA .

**********BUILD HEADER DATA

WA_MAT_HD-PSTNG_DATE = '20050430'.

WA_MAT_HD-DOC_DATE = '20050430'.

WA_MAT_HD-REF_DOC_NO = 'MIGO1'.

WA_MAT_HD-PR_UNAME = 'WOSYGEN1'.

WA_MAT_HD-HEADER_TXT = 'TESTMIGO'.

W_GMCODE-GM_CODE = '01'.

W_TEST = 'X'.

*****BUILD ITEM DATA

IT_MIGOITEM-MATERIAL = 'UR01'.

IT_MIGOITEM-MOVE_TYPE = '101'.

IT_MIGOITEM-STCK_TYPE = ' '.

IT_MIGOITEM-DELIV_NUMB = '0080109412'.

IT_MIGOITEM-DELIV_ITEM = '000010'.

IT_MIGOITEM-DELIV_NUMB_TO_SEARCH = '0080109412'.

IT_MIGOITEM-DELIV_ITEM_TO_SEARCH = '000010'.

IT_MIGOITEM-QUANTITY = '0.25'.

IT_MIGOITEM-BASE_UOM = 'BAG'.

IT_MIGOITEM-NO_MORE_GR = '1'.

*IT_MIGOITEM-WITHDRAWN = 'X'.

*IT_MIGOITEM-MVT_IND = 'X'.

IT_MIGOITEM-PLANT = 'RH12'.

IT_MIGOITEM-STGE_LOC = 'FG01'.

IT_MIGOITEM-ENTRY_QNT = '0.25'.

IT_MIGOITEM-ENTRY_UOM = 'BAG'.

IT_MIGOITEM-PO_NUMBER = '4400003370'.

IT_MIGOITEM-PO_ITEM = '00010'.

APPEND IT_MIGOITEM.

BREAK-POINT.

CALL FUNCTION 'BAPI_GOODSMVT_CREATE'

EXPORTING

GOODSMVT_HEADER = WA_MAT_HD

GOODSMVT_CODE = W_GMCODE

TESTRUN = 'X'

  • IMPORTING

  • GOODSMVT_HEADRET =

  • MATERIALDOCUMENT =

  • MATDOCUMENTYEAR =

TABLES

GOODSMVT_ITEM = IT_MIGOITEM

  • GOODSMVT_SERIALNUMBER =

RETURN = IT_MESSAGES

.

BREAK-POINT.

ENDFORM. " F00_BUILD_DATA

But it is not going thru.

It gives following error message in RETURN internal table.

Update control of movement type is incorrect (entry 101 X X)

Can u pls tell me where I have gone wrong ? Or if u have worked on it , can u pls send me the code?

Thanx in advance .

Regards,

Laxman Nayak.

Read only

0 Likes
884

Hi Laxman,

Please read the documentation. It gives you detailed description of all the parameters.

In your code, you commented out teh assignment to IT_MIGOITEM-MVT_IND. I guess it gave you an error because 'X' is not a valid value. But at the same time, you have to pass a value to this field if you are doing a goods receipt for a PO. That value is 'B'. So uncomment your code line IT_MIGOITEM-MVT_IND = 'X' and change it IT_MIGOITEM-MVT_IND = 'B'.

Srinivas

Read only

Former Member
0 Likes
884

You should start taking a look at the gm_code field (it has check-table) This codes provide the t-code which you can execute using this funtion.

Good luck.

D. Krijger

Read only

Former Member
0 Likes
885

the gm_Code is the domain of the associated type of the fieldname in the bapi ( called GOODSMVT_CODE ) which can contain the values in table T158G to execute the possible transactions of the bapi.

Good luck,

D. Krijger