Quantcast
Channel: SCN: Message List
Viewing all 8665 articles
Browse latest View live

Routing synchronous messages to different system

$
0
0

Hello all,

 

Can PI support synchronous content based routing?

 

For example

 

1) System A sends a synchronous request message to PI

2) PI receives the synchronous request message and route the request based on the content to System B or System C.

3) System B or System C response to PI and PI response back to System A


Re: Direct update DSO filed is missing in RSINPUT

$
0
0

thanks Korrapati for your reply.

Quantity not updating for education contracts no having schedule lines

$
0
0

Hi All,

 

 

I am updating the quantity from the third party system and from third party system it comes to ecc through  the BAPI -  SD_SALESDOCUMENT_CHANGE where we its updating the quantity as below

 

Suppose if I am changing the quantity in the third party from 10 to 9 and in sap if already the quantity for the quotation is 10 then after

full execution of the program the target quantity is updating in sap as 19 ( 10 +9) .

 

Please provide me the solution to update the correct quantity which I am passing

Below is my code :

 

 

FUNCTION z_sd_order_maintain.

*"----------------------------------------------------------------------

*"*"Local Interface:

*"  IMPORTING

*"     VALUE(SALESDOCUMENT) TYPE  VBELN OPTIONAL

*"     VALUE(SALES_HEADER_IN) TYPE  BAPISDHD1 OPTIONAL

*"     VALUE(HEADER_CUSTOM_FIELDS) TYPE  ZGD_SD_S_DOC_HEAD_CUST_FIELDS

*"       OPTIONAL

*"     VALUE(DEAL_TEAM_DATA) TYPE  ZGD_SD_QSPL_STS OPTIONAL

*"  EXPORTING

*"     VALUE(SALESDOCUMENT_EX) TYPE  VBELN

*"     VALUE(SALES_HEADER_OUT) TYPE  BAPISDHD

*"     VALUE(SALES_HEADER_STATUS) TYPE  BAPISDHDST

*"  TABLES

*"      RETURN STRUCTURE  ZGD_SD_S_RFC_MSGS OPTIONAL

*"      SALES_ITEMS_IN STRUCTURE  BAPISDITM OPTIONAL

*"      SALES_ITEMS_CUST STRUCTURE  ZGD_SD_S_DOC_ITEM_CUST_FIELDS

*"       OPTIONAL

*"      SALES_PARTNERS STRUCTURE  BAPIPARNR OPTIONAL

*"      SALES_SCHEDULES_IN STRUCTURE  BAPISCHDL OPTIONAL

*"      SALES_CONDITIONS_IN STRUCTURE  BAPICOND OPTIONAL

*"      SALES_CFGS_VALUE STRUCTURE  BAPICUVAL OPTIONAL

*"      SALES_CCARD STRUCTURE  BAPICCARD OPTIONAL

*"      SALES_TEXT STRUCTURE  BAPISDTEXT OPTIONAL

*"      SALES_KEYS STRUCTURE  BAPISDKEY OPTIONAL

*"      SALES_CONTRACT_IN STRUCTURE  BAPICTR OPTIONAL

*"      PARTNERADDRESSES STRUCTURE  BAPIADDR1 OPTIONAL

*"      SALES_SCHED_CONF_IN STRUCTURE  BAPISCHDL2 OPTIONAL

*"      INCOMPLETE_LOG STRUCTURE  ZGD_SD_S_RFC_MSGS OPTIONAL

*"      BILLPLAN_DATES STRUCTURE  FPLT OPTIONAL

*"----------------------------------------------------------------------

 

 

