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 - BAPI_GOODSMVT_CREATE for Goods Receipt

Former Member
0 Likes
24,418

Hello All,

I have written a report that will do the goods receipt with the help of BAPI  BAPI_GOODSMVT_CREATE.

I have passed the input parameters to the BAPI and after executing the BAPI I got sy-subrc value 0.

But can anyone please tell me what is happening in background after the successful execution of BAPI BAPI_GOODSMVT_CREATE.

As I could not find any difference in tables.

Please find the attached file for the code that I have used in my program for Goods Receipt.

Thanks in advance

Mayusha.

1 ACCEPTED SOLUTION
Read only

former_member185054
Active Participant
0 Likes
12,240

yes, goods receipt is done. That is MIGO transaction.

Material document number will be generated

With regards,

sampath kumar.

Hello All,

I have written a report that will do the goods receipt with the help of BAPI  BAPI_GOODSMVT_CREATE.

I have passed the input parameters to the BAPI and after executing the BAPI I got sy-subrc value 0.

But can anyone please tell me what is happening in background after the successful execution of BAPI BAPI_GOODSMVT_CREATE.

As I could not find any difference in tables.

Please find the attached file for the code that I have used in my program for Goods Receipt.

Thanks in advance

Mayusha.

11 REPLIES 11
Read only

Former Member
0 Likes
12,240

Hi,

This function module mainly creates material documents in the MSEG table.

You can get more information by clicking on the 'function module documentation' button for it.

You can use this FM to create a material document for a goods movement and you can only create one material document each time you call up the method.

You can also use a simulation function before posting the goods movement to check how the data is updated in the database. The standard system is configured so that the goods movement is posted immediately, without prior simulation.

Let me know.

Read only

0 Likes
12,240

Hi Utkarsha,

Thanks for the information I saw the entry in MSEG table.

But my requirement is to do a Goods receipt for a purchase order and for that I have used the BAPI_GOODSMVT_CREATE.


But I found that after Goods Receipt of purchase order, the quantity will reduce from the scheduled quantity of purchase order  for that material.

Can you please let me know which table will updated in this case.



Read only

0 Likes
12,240

Hi Mayusha,

I didnt quite get what table you are looking for. However, an intersection of EORD (purchasing Source list) and EKET (Scheduling Agreement Schedule Lines) will give you open scheduling agreements. Also, EINA table stores the Purchasing info records for the pricing information.

Regards.

Read only

SwadhinGhatuary
Active Contributor
0 Likes
12,240


Hi,

after success full calling of BAPI_GOODSMVT_CREATE u get entry in MSEG table.

and simultaneously if u receive material against open PO then then target PO quantity will reduce.

like this many change will happen in background.

so check once what ever mblnr no u get after BAPI_GOODSMVT_CREATE and commit in migo tcode. if entry exist every thing is ok.

if no entry found then it will be a problem .

Read only

0 Likes
12,240

Hi Swadhin,

Thanks.

Can you please tell me  what this statement  "commit migo tcode" meant for ?

Read only

0 Likes
12,240

Hi,

Here I want say about bapi transaction commit .

so check once what ever mblnr no u get after BAPI_GOODSMVT_CREATE and commit.

In migo tcode if entry exist every thing is ok.

Read only

0 Likes
12,240

Hi Swadhin,

When gcode = '04'

In MIGO tcode newly generated mblnr number( which I got from the BAPI ) is there.

So you mean to say that from the purchase order the quantity is reduced  for that material and Goods receipt has done successfully.

Please confirm if gcode 4 is correct for Goods receipts, and if I used gcode = 1 then in MIGO mblnr is not showing.

Read only

former_member185054
Active Participant
0 Likes
12,240

Hi Mayusha,

101-Goods receipt for purchase order.

After executing the bapi you will get the material document number in p_mblnr.

you van check in transaction migo , mb03,  mb51.

header table is MKPF,item is  MSEG.

With regards,

sampath kumar.

Read only

Former Member
0 Likes
12,240

Thank you all.

But can anyone please confirm me if BAPI is successful then Post Goods Receipt is done successfully?

Read only

former_member185054
Active Participant
0 Likes
12,241

yes, goods receipt is done. That is MIGO transaction.

Material document number will be generated

With regards,

sampath kumar.

Read only

Former Member
0 Likes
12,240

Hi Mayusha,

BAPI won't written sy-subrc, rather it writes RETURN internal table.