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 to take data for GRN from SAP server

Former Member
0 Likes
1,085

Hello Expertise,

We are going to develop a software(nonsap) which will receive goods against a PO(generated by SAP) and update the fields like PO number, Material No,Quantity, Unit, Date etc. Scenario will be like this, when I click on save button of other software it will update related SAP tables( MKPF , MSEG ) through BAPI and MIGO will be updated automatically whenever tables are updated. Therefore a GRN number will be generated. Guys plz help me regarding this situation. I never used BAPI. So, I am confused on how to do this. Plz give me some useful suggestions.

Thanks,

With regards,

Rosaline

1 ACCEPTED SOLUTION
Read only

former_member308418
Participant
0 Likes
979

Hi,

You can use BAPI "BAPI_GOODSMVT_CREATE" to create a GRN. And also give gmcode = '01' for Goods Receipt.

With regards,

Tripod.

4 REPLIES 4
Read only

Former Member
0 Likes
979

Hi Rosaline,

You can use BAPI BAPI_GOODSMVT_CREATE to do a Goods Receipt against PO. This BAPI can be used for the following purposes :

1. Goods receipt for purchase order

2. Goods receipt for production order

3. Goods issue

4. Transfer posting

5. Other goods receipt

6. Reversal of goods movements

7. Subsequent adjustment with regard to a subcontract order

I used this BAPI for Goods Issue.

Read the documentation of this BAPI, which is pretty clear.


      CALL FUNCTION 'BAPI_GOODSMVT_CREATE'
        EXPORTING
          GOODSMVT_HEADER  = WA_HEADER
          GOODSMVT_CODE    = WA_CODE " GM Code should be 01 for GRN
        IMPORTING
          GOODSMVT_HEADRET = WA_HEADRET
          MATERIALDOCUMENT = WA_RETMTD
        TABLES
          GOODSMVT_ITEM    = IT_ITEM
          RETURN           = IT_RETURN.

Thanks & Regards,

Faheem.

Read only

0 Likes
979

Hi Faheem,

Thanks a lot for your reply. I have some questions regarding this issue. How BAPI works. I mean how this BAPI will generate a GRN( Goods receipt note ) number? How MIGO will be update automatically or I have to do something here? Does BAPI support XML files ? We have XI as middle ware to communicate with SAP. So, plz explain me what are the steps for me to create a GRN with this BAPI .

Any document in this regard will be helpful.

Thanks,

Rosaline.

Read only

0 Likes
979

For questions related to XI/PI, please post in the process integration forum...

BAPI_GOODSMVT_CREATE has got very nice documentation... You can go to SE37 t-code and enter the BAPI name and press enter and then click on documentation to understand how the input parameters should be filled. This BAPI will post a goods movement document.. U can test creation of this BAPI by pressing the execute button after filling the parameters as per documentation (from SE37)

BAPI does not support XML files; it has its own interface that needs to be filled before calling the bapi... You can fill the BAPI interface via graphical mapping in XI and call the BAPI from XI using RFC adapter.

Read only

former_member308418
Participant
0 Likes
980

Hi,

You can use BAPI "BAPI_GOODSMVT_CREATE" to create a GRN. And also give gmcode = '01' for Goods Receipt.

With regards,

Tripod.