Error in Sales change Bapi

I am using BAPI_SALESORDER_CHANGE bapi to add new items. Additionaly i am passing EXTENSIONIN table. I am getting this error message "Inconsistency between a document field and the prof. segment number" for some of the materials. Can you please suggest why we are getting this error message.
- Rk

Hi
Pls check the OSS note
Note 117820 - Inconsist. between profit. segment and doc. field
Pls take opinion from SAP / BASIS before implementing the note
Regards
Madhan D

Similar Messages

  • How to change pricing Conditions in Sales order in change sales order bapi

    Hi Experts,
    How to change pricing Conditions in Sales order in change sales order bapi.
    I have used the 2 function modules bapi-changesalesorder and sd salesdocument change, But it is creating the new record , instead of changing the existing one, Could please assist regarding the same
    Thanks in Advance .
    NLN

    HI NLN
      I have just tried on my system and managed to overwrite the existing price by passing the following parameters.
      <b>Import Paramters:</b>
         SALESDOCUMENT - Sales Document Number
         ORDER_HEADER_INX - UPDATEFLAG as <b>'U'</b>.
         LOGIC_SWITCH - Import Structure - Pass 'X' to LOGIC_SWITCH-COND_HANDL.
      <b>Tables:</b>
         CONDITIONS_IN - ITM_NUMBER,
                         COND_COUNT, -> Condition counter same as KONV-ZAEHK generally it is <b>'01'</b>
                         COND_TYPE,
                         COND_VALUE,
                         CURRENCY.
         CONDITIONS_INX - ITM_NUMBER,
                          COND_COUNT,
                          COND_TYPE,
                          UPDATEFLAG as <b>'U'</b>,
                          CURRENCY.
       Hope i have clarified your query.
    Kind Regards
    Eswar

  • Sale Order change BAPI - Storage loc not updated

    Hi Everybody,
    Iam using "BAPI_SALESORDER_CHANGE", to change the sale order items.
    First iam calling above bapi with switch B, for new pricing & then second time for material change.
    When i change any material number, it is getting updated correctly.
    But the storage location, even though iam passing in the bapi it is not updated, & is blank - updation flag is also passed.
    When i execute sale order change again it is updated - ie, for any material change for first bapi call, storage loc is not updated - for 2nd bapi call storage loc is updation - for same input in both the cases.
    Is there any way to update the storage loc is first call of sales order change bapi.
    Below is the parameters iam passing in bapi :
    CALL FUNCTION 'BAPI_SALESORDER_CHANGE'
        EXPORTING
          SALESDOCUMENT      = LS_SALESDOCUMENT
          ORDER_HEADER_IN    = LT_HEADER_IN
          ORDER_HEADER_INX   = LT_HEADER_X
        TABLES
          RETURN                            = LT_RETURN
          ORDER_ITEM_IN               = LT_ITEMS
          ORDER_ITEM_INX             = LT_ITEM_X
          ORDER_CFGS_REF          = LT_CFGS_REF
          ORDER_CFGS_INST         =  LT_PARTS
          ORDER_CFGS_VALUE     = LT_VALUES
          ORDER_CFGS_BLOB        = LT_CUBLOB
          ORDER_CFGS_VK            = LT_CUVK
          ORDER_CFGS_REFINST   = LT_CUREF
          SCHEDULE_LINES            = LT_SCHEDULE_L
          SCHEDULE_LINESX         = LT_SCHEDULE_X
          ORDER_TEXT                   = LT_TEXT
          CONDITIONS_IN                = LT_CONDITION_L
          CONDITIONS_INX              = LT_CONDITION_X.
    Any help is appreciated.
    Regards,
    Nagarajan.J

    Hi,
    Storage location is updated only when same sale order bapi is called another time with required details.
    rgs,
    Nagarajan J

  • Credit card handling using sales order change BAPI

    Hi all,
      Currently, I am working on creating a custom BAPI for changing the sales order information. I am having a scenario where I need to handle multiple credit cards during the change of the sales order data. For example, if I have created a sales order  with a credit card A and a bill amount of 100. Now, in the change BAPI, I need to handle the situation like I would be getting two credit cards data out of which I need to Bill against credit card A with 200 and credit card B with 300. I need to see the entries in the sales order processing in the following fashion:
    During the creation:
    Credit card type    Credit card number    Maximum amount  Limit To
    AMEX                   A                             100                        Flag checked
    After performing change order:
    Credit card type    Credit card number    Maximum amount  Limit To
    AMEX                   A                             100                       Flag checked
    VISA                    B                              300                       Flag checked
    AMEX                   A                             100                       Flag checked
    Which implies that I am billing 200 against card A and 300 against card B.
    I want to acheive this functionality. Can any one throw some light in order to accomplish my task?
    Thanks in advance,
    From,
    Adithya

    i already used same But it's not working
    s_order_header_inx-updateflag = 'U'.
    Line items
      REFRESH: i_order_item_in, i_order_item_inx.
      LOOP AT t_data INTO wa_data.
        LOOP AT t_data_item INTO wa_data_item WHERE vbeln = wa_data-vbeln. .
    BAPISDITM
          i_order_item_in-itm_number = wa_data_item-posnr.
          i_order_item_in-profit_ctr = wa_data_item-profit_ctr.
    BAPISDITMX
          i_order_item_inx-itm_number = wa_data_item-posnr.
          i_order_item_inx-updateflag = 'U'.
          i_order_item_inx-profit_ctr = 'X'.
          APPEND: i_order_item_in, i_order_item_inx.
        ENDLOOP.
        CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
          EXPORTING
            input  = wa_data-vbeln
          IMPORTING
            output = wa_data-vbeln.
        CALL FUNCTION 'BAPI_SALESORDER_CHANGE'
          EXPORTING
            salesdocument     = wa_data-vbeln
            order_header_in   = s_order_header_in
            order_header_inx  = s_order_header_inx
            behave_when_error = 'P'
          TABLES
            return            = it_return
            order_item_in     = i_order_item_in
            order_item_inx    = i_order_item_inx.

  • Extending sales order change BAPI and updating custom fields

    Hi
    i added 3 new fields into VA01/02/03 screen.i added at the header level in the additional data tab B area and appended them in VBAK table.
    i want to change these values using sales order change BAPI.i added the fields in the structure VBAKKOZ,VBAKKOZX,BAPE_VBAK,BAPE_VBAKX.
    may i know what else i need to do?should i move them anywhere with in the code or does the bapi take those values automatically using EXTENSIONIN structure?
    also can some one send me code to actually check if bapi is changing my values?
    if poss tell me how should i populate values into BAPI.

    After adding field in structures VBAKKOZ,VBAKKOZX,BAPE_VBAK,BAPE_VBAKX, create pair of name-value pair extensiot structure and value.
    Fill values as follows :
    Data :   ls_parex  TYPE  bapiparex,
                lt_parex  TYPE STANDARD TABLE OF  bapiparex.
    ls_parex-structure = 'BAPE_VBAK'.
    ls_parex-valuepart1+0(10) = Sales order no
    ls_parex-valuepart1+10(XX) = somevalue.  <---- Value for custom field no 1
    ls_parex-valuepart1+XX(XX) = somevalue.  <---- Value for custom field no 2
    APPEND ls_parex TO lt_parex  .
    clear ls_parex.
    ls_parex-structure = 'BAPE_VBAKX'.
    ls_parex-valuepart1+0(10) = Sales order no
    ls_parex-valuepart1+10(1) = 'X'. <--- checkbox mark for custom field no 1
    ls_parex-valuepart1+11(1) = 'X'. <--- checkbox mark for custom field no 2
    APPEND ls_parex TO lt_parex.
    Same pair for VBAKKOZ & VBAKKOZX
    Updating custom fields
      CALL FUNCTION 'BAPI_SALESORDER_CHANGE'
        EXPORTING
          salesdocument    = Sales order number
          order_header_inx = 'U'   <--- U for update
        TABLES
          extensionin      = lt_parex[].
    Edited by: nkarwa on Oct 25, 2010 12:39 PM

  • Sales document was not changed BAPI

    Hi Experts,
            Am trying to upload sales documents using BAPI_SALESDOCU_CREATEFROMDATA1, but am getting an error like "sales document was not changed". here is my sample code. Thanks in Advance.
    TYPE-POOLS : TRUXS.
    types : BEGIN OF TY_file,
    auart TYPE auart,
    vkorg TYPE vkorg , "
    vtweg TYPE vtweg ,
    spart TYPE spart ,
    KUNNR  TYPE kunnr ,
    KUNNR1  TYPE kunnr ,
    matnr TYPE matnr  ,
    dzmeng TYPE dzmeng  ,
    WERKS_d TYPE werks_d ,
    END OF TY_file.
    *TYPES : tt_file TYPE STANDARD TABLE OF ty_file.
    data : it_file TYPE TABLE OF TY_FILE,
                   wa_file TYPE TY_file.
    PARAMETERs : p_file TYPE IBIPPARMS-PATH.
    at SELECTION-SCREEN on VALUE-REQUEST FOR p_file.
       PERFORM browse_file.
       START-OF-SELECTION.
       PERFORM LOAD_FLAT_FILE.
       PERFORM CALL_BAPI_CREATE.
    FORM browse_file .
    CALL FUNCTION 'F4_FILENAME'
      IMPORTING
        FILE_NAME           = p_file
    ENDFORM.                    " browse_file
    FORM LOAD_FLAT_FILE .
       DATA : LT_RAW TYPE TRUXS_T_TEXT_DATA.
       CALL FUNCTION 'TEXT_CONVERT_XLS_TO_SAP'
         EXPORTING
           I_FIELD_SEPERATOR          = 'X'
          I_LINE_HEADER              = 'X'
           I_TAB_RAW_DATA             = LT_RAW
           I_FILENAME                 = P_FILE
         TABLES
           I_TAB_CONVERTED_DATA       = IT_FILE
        EXCEPTIONS
          CONVERSION_FAILED          = 1
          OTHERS                     = 2
       IF SY-SUBRC = 0.
         MESSAGE 'UPLOADED' TYPE 'I'.
           ENDIF.
    ENDFORM.                    " LOAD_FLAT_FILE
    FORM CALL_BAPI_CREATE .
    DATA: v_vbeln            LIKE vbak-vbeln.
    DATA: header             LIKE bapisdhead1.
    DATA: headerx            LIKE bapisdhead1x.
    DATA: item               LIKE bapisditem  OCCURS 0 WITH HEADER LINE.
    DATA: itemx              LIKE bapisditemx OCCURS 0 WITH HEADER LINE.
    DATA: partner            LIKE bapipartnr  OCCURS 0 WITH HEADER LINE.
    DATA: return             LIKE bapiret2    OCCURS 0 WITH HEADER LINE.
    DATA: lt_schedules_inx   TYPE STANDARD TABLE OF bapischdlx
                              WITH HEADER LINE.
    DATA: lt_schedules_in    TYPE STANDARD TABLE OF bapischdl
                              WITH HEADER LINE.
    LOOP AT IT_FILE INTO WA_FILE.
       header-doc_type = WA_FILE-auart.
       headerx-doc_type = 'X'.
       header-sales_org = WA_FILE-vkorg.
       headerx-sales_org = 'X'.
       header-distr_chan  = WA_FILE-vtweg.
       headerx-distr_chan = 'X'.
       header-division = WA_FILE-spart.
       headerx-division = 'X'.
       headerx-updateflag = 'I'.             " flag for create a new document
       partner-partn_role = 'AG'.
       partner-partn_numb = WA_fILE-KUNNR.
       APPEND partner.
       partner-partn_role = 'WE'.
       partner-partn_numb = WA_fILE-KUNNR1.
       APPEND partner.
       itemx-updateflag = ''.
       item-itm_number = '000010'.
       itemx-itm_number = 'X'.
       item-material = WA_FILE-matnr.
       itemx-material = 'X'.
       item-plant    = WA_FILE-WERKS_d.
       itemx-plant   = 'X'.
       item-target_qty = WA_fILE-dzmeng.
       itemx-target_qty = 'X'.
       APPEND item.
       APPEND itemx.
       lt_schedules_in-itm_number = '000010'.
       lt_schedules_in-sched_line = '0001'.
       lt_schedules_in-req_qty    = WA_FILE-DZmeng.
       APPEND lt_schedules_in.
       lt_schedules_inx-itm_number  = '000010'.
       lt_schedules_inx-sched_line  = '0001'.
       lt_schedules_inx-updateflag  = 'X'.
       lt_schedules_inx-req_qty     = 'X'.
       APPEND lt_schedules_inx.
       CALL FUNCTION 'BAPI_SALESDOCU_CREATEFROMDATA1'
            EXPORTING
                 sales_header_in     = header
                 sales_header_inx    = headerx
            IMPORTING
                 salesdocument_ex    = v_vbeln
            TABLES
                 return              = return
                 sales_items_in      = item
                 sales_items_inx     = itemx
                 sales_schedules_in  = lt_schedules_in
                 sales_schedules_inx = lt_schedules_inx
                 sales_partners      = partner.
    *  LOOP AT return WHERE type = 'E' OR type = 'A'.
    *    EXIT.
    WRITE : / RETURN-NUMBER, RETURN-TYPE, RETURN-MESSAGE.
    *  ENDLOOP.
    *  IF sy-subrc = 0.
    *    WRITE: / 'Error in creating document'.
    *  ELSE.
    *    COMMIT WORK AND WAIT.
    *    WRITE: / 'Document ', v_vbeln, ' created'.
    *  ENDIF.
    *  LOOP AT RETURN.
    *WRITE : / RETURN-NUMBER, RETURN-TYPE, RETURN-MESSAGE.
       ENDLOOP.
       END

    Hi Experts,
            Am trying to upload sales documents using BAPI_SALESDOCU_CREATEFROMDATA1, but am getting an error like "sales document was not changed". here is my sample code. Thanks in Advance.
    TYPE-POOLS : TRUXS.
    types : BEGIN OF TY_file,
    auart TYPE auart,
    vkorg TYPE vkorg , "
    vtweg TYPE vtweg ,
    spart TYPE spart ,
    KUNNR  TYPE kunnr ,
    KUNNR1  TYPE kunnr ,
    matnr TYPE matnr  ,
    dzmeng TYPE dzmeng  ,
    WERKS_d TYPE werks_d ,
    END OF TY_file.
    *TYPES : tt_file TYPE STANDARD TABLE OF ty_file.
    data : it_file TYPE TABLE OF TY_FILE,
                   wa_file TYPE TY_file.
    PARAMETERs : p_file TYPE IBIPPARMS-PATH.
    at SELECTION-SCREEN on VALUE-REQUEST FOR p_file.
       PERFORM browse_file.
       START-OF-SELECTION.
       PERFORM LOAD_FLAT_FILE.
       PERFORM CALL_BAPI_CREATE.
    FORM browse_file .
    CALL FUNCTION 'F4_FILENAME'
      IMPORTING
        FILE_NAME           = p_file
    ENDFORM.                    " browse_file
    FORM LOAD_FLAT_FILE .
       DATA : LT_RAW TYPE TRUXS_T_TEXT_DATA.
       CALL FUNCTION 'TEXT_CONVERT_XLS_TO_SAP'
         EXPORTING
           I_FIELD_SEPERATOR          = 'X'
          I_LINE_HEADER              = 'X'
           I_TAB_RAW_DATA             = LT_RAW
           I_FILENAME                 = P_FILE
         TABLES
           I_TAB_CONVERTED_DATA       = IT_FILE
        EXCEPTIONS
          CONVERSION_FAILED          = 1
          OTHERS                     = 2
       IF SY-SUBRC = 0.
         MESSAGE 'UPLOADED' TYPE 'I'.
           ENDIF.
    ENDFORM.                    " LOAD_FLAT_FILE
    FORM CALL_BAPI_CREATE .
    DATA: v_vbeln            LIKE vbak-vbeln.
    DATA: header             LIKE bapisdhead1.
    DATA: headerx            LIKE bapisdhead1x.
    DATA: item               LIKE bapisditem  OCCURS 0 WITH HEADER LINE.
    DATA: itemx              LIKE bapisditemx OCCURS 0 WITH HEADER LINE.
    DATA: partner            LIKE bapipartnr  OCCURS 0 WITH HEADER LINE.
    DATA: return             LIKE bapiret2    OCCURS 0 WITH HEADER LINE.
    DATA: lt_schedules_inx   TYPE STANDARD TABLE OF bapischdlx
                              WITH HEADER LINE.
    DATA: lt_schedules_in    TYPE STANDARD TABLE OF bapischdl
                              WITH HEADER LINE.
    LOOP AT IT_FILE INTO WA_FILE.
       header-doc_type = WA_FILE-auart.
       headerx-doc_type = 'X'.
       header-sales_org = WA_FILE-vkorg.
       headerx-sales_org = 'X'.
       header-distr_chan  = WA_FILE-vtweg.
       headerx-distr_chan = 'X'.
       header-division = WA_FILE-spart.
       headerx-division = 'X'.
       headerx-updateflag = 'I'.             " flag for create a new document
       partner-partn_role = 'AG'.
       partner-partn_numb = WA_fILE-KUNNR.
       APPEND partner.
       partner-partn_role = 'WE'.
       partner-partn_numb = WA_fILE-KUNNR1.
       APPEND partner.
       itemx-updateflag = ''.
       item-itm_number = '000010'.
       itemx-itm_number = 'X'.
       item-material = WA_FILE-matnr.
       itemx-material = 'X'.
       item-plant    = WA_FILE-WERKS_d.
       itemx-plant   = 'X'.
       item-target_qty = WA_fILE-dzmeng.
       itemx-target_qty = 'X'.
       APPEND item.
       APPEND itemx.
       lt_schedules_in-itm_number = '000010'.
       lt_schedules_in-sched_line = '0001'.
       lt_schedules_in-req_qty    = WA_FILE-DZmeng.
       APPEND lt_schedules_in.
       lt_schedules_inx-itm_number  = '000010'.
       lt_schedules_inx-sched_line  = '0001'.
       lt_schedules_inx-updateflag  = 'X'.
       lt_schedules_inx-req_qty     = 'X'.
       APPEND lt_schedules_inx.
       CALL FUNCTION 'BAPI_SALESDOCU_CREATEFROMDATA1'
            EXPORTING
                 sales_header_in     = header
                 sales_header_inx    = headerx
            IMPORTING
                 salesdocument_ex    = v_vbeln
            TABLES
                 return              = return
                 sales_items_in      = item
                 sales_items_inx     = itemx
                 sales_schedules_in  = lt_schedules_in
                 sales_schedules_inx = lt_schedules_inx
                 sales_partners      = partner.
    *  LOOP AT return WHERE type = 'E' OR type = 'A'.
    *    EXIT.
    WRITE : / RETURN-NUMBER, RETURN-TYPE, RETURN-MESSAGE.
    *  ENDLOOP.
    *  IF sy-subrc = 0.
    *    WRITE: / 'Error in creating document'.
    *  ELSE.
    *    COMMIT WORK AND WAIT.
    *    WRITE: / 'Document ', v_vbeln, ' created'.
    *  ENDIF.
    *  LOOP AT RETURN.
    *WRITE : / RETURN-NUMBER, RETURN-TYPE, RETURN-MESSAGE.
       ENDLOOP.
       END

  • Getting error while calling this BAPI:Field MATNR has been transferred inco

    Hi,
    I have a rquirement to upload material master data into sap for Plant 1251.(For plant 1251 we need to upload both Basi veiw and Extended View).
    I am getting the following error while calling this BAPI.Field MATNR has been transferred inconsistently or is blank
    the errror is :Field MATNR has been transferred inconsistently or is blank.
    I have written the below logic in the program to upload material master data into SAP.
    Please help me out to resolve this issue.
    Thanks in advance.
    Program logic which i have wriiten in the program is
    LOOP AT it_rpt.
        CLEAR lwa_return.
        v_tabix  = sy-tabix.
        IF ( it_rpt-werks EQ p_werks AND
           it_rpt-matnr IS INITIAL ).
    retrieve internal number
          PERFORM get_internal_number USING lc_mtart
                                            lc_mbrsh
                                   CHANGING it_rpt-matnr.
        ENDIF.
        IF NOT it_rpt-matnr IS INITIAL.
          PERFORM convert_field_input CHANGING it_rpt-matnr.
        ENDIF.
    Header data
        CLEAR lwa_headdata.
        lwa_headdata-material                = it_rpt-matnr.
        lwa_headdata-ind_sector              = lc_mbrsh.
        lwa_headdata-matl_type               = lc_mtart.
        lwa_headdata-basic_view              = 'X'.
        IF NOT it_rpt-vkorg IS INITIAL.
          lwa_headdata-sales_view            = 'X'.
        ENDIF.
        lwa_headdata-purchase_view           = 'X'.
        lwa_headdata-mrp_view                = 'X'.
        lwa_headdata-storage_view            = 'X'.
        lwa_headdata-forecast_view           = 'X'.
        lwa_headdata-work_sched_view         = 'X'.
        lwa_headdata-account_view            = 'X'.
        lwa_headdata-cost_view               = 'X'.
    *Client data
        CLEAR: lwa_clientdata, lwa_clientdatax.
        IF it_rpt-werks EQ c_1251.
          lwa_clientdata-matl_group          = it_rpt-matkl.
          lwa_clientdata-old_mat_no          = it_rpt-bismt.
          lwa_clientdata-base_uom            = it_rpt-meins.
          lwa_clientdata-manu_mat            = it_rpt-mfrpn.
          lwa_clientdata-mfr_no              = it_rpt-mfrnr.
        ENDIF.
        lwa_clientdata-division              = it_rpt-spart.
        lwa_clientdata-unit_of_wt            = lc_gewei.
        lwa_clientdata-trans_grp             = lc_tragr.
        IF it_rpt-werks EQ c_1251.
          lwa_clientdatax-matl_group         = 'X'.
          lwa_clientdatax-old_mat_no         = 'X'.
          lwa_clientdatax-base_uom           = 'X'.
          lwa_clientdatax-manu_mat           = 'X'.
          lwa_clientdatax-mfr_no             = 'X'.
        ENDIF.
        lwa_clientdatax-unit_of_wt           = 'X'.
        lwa_clientdatax-trans_grp            = 'X'.
        lwa_clientdatax-division             = 'X'.
    Material Description
        IF it_rpt-werks EQ c_1251.
          lt_matdesc-langu           = sy-langu.
          lt_matdesc-matl_desc       = it_rpt-maktx.
          APPEND lt_matdesc.
        ENDIF.
    *Plant data
        CLEAR lwa_plantdata.
        lwa_plantdata-plant                  = it_rpt-werks.
        lwa_plantdata-availcheck             = lc_mtvfp.
        lwa_plantdata-mrp_type               = lc_dismm.
        lwa_plantdata-mrp_group              = lc_disgr.
        lwa_plantdata-auto_p_ord             = 'X'.
        lwa_plantdata-proc_type              = 'F'.
        IF it_rpt-werks EQ c_1251.
          it_rpt-prctr  = lc_prctr.                 "1252
        ELSEIF it_rpt-werks EQ c_1261.
          it_rpt-prctr  = lc_prctr1.                "1262
        ENDIF.
        lwa_plantdata-profit_ctr             = it_rpt-prctr.
        lwa_plantdata-period_ind             = lc_perkz.
        lwa_plantdata-max_stock              = it_rpt-stawn.
        lwa_plantdata-countryori             = it_rpt-herkl.
        lwa_plantdata-sloc_exprc             = it_rpt-lgfsb.
        CLEAR lwa_plantdatax.
        lwa_plantdatax-plant                 = it_rpt-werks.
        lwa_plantdatax-availcheck            = 'X'.
        lwa_plantdatax-mrp_type              = 'X'.
        lwa_plantdatax-mrp_group             = 'X'.
        lwa_plantdatax-auto_p_ord            = 'X'.
        lwa_plantdatax-proc_type             = 'X'.
        lwa_plantdatax-profit_ctr            = 'X'.
        lwa_plantdata-period_ind             = 'X'.
        lwa_plantdatax-max_stock             = 'X'.
        lwa_plantdatax-countryori            = 'X'.
        lwa_plantdatax-sloc_exprc            = 'X'.
    *Valuation data
        CLEAR lwa_valuationdata.
        lwa_valuationdata-val_area           = it_rpt-werks.
        lwa_valuationdata-price_ctrl         = lc_vprsv.
        lwa_valuationdata-price_unit         = lc_peinh.
        lwa_valuationdata-val_class          = it_rpt-bklas.
        CLEAR lwa_valuationdatax.
        lwa_valuationdatax-val_area          = it_rpt-werks.
        lwa_valuationdatax-price_ctrl        = 'X'.
        lwa_valuationdatax-price_unit        = 'X'.
        lwa_valuationdatax-val_class         = 'X'.
    *Storage location
        CLEAR lwa_storagelocation.
        lwa_storagelocation-plant            = it_rpt-werks.
        lwa_storagelocation-stge_loc         = it_rpt-lgort.
        CLEAR lwa_storagelocationx.
        lwa_storagelocationx-plant           = it_rpt-werks.
        lwa_storagelocationx-stge_loc        = it_rpt-lgort.
    *Tax Classifications
        IF it_rpt-werks EQ c_1251.
          it_rpt-tatyp = lc_tatyp.       "u2018MWSTu2019
        ELSEIF it_rpt-werks EQ c_1261.
          it_rpt-tatyp = lc_tatyp1.      "u2018UTXJu2019
        ENDIF.
        lt_taxclass-tax_type_1              = it_rpt-tatyp.
        lt_taxclass-taxclass_1              = lc_taxkm.
        lt_taxclass-tax_ind                 = lc_taxim.
        APPEND lt_taxclass.
    *Sales data
        CLEAR: lwa_salesdata, lwa_salesdatax.
        IF it_rpt-werks EQ c_1251.
          it_rpt-vkorg = lc_vkorg.
        ELSEIF it_rpt-werks EQ c_1261.
          it_rpt-vkorg = lc_vkorg1.
        ENDIF.
        lwa_salesdata-sales_org           = it_rpt-vkorg.
        lwa_salesdata-distr_chan          = lc_vtweg.
        lwa_salesdata-cash_disc           = lc_sktof.
        lwa_salesdata-item_cat            = lc_mtpos.
        lwa_salesdatax-sales_org          = it_rpt-vkorg.
        lwa_salesdatax-distr_chan         = lc_vtweg.
        lwa_salesdatax-cash_disc          = 'X'.
        lwa_salesdatax-item_cat           = 'X'.
    *Forecast parameters
        CLEAR: lwa_forecast, lwa_forecastx.
        lwa_forecast-plant                = it_rpt-werks.
        lwa_forecast-fore_model           = lc_prmod.
        lwa_forecast-fore_pds             = lc_anzpr.
        lwa_forecast-hist_vals            = lc_peran.
        lwa_forecastx-plant               = it_rpt-werks.
        lwa_forecastx-fore_model          = 'X'.
        lwa_forecastx-fore_pds            = 'X'.
        lwa_forecastx-hist_vals           = 'X'.
    Purchasing long text
        IF it_rpt-werks EQ c_1251.
          IF it_rpt-tdline1 <> ' '.
            lv_tdobject = 'MATERIAL'.
            lv_tdid     = 'BEST'.
            lv_tdname   =  it_rpt-matnr.
            PERFORM fill_longtext TABLES lt_longtext
                                  USING  lv_tdobject
                                         lv_tdname
                                         lv_tdid
                                         sy-langu
                                         it_rpt-tdline1.
          ENDIF.
    Basic long text
          IF it_rpt-tdline2 <> ' '.
            lv_tdobject = 'MATERIAL'.
            lv_tdid     = 'GRUN'.
            lv_tdname   =  it_rpt-matnr.
            PERFORM fill_longtext TABLES lt_longtext
                                  USING  lv_tdobject
                                         lv_tdname
                                         lv_tdid
                                         sy-langu
                                         it_rpt-tdline2.
          ENDIF.
    *Units of measure
          CLEAR : lt_uom,lt_uomx.
          lt_uom-alt_unit     = it_rpt-meins.
          lt_uom-alt_unit_iso = it_rpt-meins.
          lt_uom-unit_of_wt   = it_rpt-gewei.
          APPEND lt_uom.
          lt_uomx-alt_unit      = it_rpt-meins.
          lt_uomx-alt_unit_iso  = it_rpt-meins.
          lt_uomx-unit_of_wt    = 'X'.
          APPEND lt_uomx.
        ENDIF.
        CALL FUNCTION 'BAPI_MATERIAL_SAVEDATA'
          EXPORTING
            headdata             = lwa_headdata
            clientdata           = lwa_clientdata
            clientdatax          = lwa_clientdatax
            plantdata            = lwa_plantdata
            plantdatax           = lwa_plantdatax
            forecastparameters   = lwa_forecast
            forecastparametersx  = lwa_forecastx
            storagelocationdata  = lwa_storagelocation
            storagelocationdatax = lwa_storagelocationx
            valuationdata        = lwa_valuationdata
            valuationdatax       = lwa_valuationdatax
            salesdata            = lwa_salesdata
            salesdatax           = lwa_salesdatax
          IMPORTING
            return               = lwa_return
          TABLES
            materialdescription  = lt_matdesc
            unitsofmeasure       = lt_uom
            unitsofmeasurex      = lt_uomx
            materiallongtext     = lt_longtext
            taxclassifications   = lt_taxclass
            returnmessages       = it_messages.
    Regards,
    Reddy

    Can you check with below code .
    CALL FUNCTION 'CONVERSION_EXIT_MATN1_INPUT'
            EXPORTING
              INPUT        =  it_rpt-matnr       
    IMPORTING
              OUTPUT       =  it_rpt-matnr
            EXCEPTIONS
              LENGTH_ERROR = 1
              OTHERS       = 2.
          IF SY-SUBRC <> 0.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
          ENDIF.
    Move  it_rpt-matnr to    lwa_headdata-material  .
    Regard's
    Smruti

  • Sales Order BAPI Extension

    Hi,
        We would like to pass custom fields data to Custom screens in VA01 Standard Sales Order. For that we are extending standard BAPI BAPI_SALESORDER_CREATEFROMDAT2 using EXTENSION parameter. We have appended custom structures to VBAKKOZ. VBAKKOZX, BAPE_VBAK,BAPE_VBAKX and able to pass information from portal upto 480 characters using
    valuepart1 and valuepart2.
    But when we are trying to extend it further, standard sales order BAPI
    BAPI_SALESORDER_CREATEFROMDAT2 is going to dump at :
             CALL METHOD cl_abap_container_utilities=>fill_container_c
                            EXPORTING
                               im_value     = da_bape_vbap
                            IMPORTING
                               ex_container =
    ch_parex+lenstruc(da_length_bape_vbap)
                            EXCEPTIONS
                               illegal_parameter_type = 1
                               OTHERS                 = 2.
    We need to extend it up to 900 chars.
    Any help on this will be greatly apprecited.
    Thanks
    Kalyan

    I found shortly after posting my message that the notes had not been correctly applied as the Notes Assistant ended with an error, and the error that resulted in this failure had not been corrected.  The basis folks failed to inform me that this error had occured in applying the notes.  I discovered it through testing.  Had you applied the notes and run into the same error?
    When we subsequently corrected for this, the issue with lenstruc went away and everything appears to be OK.  The real problem was that due to the error in the Notes Assistant the updated version of LVBAKTOP with the definition of lenstruc did not get activated.  It was left in a state where it needed an SSCR key to be applied manually, which should all have been handled automatically with SNOTE.
    Once this was done and the source was activated, the original error went away.  The two notes seem to have solved the original Unicode issue as well.
    We still have this update in the development area only since the CRM enhancements that caused the original problem with an append to the VBAK structure are also still in development.   We will be testing those changes together before moving everything up.  If there are any further issues that come up, I'll let you know.
    What I am wondering is if you had a similar problem applying the above notes, since the problem went away for us when the notes to handle the Unicode conversion were properly applied.
    Brian
    Edited by: Brian Sammond on Jul 24, 2008 10:55 AM

  • Error in Sales Transaction in CRM 4.0 ?

    Hi All,
    We are working on CRM 4.0 i have created a sales transaction in WEB and  transaction will see in CRM and it is getting downloaded to R/3.
    But when I go back to CRM and check Sales Transaction it is showing me error as "An error has occured in the system XYZCLNT100 while copying the document".
    And i have been check in SMQ1&SMW01 ..in both T codes there is no error ..
    How can i figure out this problem ?
    can anyone help me in this regard?
    Thanks in advance.

    Please look into note 490932 for any issues of this nature
    This note gives an insight into possible error causes during the download or upload of sales transactions between CRM and R/3 and helps you correct these errors. This note is relevant for CRM Release3.0.
    It is also relevant for releases higher than 3.0.
    Other terms
    Download, initial, delta, delta download, SALESDOCUMENT, BUS_TRANS_MSG, event 00501014 501014
    Reason and Prerequisites
    The error causes may be included an incorrect configuration or missing system settings. The note only focuses on the sales transaction-specific configuration of the data exchange, but not on the settings for CRM Middleware in general or for other CRM Server applications.
    Solution
    In CRM Release 3.0, the following sales document items are transferred to the R/3 System:
    Sales items
    Customer return items
    Substitute delivery item
    Credit memo request items
    Debit memo request items
    As a leading system for the order entry, CRM only transfers data to the R/3 System if it is relevant for the logistical subsequent processing (delivery, billing). For this reason, requests for quotations and quotations themselves are not transferred to the R/3 back-end system with the standard delivery. With SAP note 455678, you can use a modification solution to also transfer quotations entered in CRM to the R/3 back-end system.
               Restrictions of note 455678:
    If you are using this solution, you cannot create any sales orders with reference to customer quotations in CRM.
    Mixed document processing (partially customer quotation items and partially sales order items) is not supported in the R/3 System and is therefore not possible during the quotation upload. The solution specified here only performs the upload for documents that consist of quotation items only.
    The quotation items must be defined in the Customizing for copying. This solution does not cover scenarios where the order is generated from the quotation as a result of a status change. Therefore, quotations entered in SAP Internet Sales (in particular) cannot be transferred to the R/3 System.
    Only completion rule 'A' ('Completed with one-time reference') is supported in the R/3 System.
    Sales transaction-specific settings for the data exchange
    1. Basic administrative settings for the replication of sales transactions
    a) The BDoc relevant for the distribution of all transaction types is called BUS_TRANSACTION_MESSAGE. In transaction SMOEAC, the relevant R/3 site must be subscribed to the corresponding publication 'All Business Transactions (MESG)' so that sales documents can be distributed to the R/3 back-end system. (To create a subscription, select the 'Subscription' object type in the 'Object type' selection list in transaction SMOEAC and then select the 'Object -> Create' function from the application menu or the corresponding symbol from the application function bar. The Subscription Wizard, which supports you during the creation of a new subscription, is started as a result.)
    b) Check to see whether the current CRM release has been maintained in the R/3 back-end system in the CRMPAROLTP table. This has to be taken into account in particular after an upgrade. You can maintain the CRMPAROLTP table in transaction SM30 in the R/3 back-end system:
                           Parameter name "CRM_RELEASE"
                           Param. value "30A"
    c) Event 00501014 must be activated in the R/3 back-end system so that the delta download of sales transactions from the R/3 back-end system to CRM works. The event must also be active for the upload of sales transactions from CRM to R/3.
    d) The event is activated automatically after a successful initial download. Call transaction R3AC4 ('Object Class Activation') in CRM and check whether the following entries exist:
                           Object class "BUSPROCESSND"
                           RFC destination <R/3 destination>
                           Select your entry and then choose 'Events by Object Class' (branch to the TBE31 table in the R/3 back-end system). The following entries must exist:
                           Event "00501014"
                           Obj. class "BUSPROCESSND"
                           Function "CRS_SALES_COLLECT_DATA"
                           If you do not see these entries, your initial download was not completed successfully.
    e) In transaction BD97 of your CRM system, the R/3 back-end system must have been maintained as the standard BAPI destination. Check the V_TBDLS view to see whether your R/3 back-end system has been defined as a logical system. A termination message in the SAPLCRM_ DISTRIBUTED_LOCKING program when you call a transaction in CRM indicates the missing destination assignment.
    Refer to notes 597812 and 674487. According to note 597812, the cross-system lock is processed using the RFC destination of the CRM middleware (SMOF_ERPSH table). However, the aforementioned entry in transaction BD97 for the Standard BAPI destination is still used to branch via the document flow to the R/3 system.
    f) In Release 3.1I, you can only have one entry for the RFCDEST field (RFC destination) in the CRMRFCPAR R/3 table.
    2. Definition of sales transaction-related Middleware parameters
    a) If you do not want a BOM explosion to occur for document items in CRM during the transfer to the R/3 back-end system, make the following settings in transaction R3AC6:
                           Key "R3A_SALES"
                           name "NOSTRUCTURE"
                           value "X"
                           This would make sense, for example, if you have already carried out a BOM explosion on the mobile client and if you do not want a new BOM explosion in the R/3 back-end system.
                           Make sure that the assigned item numbers in the sales transaction/sales document are set differently for main items and subitems so that no item numbers are assigned twice after the transfer and the BOM explosion in the R/3 System. The item numbers of the main items must be set identically in CRM and R/3. For more information, see note 496906.
                           Example:
                           CRM sales transaction
                           Pos.Nr.   Item No. Product
                           100 MAT1
                           200 MAT2
                           R/3 order
                           Pos.Nr.   Item No. Material
                           100 MAT1
                           101 Subitem1
                           102 Subitem2
                           103 Subitem3
                           104       ...
                           200 MAT2
                           You can maintain the item number assignment for the transaction types (CRM) or for the sales document types (R/3) in the Customizing.
    b) If a document is created in CRM and transferred to the R/3 back-end system, the warning messages of the transferred R/3 back-end document can also be displayed in the CRM document. In this way, you can recognize, for example, in the CRM document whether the transferred R/3 back-end document is incomplete and has to be postprocessed so that it can be further processed logistically. For this purpose, make the following settings in transaction R3AC6:
                           Key "R3A_SALES"
                           name "COLLECT_WARNINGS"
                           value "X"
    c) When you transfer a CRM document to R/3, you have the following control options with regard to pricing:
                           Key "R3A_SALES"
                           name "PRICINGTYPE"
                           value
                                             'B' = new pricing
                                             or
                                             'C' = copy manual pricecomponents,
                                             redetermine others
                                             or
                                             'G' = Copy price components unchanged,
                                             redetermine taxes (this value is
                                             delivered as a default setting)
    3. Definition of the R/3 dummy division in CRM
                  Note that no division exists in CRM in transactions at header level. In the R/3 order, however, the header division is a mandatory field. Thus, the R/3 dummy division must be maintained in CRM Customizing so that it can be determined during the transfer of a document. Otherwise, the order cannot be transferred to the R/3 back-end system.
                  Customizing path: 'Customer Relationship Management -> Master Data -> Organizational Management -> Division Settings -> Define Use of Division and Dummy Division'.
                  The use of several dummy divisions can be programmed in the CRM_DATAEXCH_AFTER_BAPI_FILL BAdI in the CRM_R3_SALESDOCUMENT_UPLOAD function module.
    Hints for the initial download
    Filter settings
    In transaction R3AC1, you set the filters for the initial/delta download of business objects. In the SALESDOCUMENT business object, you can set the filters for the order download from R/3 to CRM. For successful execution of the initial download, you have to set at least the VBAK-ERDAT filter criterion (document entry date) for the SALESDOCUMENT business object. This filter setting is required for the successful completion of order downloads.
    After you have completed these filter settings, you have to transfer these settings to the R/3 System. Select 'Filter sync.(R/3)'.
    Choose your R/3 System as a source site and check whether you are using the VBAK-ERDAT filter criterion:
    Example:
    Table/Structure Field OP Low
    VBAK ERDAT Greater than <Date>, for example, 20020128
    The date must be entered in the same form as it is stored on the database (YYYYMMDD)!
    The following filter criteria are also available:
    VBAK-AUART Sales document type
    VBAK-SPART Division
    VBAK-VBTYP Sales document category
    VBAK-VKORG Sales organization
    VBAK-VTWEG Distribution channel
    We recommend that you also use sales document numbers (VBAK-VBELN) as a further filter criterion. With this criterion, you can carry out an initial download according to sales document number intervals. The advantage of this filter criterion is that if your initial download terminates due to an error, you can restart the download after correcting the error as of the sales document number for which the error occurred. In this way you avoid having to restart a download for sales documents that have already been replicated.
    Example:
    Table/Structure   Field          OP            Low           High
    VBAK             VBELN          zwisch.        0005000000    0005099999
    Enter the field contents in the same way as it is stored on the R/3 database (leading zeros).
    If you want to use this filter criterion, go to transaction SM30 and make the following entry in the SMOFFILFLD table:
    Object name Table/Structure name Field name
    SALESDOCUMENT VBAK VBELN
    Note 497327 deals with possible filter-specific problems during the delta download that can occur due to missing R/3 back-end entries.
    Block size
    In this context, the block size specifies how many documents are selected in a transaction and transferred to CRM as a BDoc. The block size is defined on the system. The default value may have to be set to a lower value if problems occur (for example, memory overflow during the selection in the R/3 System). If the initial download terminates, check the dump log in the R/3 System (transaction ST22). The TIME_OUT or STORAGE_FREE_FAILED runtime errors indicate that the block size is too large. In this case, reduce the block size and restart the download.  In addition, you can clarify with your Basis Administration whether the rdisp/max_wprun_time kernel parameter is large enough (this avoids a TIME_OUT error).
    Basically, you should only download a few documents during the first download to check whether the system settings are correct. In this way, you can identify possible Customizing errors and correct them before the large load.
    Queue processing during the initial download
    In the case of very large transfer data sets, it may make sense to process the initial download in parallel within one object (object-internal parallel initial download) to complete the initial data transfer faster. Note 350176 describes the corresponding procedure.
    Queue processing during the upload/delta download
    Queues in CRM are defined in the SMOFQFIND table (for example, from CRM to CDB or from CRM to R/3).
    For the BUS_TRANS_MSG BDoc type, the default setting of the queue processing is that all orders for a customer are processed in one queue.
    As an alternative, you can set the queue processing in such a way that each order is processed in a separate queue. As a result, an individual order can no longer block the processing of other orders if an upload problem has occurred.
    If you prefer this queue processing, go to transaction SM30 and make the following change in the SMOFQFIND table:
    Select the BUS_TRANS_MSG BDoc type and change the segment field name from QUEUE_NAME to OBJECT_ID.
    In the same way, you can also set the queues for the delta download in the R/3 back-end system in such a way that each order is processed in a separate queue. If you prefer this queue processing, go to transaction SE16 in the R/3 back-end system and make the following change in the CRMQNAMES table:
    Select the entry for the SALESDOCUMENT object and change the BAPIFLD field from SOLD_TO to DOC_NUMBER (with BAPIOFFSET=3 and BAPIFLDLEN=10). Leave the second entry for the SALESDOCUMENT object (with QOBJPART=SAL_ERR) unchanged.
    In transaction SMQR, check to see whether the queues have been registered or check transaction SMQS to see whether the destinations have been registered because otherwise, the queues are not processed automatically, and this can lead to queue overloads.
    Check the queues regularly.
    Composite SAP Note 504090 covers all notes that solve known problems in the transfer as of Support Package 06 (SP06).
    Document cannot be maintained in online mode
    If you cannot maintain a document, this can have various reasons. Basically, a sales document entered in CRM is locked until the R/3 System has confirmed the update of the order successfully.
    If message CRM_ORDER019 "Document will be distributed - changes are not possible" occurs in CRM, check the queues (transaction SMQ1 and SMQ2). To analyze the data exchange from CRM to R/3, refer to note 431345.
    If message CRM_ORDER013 "Transaction &1 is being processed by user &2" occurs in CRM or if message V1042 "Sales document &1 is currently being processed (by user &2)" occurs in R/3, the document is processed in the other system respectively. To avoid inconsistencies, a cross-system lock is set during the processing of a replicated transaction so that the document cannot be processed simultaneously in two systems.
    Other notes
    Only error-free sales documents are distributed to the R/3 System. If, in R/3, you change a sales document that was originally created in CRM, these changes are not transferred to CRM. That is, you should always make the changes in the original CRM document to ensure the consistency of the document data in both systems. Sales documents entered in the R/3 System are transferred to CRM, but they are locked for processing there. Changes to a document created in R/3 are also transferred to CRM.
    In your settings for the data exchange, also make sure that the document number ranges correspond in both systems. For the successful sales document exchange between the systems, the transaction types and item categories have to be created in exactly the same way in both systems. If these objects do not exist in one system, you have to create them manually.
    In transaction CRMM_BUPA_MAP, you can determine into which R/3 customer number the CRM business partner is converted and vice versa. If you do not receive a conversion for the specified business partner here, this indicates that a transfer problem has not occurred in the sales document but during the business partner download.
    Header Data
    Release Status: Released for Customer
    Released on: 02.05.2006  15:04:13
    Priority: Recommendations/additional info
    Category: Consulting
    Primary Component: CRM-BTX-BF-IF R/3 Interface for Business Transactions

  • Sending goods error in sales order

    Hi guru ,
    i am facing one error in sales process in sap sd, that error , i am sending the goods to  the customer , conforms  quantity  5  that system send to customer 10 quantity  , what is happened here , and what will i do sir  , plz tell me sir

    Hello,
    Check the change log in Delivery
    Menu: Environment --> changes
    Check if anybody has changed the delivery qty in delivery manually.
    Also check your picking qty, GI qty in your material document..
    thank you
    Venkatesh

  • Change Bapi Wrapper

    when creating CHANGE bapi wrapper , is there any rule that should follows
    Except the rule define below, is there any rule/logic define  inside the function?
    Import – Structure to hold the BO header data being modified
    Tables – Table(s) to hold the list(s) of associated item data, which are used to replace (add/modify/delete) the item data
    “RETURN” as Export or Tables parameter
    i have read somewhere, that in the change bapi wrapper,i need to replace the existing rows...
    my problem is when i modify the value
    <b><u>0001</u> Abu   1 </b>
    change to
    <b><u>0001</u> Abu   2</b>
    after i sync
    <u>0002</u> Abu 1   <<---data is not modified and syncKey changed
    i new syncKey created and i check merep_10100 the old synckey eg: 0001 rows is deleted and new syncKey 0002 is created.
    Is this the change bapi wrapper logic error ?
    Message was edited by:
            yzme yzme
    Message was edited by:
            yzme yzme

    i think i have difficulties understand you  "raam"....
    can you explain more......
    the post that i post earlier is an example to make it simple for ppl to understand .
    the real data is down here.
    <b><u>Change Bapi Wrapper</u></b>
    FUNCTION zemi_am_p2p_v1.
    *"*"Local interface:
    *"  IMPORTING
    *"     VALUE(AM_DATA) LIKE  ZASTMS STRUCTURE  ZASTMS
    *"  EXPORTING
    *"     VALUE(RETURN) LIKE  BAPIRET2 STRUCTURE  BAPIRET2
    *"  TABLES
    *"      AM_DETAILS STRUCTURE  ZASTMS OPTIONAL
      DATA : v_date LIKE sy-datum,
             var1 LIKE  balm-msgv1,
             var2 LIKE  balm-msgv2.
      REFRESH : bdcdata, messtab.
      CLEAR : bdcdata, messtab, v_date.
    *v_msg,
      CONCATENATE am_data-anln1 am_data-werks am_data-stort sy-datum sy-uzeit INTO zztable-char100
      SEPARATED BY space.
      INSERT zztable.
      SELECT SINGLE * FROM anla WHERE anln1 = am_data-anln1
                                  AND bukrs = '1000'.
      SELECT SINGLE * FROM anlz WHERE anln1 = am_data-anln1
                                  AND bukrs = '1000'.
      SELECT SINGLE * FROM anlh WHERE anln1 = am_data-anln1
                                  AND bukrs = '1000'.
      CONCATENATE   anla-aktiv+6(02)  anla-aktiv+4(02) anla-aktiv(04) INTO v_date.
    call function 'ZBAPI_AM_P2P'
       exporting
         v_anln    = anla-anln1
         v_stort   = am_data-stort
          v_txt50   = anla-txt50
          v_anlhtxt = anlh-anlhtxt
          v_kostl   = anlz-kostl
          v_werks   = anlz-werks
          v_date    = v_date.
    *    importing
    *v_msg     = v_msg.
      APPEND am_data TO am_details.
    ENDFUNCTION.
    FUNCTION zbapi_am_p2p.
    *"*"Local interface:
    *"  IMPORTING
    *"     VALUE(V_ANLN) LIKE  ANLA-ANLN1 OPTIONAL
    *"     VALUE(V_STORT) LIKE  ANLZ-STORT OPTIONAL
    *"     VALUE(V_TXT50) LIKE  ANLA-TXT50 OPTIONAL
    *"     VALUE(V_ANLHTXT) LIKE  ANLH-ANLHTXT OPTIONAL
    *"     VALUE(V_KOSTL) LIKE  ANLZ-KOSTL OPTIONAL
    *"     VALUE(V_WERKS) LIKE  ANLZ-WERKS OPTIONAL
    *"     VALUE(V_DATE) LIKE  SY-DATUM OPTIONAL
    *"  EXPORTING
    *"     VALUE(V_MSG) TYPE  STRING
      DATA :  var1 LIKE  balm-msgv1,
              var2 LIKE  balm-msgv2.
      PERFORM open_group.
      PERFORM bdc_dynpro      USING 'SAPLAIST' '0100'.
      PERFORM bdc_field       USING 'BDC_OKCODE' '=MAST'.
      PERFORM bdc_field       USING 'ANLA-ANLN1' v_anln.
      PERFORM bdc_field       USING 'ANLA-ANLN2' '0'.
      PERFORM bdc_field       USING 'ANLA-BUKRS' '1000'.
      PERFORM bdc_dynpro      USING 'SAPLAIST' '1000'.
      PERFORM bdc_field       USING 'BDC_OKCODE' '=TAB02'.
      PERFORM bdc_field       USING 'ANLA-TXT50' v_txt50.
      PERFORM bdc_field       USING 'ANLH-ANLHTXT' v_anlhtxt.
      PERFORM bdc_field       USING 'ANLA-AKTIV' v_date.
      PERFORM bdc_dynpro      USING 'SAPLAIST' '1000'.
      PERFORM bdc_field       USING 'BDC_OKCODE' '=BUCH'.
      PERFORM bdc_field       USING 'ANLZ-KOSTL' v_kostl.
      PERFORM bdc_field       USING 'ANLZ-WERKS' v_werks.
      PERFORM bdc_field       USING 'ANLZ-STORT' v_stort.
      PERFORM bdc_dynpro      USING 'SAPLAIST' '3020'.
      PERFORM bdc_field       USING 'BDC_OKCODE' '=YES'.
      CALL TRANSACTION 'AS02' USING bdcdata MODE 'N'
                                            UPDATE 'S'
                                            MESSAGES INTO messtab.
      PERFORM close_group.
      READ TABLE messtab INDEX 1.
      MOVE messtab-msgv1 TO var1.
      MOVE messtab-msgv2 TO var2.
      CLEAR v_msg.
      CALL FUNCTION 'MESSAGE_PREPARE'
           EXPORTING
               language               = 'E'
                msg_id                 = messtab-msgid
                msg_no                 = messtab-msgnr
                msg_var1               = var1
                msg_var2               = var2
    *         MSG_VAR3               = ' '
    *         MSG_VAR4               = ' '
          IMPORTING
               msg_text               = v_msg
           EXCEPTIONS
                function_not_completed = 1
                message_not_found      = 2
                OTHERS                 = 3.
    ENDFUNCTION.
    <b><u>GetDetails Bapi Wrapper</u></b>
    FUNCTION ZBAPI_AM_DETAILS_V1.
    *"*"Local interface:
    *"  IMPORTING
    *"     VALUE(DATA_ANLN1) LIKE  ZASTMS-ANLN1 OPTIONAL
    *"  EXPORTING
    *"     VALUE(RETURN) LIKE  BAPIRET2 STRUCTURE  BAPIRET2
    *"     VALUE(AM_DATA) LIKE  ZASTMS STRUCTURE  ZASTMS
    *"  TABLES
    *"      AM_DETAILS STRUCTURE  ZASTMS OPTIONAL
      DATA : BEGIN OF it_return OCCURS 0,
       mandt like anla-mandt,
       bukrs LIKE anlz-bukrs,
       anln1 LIKE anlz-anln1,
       anln2 LIKE anlz-anln2,
       kostl LIKE anlz-kostl,
       werks LIKE anlz-werks,
       stort LIKE anlz-stort,
       txt50 LIKE anla-txt50,
       txa50 LIKE anla-txa50,
       END OF it_return.
      SELECT SINGLE * INTO CORRESPONDING FIELDS OF it_return
      FROM anla AS a INNER JOIN anlz AS b
      ON a~bukrs = b~bukrs AND
         a~anln1 = b~anln1 AND
         a~anln2 = b~anln2
      WHERE
      a~anln1 = DATA_ANLN1
    * AND   b~kostl = data-kostl
    * AND   b~anln1 = DATA_ANLN1
      AND   b~werks = '1000'
      AND   b~bukrs = '1000'
      and   b~bdatu = '99991231'.
    * AND   b~anln2 = data-anln2.
      APPEND it_return.
      SORT it_return BY anln1.
      DELETE ADJACENT DUPLICATES FROM it_return COMPARING ALL FIELDS.
      am_details[] = it_return[].
    ENDFUNCTION.
    <?xml version="1.0" encoding="utf-8" ?>
    - <MeRepApplication schemaVersion="1.1" id="ZAM_03" version="03">
      <Property name="CLIENT.BUILDNUMBER" />
      <Property name="C_APPLRESOLVE" />
      <Property name="DATA_VISIBLE_SHARED">X</Property>
      <Property name="E_APPLRESOLVE" />
      <Property name="FACADE_C_CLIENT">X</Property>
      <Property name="FACADE_E_CLIENT">X</Property>
      <Property name="HOMEPAGE.INVISIBLE" />
      <Property name="INITVALUE" />
      <Property name="RUNTIME">JSP</Property>
      <Property name="TYPE">APPLICATION</Property>
    - <SyncBO id="ZAM_03" version="1" type="twoWay" allowCreate="false" allowModify="true" allowDelete="false" reqDirectSync="true" downloadOrder="1">
    - <TopStructure name="TOP">
    - <Field name="SYNC_KEY" type="N" length="10" decimalLength="0" signed="false" isKey="true" isIndex="true">
      <Input type="create">false</Input>
      <Input type="modify">false</Input>
      </Field>
    - <Field name="ANLN1" type="C" length="12" decimalLength="0" signed="false" isKey="false" isIndex="false">
      <Input type="create">false</Input>
      </Field>
    - <ChildStructure name="010">
    - <Field name="SYNC_KEY" type="N" length="10" decimalLength="0" signed="false" isKey="true" isIndex="true">
      <Input type="create">false</Input>
      <Input type="modify">false</Input>
      </Field>
    - <Field name="BUKRS" type="C" length="4" decimalLength="0" signed="false" isKey="false" isIndex="false">
      <Input type="create">false</Input>
      </Field>
    - <Field name="ANLN1" type="C" length="12" decimalLength="0" signed="false" isKey="false" isIndex="false">
      <Input type="create">false</Input>
      </Field>
    - <Field name="ANLN2" type="C" length="4" decimalLength="0" signed="false" isKey="false" isIndex="false">
      <Input type="create">false</Input>
      </Field>
    - <Field name="KOSTL" type="C" length="10" decimalLength="0" signed="false" isKey="false" isIndex="false">
      <Input type="create">false</Input>
      </Field>
    - <Field name="WERKS" type="C" length="4" decimalLength="0" signed="false" isKey="false" isIndex="false">
      <Input type="create">false</Input>
      </Field>
    - <Field name="STORT" type="C" length="10" decimalLength="0" signed="false" isKey="false" isIndex="false">
      <Input type="create">false</Input>
      </Field>
      </ChildStructure>
      </TopStructure>
      </SyncBO>
      </MeRepApplication>

  • Error while creating/changing/desplay cost element

    Gents
    Need urgent help. I am getting a below error while creating/changing/Displaying the cost element.
    Table CI_CSKB is not an active table
    Message no. AD 228
    Kindly help me to get the resolve this issue.
    Thanks and Regards
    Vinay Thakre

    hi
    In Cost Elements (Data is Dependent on Controlling Area), please go to extras and check your controlling area while creating the cost element, and make sure if u r creating Primary CE, it has been created as a G/L account and also make sure you use correct CE Category.
    Thanks
    plz award points if helpful.

  • URGENT: Error while creating a BAPI

    Hi all !!
    I am facing the below mentioned error while creating a BAPI , to be more specific , the error comes when i try adding a new method by using
    Utilities > API method > add a method
    on after adding a function modile name in there, when i click on the tick mark..
    It shows an error as in :
    BAPI &1 : BAPI function module &2 has no return parameter
    Please help in resolving the same !!
    Thanks & Regards
    Gaurav Verma
    Edited by: Gaurav Verma on Feb 13, 2008 11:52 AM

    Hi,
    cehck the below link how to create a bapi and add as method..
    http://www.sapdev.co.uk/java/jco/bapi_jco.pdf
    Regards,
    Nagaraj

  • Error message when changing from portrait to landscape when printing

    I receive an error message when changing from portrait to landscape when trying to print.  How do I resolve this issue?

    Hi hillclimbing,
    Can you please let me know the exact error message you see as that would be helpful.
    Does this occur with all the pdf files.
    What OS and Acrobat version are you using?
    Regards,
    Rave

  • The application detected an error that prevents changes from being saved.

    Hi. I'm having this problem almost all the time when I do some color correction.
    "The application detected an error that prevents changes from being saved. To avoid losing your work, quit Final Cut Pro."
    Any ideas why this is happening?
    I'm on a 2010 Mac Pro running latest Mavericks and latest FCP X.
    I already removed FCP X, and all the effects I have installed. But still the issue persists.
    Thanks.

    That could have happened. I can't remember though.
    Is there any work around?
    I currently only have 1 open library and 1 event on it. If I move or copy that event into a new library, would that in theory work?
    Thanks for the help so far.

Maybe you are looking for

  • Catalog not working Windows 8.1 - Elements 11

    I have repeatedly built catolgs of over 5000 images but only less than a dozen show in the organizer view.  Using identical photos and even directory structure I have had no issues using the same elements disc installation on a Windowe 7 machine.

  • HFM 9.3.1.04 Patch

    Where will I get the HFM 9.3.1.04 patch and how will this be updated. What are the steps to update HFM 9.3.1 to 9.3.1.04? Thank you.

  • Iterrate through an array of files

    I am having trouble with the following program, making to iterate through an array of three files, that are placed in a directory below the program directory. What I would like my program to do is to read 10 lines of each of the files in the subdirec

  • Is there a program that can replace entourage?

    I tried to install entourage to my computer because i got a new macbook, and to my suprise now i have to have a premium account to use it. And i dont feel like paying the 30 dollars for it, so if someone knows a program to replace entourage or how to

  • My music isnt showing up in Itunes

    I have downloaded the new iTunes and am trying to add music.  I have tried dragged and dropping, add file and add folder, it shows that it is adding music however when it is finshed there is no music anywhere ??