Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

BAPI Doubt

Former Member
0 Likes
567

Hi

I am using BAPI_SAG_CREATE.. I know the structure which I need to fill for this BAPI but I dont know what these two ls_headerx & lt_itemx to be filled with

Please let me know this asp.. points for everyone



  DATA: ls_header TYPE bapimeoutheader,
        ls_headerx TYPE bapimeoutheaderx,
        ls_item TYPE bapimeoutitem,
        ls_itemx TYPE bapimeoutitemx.

  data: lt_item TYPE bapimeout_t_item,
        lt_itemx TYPE bapimeout_t_itemx.

  ls_header-suppl_plnt = wa_bapi_data-reswk.
  ls_header-DOC_TYPE   = wa_bapi_data-evart.
  ls_header-purch_org  = wa_bapi_data-ekorg.
  ls_header-pur_group  = wa_bapi_data-ekgrp.
  ls_header-SUPPL_PLNT = wa_bapi_data-werks.
  ls_header-vper_start = wa_bapi_data-kdatb.
  ls_header-vper_end   = wa_bapi_data-kdate.

  ls_item-ematerial    = wa_bapi_data-ematn.
  ls_item-target_qty   = wa_bapi_data-ktmng.
  ls_item-net_price    = wa_bapi_data-netpr.
  ls_item-price_unit   = wa_bapi_data-peinh.
  ls_item-ORDERPR_UN   = wa_bapi_data-bprme.

  ls_header-incoterms1   = wa_bapi_data-inco1.
  ls_header-incoterms2   = wa_bapi_data-inco2.
  ls_item-tax_code       = wa_bapi_data-mwskz.
  ls_item-shipping       = wa_bapi_data-evers.
  ls_item-conf_ctrl      = wa_bapi_data-bstae.
  ls_item-gr_pr_time     = wa_bapi_data-webaz.
  ls_item-PLAN_DEL       = wa_bapi_data-plifz.
  
  append ls_item to lt_item.
  
  CALL FUNCTION 'BAPI_SAG_CREATE'
    EXPORTING
      header                      = ls_header
      headerx                     = ls_headerx
*     VENDOR_ADDRESS              =
*     HEAD_EXPORT_IMPORT          =
*     HEAD_EXPORT_IMPORTX         =
*     TESTRUN                     =
*     TECHNICAL_DATA              =
*   IMPORTING
*     PURCHASINGDOCUMENT          =
*     EXP_HEADER                  =
    tables
*     RETURN                      =
      item                        = lt_item
      itemx                       = lt_itemx
*     ACCOUNT                     =
*     ACCOUNTPROFITSEGMENT        =
*     ACCOUNTX                    =
*     SCHEDULE                    =
*     SCHEDULEX                   =
*     SC_COMPONENT                =
*     SC_COMPONENTX               =
*     SHIPPING                    =
*     SHIPPINGX                   =
*     SHIPPING_EXP                =
*     DELIVERY_ADDRESS            =
*     ITEM_COND_VALIDITY          =
*     ITEM_COND_VALIDITYX         =
*     ITEM_CONDITION              =
*     ITEM_CONDITIONX             =
*     ITEM_COND_SCALE_VALUE       =
*     ITEM_COND_SCALE_QUAN        =
*     EXPORT_IMPORT               =
*     EXPORT_IMPORTX              =
*     ITEM_TEXT                   =
*     HEADER_TEXT                 =
*     HEAD_COND_VALIDITY          =
*     HEAD_COND_VALIDITYX         =
*     HEAD_CONDITION              =
*     HEAD_CONDITIONX             =
*     HEAD_COND_SCALE_VAL         =
*     HEAD_COND_SCALE_QUAN        =
*     PARTNER                     =
*     PARTNERX                    =
*     EXTENSIONIN                 =
*     EXTENSIONOUT                =
            .

3 REPLIES 3
Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
493

The "X" structures/internal tables need to be filled as flag fields. So if you want to update a certain field in LS_HEADER, then make sure that you put an "X" in the corresponding field in LS_HEADERX

Regards,

RIch Heilman

Read only

0 Likes
493

Hi Rich

Do you mean to say

ls_headerx-suppl_plnt = 'X'.

ls_headerx-DOC_TYPE = 'X'.

should I do in this way..

this is BAPI for SAG create not any modification operation.. even then I need to pass it on as 'X'.

Let me know

Read only

Former Member
0 Likes
493

consider tat u have 'BAPIEN' parameter in u r bapi ......

u should consider 'BAPIENX' parameter in u r bapi functionmodule ......

in program

bapien-synch = 'xxxxxx1'.

bapien-userid = '00001'.

bapien-name = 'Abu'.

bapien-quantord = '2'. ( the field u r going to change)

so enable the change parameter structure such that

bapienx-quantord = 'x'. (by assigning x to this field).

untill and unless u enable the change parameter structure .... u r changed field wont get updated ........