Application Development 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: 

Check GR already done when using IDOC WMMBID02.

Former Member
0 Kudos

Hi friends,

I have a requirement where I need to do GR for a given PO from NON-SAP system.

Which I have done using basic IDOC type WMMBID02, message type - WMMBXY, process code - WMMB.

It is working perfectly.

Issue is - sometimes these GR will be done at SAP system. Such cases the IDOC should check whether the GR is already done or not, IF it exists then it should not process the IDOC.

I have checked all the fields I could not see anything that will check for GR status.

Please kindly help me resolve this issue.

Thanks,

Santo.

1 REPLY 1

Former Member
0 Kudos

Hi Santo,

while posting within SAP, you need to query table EKBE to check whether PO is GRed.

Below is the code.

SELECT * FROM EKBE INTO TABLE LT_EKBE WHERE
                                                EBELN =  P_EBELN
                                            AND VGABE = '1'.   " GR
      IF LT_EKBE[] IS INITIAL.             " PO not yet GR'd
        PERFORM POST_GR USING P_EBELN.        " Use BAPI_GOODSMVT_CREATE to post GR
        REFRESH: LT_EKBE.
      ENDIF.

There can be partial postings, Deleted items(LOEKZ in EKPO) as well. These should be handled in your code.

Hope this helps.

Thanks,

Prathap