*TABLES:

  DATA: it_return TYPE TABLE OF bapiret2 WITH HEADER LINE,

        it_incomplete_log TYPE TABLE OF bapiincomp WITH HEADER LINE  .

  DATA: sales_cfgs_ref TYPE STANDARD TABLE OF bapicucfg WITH HEADER LINE,

        sales_cfgs_refinst TYPE STANDARD TABLE OF bapicuref WITH HEADER LINE,

        sales_cfgs_inst TYPE STANDARD TABLE OF bapicuins WITH HEADER LINE,

        sales_cfgs_part_of TYPE STANDARD TABLE OF bapicuprt WITH HEADER LINE,

        tmp_config TYPE STANDARD TABLE OF bapicuval WITH HEADER LINE.

 

 

  CONSTANTS: c_create TYPE c VALUE 'C',

             c_update TYPE c VALUE 'U'.

  DATA: l_action TYPE c, l_has_errors TYPE c , l_has_new_lines TYPE c.

 

 

  DATA: conf_id(6) TYPE n,

       inst_id(8) TYPE n,

       cpu_inst_id(8) TYPE n,

       l_netwr TYPE vbap-netwr,

       l_subline_count TYPE i,

       l_count TYPE i.

 

 

  FIELD-SYMBOLS: <fs_item> LIKE LINE OF sales_items_in,

                 <fs_conf> LIKE LINE OF sales_cfgs_value,

                 <fs_cond> LIKE LINE OF sales_conditions_in,

                 <fs_sales_partners> LIKE LINE OF sales_partners,

                 <fs_eaid_link> TYPE zgd_eaid_link,

                 <fs_sales_items_in> TYPE bapisditm.

 

 

 

 

  DATA: itemx LIKE bapisditmx OCCURS 10 WITH HEADER LINE,

        itemx_update  LIKE bapisditmx OCCURS 10 WITH HEADER LINE .

  DATA: it_vbap TYPE TABLE OF vbap WITH HEADER LINE.

 

 

  DATA: lt_extensionin TYPE  STANDARD TABLE OF bapiparex ,

        lt_extensionex TYPE  STANDARD TABLE OF bapiparex ,

        wa_extensionin TYPE bapiparex,

        wa_extensionex TYPE bapiparex ,

        wa_sales_schedule_inx TYPE bapischdlx,

        sales_schedule_inx TYPE STANDARD TABLE OF bapischdlx.

 

 

  DATA: wa_bape_vbak   TYPE bape_vbak,

        wa_bape_vbakx  TYPE bape_vbakx,

        wa_bape_vbap TYPE bape_vbap,

        wa_bape_vbapx TYPE bape_vbapx.

  DATA: conditions_inx TYPE TABLE OF  bapicondx WITH HEADER LINE,

        items_ex TYPE TABLE OF bapisdit WITH HEADER LINE.

 

 

*  DATA: bapi_tcode(4) TYPE c VALUE 'VA01',

  DATA: bapi_tcode(4) TYPE c .   "VALUE 'VA01',

  DATA: l_memory_id(15) TYPE c.

  DATA: l_ismodified TYPE c,

        old_num LIKE sales_partners-partn_numb,

        l_msg(100) TYPE c.

  DATA: it_vbuv LIKE TABLE OF vbuv WITH HEADER LINE,

        da_dfies_tab TYPE dfies,

        l_field(20) TYPE c,

        l_billplan(100) TYPE c,

        l_date(10) TYPE c,

        l_fakwr(20) TYPE c.

  DATA: l_cond_value TYPE char15.

  DATA: no_decimals1 TYPE tcurx-currdec.

  DATA: lv_bussobject LIKE  bapiusw01-objtype,

        l_target_val TYPE bapisditm-target_val.

  DATA: v_target_val LIKE bapisditm-target_val.

 

 

  DATA: l_flag TYPE c,

        l_vbeln(10) TYPE n,

        l_posnr LIKE bapisditm-val_con_i .

 

 

 

 

  FIELD-SYMBOLS : <fs_cond1> TYPE bapicond, "LIKE LINE OF sales_conditions_in,

                  <fs_items> TYPE bapisditm. "LIKE LINE OF sales_items_in.

  DATA: t_sales_items TYPE STANDARD TABLE OF bapisditm.

  t_sales_items[] = sales_items_in[].

  SORT t_sales_items BY itm_number.

 

 

 

 

  DELETE sales_items_in WHERE itm_number = '000000'.

 

 

  LOOP AT sales_conditions_in ASSIGNING <fs_cond1>.

    IF <fs_cond1>-cond_value > '999999999.99'.

      CONCATENATE 'The quantity entered for line item' <fs_cond1>-itm_number INTO return-message SEPARATED BY space.

      APPEND return.

      READ TABLE t_sales_items ASSIGNING <fs_items> WITH KEY itm_number = <fs_cond1>-itm_number BINARY SEARCH.

      IF sy-subrc = 0.

        CONCATENATE return-message 'product' <fs_items>-material INTO return-message SEPARATED BY space.

      ENDIF.

      APPEND return.

      return-message = 'exceeds the maximum digits allowed in this field. Please update Order to Special Metric'.

*      return-message = 'exceeds 999999999.99. Please update Quote to Special Metric'.

      APPEND return.

      return-message = 'and adjust the quantity accordingly'.

      APPEND return.

      RETURN.

    ENDIF.

  ENDLOOP.

 

 

 

 

 

 

  CLEAR: return,return[],l_memory_id,l_has_errors,l_has_new_lines.

  CLEAR: wa_bape_vbak,l_action.

 

 

  sales_header_in-ref_1_s = header_custom_fields-opp_number.

 

 

  wa_bape_vbak-vbeln = salesdocument.

  wa_bape_vbak-zrevregmodel  = header_custom_fields-zrevregmodel.

