Skip to Content
avatar image
Former Member

Reversal of an unplanned Goods Movement through BAPI_GOODSMVT_CREATE. gm_code-06/TCode:MB11

Hi experts,

We've implemented the Goods Issue to Work Order functionality through a custom Fiori app. We are facing an issue while reversing a goods issue with unplanned material.

The issue is: In the Fiori app first we displayed a work order by fetching all the details of it. Then we added one material which is not there in the Work order at all and we performed a posting with 261 movement type. It worked fine as we saw the the correct type 261 in MIGO-> Display Document.

Now we want to reverse this particular movement through 262. the document is successfully posted. But when we check in MIGO->Display Document, it is updating correct movement type i.e., 262 for the material which are there in the Work Order. But for the material which was not there in the Work Order, but we added to the goods movement 261, it is updating 261 even if we are doing 262.

I've checked in the forum and googled but I'm not getting any clues about it. If anyone is aware of this, then please help because we are running out of time.

Thank in advance. :)

Regards,

Sreehari

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

6 Answers

  • Best Answer
    May 04, 2017 at 06:21 PM

    Have a look into OSS note 1944211 - BAPI_GOODSMVT_CREATE: 262; Planned reversal and order update

    it may give you an idea how to play around to get the desired result

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    May 08, 2017 at 04:17 PM

    Hi Jürgen L,

    Thank you for your response.

    I tried your suggested solution by passing XSTOB = 'X' for Movement type 261. Now for movement type 262 it is updating the correct movement type in MIGO. but for the movement type 261 it is updating 262. so I'm a bit confused.

    Can you please suggest something?

    Rhank you.

    Add comment
    10|10000 characters needed characters exceeded

    • Why do you use the same setting for the normal 261 movement too?

      if the solution was that you get 262 by doing XSTOB = 'X' with Movement type 261

      then it would probably for a normal 261 be and empty XSTOB = ' '.

  • avatar image
    Former Member
    May 09, 2017 at 02:30 PM

    Thanks Jürgen,

    Now I'm trying with the below code,

    IF it_header-movement_type = '261'.

    gs_goodsrec-xstob = ''.

    ELSEIF it_header-movement_type = '262'.

    gs_goodsrec-xstob = 'X'.

    ENDIF.

    For this updating the correct movement type for materials which are there in the Work Order but if we add an additional material to it and do the posting, it is updating 262 instead of 261 in MIGO. (which is the same issue which we were having at the time when I created this discussion)

    I think we are missing something here which I'm unable to see. Please help. :(

    Add comment
    10|10000 characters needed characters exceeded

  • May 09, 2017 at 03:15 PM

    Have you eventually filled the fields RESERV_NO and RES_ITEM , if yes then it means planned consumption, for unplanned consumption they have to be empty.

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    May 09, 2017 at 06:09 PM

    Yes. for planned line items we are fetching Reservation Number and Reservation Item from RESB table and passing the same to the BAPI. But for unplanned items we are not passing anything, only the Operation Number and rest of the details such as MATNR,WERKS,LGORT,MENGE etc.

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    May 16, 2017 at 08:37 PM

    Hi Jürgen L,

    Thanks for your inputs. The issue is resolved now... !!! :)

    For movement type 262, you have to pass 261 to the BAPI and the XSTOB value as 'X'. the code looks as below:

    IF it_header-movement_type = '261'.

    gs_goodsrec-xstob = ''.

    ELSEIF it_header-movement_type = '262'.

    gs_goodsrec-bwart = '261'.

    gs_goodsrec-xstob = 'X'.

    ENDIF.

    Add comment
    10|10000 characters needed characters exceeded