Current Position:Home > BAPI_SALESORDER_CREATEFROMDAT2 , cannot update ZFIELD

BAPI_SALESORDER_CREATEFROMDAT2 , cannot update ZFIELD

Update:11-30Source: network consolidation
Advertisement
reference note: 143580
VBAK (Append ZZFIELD1 CHAR4)
VBAKKOZ (Append ZZFIELD1 CHAR4)
VBAKKOZX (Append ZZFIELD1 CHAR1)
BAPE_VBAK (Append ZZFIELD1 CHAR4)
BAPE_VBAKX (Append ZZFIELD1 CHAR1)
  DATA: WA_EXTENSION TYPE BAPIPAREX,
        WA_BAPE_VBAK TYPE BAPE_VBAK,
        WA_BAPE_VBAKX TYPE BAPE_VBAKX.
  WA_BAPE_VBAK-ZZFIELD1 = 'ABCD'.
  WA_BAPE_VBAKX-ZZFIELD1 = 'X'.
  MOVE 'BAPE_VBAK' TO WA_EXTENSION-STRUCTURE.
  MOVE WA_BAPE_VBAK TO WA_EXTENSION-VALUEPART1.
  APPEND WA_EXTENSION TO EXTENSIONIN.
  CLEAR WA_EXTENSION.
  MOVE 'BAPE_VBAKX' TO WA_EXTENSION-STRUCTURE.
  MOVE WA_BAPE_VBAKX TO WA_EXTENSION-VALUEPART1.
  APPEND WA_EXTENSION TO EXTENSIONIN.
Finally, Sales Order is created, but does not update  ZZFIELD1.
what's problem?

The Best Answer

Advertisement
Hi
Madhu is right. See SAP Note 143580 - Information on SD BAPIs and customer enhancement concept
This IDOC call the function module SD_SALESDOCUMENT_CREATE. In the subroutine
  perform ms_move_extensionin tables extensionin
                                     sales_items_in
                                     sales_schedules_in
                              using
                                     sales_header_in.
In this subroutine, in this coding and so on, debug it, with the aim to know what happens.
  LOOP AT extensionin.
    CASE extensionin-structure.
* BAPI-Schnittstelle für Kundenerweiterungen zur Tabelle VBAK
      WHEN 'BAPE_VBAK'.
        call method cl_abap_container_utilities=>read_container_c
          exporting
            im_container           = extensionin+lv_length
          importing
            ex_value               = wa_bape_vbak
          exceptions
            illegal_parameter_type = 1
            others                 = 2.
        CATCH SYSTEM-EXCEPTIONS conversion_errors  = 1.     "#EC *
          MOVE-CORRESPONDING wa_bape_vbak TO e_vbakkom.
        ENDCATCH.
* BAPI-Ankreuzleiste für Kundenerweiterungen zur Tabelle VBAK
      WHEN 'BAPE_VBAKX'.
        MOVE extensionin+lv_length TO wa_bape_vbakx.
        CATCH SYSTEM-EXCEPTIONS conversion_errors  = 1.     "#EC *
          MOVE-CORRESPONDING wa_bape_vbakx TO e_vbakkomx.
        ENDCATCH.
ie: check if data is trasfered to E_VBAKKOM as note says in point 8
I hope this helps you
Regards
Eduardo
  • BAPI_SALESORDER_CREATEFROMDAT2 , cannot update ZFIELD Update:11-30

    reference note: 143580 VBAK (Append ZZFIELD1 CHAR4) VBAKKOZ (Append ZZFIELD1 CHAR4) VBAKKOZX (Append ZZFIELD1 CHAR1) BAPE_VBAK (Append ZZFIELD1 CHAR4) BAPE_VBAKX (Append ZZFIELD1 CHAR1)   DATA: WA_EXTENSION TYPE BAPIPAREX,         WA_BAPE_VBAK TYPE B

  • Update zfields in MARA table Update:10-11

    hi, In my client system a custom view is maintained for MM* transactions I have added two custom fields in MARA table as well as this custom view. Now i have to populate value for this two custom fields. i am using "/AFS/BAPI_MATERIAL_SAVEDATA"

  • How to update zfields by using BAPI_REQUISITION_CHANGE for purchase requisi Update:11-30

    Hi Experts, There is a requirement to create a zfield in purchase requisition and i have appended zfileds in EBAN table. How to update these zfields by using  BAPI_REQUISITION_CHANGE, the requisition_items_new contain my zfileds and the lates values.

  • Updating Zfields in the BUT000 table Update:11-30

    Hi , I have created new zfields for but000 table . Is there any FM present to Update the newly created Z fields  . ( here  business partner number  is already created using the FM CRM_ISA_REGISTER_CONSUMER .Now i want to update the Zfileds for this b

  • Update Zfield information on Devlivery header Update:11-30

    Hi, Does anyone please suggest  how to use BAPI_OUTB_DELIVERY_CHANGE with the extension fields populated. I used below code but no updates happening on custom field  in Delivery header table (LIKP). data : ls_ext1 type BAPIEXTC,         lt_ext1 type

  • BADI/BDT Event to Update Zfields into BUT000 Update:11-30

    Hi I am looking for updating newly added Z fields of BUT000 table to databse. I got confused to two different solutions, as BADI and BUPT Events. Anyone suggest which is the right one. I have used BUPT Control- Screens to enable the Z fields under bu

  • Passing Net value through BAPI_SALESORDER_CREATEFROMDAT2 Update:11-30

    HI All, I am using BAPI_SALESORDER_CREATEFROMDAT2 to update sales order. Here Sales order has been creating but without net value. while i am trying to create using BAPI_OUTB_DELIVERY_CREATE_SLS system throwing an error " sales order is incomplete -

  • Sales quotation Create Update:11-30

    Hi, I am trying to use BAPI_QUOTATION_CREATEFRMDATA2 to create sales qoutation.However I am not able to copy the Zfields of VBAK table. Please can anyone let me know how can this be done. Regards AmrutaHello Techies, I am trying to use this BAPI to u

  • Updating Sales order with BAPI_SALESORDER_CREATEFROMDAT2 Update:11-30

    Hi All , I am not able to Update two Zfields in vbap using FM BAPI_SALESORDER_CREATEFROMDAT2, In create mode I am able to save values into those fields . I have checked the fields in structures                ZZVBAP (append structure of VBAP)        

  • Quantity is not updating while using BAPI_SALESORDER_CREATEFROMDAT2 Update:10-11

    Hi all, i am Creating Sales Order using BAPI_SALESORDER_CREATEFROMDAT2 BAPI, Here i am passing all required fields. Sales order also created, but in the created order; quantiy value is updating as 0 only. Even though i passed the value.(BAPISDITM-ARG