*  wa_bape_vbak-zdelmethod    = HEADER_CUSTOM_FIELDS-zdelmethod.

 

 

  IF sales_header_in-doc_type EQ 'ZDRO'.

*    for direct regi CPQ will send QUOTE number

    wa_bape_vbak-zcpqno        = header_custom_fields-cpq_quote_number.

  ELSE.

    wa_bape_vbak-zcpqno = header_custom_fields-cpq_quote_backup.

  ENDIF.

 

 

  wa_bape_vbak-zopp_number   = header_custom_fields-opp_number.

 

 

  wa_bape_vbak-zopp_type     = header_custom_fields-zopp_type.

  wa_bape_vbak-zquick_ctr    = header_custom_fields-zquick_ctr.

 

 

 

 

  wa_bape_vbak-zzcpq_ordno            = header_custom_fields-zzcpq_ordno.

  wa_bape_vbak-zzpromo_code           = header_custom_fields-zzpromo_code.

  wa_bape_vbak-zzpo_required          = header_custom_fields-zzpo_required.

  wa_bape_vbak-zzinv_paymnt_amt       = header_custom_fields-zzinv_paymnt_amt.

  wa_bape_vbak-zzinv_paymnt_date      = header_custom_fields-zzinv_paymnt_date.

  wa_bape_vbak-zzcredit_card_payamnt  = header_custom_fields-zzcredit_card_payamnt.

  wa_bape_vbak-zzcredit_card_paydate  = header_custom_fields-zzcredit_card_paydate .

 

 

  wa_extensionin-structure   = 'BAPE_VBAK'.

  wa_extensionin+30(960) = wa_bape_vbak.

  APPEND wa_extensionin TO lt_extensionin.

  CLEAR wa_extensionin.

 

 

  CLEAR wa_bape_vbakx.

  wa_bape_vbakx-vbeln = salesdocument.

  wa_bape_vbakx-zrevregmodel = 'X'.

  wa_bape_vbakx-zcpqno       = 'X'.

*  wa_bape_vbakx-zdelmethod  = 'X'.

  wa_bape_vbakx-zopp_number  = 'X'.

 

 

  wa_bape_vbakx-zopp_type     = 'X'.

  wa_bape_vbakx-zquick_ctr    = 'X'.

 

 

 

 

 

 

  wa_bape_vbakx-zzcpq_ordno           = 'X'.

  wa_bape_vbakx-zzpromo_code          = 'X'.

  wa_bape_vbakx-zzpo_required         = 'X'.

  wa_bape_vbakx-zzinv_paymnt_amt      = 'X'.

  wa_bape_vbakx-zzinv_paymnt_date     = 'X'.

  wa_bape_vbakx-zzcredit_card_payamnt = 'X'.

  wa_bape_vbakx-zzcredit_card_paydate = 'X'.

 

 

 

 

  wa_extensionex-structure = 'BAPE_VBAKX'.

*

  wa_extensionex+30(960)   = wa_bape_vbakx.

*

  APPEND wa_extensionex TO lt_extensionin. "

  APPEND wa_extensionex TO lt_extensionex.

  CLEAR wa_extensionex.

 

 

*  CONF_ID -> should match with line item id.

  LOOP AT sales_cfgs_value ASSIGNING <fs_conf>.

    conf_id = <fs_conf>-config_id.

    inst_id = <fs_conf>-config_id.

    <fs_conf>-config_id = conf_id.

    <fs_conf>-inst_id = inst_id.

  ENDLOOP.

 

 

*

  DELETE sales_cfgs_value WHERE charc = 'ZZ_SHIP'. " defect

 

 

 

 

  IF salesdocument IS NOT INITIAL.

    SELECT vbeln posnr matnr uepos cuobj FROM vbap INTO CORRESPONDING FIELDS OF TABLE it_vbap

      WHERE vbeln = salesdocument.

*     delete subline items

    DELETE it_vbap WHERE uepos IS NOT INITIAL.

  ENDIF.

 

 

  CALL FUNCTION 'TCURX_READ'

    EXPORTING

      i_curr    = sales_header_in-currency

    IMPORTING

      e_currdec = no_decimals1.

 

 

*     pricing conditions

  LOOP AT sales_conditions_in ASSIGNING <fs_cond>.

    AT NEW itm_number.

      CLEAR: wa_bape_vbap, wa_bape_vbapx,l_netwr,conf_id,l_subline_count.

 

 

      LOOP AT sales_conditions_in WHERE itm_number = <fs_cond>-itm_number.

        l_netwr = sales_conditions_in-cond_value.

 

 

        CASE sales_conditions_in-cond_type.

 

 

          WHEN 'ZEDP' .

