Application Development 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: 

BAPI_SALES_ORDER_CHANGE problem with Configuration Item

Former Member
0 Kudos

Dear Gurus,

I'm creating a custom program to upload SO line item, this program is based on two functionality first is creation which involves  BAPI_SALESORDER_CREATEFROMDAT2 and addition that are using  BAPI_SALESORDER_CHANGE.


We dont have issue during creation but when doing addition especially for those item with BOM and having configuration in it the performance is really bad and sometimes will hit dump TSV_TNEW_PAGE_ALLOC_FAILED.


I have search for this particular dump and one of the solution is to change BASIS setting for certain parameter.

Our BASIS is not really keen with this method, one of their reason is because of data growth.


Is there any missing parameter or any code that I need to add that can slightly increase program performance, below is my code with some modification.

gw_header_x-updateflag = c_u.


*     Fill item

       gw_item-prc_group1  gw_ord_data-prc_group1.

       IF rb_upd IS NOT INITIAL.

         gw_item-itm_number = lv_tabix + lv_posnr.

      ELSE.

         gw_item-itm_number  lv_tabix."gw_ord_data-itm_number.

      ENDIF.

       gw_item-prc_group1  gw_ord_data-prc_group1.

       CLEAR lv_po_itm.

       IF gw_ord_data-itm_number_st IS NOT INITIAL.

         gw_item-po_itm_no = gw_ord_data-itm_number_st.     

        lv_po_itm = gw_ord_data-itm_number_st.

       ELSE.

         gw_item-po_itm_no = gw_ord_data-itm_number.        

        lv_po_itm = gw_ord_data-itm_number.

       ENDIF.

       gw_item-purch_no_s  gw_ord_data-purch_no_s  .

       gw_item-material    gw_ord_data-material    .

       gw_item-target_qty  gw_ord_data-target_qty   .

      gw_item-plant       gw_ord_data-werks   .

       gw_item-po_meth_s   'ZUPL'.

      IF gw_ord_data-item_categ IS NOT INITIAL.

         gw_item-item_categ  gw_ord_data-item_categ.

         gw_itemx-item_categ  c_x.

       ELSE.

       ENDIF.

       APPEND gw_item TO gt_item .

       CLEAR gw_item .

       gw_itemx-itm_number  = gw_ord_data-itm_number.

       gw_itemx-prc_group1  = c_x.

       gw_itemx-po_itm_no   = c_x.

       gw_itemx-purch_no_s  = c_x.

       gw_itemx-material    = c_x.

       gw_itemx-target_qty  = c_x.

       gw_itemx-plant       = c_x.

       gw_itemx-po_meth_s   = c_x.

       gw_itemx-updateflag  = c_i.

       APPEND gw_itemx TO gt_itemx .

       CLEAR gw_itemx .

*     Fill Schedule

       gw_schedule-itm_number  gw_ord_data-itm_number  .

       gw_schedule-sched_line  '1' .

       gw_schedule-req_qty     gw_ord_data-target_qty  .

       gw_schedule-req_date    gw_ord_data-vdatu .

       gw_schedule-sched_type  gw_ord_data-sched_type.

       APPEND gw_schedule TO gt_schedule .

       CLEAR gw_schedule .

       gw_schedulex-itm_number  gw_ord_data-itm_number .

       gw_schedulex-sched_line  '1'.

       gw_schedulex-req_qty     c_x.

       gw_schedulex-req_date    c_x.

      gw_schedulex-sched_type  =  c_x.          

       gw_schedulex-updateflag  c_i.

       APPEND gw_schedulex TO gt_schedulex .

       CLEAR gw_schedulex .

*     Fill Config

       ADD 1 TO lv_config_id.

       gw_configref-posex     = lv_po_itm.         

      gw_configref-config_id = lv_config_id

       APPEND gw_configref TO gt_configref.

       CLEAR gw_configref.

       gw_configval-config_id lv_config_id

       gw_configval-charc     gw_ord_data-charc01.

       gw_configval-value     gw_ord_data-value01.

       APPEND gw_configval TO gt_configval.

       CLEAR gw_configval.

       gw_configval-config_id = lv_config_id.  

       gw_configval-charc     = gw_ord_data-charc02.

       gw_configval-value     = gw_ord_data-value02.

       APPEND gw_configval TO gt_configval.

       CLEAR gw_configval.

         gw_configval-config_id = lv_config_id.

         gw_configval-charc     = gw_ord_data-charc03.

         gw_configval-value     = gw_ord_data-value03.

         APPEND gw_configval TO gt_configval.

         CLEAR  gw_configval.


         gw_configval-config_id = lv_config_id. "GW_ORD_DATA-CONFIG_ID.

         gw_configval-charc     = gw_ord_data-charc04.

         gw_configval-value     = gw_ord_data-value04.

         APPEND gw_configval TO gt_configval.

         CLEAR  gw_configval.


         gw_configval-config_id = lv_config_id. "GW_ORD_DATA-CONFIG_ID.

         gw_configval-charc     = gw_ord_data-charc05.

         gw_configval-value     = gw_ord_data-value05.

         APPEND gw_configval TO gt_configval.

         CLEAR  gw_configval.


         gw_configval-config_id = lv_config_id. "GW_ORD_DATA-CONFIG_ID.

         gw_configval-charc     = gw_ord_data-charc06.

         gw_configval-value     = gw_ord_data-value06.

         APPEND gw_configval TO gt_configval.

         CLEAR  gw_configval.

         gw_configval-config_id = lv_config_id. "GW_ORD_DATA-CONFIG_ID.

         gw_configval-charc     = gw_ord_data-charc07.

         gw_configval-value     = gw_ord_data-value07.

         APPEND gw_configval TO gt_configval.

         CLEAR  gw_configval.

CALL FUNCTION 'BAPI_SALESORDER_CHANGE'

     EXPORTING

       salesdocument          = gv_vbeln

       order_header_in        = gw_header_in

       order_header_inx       = gw_header_x

       simulation             = space

     TABLES

       return                 = gt_return

       order_item_in          = gt_item

       order_item_inx         = gt_itemx

      schedule_lines         = gt_schedule

       schedule_linesx        = gt_schedulex

      order_cfgs_ref         = gt_configref

       order_cfgs_value       = gt_configval

       order_text             = gt_text.

  CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'

     EXPORTING

       wait = c_x.

Best Regards,

AT

2 REPLIES 2

thanga_prakash
Active Contributor
0 Kudos

Hello Allan,

Is there any reason why are you passing values to the below TABLE parameters.


order_cfgs_ref

order_cfgs_value

As it is optional parameter, don't pass them, remove it and check the performance.

Regards,

TP

0 Kudos

Hi TP,

I need to update configuration value since this upload involve configuration items. I suspect Object Dependencies also affecting this process but still cannot determine the exact root cause.

Regards,

AT