BAPI por return delivery

Hi experts.
   I need a BAPi or FM to make a return delivery of goods receipt ( i nedd to return some lines of the initial good movement ) . Do you know some BAPI or FM??
   Thanks.

Hi Jorge,
You need to use FM  BAPI_PO_CREATE to create the return delivery. The sample code is as attached.
CALL FUNCTION 'BAPI_PO_CREATE'
    EXPORTING
      po_header                = g_po_head
      po_header_add_data       = g_po_head_add_data
      header_add_data_relevant = header_add_data_relevant
      skip_items_with_error    = 'X'
    IMPORTING
      purchaseorder            = g_exp_ebeln
    TABLES
      po_items                 = g_po_item
      po_item_schedules        = g_po_sched
      return                   = g_return
      po_business_partner      = g_po_business_partner.
Thanks.

Similar Messages

  • Bapi for return delivery of rejected goods

    Hi experts,
    can you tell me is there is any bapi for return delivery of rejected goods at transaction QA11?
    thanks

    Hi,
    You need to use FM BAPI_PO_CREATE to create the return delivery.you have to manually the rejected goods.....
    CALL FUNCTION 'BAPI_PO_CREATE'
    EXPORTING
    po_header = pohead
    po_header_add_data = po_header_add_data
    header_add_data_relevant = header_add_data_relevant
    skip_items_with_error = 'X'
    IMPORTING
    purchaseorder = purchaseorder
    TABLES
    po_items = po_items
    po_item_schedules = sched
    return = return
    po_business_partner = businesspartner.
    Reward points if helpful,
    regards,
    jinesh.

  • BAPI for creating Return delivery to vendor using transaction MIGO

    Hi All,
             My requirement is to create Return delivery to vendor using transaction MIGO.
    In MIGO transaction to create return delivery, the following steps needs to be followed.
    i) Select the option A02 Return delivery, R02 Material document,
        Enter Material document xxxxxxxx.
        Reson for movement:xxxx
        By selecting the option item ok and via delivery check box, then save.
    After saving return delivery needs to be created.
    Is there any BAPI/FM exist for this requirement?
    I made lot of search in sdn, but i could not find any thing helpful.
    Appreciate quick help.
    regards
    surya

    Hi
    In VL02n->Extras->Delivery Output->Header
    Check if you see any message type (LD00 ?).
    If you do not see any, insert a message type LD00.
    If you want to check the IMG settings, see Txns : V/71 (for delivery types RL/RLL) and V/73 (for Item category RLLN)
    Best regards
    Ramki

  • Return delivery BAPI with out ref

    looking for  bapi or fm to create a return delivery with out reference.

    Hi Priya,
    Try below BAPI  programs
    BAPI_OUTB_DELIVERY_CREATENOREF
    SHIP_DELIVERY_CREATE_NOREF
    Regards
    Ram

  • BAPI for Post Goods Receipt - VL02N(SD) - Return Delivery

    Hi All,
    Could you plz tell me the bapi or function module or bdc for post goods rceipt for return delivery. I am ucing the bapi called BAPI_GOODSMVT_CREATE but it throughing an error. u can not do the these movement types.like this. Here i am using the movement types as - 632,651 and 653. could any one hlp me regarding this issue. its urgnt and i am not able to get the reason.it is working for normal delivery when i use the same for return delivey with the above movement types its not working.
    VL02N - return delivery number -
    > Post goods receipt.
    thnks
    yerukala setty

    Hi,
    Use BAPI 'BAPI_OUTB_DELIVERY_CHANGE'
    Check out this thread, this question is being solved before.
    bapi for vl02n about post goods issue
    Thanks,
    Krishna

  • Problem with pgi for returns delivery

    Hi,
    I'm trying to do PGI for returns delivery through BAPI_GOODSMVT_CREATE.
    The when the delivery is opened through VL02N, the Post Goods Issue button has Post Goods Receipt text written on it. When the GI is done, the material document has movement type 651.
    However I'm not able to create the same through the BAPI. I have tried various combinations of GM_CODE and all other variables. Have anybody of you tried doing movement type 651 for a returns delivery using the same BAPI?
    Please reply if you've come across some similar situation. I know how to use the BAPI,  I've been using it successfully for other movement codes etc. It's only in this case that I'm stuck up.
    Regards,
    Vijay

    Hi Vijay,
    can u pls tell me how  did u do  it....i am also having the same requirement....
    Developed a custom program for creating and updating Goods Movement Document by using BAPI_GOODSMVT_CREATE & WS_DELIVERY_UPDATE_2.
    thanks, Ankita.

  • Return Delivery of Material Document as in MIGO.

    Hi  guys,
    Is there any bapi or function  module that  simulates the Return Delivery of Material Document as done in MIGO transaction.
    I have checked BAPI_GOODSMVT_CREATE but, this is not exactly matching the Return Delivery process(i.e, therez no field for item number of material document although material document field exists in GOODSMVT_ITEM) . If there is an other bapi or function module, kindly suggest.
    Many thanks in advance.
    Nithin

    Hi Nithin,
    Check FM  <b>BAPI_GOODSMVT_CREATE</b> documentation. In that check this
    6. GM_Code 06: Reversal of goods movements.
    Regards,
    Balavardhan.K

  • Same Handling Unit in Return delivery

    we have a scenario which we are implementing for SAP's client DHL.
    The scenario is as follows:
    1. We have done the GI for the handling units.
    2. And we want to take the same handling units back.
    In order to do so, what we do
    1. We create a return order with original sales order
    2. This eventually creates a return delivery but does not get the handling units assigned.
    3. Hence the delivery needs to be packed with the same HU's with which the goods have been issued.
    Anyone has faced the issue earlier or any one aware of any Bapi or functional modules which will allow them to pack with the same HU.
    Thanks in advance
    Ajay.

    It's seems that you faced it a few years ago, could you please post what you did?
    Thanks

  • Create return delivery in MB11

    Hi expert,
    I am trying to post a return delivery 222 via BAPI_GOODSMVT_CREATE and also in MB11 and getting error For reservation 0002207600 0001, no movements can be posted. But i am able to post the return delivery by using MIGO. Any idea why this happen? A customize program require to use bapi for the posting. Thanks.

    >
    fcgan wrote:
    > Hi,
    >
    > Both also doing return delivery. IN MB11 when i enter the reservation number i am getting the error while in migo i just enter material document number and then enter the quantity to post. Thanks.
    I understand this as you are not doing the same in MB11 and MIGO.
    Have you tried doing the same? e,g, entering reservation number in MIGO?

  • Bapi to return a Sales order (RMA)

    Hi guys,
    I am trying to do a return using a sales order as reference. I am using:
    - BAPI_OUTB_DELIVERY_CREATE_SLS <<< to create a delivery
    - BAPI_TRANSACTION_COMMIT <<< to commit my changes
    - WS_DELIVERY_UPDATE <<< to PGI
    It doesn't produce any errors but when I go to MB52 the stock level does not change. I see in some posts that the correct bapi to post a return for a sales order is: BAPI_CUSTOMERRETURN_CREATE but i'm not sure which parameters i need to set for this bapi. Can you please help? Here's my code so far...
    *Create delivery
      CALL FUNCTION 'BAPI_OUTB_DELIVERY_CREATE_SLS'
        IMPORTING
          delivery          = delivery
          num_deliveries    = num_deliveries
        TABLES
          sales_order_items = sales_order_items
          serial_numbers    = serial_numbers
          deliveries        = deliveries
          created_items     = created_items
          extension_out     = extension_out
          return            = return.
    *Check for errors
      READ TABLE return INTO wa_return WITH KEY type = 'E'.
      IF sy-subrc EQ 0. "error found
        p_lv_err_flag = 'X'.
        LOOP AT return INTO wa_return WHERE type = 'E'.
          CONCATENATE wa_return-message p_lv_error_message INTO p_lv_error_message SEPARATED BY space.
        ENDLOOP.
        ROLLBACK WORK.
        RETURN.
      ELSE.             "no error found
        CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
          IMPORTING
            return = return_commit.
        IF return_commit-type = 'S' OR return_commit-type IS INITIAL.
          READ TABLE return INTO wa_return WITH KEY type = 'S' id = 'VL'.
          IF sy-subrc = 0.
            p_lv_err_flag = 'S'.
            MOVE wa_return-message TO p_lv_error_message.
          ENDIF.
        ELSE.
          p_lv_err_flag = 'X'.
          MOVE return_commit-message TO p_lv_error_message.
        ENDIF.
      ENDIF.
    * Perform picking, confirmation W-M status and PGI.
      CLEAR: vbkok_wa, vbpok_tab.
      REFRESH: vbpok_tab.
    * Clearing the implicit lock that mb_create_goods_mvt has. That
    * prevents it from bieng called more then once within same LUW.
      PERFORM clear_xcommit IN PROGRAM saplmbwl.
      LOOP AT created_items INTO created_items_wa.
        vbkok_wa-vbeln_vl = created_items_wa-deliv_numb.
        vbkok_wa-vbtyp_vl = 'C'. "order
        vbkok_wa-vbeln = created_items_wa-deliv_numb.
        vbkok_wa-wabuc = 'T'. "returns delivery
        vbpok_wa-vbeln_vl = created_items_wa-deliv_numb.
        vbpok_wa-posnr_vl = created_items_wa-deliv_item.
        vbpok_wa-vbeln = created_items_wa-deliv_numb.
        vbpok_wa-posnn = created_items_wa-deliv_item.
        vbpok_wa-matnr = created_items_wa-material.
    *  vbpok_wa-charg = fp_afpo-charg. "batch number???
        READ TABLE p_lt_rma_be INTO ls_rma_be WITH KEY matnr = created_items_wa-material.
        vbpok_wa-werks = ls_rma_be-werks.
        vbpok_wa-taqui = 'X'.
        vbpok_wa-pikmg = created_items_wa-dlv_qty.
        APPEND vbpok_wa TO vbpok_tab.
      ENDLOOP.
      CALL FUNCTION 'WS_DELIVERY_UPDATE'
        EXPORTING
          vbkok_wa                 = vbkok_wa
          synchron                 = 'X'
          delivery                 = delivery_ws
          update_picking           = 'X'
          nicht_sperren            = 'X'
          if_database_update       = '1'
          if_error_messages_send_0 = 'X'
        TABLES
          vbpok_tab                = vbpok_tab
          prot                     = prot.
    * Checking if any error in PGI
      READ TABLE prot WITH KEY msgty = 'E' TRANSPORTING NO FIELDS.
      IF sy-subrc EQ 0.
        MESSAGE e046 WITH delivery_ws.
        ROLLBACK WORK.
        RETURN.
      ENDIF.
      READ TABLE prot WITH KEY msgty = 'A' TRANSPORTING NO FIELDS.
      IF sy-subrc EQ 0.
        MESSAGE e046 WITH delivery_ws.
        ROLLBACK WORK.
        RETURN.
      ENDIF.
      COMMIT WORK AND WAIT.

    I got past the previous error. I'm now getting the following error:
    External number assignment is not defined for document type ZRE
    Sales document 0000000018 was not changed
    Here's the code:
    *& Report  ZTEST_BAPI_RETURN_SALES_ORDER
    REPORT  ztest_bapi_return_sales_order.
    DATA: return_partners TYPE TABLE OF bapiparnr,
          wa_return_partners TYPE bapiparnr,
          return_header_in TYPE bapisdhd1,
          return_header_inx TYPE bapisdhd1x,
          return_items_in TYPE TABLE OF bapisditm,
          return_items_in_wa TYPE bapisditm,
          return_items_inx TYPE TABLE OF bapisditmx,
          return_schedules_in TYPE TABLE OF bapischdl,
          return_schedules_inx TYPE TABLE OF bapischdlx,
          return TYPE TABLE OF bapiret2,
          wa_return TYPE bapiret2,
          salesdocumentin TYPE bapivbeln-vbeln,
          salesdocument TYPE bapivbeln-vbeln.
    DATA: lv_knumv TYPE vbrk-knumv.
    DATA: i_konv LIKE konv OCCURS 0 WITH HEADER LINE,
          i_conditions TYPE TABLE OF bapicond WITH HEADER LINE.
    salesdocumentin = '0000000018'.
    SELECT SINGLE knumv FROM vbrk INTO lv_knumv WHERE vbeln = salesdocumentin.
    IF sy-subrc = 0.
      SELECT * FROM konv
      INTO TABLE i_konv
      WHERE knumv = lv_knumv
      AND kposn = '000010'
      AND kschl = 'ZRSK'.
    *  AND kschl = 'ZPR0'.
    *  AND kschl = 'ZRSK'.
    *  AND kschl = 'ZKF1'.
    *  AND kschl = 'CTXJ'.
    *  AND kschl = 'JRC1'.
    *  AND kschl = 'JRC2'.
    *  AND kschl = 'VPRS'.
      LOOP AT i_konv.
        i_conditions-itm_number = i_konv-kposn.
        i_conditions-cond_type = i_konv-kschl.
        i_conditions-cond_value = i_konv-kbetr.
        i_conditions-currency = i_konv-waers.
        i_conditions-cond_unit = i_konv-kmein.
        i_conditions-cond_p_unt = i_konv-kpein.
        i_conditions-numconvert = i_konv-kumza.
        i_conditions-denominato = i_konv-kumne.
        i_conditions-condorigin = i_konv-kherk.
        i_conditions-accountkey = i_konv-kvsl1.
        i_conditions-condcntrl = i_konv-ksteu.
        i_conditions-condclass = i_konv-koaid.
        i_conditions-condchaman = i_konv-kmprs.
        APPEND i_conditions.
      ENDLOOP.
    ENDIF.
    CLEAR: return_header_in, return_header_inx.
    return_header_in-price_date = sy-datum.
    return_header_in-ref_doc = '0000000018'.
    return_header_in-doc_type = 'ZRE'.
    return_header_in-sales_org = '1000'.
    return_header_in-distr_chan = '10'.
    return_header_in-division = '10'.
    return_header_in-sales_grp = '110'.
    return_header_in-sales_off = '100'.
    return_header_in-ship_cond = 'RE'.
    return_header_inx-ref_doc = 'X'.
    return_header_inx-doc_type = 'X'.
    return_header_inx-updateflag = 'I'.
    return_items_in_wa-itm_number = '000010'.
    return_items_in_wa-material = 'TACKER'.
    return_items_in_wa-target_qty = '1'.
    APPEND return_items_in_wa TO return_items_in.
    wa_return_partners-partn_role = 'AG'.
    wa_return_partners-partn_numb = '0000200111'.
    *wa_return_partners-itm_number = '000010'.
    APPEND wa_return_partners TO return_partners.
    CALL FUNCTION 'BAPI_CUSTOMERRETURN_CREATE'
      EXPORTING
        salesdocumentin               = salesdocumentin
        return_header_in              = return_header_in
        return_header_inx             = return_header_inx
      IMPORTING
        salesdocument                 = salesdocument
      TABLES
        return                        = return
        return_items_in               = return_items_in
        return_items_inx              = return_items_inx
        return_partners               = return_partners
        return_schedules_in           = return_schedules_in
        return_schedules_inx          = return_schedules_inx
        return_conditions_in          = i_conditions
    LOOP AT return INTO wa_return WHERE type = 'E'.
      WRITE:/ wa_return-message.
    ENDLOOP.

  • Returns delivery and Serial Number status

    Hi Experts,
    for Goods returns, we create a Returns Delivery with a Material and Serial No.
    We can't make any Goods movement because the Status (into IQ03) stay on ECUS (or EKUN).
    I can modify this status by using IE02, but is it possible to do it with a Function or BAPI ?
    Thanks.
    Regards,
    David

    Hi,
    Goto the Table VBFA in SE16 and Key in the SALES DOCUMENT number in PRECEDDING DOCUMENT NUMBER  in the field VBELV and Fetch the document with the SUBSEQUENT DOCUMENT Category J and M which are Delivery and Billing respectively.
    VBFA--VBELV  === Sales order (VBAK-VBELN)
    fetch  VBELN where VBTYP_N = M and J for both Delivery and Billing.
    Once you got the Delivery document then goto Table SER01 and fetch the  OBKNR
    and with the OBKNR as input field goto the Table OBJK and fetch SERNR which the serial number .
    Please check this and revert back if you need any more details
    regards,
    santosh

  • Return delivery using BAPI_OUTB_DELIVERY_CREATENOREF

    Hi,
    I am trying to create a return delivery of type 'zesr' using bapi with out reference.
    I am passing below fields and see an error. Is anyone faced this issue and let me know how to resolve this.
    I am not sure what input parameter i am missing.
    I was able to create delivery with out reference of type 'zesp' by passing below fields.
    Shipping point,
    delivery type
    SALESORG
    DISTR_CHAN
    DIVISION
    SHIP_TO
    DATE_USAGE as '0'
    DELIV_NUMB TIMETYPE                         TIMESTAMP_UTC       TIMEZO
                            WS GOODS ISSUE  LIKP       20,111,121,112,220     CST
    REF_IT MATERIAL           ITEM DLV_QTY           SAL SAL PLAN STGE
    000001 72                 ZRRN            1.000  EA  EA  4012 2000
    REF_DOC    REF_IT SERIALNO
                          000001 10386275
    A ICC_NUMBERING        770 Global official numbering: Input parameter incomplete
    E BAPI                 001 No instance of object type OutboundDelivery has been created. External reference:
    Appreciate your inputs.
    Also note that i was able to create return delivery with out ref using VL01NO successfully.
    Edited by: Priya_S09 on Nov 22, 2011 4:04 PM

    BAPI_OUTB_DELIVERY_CREATENOREF works for Return Delivery with out reference.
    The error is because of Wrong copy control routines assigned in Config.
    Routines 301 for header, 302 for item should be used.

  • BAPI_GOODSMVT_CREATE   /   Return Delivery

    Hi,
    I was able to create GR/material documents for a PO using this bapi -BAPI_GOODSMVT_CREATE with mvtype 101.
    I'm having problems in creating return delivery to vendor (mvtype 122) ,using this BAPI.Is there any other BAPI that i can use.YOur thoughts please....
    Thanks,
    Dan.

    Hi Dan,
    Please check this BAPI <b>BAPI_DELIVERYPROCESSING_EXEC</b>.
    Also you can check this FM <b>RV_DELIVERY_CREATE</b> as well.
    Please use FM RV_DISPATCH_DUE_DATE_POS to get some of the tables populated to be used in RV_DELIVERY_CREATE.
    Hope this will help.
    Regards,
    Ferry Lianto

  • Return Delivery via BAPI_GOODSMVT_CREATE

    Hi,
    I'm trying to post a return delivery movement type 222 using BAPI_GOODSMVT_CREATE but getting error For reservation 0002207600 0001, no movements can be posted  . I notice that this bapi was using MB11 for the posting and tested also getting same error. But the return delivery was able to be post using MIGO.

    Not able to post via BAPI causes by the item in the reservation was mark for deletion.

  • Can we create cancellation/return delivery with BAPI_CONFEC_CREATE

    hi experts,
    i want to use the above BAPI to create cancellations and return deliveries in SRM 7. i am not able to figure out the exact data that needs to be passed to the BAPI to create cancellation/return delivery. i have used class approach to do the same and able to create them, but i am specifically interested in FM/BAPI
    does anybody used this BAPI to create cancellations?
    thanks

    hi,
    i could not make this BAPI work for cancellations but found another way of doing confirmations and cancellations using std FMs
    here is the code for confirmation
    CALL FUNCTION 'BBP_PD_PO_GETDETAIL'
       EXPORTING
         I_OBJECT_ID                      = is_conf_header-po_number
         I_WITH_ITEMDATA                  = 'X'
       IMPORTING
         E_HEADER                         = ls_header
         ET_ATTACH                        = lt_attach
       TABLES
         E_ITEM                           = lt_item
         E_ACCOUNT                        = lt_account
         E_PARTNER                        = lt_partner
         E_LONGTEXT                       = lt_longtext
         E_ORGDATA                        = lt_orgdata
         E_TAX                            = lt_tax
         move-corresponding ls_header to ls_new_header.
    ls_new_header-process_type = 'CONF'.
    ls_new_header-subtype = 'CF'.
    ls_new_header-src_object_type = 'BUS2201'.
    ls_new_header-src_guid = ls_header-guid.
    clear ls_new_header-object_id.
    loop at lt_item into ls_item.
      read table it_conf_items into ls_conf_items with key po_item_number = ls_item-number_int.
    if sy-subrc ne 0.
      continue.
      endif.
      move-corresponding ls_item to ls_new_item.
      ls_new_item-src_object_type = 'BUS2201001'.
      ls_new_item-src_guid = ls_item-guid.
      ls_new_item-final_entry = ls_conf_items-final_entry.
      ls_new_item-quantity = ls_conf_items-quantity.
      append ls_new_item to lt_new_item.
      endloop.
    loop at lt_partner into ls_partner.
       move-corresponding ls_partner to ls_new_partner.
       append ls_new_partner to lt_new_partner.
       endloop.
       loop at lt_orgdata into ls_orgdata.
         move-corresponding ls_orgdata to ls_new_orgdata.
         append ls_new_orgdata to lt_new_orgdata.
         endloop.
    loop at lt_account into ls_account.
       move-corresponding ls_account to ls_new_account.
       append ls_new_account to lt_new_account.
       endloop.
    lv_src_guid = ls_header-guid.       .
    CALL FUNCTION 'BBP_PD_CONF_CREATE'
    EXPORTING
      I_SAVE                           =  'X'
       I_HEADER                         = ls_new_header
       I_SRC_GUID                       = lv_src_guid
       IT_ATTACH                        = lt_new_attach
    IMPORTING
       E_HEADER                         = ls_e_header
       ET_ATTACH                        = lt_e_attach
      TABLES
      I_ITEM                           = lt_new_item
       I_PARTNER                        = lt_new_partner
       I_ORGDATA                        = lt_new_orgdata
       E_ITEM                           = lt_e_item
       E_ACCOUNT                        = lt_e_account
       E_PARTNER                        = lt_e_partner
       E_ORGDATA                        =  lt_e_orgdata
        e_messages                       = lt_new_message
    et_msg[] = lt_new_message[].
    ls_conf_documents-doc_number = ls_e_header-object_id.
    append ls_conf_documents to et_conf_documents.
    CALL FUNCTION 'BBP_PD_CONF_SAVE'
    EXPORTING
        IV_USERTYPE               = 'X'
       IV_HEADER_GUID            = ls_e_header-guid
      CALL FUNCTION 'BAPI_TRANSACTION_COMMIT
    code for cancellation
    get all the confirmations created for the PO
        CALL FUNCTION 'BBP_PD_CONF_GETLIST'
          EXPORTING
            i_for_po_id = is_conf_header-po_number
          TABLES
            e_pdlist    = lt_pdlist
            e_messages  = lt_msgs.
    delete GRS which are cancelled
        LOOP AT lt_pdlist INTO ls_pdlist WHERE subtype EQ 'CA'.
          DELETE lt_pdlist WHERE guid = ls_pdlist-src_guid.
        ENDLOOP.
    delete the cancelllation documents. we don't need them anymore
        DELETE lt_pdlist WHERE subtype EQ 'CA'.
        loop at lt_pdlist into ls_pdlist.
          CALL FUNCTION 'BBP_PD_CONF_GETDETAIL'
           EXPORTING
              I_GUID                           =  ls_pdlist-guid
              I_WITH_ITEMDATA                  = 'X'
          IMPORTING
             E_HEADER                         =  ls_conf_hdr
           TABLES
             E_ITEM                           =  lt_con_items
             E_PARTNER                        =  lt_con_partner
    move-corresponding ls_conf_hdr to ls_new_header.
    ls_new_header-process_type = 'CONF'.
    ls_new_header-subtype = 'CA'.
    ls_new_header-src_object_type = 'BUS2203'.
    ls_new_header-src_guid = ls_conf_hdr-guid.
    clear ls_new_header-object_id.
    loop at lt_con_items into ls_con_items.
      move-corresponding ls_con_items to ls_new_item.
      ls_new_item-src_object_type = 'BUS2203001'.
      ls_new_item-src_guid = ls_con_items-guid.
      append ls_new_item to lt_new_item.
      endloop.
    loop at lt_con_partner into ls_con_partner.
       move-corresponding ls_con_partner to ls_new_partner.
       append ls_new_partner to lt_new_partner.
       endloop.
          lv_src_guid = ls_conf_hdr-guid.
    after that call BBP_PD_CONF_CREATE as we did for the confirmation followed by BBP_PD_CONF_SAVE and commit work.
    Edited by: SRM7CON on Mar 7, 2012 12:04 PM
    Edited by: SRM7CON on Mar 7, 2012 12:25 PM

Maybe you are looking for