*            wa_bape_vbap-zedp_a = l_netwr .

            PERFORM cond_value TABLES sales_conditions_in USING no_decimals1 CHANGING l_cond_value.

            wa_bape_vbap-zedp_a = l_cond_value.

            wa_bape_vbapx-zedp_a = 'X' .

          WHEN 'ZEDA' .

            PERFORM cond_value TABLES sales_conditions_in USING no_decimals1 CHANGING l_cond_value.

            wa_bape_vbap-zeda_a = l_cond_value.

            wa_bape_vbapx-zeda_a = 'X' .

          WHEN 'ZLEP' .

            PERFORM cond_value TABLES sales_conditions_in USING no_decimals1 CHANGING l_cond_value.

            wa_bape_vbap-zlep_a = l_cond_value .

            wa_bape_vbapx-zlep_a = 'X' .

        ENDCASE.

      ENDLOOP.

 

 

      conf_id = <fs_cond>-itm_number.

      <fs_cond>-itm_number = conf_id.

 

 

      wa_bape_vbapx-vbeln = wa_bape_vbap-vbeln = salesdocument.

      wa_bape_vbapx-posnr = wa_bape_vbap-posnr = <fs_cond>-itm_number.

 

 

      READ TABLE sales_items_cust WITH KEY line_item = wa_bape_vbapx-posnr.

      IF sy-subrc EQ 0.

        wa_bape_vbap-z_prior_contract = sales_items_cust-old_contract_number.

        wa_bape_vbapx-z_prior_contract = 'X'.

        wa_bape_vbap-z_prior_ln_itm =  sales_items_cust-old_contract_line.

        wa_bape_vbapx-z_prior_ln_itm = 'X'.

     

        wa_bape_vbap-zpayment_method =  sales_items_cust-zpayment_method.

        wa_bape_vbapx-zpayment_method = 'X'.

        wa_bape_vbap-zdelivery_method =  sales_items_cust-zdelivery_method.

        wa_bape_vbapx-zdelivery_method = 'X'.

   

      ENDIF.

 

 

      CLEAR: wa_extensionin.

      wa_extensionin-structure   = 'BAPE_VBAP'.

      wa_extensionin+30(960)     = wa_bape_vbap.

      APPEND wa_extensionin TO lt_extensionin.

      CLEAR wa_extensionex.

      wa_extensionex-structure = 'BAPE_VBAPX'.

      wa_extensionex+30   = wa_bape_vbapx.

      APPEND wa_extensionex TO lt_extensionin. "<-- this is required.

      APPEND wa_extensionex TO lt_extensionex.

    ENDAT.

 

 

  ENDLOOP.

 

 

  CLEAR: sales_conditions_in[],sales_conditions_in.

 

 

  SORT sales_cfgs_value BY config_id charc.

 

 

  LOOP AT sales_items_in ASSIGNING <fs_item> WHERE hg_lv_item IS INITIAL.

    CLEAR: itemx.

    conf_id = <fs_item>-itm_number.

    inst_id = <fs_item>-itm_number.

 

 

    <fs_item>-itm_number = conf_id.

    <fs_item>-po_itm_no = <fs_item>-itm_number.

 

 

*    sales_items_in-target_qty =  <fs_item>-target_qty.

 

 

    PERFORM sub_move_x_structure USING sales_items_in  CHANGING itemx.

 

 

    READ TABLE it_vbap WITH KEY posnr = <fs_item>-itm_number.

    IF sy-subrc EQ 0.

 

 

*      sales_items_in-target_qty =  <fs_item>-target_qty.

      itemx-itm_number = <fs_item>-itm_number.

      itemx-po_itm_no = 'X'.

      itemx-updateflag = 'U'.

      itemx-material = 'X'.

      itemx-target_qty = 'X'.

 

 

      APPEND itemx.

      CLEAR itemx.

 

 

*      IF  sales_schedules_in-req_qty = <fs_item>-target_qty.

*      update quantity.

      sales_schedules_in-itm_number = <fs_item>-itm_number.

      sales_schedules_in-req_qty = <fs_item>-target_qty.  

 

 

      APPEND sales_schedules_in.

*      clear sales_schedules_in.

*

      wa_sales_schedule_inx-itm_number = 'X'.

      wa_sales_schedule_inx-req_qty = 'X'. 

*

      APPEND wa_sales_schedule_inx to sales_schedule_inx.

*      CLEAR  wa_sales_schedule_inx.

*     ENDIF.

 

 

 

    ELSE.

      itemx-itm_number = <fs_item>-itm_number.

      itemx-po_itm_no = 'X'.

      itemx-updateflag = 'I'.

      itemx-material = 'X'.

      itemx-target_qty = 'X'.

*      itemx-trg_qty_no = 'X'.

