Current Position:Home > Custom fields update using BAPI: BAPI_SALESORDER_CHANGE

Custom fields update using BAPI: BAPI_SALESORDER_CHANGE

Update:11-30Source: network consolidation
Advertisement
Hi,
      I have append one field into VBAP Table, and i want to update that filed value by using BAPI_SALESORDER_CHANGE FM. I have done all the coding but still its not updating the table. I have checked with SAP fields like order quantity, its upadating the database but the custom fileds are not upadting.
steps i have done:  Append field to :           VBAP,BAPE_VBAP,VBAPKOZ
                               Append Check field to : BAPE_VBAPX,VBAPKOZX
Here is the code : plz check and add ur comments
  DATA : l_wa_bapiparex        TYPE bapiparex,
         l_wa_ord_header        TYPE bapisdh1x,
         l_itab_bapiparex      TYPE STANDARD TABLE OF bapiparex INITIAL SIZE 0,
         l_itab_return         TYPE STANDARD TABLE OF bapiret2   INITIAL SIZE 0,
         l_wa_item              TYPE bapisditm,
         l_itab_item           TYPE STANDARD TABLE OF bapisditm  INITIAL SIZE 0,
         l_wa_itemx             TYPE bapisditmx,
         l_itab_itemx          TYPE STANDARD TABLE OF bapisditmx INITIAL SIZE 0,
         ORDER_HEADER_IN       LIKE BAPISDH1.
  l_wa_ord_header-updateflag = 'U'.
  ORDER_HEADER_IN-REF_DOC = '0000000244'.
*Populate Item detail
  l_wa_item-itm_number = '000010'.
  l_wa_item-NET_WEIGHT = '5000'.
  APPEND l_wa_item TO l_itab_item.
*Populate Item detail checkbox
  l_wa_itemx-itm_number = '000010'.
  l_wa_itemX-NET_WEIGHT = 'X'.
  l_wa_itemx-updateflag = 'U'.
  APPEND l_wa_itemx TO l_itab_itemx.
  l_wa_bapiparex-structure = 'BAPE_VBAP'.
  l_wa_bapiparex-valuepart1+0(10) = '0000000244'.
  l_wa_bapiparex-valuepart1+10(6) = '000010'.
  l_wa_bapiparex-valuepart1+16(15) = 'ABCDEF'.
  APPEND l_wa_bapiparex TO l_itab_bapiparex.
  CLEAR l_wa_bapiparex.
  l_wa_bapiparex-structure = 'BAPE_VBAPX'.
  l_wa_bapiparex-valuepart1+0(10) = '0000000244'.
  l_wa_bapiparex-valuepart1+10(6) = '000010'.
  l_wa_bapiparex-valuepart1+17(1) = 'X'.
  APPEND l_wa_bapiparex TO l_itab_bapiparex.
  clear l_wa_bapiparex.
  CALL FUNCTION 'BAPI_SALESORDER_CHANGE'
    EXPORTING
      salesdocument    = '0000000244'
      order_header_in  = ORDER_HEADER_IN
      order_header_inx = l_wa_ord_header
    TABLES
      return           = return
      order_item_in    = l_itab_item
      order_item_inx   = l_itab_itemx
     schedule_lines   = l_itab_schedule
     schedule_linesx  = l_itab_schedulex
      extensionin      = l_itab_bapiparex.
IF SY-SUBRC = 0.
  CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
EXPORTING
  WAIT          = 'X'
IMPORTING
  RETURN        =
ELSE.
   RAISE ERROR.
ENDIF.
I HAVE GONE THROUGH DEBUGGING AND FOUND ALL ARE GOING FINE...ITS UPDATING VBKOM AND VBKOMX STRUCTURE BUT AT LAST ITS NOT UPDATING THE CUSTOM FIELDS
Thanks,
Baidya

The Best Answer

Advertisement
Sorry guys........this code is correct one.......there is a problem in IDES....i tried in client server its working fine
If anyone is having this type of requirement then copy this program.
thanks,
Baidya
  • Custom fields update using BAPI: BAPI_SALESORDER_CHANGE Update:11-30

    Hi,       I have append one field into VBAP Table, and i want to update that filed value by using BAPI_SALESORDER_CHANGE FM. I have done all the coding but still its not updating the table. I have checked with SAP fields like order quantity, its upad

  • Issue with Custom Field updation through BAPI FM Update:10-11

    Hi All, I am going to update some custom filelds in BUt050. So for these custom fields, I want to fill buffer memory so that I can track the changes through buffer. So I was calling FM BAPI_BUPR_CONTP_CHANGE and passing following parameters.         

  • Custom field updation in bapi_salesorder_createfromdat2 structures Update:10-11

    hi friends, custom field updation in bapi_salesorder_createfromdat2 structures i having a problem while creating a salesorder in vao1 tcode i unable to find the WWDLC FIELD AND DATA ELEMENT IS RKEG_WWDLC (delivery to country) in item data-> account a

  • VBRP Z fields update by bapi ? Update:11-30

    Hi, i have to update some Z fields in table VBRP. Which bapi can i use to maintain these custom fields ? with kind regards, HansOk Hans I know that, but bill document is an internal document, so usually all fields are from sales order and delivery, s

  • Reg: Mandatory fields updation with BAPI Update:10-11

    Hi.. We are working on BDC using BAPI. In this if flat files contians only 4 fields and the mandatory fields in the application are seven then system needs to through error message. But with BAPI the program is updating the database without throwing

  • Custom fields updation in EBAN Table for bapi_pr_create - Extensionin Update:11-30

    Hi all, My requirement is PR creation by BAPI_PR_CREATE Function Module . for pr item level customer added 10 fields in the EBAN table append structure CI_EBANDB. . i am creating PR by using Funcation module BAPI_PR_CREATE. In this Function Module I

  • Custom field update in Purchase Requisition Final Release Update:11-30

    Hi,   We have PR release strategy at Item level. In PR table EBAN include I have added new field as ZZREL_DT (for final release date), This Field I want to update when final release will get triggred for the PR item. For updating this custom field I

  • Customer Master Update using BAPI Update:10-11

    Hi all,     I am using class CMD_EI_API for updating customer master, but this class does not supports processing of  license data ( databaase table -> KNVL ) and Permitted Alternative Payee data ( database table -> KNZA ) for customer. Are there an

  • Update Custom Field in Task Level Project Server using JSOM (PS.js) Update:11-30

    Does anyone have javascript which updates the task level custom field? I just have the code with C#. I am trying to convert this code to javascript (below). But the javascript code had failed in update process. When I see queue jobs, JobState: Report

  • Update ProjectResource/EnterpriseResource custom fields Update:11-30

    Does anyone know if it's possible to update an enterprise custom field for a ProjectResource or EnterpriseResource using CSOM or JSOM? Thanks, RolandHi Roland, As far as I know this is not possible. http://parthrawal.wordpress.com/2014/02/11/update-r