Current Position:Home > Req Help to Update LIKP-LIFSK,Delivery Header block through custom program.

Req Help to Update LIKP-LIFSK,Delivery Header block through custom program.

Update:11-30Source: network consolidation
Advertisement
Hi everyone,
Can you please suggest a FM or BAPI to update the delivery header block field, LIFSK, in LIKP table through FM or a BAPI.
I tried using 'BAPI_OUTB_DELIVERY_CHANGE' as below to update the LIKP-LIFSK, but it is not working.
DATA : ls_likp TYPE likpvb,
       ls_dlv_header  TYPE bapiobdlvhdrchg,
       lt_dlv_items_control TYPE STANDARD TABLE OF bapiobdlvitemctrlchg,
       ls_dlv_item_control TYPE bapiobdlvitemctrlchg.
DATA : ls_dlv_hdr_control   TYPE bapiobdlvhdrctrlchg,
       ls_dlv_techn_control TYPE bapidlvcontrol,
       lt_bapireturn TYPE STANDARD TABLE OF bapiret2,
       ls_bapireturn TYPE bapiret2,
       lt_bapiext2 TYPE STANDARD TABLE OF bapiext,
       ls_bapiext2 TYPE bapiext.
DATA :  BEGIN OF ls_mns_of_del,
             vbeln TYPE likp-vbeln,     "delivery number
             lifsk TYPE likp-lifsk,     "means of transport
       END OF ls_mns_of_del.
CONSTANTS : lc_del_blck           TYPE bapiext-param VALUE 'LIKP-LIFSK'.
PARAMETERS : p_dlv TYPE likp-vbeln OBLIGATORY."  OBLIGATORY.
SELECT SINGLE *
  FROM likp
  INTO ls_likp
  WHERE vbeln = p_dlv.
CHECK sy-subrc = 0.
CLEAR : ls_bapiext2.
ls_mns_of_del-vbeln = ls_likp-vbeln.
ls_mns_of_del-lifsk = 'BX'.
ls_bapiext2-param = lc_del_blck .
ls_bapiext2-value = ls_mns_of_del.
APPEND ls_bapiext2 TO lt_bapiext2.
CALL FUNCTION 'MAP2E_LIKPVB_TO_BAPIOBDLVHDRCH'
  EXPORTING
    likpvb          = ls_likp
  CHANGING
    bapiobdlvhdrchg = ls_dlv_header.
CALL FUNCTION 'BAPI_OUTB_DELIVERY_CHANGE'
  EXPORTING
    header_data           = ls_dlv_header
    header_control        = ls_dlv_hdr_control
    delivery              = ls_likp-vbeln
    techn_control         = ls_dlv_techn_control
  TABLES
    extension2            = lt_bapiext2[]
    return                = lt_bapireturn[]
  EXCEPTIONS
    communication_failure = 1
    system_failure        = 2
    OTHERS                = 3.
IF lt_bapireturn[] IS INITIAL.
  COMMIT WORK AND WAIT.
  MESSAGE 'Success' TYPE 'I' DISPLAY LIKE 'S'.
  LEAVE LIST-PROCESSING.
ELSE.
  MESSAGE 'Error' TYPE 'I' DISPLAY LIKE 'E'.
  LEAVE LIST-PROCESSING.
ENDIF.

The Best Answer