*    For education materials use the item category that comes from CPQ

      IF salesdocument IS NOT INITIAL AND <fs_item>-item_categ IS NOT INITIAL .

        itemx-item_categ = 'X'.

      ENDIF.

 

 

      APPEND itemx.

      CLEAR: itemx.

      l_has_new_lines = 'X'.

*       insert data into SALES_SCHEDULES_IN

      sales_schedules_in-itm_number = <fs_item>-itm_number.

      sales_schedules_in-req_qty = <fs_item>-target_qty.  

      APPEND sales_schedules_in.

    ENDIF.

*    load VC config tables

    PERFORM sub_load_config_tables

              TABLES sales_items_in sales_cfgs_refinst  sales_cfgs_ref sales_cfgs_inst

                     sales_cfgs_part_of sales_cfgs_value

              USING conf_id inst_id  <fs_item>-material .

  ENDLOOP.

 

 

  LOOP AT it_vbap.

    READ TABLE sales_items_in WITH KEY itm_number = it_vbap-posnr.

    IF sy-subrc <> 0.

      "DELETE THE LINE ITEMS WHERE ARE NOT THERE IN INPUT STRUCTURE

      sales_items_in-itm_number = it_vbap-posnr.

      sales_items_in-po_itm_no = it_vbap-posnr.

      sales_items_in-material = it_vbap-matnr.

      APPEND sales_items_in.

      CLEAR: itemx.

      itemx-itm_number = it_vbap-posnr.

      itemx-po_itm_no = 'X'.

      itemx-updateflag = 'D'.

*      itemx-MATERIAL = 'X'.

      APPEND itemx.

      CLEAR: itemx.

 

 

    ENDIF.

  ENDLOOP.

 

 

  SORT itemx BY itm_number.

 

 

  CLEAR: l_flag,l_vbeln,l_posnr.

 

 

  READ TABLE sales_items_in INDEX 1 .

  IF NOT sales_items_in[] IS INITIAL AND sales_items_in-ref_doc IS NOT INITIAL.

    SELECT SINGLE posnr INTO l_posnr FROM vbap WHERE vbeln = sales_items_in-ref_doc AND zwert > 0.

    IF sy-subrc EQ 0.

      l_vbeln = sales_items_in-ref_doc.

*        CONCATENATE 'VB' l_vbeln l_posnr INTO SALES_HEADER_IN-REFOBJKEY.

      sales_header_in-refdoctype = 'G'.

      sales_header_in-ref_doc = sales_items_in-ref_doc.

      sales_header_in-refdoc_cat = 'G'." contract

 

 

 

 

      LOOP AT sales_items_in ASSIGNING <fs_sales_items_in>.

        <fs_sales_items_in>-ref_doc = sales_items_in-ref_doc.

        <fs_sales_items_in>-val_contr = sales_items_in-ref_doc.

        <fs_sales_items_in>-val_con_i = l_posnr.

        <fs_sales_items_in>-ref_doc_it = l_posnr.

        <fs_sales_items_in>-ref_doc_ca = 'G'.

      ENDLOOP.

    ENDIF.

  ENDIF.

 

 

 

 

  IF salesdocument IS INITIAL .

    SORT sales_items_in[] BY itm_number ASCENDING.

 

 

    l_action = c_create.

 

 

    bapi_tcode = 'VA01'.

    EXPORT bapi_tcode TO MEMORY ID 'BAPI_TCODE'.

    lv_bussobject  = 'BUS2032'.   " Direct Reg.Order

 

 

 

 

    CALL FUNCTION 'SD_SALESDOCUMENT_CREATE'

      EXPORTING

        sales_header_in      = sales_header_in

*       SALES_HEADER_INX     =

*       SENDER               =

        business_object      = lv_bussobject "'BUS2034'

      IMPORTING

        salesdocument_ex     = salesdocument_ex

        sales_header_out     = sales_header_out

        sales_header_status  = sales_header_status

      TABLES

        return               = it_return

        sales_items_in       = sales_items_in

*       SALES_ITEMS_INX      = itemx

        sales_partners       = sales_partners

        sales_schedules_in   = sales_schedules_in

*       SALES_SCHEDULES_INX  =

*       sales_conditions_in  = sales_conditions_in

        sales_conditions_inx = conditions_inx

        sales_cfgs_ref       = sales_cfgs_ref

        sales_cfgs_inst      = sales_cfgs_inst

        sales_cfgs_part_of   = sales_cfgs_part_of

        sales_cfgs_value     = sales_cfgs_value

*       SALES_CFGS_BLOB      =

*       SALES_CFGS_VK        =

        sales_cfgs_refinst   = sales_cfgs_refinst

        sales_ccard          = sales_ccard

        sales_text           = sales_text

        sales_keys           = sales_keys

        sales_contract_in    = sales_contract_in

