Skip to Content
avatar image
Former Member

Delete A Sales Order

Hi There,

I have used BAPI_SALESDOCUMENT_CHANGE to change a Sales Order.

I was wondering is there another BAPI that I can use to delete the Sales Order?

Many Thanks,

Colm

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

3 Answers

  • Best Answer
    avatar image
    Former Member
    Sep 04, 2008 at 04:35 PM

    Hi,

    Please check the sample code..

    DATA: T_RETURN LIKE BAPIRET2 OCCURS 0 WITH HEADER LINE.
    DATA: BAPISDH1X LIKE BAPISDH1X.
    
    PARAMETERS: P_VBELN LIKE VBAK-VBELN.
    
    *SET THE DELETION FLAG 
    BAPISDH1X-UPDATEFLAG = 'D'.
    
    CALL FUNCTION 'BAPI_SALESORDER_CHANGE'
    EXPORTING
    salesdocument = P_VBELN
    order_header_inx = BAPISDH1X
    tables
    return = T_RETURN
    .
    
    COMMIT WORK.

    Thanks

    Naren

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Sep 04, 2008 at 09:18 AM

    Try 'BAPI_SALESSUPDOCUMENT_DELETE' to delete sales order.

    Regards,

    Aparna Gaikwad

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      This FM appears useful due to its name but there doesn't appear to be any source code in there to do anything.

      Do you have an example of how I might use it?

  • avatar image
    Former Member
    Sep 04, 2008 at 04:23 PM

    Hi,

    Use the same bapi or BAPI_SALESORDER_CHANGE. ...and pass order_header_inx-updateflag = 'D'...

    Thanks

    Naren

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      Thanks Naren,

      However when I try to do this I get the following message:

      Field header_inx-updateflag is not an input field

      Any ideas?