Advertisement
Hi ,
After seeing your code, you are not passing any parameters to header control data. once check the below code, it might useful.
DATA: h_data like bapiobdlvhdrchg,
         h_control like bapiobdlvhdrctrlchg,
        delivery like bapiobdlvhdrchg-deliv_numb,
        item_data like bapiobdlvitemchg occurs 0 with header line,
        item_control like bapiobdlvitemctrlchg occurs 0 with header line,
         return like bapiret2 occurs 0 with header line.
        CLEAR: h_data, h_control, delivery, item_data, item_control,
               return.
        REFRESH: item_data, item_control, return.
       h_data-deliv_numb = gst_alv_table-c6_vbeln.
       h_data-dlv_block  = p_new_del_blck.         "the new delivery block
       h_control-deliv_numb = gst_alv_table-c6_vbeln.
       h_control-dlv_block_flg = 'X'.
       delivery = gst_alv_table-c6_vbeln.
          CALL FUNCTION 'BAPI_OUTB_DELIVERY_CHANGE'
              EXPORTING
           header_data                   = h_data
         header_control                = h_control
          delivery                      = delivery
           TABLES
            return                        = return .
         "Check if return table got an error.
         READ TABLE return WITH KEY type = 'E'.
            IF NOT sy-subrc IS INITIAL.
           CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
               EXPORTING
              wait = 'X'.
             ELSE.
         ROLLBACK WORK.
                        ENDIF.
Regards,
Parupelly
  • Req Help to Update LIKP-LIFSK,Delivery Header block through custom program. Update:11-30

    Hi everyone, Can you please suggest a FM or BAPI to update the delivery header block field, LIFSK, in LIKP table through FM or a BAPI. I tried using 'BAPI_OUTB_DELIVERY_CHANGE' as below to update the LIKP-LIFSK, but it is not working. DATA : ls_likp

  • Delivery block - LIKP-LIFSK Update:11-30

    Hi, Is there a FM to update "delivery block" in a delivery ?  Process is ,for EDI 850 order change requests,  if the delivery is already created for the sales order, block the delivery with some kind of block (LIKP-LIFSK). I am on 46C, so I do n

  • Update Likp table from HUPAST Update:11-30

    I've a scenerio where i've to updated LIKP table, when user save the HUPAST. I've created the BDC program which update the likp table using VL02N transacton. but when i'm calling the BDC from a BADI its giving a error, as i'm trying to update the sam

  • BAPI to update LIKP and LIPS Update:11-30

    Is there a BAPI to update LIKP and LIPS? ThanksPlease close your post "Updating Address changes" if your question is answered in there. This is related to the same issue you entered there, and again I don't see how you can achieve that. You can

  • How to update Sales Order Delivery Block while saving Delivery ? Update:11-30

    Hi, I have a requirement wherein i need to update sales order delivery block field(VBAK-LIFSK) while saving the delivery for the order. Also I need to remove this block while execution of  Backorder Rescheduling program SDV03V02 (Tcode : V_V2), Can a

  • Update Schedule line Delivery date using Bapi_po_Change Update:10-11

    Hi all, I am using Bapi_po_change to Update the Schedule line Delivery date(EKET-EINDT) for the PO based on the Item and the Schedule line. I am passing the PO number, Po header, Item structure, Schedule line Structure. But the Date is not getting up

  • Goods Movement and Updation of outbound delivery. Update:10-11

    Hi, I am using BAPI_GOODSMVT_CREATE to do a transfer posting with movement type 411K.After doing the posting I am updating the outbound delivery for the PO using BDC recording. The problem is that after doing the transfer posting when I try to update

  • Urgent help needed-Updating an outbound delivery. Update:10-11

    Hi, I have created an outbound delivery for a stock transport order in using VL10D. The otbound delivery then goes to a different system wherein it is updated with picking,packing and shipping info.Then it comes back to SAP in the form of idoc(DELVRY

  • GR qty is updated in future delivery date in Scheduling agreement Update:10-11

    Dear All, In one of our Scheduling agreement  delivery schedule, the Goods receipt qty got updated in  future delivery date (ie., 30.07.2011 & 19.10.2011). Any idea how this got updated wrongly? or is there any standard functionality that controls th

  • Automatic updation of planned delivery time in material master. Update:10-11

    Dear all, Is it possible to update the Planned delivery time in the material master automatically by the system based on goods receipt date. what customisation needs to be done. Regards, DayanandIt is not dynamic field so you  can't retrive automatic