*       SALES_CONTRACT_INX   =

        extensionin          = lt_extensionin[]

        partneraddresses     = partneraddresses

        sales_sched_conf_in  = sales_sched_conf_in

        items_ex             = items_ex

*       SCHEDULE_EX          =

*       BUSINESS_EX          =

        incomplete_log       = it_incomplete_log

        extensionex          = lt_extensionex[]

*       CONDITIONS_EX        =

*       PARTNERS_EX          =

*       TEXTHEADERS_EX       =

*       TEXTLINES_EX         =

*       BATCH_CHARC          =

      .

*    ENDIF.

* endif.

    PERFORM sub_check_vc_errors TABLES it_return sales_items_in sales_cfgs_value return

          CHANGING l_has_errors.

 

 

    PERFORM sub_collect_msgs TABLES it_return return.

 

 

    IF salesdocument_ex IS NOT INITIAL.

      CLEAR:it_return[],it_return.

      salesdocument = salesdocument_ex.

      CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'

        EXPORTING

          wait   = 'X'

        IMPORTING

          return = it_return.

      PERFORM sub_collect_msgs TABLES it_return return.

    ELSE.

      l_has_errors = 'X'.

      CALL FUNCTION 'BAPI_TRANSACTION_ROLLBACK'.

    ENDIF.

 

 

 

 

  ELSE. " UPDATE REQUEST START HERE<----------------------

 

 

    DATA: sales_header_inx LIKE bapisdhd1x,

          sales_contract_inx TYPE TABLE OF bapictrx  WITH HEADER LINE,

          partnerchanges TYPE TABLE OF bapiparnrc WITH HEADER LINE,

          it_vbpa TYPE TABLE OF vbpa WITH HEADER LINE.

 

 

    FIELD-SYMBOLS: <fs> LIKE LINE OF sales_contract_in.

 

 

    bapi_tcode = 'VA02'.

    EXPORT bapi_tcode TO MEMORY ID 'BAPI_TCODE'.

 

 

    l_action = c_update.

 

 

    sales_header_inx-updateflag = 'U'. "<-this should be passed as otherwise document will not be updated

    sales_header_inx-cust_grp3 = 'X'.

    sales_header_inx-cust_grp4 = 'X'.

    sales_header_inx-purch_no_c = 'X'.

*    TODO:

    "for date changes update X structure is mandatory

    CLEAR: sales_contract_inx[].

    LOOP AT sales_contract_in ASSIGNING <fs>.

      conf_id = <fs>-itm_number.

      <fs>-itm_number = conf_id.

 

 

      sales_contract_inx-itm_number = conf_id.

      sales_contract_inx-updateflag = 'U'.

      sales_contract_inx-inst_date = 'X'.

      sales_contract_inx-dism_date = 'X'.

      APPEND sales_contract_inx.

    ENDLOOP.

 

 

 

 

    SELECT vbeln posnr parvw kunnr pernr parnr FROM vbpa INTO CORRESPONDING FIELDS OF TABLE it_vbpa

        WHERE vbeln = salesdocument.

 

 

    LOOP AT sales_partners.

 

 

      READ TABLE it_vbpa WITH KEY parvw = sales_partners-partn_role.

      IF sy-subrc EQ 0.

 

 

        IF it_vbpa-kunnr IS INITIAL AND it_vbpa-pernr IS INITIAL AND it_vbpa-parnr IS INITIAL.

          READ TABLE sales_partners WITH KEY partn_role = it_vbpa-parvw.

          IF sy-subrc EQ 0 AND sales_partners-partn_numb IS NOT INITIAL.

            CLEAR: partnerchanges.

            partnerchanges-document = salesdocument.

            partnerchanges-itm_number = '000000'.

            partnerchanges-updateflag = 'U'.

            partnerchanges-partn_role = sales_partners-partn_role.

            partnerchanges-p_numb_old = '0'.

            partnerchanges-p_numb_new = sales_partners-partn_numb.

            APPEND partnerchanges.

          ENDIF.

        ELSE.

 

 

          CLEAR: l_ismodified,old_num.

 

 

          IF it_vbpa-kunnr IS NOT INITIAL.

            old_num = it_vbpa-kunnr.

            IF it_vbpa-kunnr <> sales_partners-partn_numb.

              l_ismodified = 'X'.

            ENDIF.

          ELSEIF it_vbpa-pernr IS NOT INITIAL.

            old_num = it_vbpa-pernr.

            IF it_vbpa-pernr <> sales_partners-partn_numb.

              l_ismodified = 'X'.

            ENDIF.

          ELSEIF it_vbpa-parnr IS NOT INITIAL.

            old_num = it_vbpa-parnr.

            IF it_vbpa-parnr <> sales_partners-partn_numb.

              l_ismodified = 'X'.

            ENDIF.

          ENDIF.

 

 

          IF l_ismodified IS NOT INITIAL.

            CLEAR: partnerchanges.

            partnerchanges-document = salesdocument.

            partnerchanges-itm_number = '000000'.

            partnerchanges-updateflag = 'U'.

            partnerchanges-partn_role = sales_partners-partn_role.

            partnerchanges-p_numb_old = old_num.

            partnerchanges-p_numb_new = sales_partners-partn_numb.

            APPEND partnerchanges.

          ENDIF.

        ENDIF.

      ELSE.

        CLEAR: partnerchanges.

        partnerchanges-document = salesdocument.

        partnerchanges-itm_number = '000000'.

        partnerchanges-updateflag = 'I'.

        partnerchanges-partn_role = sales_partners-partn_role.

        partnerchanges-p_numb_old = '0'.

        partnerchanges-p_numb_new = sales_partners-partn_numb.

        APPEND partnerchanges.

      ENDIF.

    ENDLOOP.

 

 

 

 

    CALL FUNCTION 'SD_SALESDOCUMENT_CHANGE'

      EXPORTING

        salesdocument       = salesdocument

        order_header_in     = sales_header_in

        order_header_inx    = sales_header_inx

        business_object     = lv_bussobject    " 'BUS2032'

        call_from_bapi      = 'X'     "<-- this is required

      IMPORTING

        sales_header_out    = sales_header_out

        sales_header_status = sales_header_status

      TABLES

        return              = it_return

        item_in             = sales_items_in

        item_inx            = itemx

        schedule_in         = sales_schedules_in

        schedule_inx        = sales_schedule_inx 

