Update Inbound Delivery with batch

Hi All,
     My requirement is that, if for an Inbound delivery, the batch(CHARG) field is found to be empty, then a batch need to be created and the batch number should be updated in the Delivery. The batch can be created using the BAPI 'BAPI_BATCH_CREATE'. After obtaining the batch number from the BAPI, I tried using the FM 'WS_DELIVERY_UPDATE_2' but was not successful (because I didn't know how to use the FM). I have filled up the Delivery number in the 'delivery' parameter of the FM. Also, I'm passing the structure ls_vbkok and the table lt_vbpok with values as given below in the code. The field 'Batch (CHARG)' was found to be in the VBPOK structure and I have updated the same in that table. Also there are a bunch of other parameters namely SYNCHRON, NO_MESSAGES_UPDATE_1, COMMIT and NICHT_SPERREN_1 which were all used in a example program I was referring and I am completely ignorant of their significance. When I tried executing the below code, the CHARG field did not get updated in the LIPS table. Could anyone guide me on how to use this FM fro my particular purpose.
DATA: ls_vbkok TYPE vbkok,
          ls_vbpok TYPE vbpok,
          lt_vbpok TYPE STANDARD TABLE OF vbpok.
CONSTANTS :lc_del TYPE vbeln_vl VALUE '0080000110',
                      lc_pos TYPE posnr_vl VALUE '000010',
                      lc_batch TYPE charg_d VALUE '124234'.
ls_vbkok-vbeln_vl = lc_del.
ls_vbpok-vbeln_vl = lc_del.
ls_vbpok-posnr_vl = lc_pos.
ls_vbpok-charg = lc_batch.
APPEND ls_vbpok TO lt_vbpok.
CALL FUNCTION 'WS_DELIVERY_UPDATE_2'
   EXPORTING
     vbkok_wa                           = ls_vbkok
     synchron                           = 'X'
     no_messages_update_1               = 'X'
     commit                             = 'X'
     delivery                           = lc_del
*   UPDATE_PICKING                     = ' '
     nicht_sperren_1                    = 'X'
*   IF_CONFIRM_CENTRAL                 = ' '
*   IF_WMPP                            = ' '
*   IF_GET_DELIVERY_BUFFERED           = ' '
*   IF_NO_GENERIC_SYSTEM_SERVICE       = ' '
*   IF_DATABASE_UPDATE_1               = '1'
*   IF_NO_INIT_1                       = ' '
*   IF_NO_READ_1                       = ' '
*   IF_ERROR_MESSAGES_SEND             = 'X'
*   IF_NO_BUFFER_REFRESH               = ' '
*   IT_PARTNER_UPDATE                  =
*   IT_SERNR_UPDATE                    =
*   IF_NO_REMOTE_CHG_1                 = ' '
*   IF_NO_MES_UPD_PACK                 = ' '
*   IF_LATE_DELIVERY_UPD               = ' '
*   IF_TXT_REINITIALIZE                =
*   IF_BOR_INIT                        = ' '
*   SPE_MES_NO_SEND_NODIAL             =
*   IT_LECOMP_1                        =
* IMPORTING
*   EF_ERROR_ANY                       =
*   EF_ERROR_IN_ITEM_DELETION          =
*   EF_ERROR_IN_POD_UPDATE             =
*   EF_ERROR_IN_INTERFACE              =
*   EF_ERROR_IN_GOODS_ISSUE            =
*   EF_ERROR_IN_FINAL_CHECK            =
*   EF_ERROR_PARTNER_UPDATE            =
*   EF_ERROR_SERNR_UPDATE              =
  TABLES
    vbpok_tab                          = lt_vbpok
*   PROT                               =
*   VERKO_TAB                          =
*   VERPO_TAB                          =
*   VBSUPCON_TAB_1                     =
*   IT_VERPO_SERNR                     =
*   IT_PACKING                         =
*   IT_PACKING_SERNR                   =
*   IT_REPACK                          =
*   IT_HANDLING_UNITS_1                =
*   IT_OBJECTS                         =
*   ET_CREATED_HUS                     =
*   TVPOD_TAB                          =
*   IT_TEXTH                           =
*   IT_TEXTL                           =
*   IT_TMSTMP                          =
*   IT_OBJ_QUAN_CHG                    =
*   IT_VBPOK_SPLIT                     =
*   IT_BAPIADDR1                       =
*   IT_HU_HEADER_EPC                   =
*   IT_HU_ITEMS_EPC                    =
*   IT_AAC_ITEM_BLOCK                  =
IF sy-subrc = 0.
   COMMIT WORK.
ENDIF.

Hi,
You also have to create a segment with following data as well (for batches).
E1EDL19-QUALF = "QUA".
Cheers,

Similar Messages

  • Create Inbound Delivery with Reference to PO using Serial Numbers

    I guys.
    I didn't find any BAPI  to create an Inbound Delivery with Reference to PO using Serial Numbers so I've made a Function Module with BDCData.
      LOOP AT serial.
        ADD 1 TO ld_count.
        ld_value = serial-sernr.
        CONCATENATE  'RIPW0-SERNR(' ld_count ')' INTO ld_field.
        PERFORM bdc_field USING ld_field ld_value.
      ENDLOOP.
    This works fine for 10 entries, but when I'm trying to use 1000 entries in serial Internal Table I'm getting the error: Screen 0000 is too large for internal batch input area - Message no. 00379.
    Please note that my issue is the Serial numbers, so don't answer me please with BAPIs that doesnt allow me to deal with this.
    Any idea?
    Thanks in advance,
    Nuno

    As I expect, it solved my problem. It's not pretty, but it works...
      PERFORM bdc_dynpro      USING 'SAPLIPW1'       '0200'.
      PERFORM bdc_field       USING 'BDC_CURSOR'     'RIPW0-SERNR(01)'.
      DATA: ld_valor(4) TYPE n,
            ld_next,
            ld_tabix TYPE sy-tabix.
      LOOP AT serial.
        ld_tabix = sy-tabix.
        IF ld_next = 'X'.
          CLEAR ld_next.
          ld_count = 2.
        ELSE.
          ADD 1 TO ld_count.
        ENDIF.
        ld_value = serial-sernr.
        CONCATENATE  'RIPW0-SERNR(' ld_count ')' INTO ld_field.
        PERFORM bdc_field USING ld_field ld_value.
        ld_valor = ld_tabix + 17.
        ld_valor = ld_valor MOD 18.
        IF ld_tabix NE 1 AND ( ld_tabix EQ 19 OR ld_valor EQ 0 ).
          ld_next = 'X'.
          PERFORM bdc_field       USING 'BDC_OKCODE'     '=PNPG'.
          PERFORM bdc_dynpro      USING 'SAPLIPW1'       '0200'.
          PERFORM bdc_field       USING 'BDC_CURSOR'     'RIPW0-SERNR(01)'.
        ENDIF.
      ENDLOOP.
      PERFORM bdc_field       USING 'BDC_OKCODE'     '=RWS'.

  • Creation of Inbound Delivery with reference from PO

    Hi,
            I use this FM-BBP_INB_DELIVERY_CREATE for creation of inbound delivery.  Delivery date is  same  Actual GR date means it's working fine. But i give less than or greater than Actual GR date  means it shows following error,
              'Acknowledgment for PO item 10028 00010 contains date variance'
        Please tell me how to correct this error.Otherwise tell me correct FM/BAPI to create inbound delivery with reference from PO

    Hi Anjaneya,
                My business process is,(In MM side)
         I create one purchase order(me21n) mention Delivery Date is 24.08.2011 and Delivery Qty is 20 etc......And raise the po to vendor.
       In vendor side, check the po details and perform confirmation process i.e creation of inbound delivery using FM BBP_INB_DELIVERY_CREATE. I give the following  inputs,
            Import
              IS_INB_DELIVERY_HEADER -DELIV_DATE  = 26.08.2011
             Tables
             IT_INB_DELIVERY_DETAIL -MATERIAL = M1
             IT_INB_DELIVERY_DETAIL -DELIV_QTY  = 20
            IT_INB_DELIVERY_DETAIL-UNIT = EA
            IT_INB_DELIVERY_DETAIL-PO_NUMBER = 0000010028
             IT_INB_DELIVERY_DETAIL -PO_ITEM  = 00010
    If run this FM shows the following error
           '      Acknowledgment for PO item 0000010028 00010 contains date variance'
                    Please tell me how to correct this error.

  • Goods Receipt using Inbound Delivery with reference to Outbound Delivery

    Here is our scenario that we need help finding a solution:
    1.  Multiple Intracompany POs created
    2.  On the confirmations tab of the POs, we have u201CInbound Deliveryu201D Selected because the items need to be received in with Handling Unit management.
    3.  We have the Order Combination box checked on the shipping tab to allow 1 delivery to be created for multiple purchase orders.
    4.  We create only 1 Outbound Delivery for only available items on various purchase orders.
    5.  Due to being handling unit managed, we need to receive the items using an inbound delivery.
    Problem:  We need to find a solution to easily enter an outbound delivery number which will allow us to receive only the parts that were shipped (issued), via the inbound delivery process. 
    If we remove the confirmation control key, we can complete a Goods Receipt for Outbound Delivery in MIGO u2013 but is there a way to complete a goods receipt using an inbound delivery with reference to an Outbound Delivery?
    Thank you for the help.

    Hi,
    You can work with Inbound delivery created via IDOC Triggered from Outbound Delivery, this will carry the HU Data as well. Please refer this wonderful note, which will explain you a lot of things,  Note 1119073 - FAQ: Automatic inbound delivery creation for stock transfers
    There are other notes also available for Inbound delivery creation with HU in STO, please browse the notes, if you find any difficulty.
    Regards
    Chandra Shekhar

  • Function module to create Inbound delivery with reference to Purchase Order

    Hi experts,
    I want to create Inbound delivery with refernce to Purchase Order. But I want to create item wise. For example If one purchase order is there with 10 line items. 10, 20, 30, 40, 50......100.
    If I am showing report for Purchase Order with select option and if I select first 5 line items 10, 20, 30, 40, 50 then my program should be create one Inbound delivery for selected line items only. I have tried BDC for Tcode VL31N, but its not worked. Is there any Function module to create Inbound delivery with reference to Purchase Order for selected line items????????

    Hi,
    Try FM RV_DELIVERY_CREATE or GN_DELIVERY_CREATE.
    For creating a delivery wrt PO u 1st need to have a sales order i guess.
    Regards,
    Amit

  • Function module create inbound delivery with text

    Hello
    I'm trying to create an inbound delivery with reference to a purchase order and create additional texts. I found FM GN_DELIVERY_CREATE but the texts are not added. I entered data in table IT_GN_TEXTL & IT_GN_TEXTH.
    What can be the problem?
    KR

    We will solve it with some extra development.
    As we do not have the parameter IS_BORGR_CONTROL-SAVE_TEXTS = 'X', I compared the version of ECC 6.0 to the 4.7. In debugging, we just have to pass one check and it will work. We will create a own version of gn_delivery_create with one extra parameter and put this parameter where it is added in Ecc 6.0.
    Check:
    if v50agl-create_decentral ne space
        or v50agl-create_uclief     = 'X'.
    KR

  • Is it possible to create an inbound delivery with MB31

    Hi,
    I would like to know if it's possible to create an inbound delivery with transaction MB31. It's a requirement of the client that all goods that come into the warehouse (HU managed) get in with an inbound delivery.
    So, for the scenario of production (non HUM storage Location) to warehouse (HUM storage location) a transfer posting will be done with MB31, A inbound delivery must be created.
    I hope this is possible.
    Regards,
    Alexander

    Hi,
    You can use an STO to transport stock from production to your warehouse and you can use VL31N with reference to your STO to create an inbound delivery document.
    Thanks
    Silas

  • Could we create an inbound delivery with reference to purchase requisition?

    Dear all,
    Could we create an inbound delivery with reference to purchase requisition?
    If yes, how could we customize the system?
    Kind regards,
    Adi

    No, I don't think so. You have to convert it into a PO and then you can create the delivery.

  • Intercompany STO with inbound delivery with freight....Urgent

    Hi,
    I have following scenario to map.
    There are 2 company codes A & B and a shipment of goods is to be transferred from A to B.
    I wish to use Intercompany STO process with UB.
    However, A & B are geographycally separated so there involves transportation costs which will be beared by B.
    How can I have the pricing procedure if I wish to have one in STO ?
    If I create some freight conditions then I can add the values but I will not able to know the exact freight charges till B receives the shipment and the invoice for the same.
    In this case how can I use pricing procedure ?
    If I do not enter any freight charges in PO then how can I add them before I do the GR in B as this is requirement to add freight costs on material at the time of goods receipt so to arrive at exact landed cost for that material in B.
    Once I wish to transfer the goods from A to B, I will do delivery so that stock gets reduced from A otherwise if I wait till the stock is physically transferred to B and then B changing the PO and add freight and subsequently doing picking, PGI and GR ,it will not correctly reflect stock positions in A.
    What is the better way I can map this process.
    If I wish to use inbound delivery before receiving the goods in B can I add conditions in Inbound delivery ? If so how it can be done ?
    So my intended procedure will look as
    Intercompany STO-UB
    Outbound Delivery
    Picking/PGI
    Inbound Delivery with freight
    GR
    Please suggest as this is very critical and important requirement
    Thanks in advance
    regards,
    manOO

    Hi,
    Thanks for the feedback.I wished to use NB but I don't want to go with the regular NB and subsequent billing cycle.
    I want to use UB.
    Anyways, is there any way by which I can have freight cnditions added at the time of Delivery.Be it Outbound or Inbound.
    Please suggest.
    Thanks in advance
    Regards,
    manOO

  • Can we create inbound delivery with refernce to outbound delivery?

    Dear all,
    can we create inbound delivery with refernce to outbound delivery?
    Regards
    ahmad

    Dear Ahamed
    I beleive it is a stock movement between 2 different plants
    If so then the receiving plant will have to do GR against the outbound delivery only
    The outbound delivery of the supplying plant
    The  outbound delivery of the supplying plant will not become the inbound delivery of the receiving plant in SAP
    But logically yes
    Your second post talks about outbound delivery only and that is correct
    My point is your proces doesnot involve inbound delivery at all
    In STO there is no inbound delivery at all
    Inbound delivery in SAP means shipping notification that means the confirmation from the vendor about the despatches
    That will not have  muck material details and it is just a confirmation
    Meaning of inbound delivery from SCM 601 logistics execution
    The goods receipt process using inbound deliveries realistically maps standard
    processes in many companies. If the vendor announces the goods receipt with a
    shipping notification, the inbound delivery can be created either manually or
    automatically on the basis of the shipping notification. It contains information
    transmitted by the vendor concerning the expected delivery times and quantities,
    as well as any information about packaging. It is also the reference document for
    the subsequent putaway using a transfer order. If you also use the transportation
    function as part of Logistics Execution, you can summarize inbound deliveries
    into inbound shipments.
    Regards
    Raja

  • Create Inbound Delivery with reference to Outbound Delivery

    Hi Team,
    Can anybody describe the process needed to be able to Create an Inbound Delivery with reference to an Outbound Delivery.
    Also, can the whole inbound delivery creation process be automated?
    Thanks.

    Inbound Delivery can be created wrt :
    Purchase order
    Shipping notification
    Customer return
    and
    Outbound Delivery can be created wrt:
    Goods shipment based on a sales order
    Stock transfer order
    Goods return (to the vendor)

  • Update a delivery with empty HU

    Hai guys,
    My delivery has 1 pallet and 4 hu's with 1 material each in them.
    I need to update this delivery with 4 more empty HU's.(it is manadatory  for each pallet to have 8 hus)
    i am creating everything programticaly...
    now i created hus with fm  CALL FUNCTION 'HU_CREATE_ONE_HU'.
    how can i update delievery with this HU mainting the hierrachy as
    pallet(0)
    hu(1)
      mat(2)
    hu(1)
    mat(2).
    hu(1)
    mat(2)
    hu(1)
    mat(2)
    hu(1)
    hu(1)
    hu(1)
    hu(1).
    i dont want BDC.

    Thanks for the response....The FM WS_UPDATE_DELIVERY doesn't update the date events of delivery. I already used this FM to update the picking information & PGI, which also updates the delivery header data.
    Help me with this..
    Gita

  • Delivery with batch

    dear all,
    can anybody  explain me the delivery with batch in details .
    thanks  in advance

    Dear
    If you are doing delivery of those materials of which batch management is on in material master data then you have to deliver these materials with batches. If batch management is not activated for any material than batch field will be in display mode but if batch management is activated than you have to enter batches. If there is only 1 quantity than you can enter batch on main screen of delivery document in VL01N or in Sale order VA01. If there is quantity more than one than you have to enter batches in delivery document in batch split screen. Select the line item and click batch split button and enter the batches. System will tell you open quantity and confirm quantity in batch split screen.
    Devilry with batches is maintained to have record of sold materials for warranty claim and tracking of materials in future.

  • Production date in inbound delivery in batch split

    Hi,
         I have a issue with production date update in inbound delivery.
    I have created a inbound delivery for 10 PC. The inbound delivery has only one line item and there are no batch details on it. As soon as the inbound delivery is created a message is sent to the 3PL . Once the 3PL receives the goods from vendor he send us a message with the batch details. Say the 3PL has received multiple batches from the vendor. So he send us back an SHPCON message with multiple batch details. That  is batch A with QTY 6 and batch B with QTY 4. He also send us the production date for each batch via the shpcon idoc. say batch A has production date as 10.02.2011 and batch B has production date as 21.03.2011.
    The IDOC is created successfully in our system and the inbound delivery is also updated correctly with the batch split details with correct QTY. That is line item 10 has batch split line items 900001 with batch as A and QTY as 6 and line item 900002 with batch as B and QTY as 4. The issue is only with updation of date of production for each of the above batch. Both batch A & B are updated with date of production as 21.03.2011. Instead of batch A being updated with date of production as 10.02.2011 it is updated with the batch B date of production. I checked in the idoc. In the idoc each batch has correct production date. only when updating the inbound delivery it has updated wrongly..   Has any one come across similar kind of situation. ? How did u manage it?
    Ram

    I found out the issue and the approriate changes has been made in the message handling

  • Post Goods Receipt for Inbound Delivery with BAPI_GOODSMVT_CREATE

    Hello,
    I try to post GR for an Inbound Delivey with BAPI_GOODSMVT_CREATE and it is not working.
    I know delivery number and PO number and give both to the bapi.
    I am not sure how to set the movement indicator in the item.
    When I set it to B.
    I do get a shortdump from MB_POST_GOODS_MOVEMENT numer 143, stating that this type of movement is not allowed with this transaction
    when setting to L I do get an error stating
    "Update control of movement type is incorrect (entry 101 X X _ L)"  from message class M7.
    Below is the coding for it.
    Thank you very much for your help
    Michael
    * Füllen der Kopfdaten
      ls_gm_header-pstng_date = sy-datum.
      ls_gm_header-doc_date = sy-datum.
      ls_gm_header-ref_doc_no = delivery_header-lifex.
      ls_gm_header-bill_of_lading = delivery_header-bolnr.
      ls_gm_header-gr_gi_slip_no = delivery_header-xabln.
      ls_gm_header-pr_uname = sy-uname.
      ls_gm_header-ref_doc_no_long = delivery_header-lifex.
      ls_gm_header-bill_of_lading_long = delivery_header-bolnr.
      lv_gm_code = '01'.
    * Füllen der Positionsdaten
      LOOP AT selected_delivery_items INTO ls_delivery_item.
        ls_gm_items-material          =  ls_delivery_item-matnr.
        ls_gm_items-plant             = ls_delivery_item-werks. "             0001
        ls_gm_items-stge_loc = ls_delivery_item-lgort.
        ls_gm_items-move_type ='101'. "101
        ls_gm_items-entry_qnt                      = ls_delivery_item-lfimg. "          10,000
        ls_gm_items-entry_uom                      = ls_delivery_item-vrkme.
        ls_gm_items-po_number                      = ls_delivery_item-vgbel. "55001582
        ls_gm_items-po_item                        = ls_delivery_item-vgpos. "00010
        ls_gm_items-mvt_ind = 'B'.
        ls_gm_items-expirydate = sy-datum + 30 .
        ls_gm_items-deliv_numb = ls_delivery_item-vbeln.
        ls_gm_items-deliv_item = ls_delivery_item-posnr.
        APPEND ls_gm_items TO lt_gm_items.
      ENDLOOP.
      CALL FUNCTION 'BAPI_GOODSMVT_CREATE'
        EXPORTING
          goodsmvt_header               = ls_gm_header
          goodsmvt_code                 =  lv_gm_code
    *     testrun                       = 'X'
    *   GOODSMVT_REF_EWM              =
       IMPORTING
         goodsmvt_headret              =  ls_gm_header_ret
         materialdocument              = lv_mat_docno
         matdocumentyear               = lv_mat_year
        TABLES
          goodsmvt_item                 = lt_gm_items
         goodsmvt_serialnumber         = lt_gm_serial_numbers
          return                        = lt_return
      if lt_return is INITIAL.
      endif.

    Hello Pranav,
    the input for the business data is correct.
    When performing the goods receipt with Migo it works.
    I think the B in the movement indicator is correct, but there might be something wrong with the other data.
    Best regards
    Michael

Maybe you are looking for