*       PARTNERS            = SALES_PARTNERS <- don't pass this table again

        partnerchanges      = partnerchanges

        partneraddresses    = partneraddresses

        sales_cfgs_ref      = sales_cfgs_ref

        sales_cfgs_inst     = sales_cfgs_inst

        sales_cfgs_part_of  = sales_cfgs_part_of

        sales_cfgs_value    = sales_cfgs_value

*       SALES_CFGS_BLOB     =

*       SALES_CFGS_VK       =

        sales_cfgs_refinst  = sales_cfgs_refinst

        sales_ccard         = sales_ccard

        sales_text          = sales_text

        sales_keys          = sales_keys

        conditions_in       = sales_conditions_in

        conditions_inx      = conditions_inx

        sales_contract_in   = sales_contract_in

        sales_contract_inx  = sales_contract_inx

        extensionin         = lt_extensionin[]

*       ITEMS_EX            =

*       SCHEDULE_EX         =

*       BUSINESS_EX         =

        incomplete_log      = it_incomplete_log

        extensionex         = lt_extensionex[].

 

 

 

 

    PERFORM sub_check_vc_errors TABLES it_return sales_items_in sales_cfgs_value return

          CHANGING l_has_errors.

 

 

    PERFORM sub_collect_msgs TABLES it_return return.

    READ TABLE it_return WITH KEY type = 'E'.

    IF sy-subrc <> 0.

      READ TABLE it_return WITH KEY type = 'A'.

    ENDIF.

 

 

    IF sy-subrc <> 0.

      CLEAR:it_return[],it_return.

      CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'

        EXPORTING

          wait   = 'X'

        IMPORTING

          return = it_return.

      PERFORM sub_collect_msgs TABLES it_return return.

    ELSE.

      l_has_errors = 'X'.

      CALL FUNCTION 'BAPI_TRANSACTION_ROLLBACK'.

    ENDIF.

  ENDIF.

Re: Public Holiday in SCAL

$
0
0

Hi Lakshmipathi,

 

I appreciate your concern about SCN environment. I aware scn rule.

 

More than above you can check my previous suggestion, I gave threads of scn wiki only but not copied.

 

In this case, he required particular functionality which needs particular point, so giving complete topic will confuse him, so I gave with screen shots copy.

 

Other I don't have any intentions to get the score or some appreciation. who ever gives some suggestion, I believe they will learn it from one or other source.

 

How ever, still I appreciate your concern and I will adhere the rules for best hormony.

 

Thanks & Regards

 

Bhaskar

Re: Public Holiday in SCAL

$
0
0

Hi Lakshmipathi,

 

I appreciate your concern about SCN environment. I aware scn rule.

 

More than above you can check my previous suggestion, I gave threads of scn wiki only but not copied.

 

In this case, he required particular functionality which needs particular point, so giving complete topic will confuse him, so I gave with screen shots copy.

 

Other I don't have any intentions to get the score or some appreciation. who ever gives some suggestion, I believe they will learn it from one or other source.

 

How ever, still I appreciate your concern and I will adhere the rules for best hormony.

 

Thanks & Regards

 

Bhaskar

Re: Change purchase order draft line removes G/L account data

$
0
0

Hi,

 

Please clarify- same scenario was tested in 8.81 PL10 that, GL account is still remain, if copy draft to PO with changing delivery date for both item and service type PO.

 

Note: checked only for GL account not for distribution rule

 

 

Thanks & Regards,

Nagarajan

Re: running balance wrong preview in viewer

$
0
0

and by the way i put this formula on the report header

@rt

WhilePrintingRecords;

numbervar rt := 121146;

 

tried putting it to page header,group header,details,footer secton. but i still dont get the correct computation. please help

Re: import AppBuilder project into Eclipse for Android


Re: String character replacement manipulation

$
0
0

Hi,

 

Try this code:

 

**************************************************************************

data: ls_inc type string.

data: ls_text type string value 'You need # keyboard and # screens'.

 

while sy-subrc = 0.

 

ls_inc = '#' && sy-index.

 

REPLACE FIRST OCCURRENCE OF '#'

        IN ls_text WITH ls_inc.

 

endwhile.

 

**************************************************************************

 

I can't test it, but I think its work!

Re: Problem with SAP Management console 'yellow is not changing to green'

$
0
0

Hi Zohaib,

 

Seems to me that your apps is not able to determine the oracle instance's status. Further you said you were able to login to it? But as per dev_w0 doesn't seems to be the case - it died to be allowing to login.Can you please check if the database is up and running?

 

If the DB is up and running the is the Listener is up and running and if yes then is the listener is pointing to correct DB values? If every thing is correct then.. check your R3trans log.

 

Was there multiple DB instances installed? DB upgraded which left old kernel folders and your sap is pointing to that?

 

Now I would like to clean startup and shutdown once in between - Shutdown Immediate & then Startup

 

Once checked the error in R3trans - Check if your environment variables are correctly pointing to the oracle binary folder(oracle_home), the Oracle SID, Oracle dbms type, tns values maybe.. and correct it, check also the permission and access of SIDADM,ORASID to folders and executables. Quite sure here will be your solution - faced similar so..

 

Cheers,
TD

Enter purchase order

$
0
0

Good evening,

 

When I create a new application, when I enter an item code put the item and press enter it is giving this error: cancellation PTF8 not provided.

 

Could anyone help me ??

Re: EHP5 query

$
0
0

Thanks a ton Ravi!! your reply helped me decide which one to go ahead with...

 

I opted for C_TSCM62_64 and my profile got approved

 

you mentioned that pass % is 54, is it same in India?

Question on my mind because I have searched the forum and I got many conflicting answers some saying 70% 64% ... etc?? please clarify?



where will I get the syllabus? including tips on getting good percentage pleassse


too many Qs at a time i guess sorry - but this is just out of curiosity -  why do we have option of taking either C_TSCM62_64 or C_TSCM62_65 whats the difference?


Thanks again


Abhishek



Re: reg:cardinality error

Re: IDM request grouping issue

$
0
0

Hi Andrew,

 

Many thanks for your detail reply.

 

Could you please guide me where I need to see to club all these requests? Could you please suggest me an approach or tell me which script I should look into.

 

Thanks,

Dhiman Paul.

Re: could not connect to host localhost on port 21200

$
0
0

Hi Rafa

 

What about UAC?

 

Regards

SS


Re: PO number with Exception status 20(cancel process).

$
0
0

Hi Caetano,

Thank you very much for the reply.

It is very helpful.

 

Will proceed to close this case.

Regards

 

Chin

28-Aug-2014 @10:30am

Re: Passing values to custom OVS dynamically

$
0
0

Hi,

     1. What did you bind your Item datalist with?? It must bind with Customer if your ValueHelpQuery is bound with QueryByElements or other Query directly to Customer.

     2. You have to make sure that both ObjectId and ObjectName has the same multiplicity.

     3. Add add ObjectId and ObjectName to the inport too.

     4. And please delete the extension field from the UI first and then add again and configure again.

   

Hope this helps.

Fred.

Re: Not able to delete a column in Table in webdynpro

$
0
0

Hi Kiran,

 

I rectified the mistakes that you told, the method remove_grouped_column was not working but method REMOVE_COLUMN worked.

 

Thanks for your support.

 

Regards,

Rajan Jain

Re: Error: XXXXX:6400 not found or server may be down (FWM 01003) null.

$
0
0

Hi,

 

Check if database is running mode or not?

 

Amit

Re: Error MB51

$
0
0

Check the selection fields in MB51. It should be like below :

dev.jpg

Viewing all 8665 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>