Field catalog for pricing condition not present

Hi experts,
i want to create a princing condition so for this i have to add one field to structure KOMPAZ. So, i have included required field (manufacturer) in this customer structure KOMPAZ but even with this modification I can't see manufacturer field in field catalog (t-code V/03)
Why??
Please someone help me.
Any help would be apppreciated.

Hi
SPRO--> u2018Sales and Distribution -> Basic Functions -> Pricing -> Pricing Controlu2019 and execute u2018Define Condition Tablesu2019. Choose u2018Conditions: Allowed fieldsu2019 and include Conditions: Allowed fieldsu2019 and include (Customized "Manufacturer" ) Field as a new entry.
Now you can use field (Customized "Manufacturer" ) as a key field when you create a condition table
Further Info refer the URL Below
[  Add New Fields To Field Catalog |http://sapsdforum.com/2007/10/23/pricing-in-sd-in-great-detail/]

Similar Messages

  • Newly-added field  missing in the field catalog  for NR00

    I  am about to creat condition record for condition type NR00 free goods . I need to make some customizing to meet our requirement .So  I changed  the field catalog for the condition table by adding a new field BWAST  (purchasing document type) . After that I am going to creat a new condition table 501 with this newly-added field ,but I can't find the field in the right part for field catalog .
    Can you give me some advice ?   Thank you in advance.

    I 've got the answers ,  
    Note 21040 - Allowed Fields not appearing for condition table
    thaks

  • Creation of Customized field for  Pricing Condition tables

    Hi Friends
    I have a requirement to create a  Pricing condition table with Customized field starts with 'Z'  and
    Field length should be more than 80.
    After creating New Customized Field, system  is not allowing to create Pricing Condition table and giving error 'Too Many fields selected (larger than 100 bytes)'.
    Could you please advice how to over come this error and Maximum field to create Pricing  condition table .
    Thanks
    Ravi

    Hi there,
    Table & table attributes are defined by the ABAPers. Not by finctional consultants.
    You need to have an access key to define new tables & access sequence.
    Check with your ABAPer. He will be able to help you with that.
    Regards,
    Sivanand

  • Mandatory Fields for IDOC ORDERS01 for Pricing Condition EDI1 to trigger

    Hi ,
    I'm Testing an Inbound ORDRSP using we 19  for Pricing Conditions EDI1. What are the Mandatory Fields for IDOC ORDERS01
    Thanks

    hello,
    I think it's better to execute VA01 to create a sales order; in that way you should have an idea of mandatory fields.
    Thanks.

  • Receive "The page cannot be displayed" for Pricing Conditions

    To all,
    I receive the message "The page cannot be displayed" for Pricing Conditions when I select the "Accesses" button.  I then received the message "HTML field saved to C:\temp\CRM_IPC.html". 
    This only seems to happen when using the pricing in the service order confirmation.

    Hi Bob,
    R u using IPC for pricing, if yes just check the connections to the IPC server.
    The error is because of the IPC connection not getting established.
    <b>Please reward points if it helps.</b>
    Regards,
    Amit Mishra

  • Function module to change the value for pricing condition type

    Hello experts,
    I want to change the value for pricing condition type for an item in the transaction CRMD_ORDER.
    I used many function modules but none are working.
    Please kindly suggest a function module that will change the value for a condition type .
    I have used the following function module but its not working, please correct the coding if anything needs to be changed or added. Please help me .
    Thank you.
    CLEAR PRCD_COND.
         SELECT SINGLE * FROM PRCD_COND WHERE KPOSN = WA_ORDERADM_I-GUID AND
                                              KSCHL = COND_TY.
      IF SY-SUBRC = 0.
    *    MOVE-CORRESPONDING PRCD_COND TO L_COND_CHG.
    *    CLEAR L_COND_CHG-KBETR.
        L_COND_CHG-STUNR = PRCD_COND-STUNR.
        L_COND_CHG-KBETR = COND_PRC.
    *    L_COND_CHG-KSCHL = COND_TY.
        INSERT L_COND_CHG INTO TABLE T_COND_CHG.
    L_HEAD_GUID = CRMD_ORDERADM_H-GUID.
    L_ITEM_GUID = WA_ORDERADM_I-GUID.
    INSERT L_HEAD_GUID INTO TABLE HEAD_GUID.
    INSERT L_ITEM_GUID INTO TABLE ITEM_GUID.
        CALL FUNCTION 'CRM_ORDER_READ'
         EXPORTING
           IT_HEADER_GUID                    = HEAD_GUID
           IT_ITEM_GUID                      = ITEM_GUID
         IMPORTING
           ET_ORDERADM_H                     = LT_ORDERADM_H
           ET_ORDERADM_I                     = LT_ORDERADM_I
           ET_PRIDOC                         = IT_PRIDOC_RD
           ET_DOC_FLOW                       = T_DOC_FLOW
    *     CHANGING
    *       CV_LOG_HANDLE                     =
    *     EXCEPTIONS
    *       DOCUMENT_NOT_FOUND                = 1
    *       ERROR_OCCURRED                    = 2
    *       DOCUMENT_LOCKED                   = 3
    *       NO_CHANGE_AUTHORITY               = 4
    *       NO_DISPLAY_AUTHORITY              = 5
    *       NO_CHANGE_ALLOWED                 = 6
    *       OTHERS                            = 7
        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-CORRESPONDING LS_PRIDOC_RD TO L_PRI_COND.
    INSERT L_PRI_COND INTO TABLE PRI_COND.
    LOOP AT IT_PRIDOC_RD INTO LS_PRIDOC_RD.
    MOVE-CORRESPONDING LS_PRIDOC_RD TO L_PRIDOC_CHG.
    L_PRIDOC_CHG-PRIC_COND = PRI_COND.
    L_PRIDOC_CHG-REF_GUID = LS_PRIDOC_RD-GUID.
    L_PRIDOC_CHG-COND_CHANGE = T_COND_CHG.
    INSERT L_PRIDOC_CHG INTO TABLE PRIDOC_CHG.
    ENDLOOP.
    LOOP AT LT_ORDERADM_H INTO LS_ORDERADM_H .
    MOVE-CORRESPONDING LS_ORDERADM_H TO L_HEADER.
    INSERT L_HEADER INTO TABLE HEADER.
    ENDLOOP.
    LOOP AT LT_ORDERADM_I INTO LS_ORDERADM_I.
    MOVE-CORRESPONDING LS_ORDERADM_I TO L_ITEM.
    INSERT L_ITEM INTO TABLE ITEM.
    ENDLOOP.
    L_FIELD-FIELDNAME = 'STUNR'.
    INSERT L_FIELD INTO TABLE FIELD.
    L_FIELD-FIELDNAME = 'KBETR'.
    L_FIELD-CHANGEABLE = 'X'.
    INSERT L_FIELD INTO TABLE FIELD.
    L_INPUT-FIELD_NAMES = FIELD.
    L_INPUT-REF_KIND = 'E'.
    L_INPUT-REF_GUID = LS_PRIDOC_RD-GUID.
    L_INPUT-OBJECTNAME = 'PRIDOC'.
    INSERT L_INPUT INTO TABLE INPUT.
        CALL FUNCTION 'CRM_ORDER_MAINTAIN'
         EXPORTING
           IT_PRIDOC                     = PRIDOC_CHG
         IMPORTING
           ET_EXCEPTION                  = EXCEPT
         CHANGING
           CT_INPUT_FIELDS               = INPUT.
        IF SY-SUBRC <> 0.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
        ENDIF.
    REFRESH EXCEPT.
    CALL FUNCTION 'CRM_ORDER_SAVE'
      EXPORTING
        IT_OBJECTS_TO_SAVE         = HEAD_GUID
    *   IV_UPDATE_TASK_LOCAL       = FALSE
    *   IV_SAVE_FRAME_LOG          = FALSE
    *   IV_NO_BDOC_SEND            = FALSE
    *   IT_ACTIVE_SWITCH           =
    IMPORTING
       ET_SAVED_OBJECTS           = SAVED
       ET_EXCEPTION               = EXCEPT
       ET_OBJECTS_NOT_SAVED       = UNSAVED
    * CHANGING
    *   CV_LOG_HANDLE              =
    * EXCEPTIONS
    *   DOCUMENT_NOT_SAVED         = 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.
    COMMIT WORK AND WAIT.

    Hi,,
    To be able to call a function module in an update work process, you must flag it in the Function Builder. When you create the function module, set the Process Type attribute to Update with immediate start
    Alternatively u can use this function module.
    CRM_STATUS_DATA_SAVE_DB
    BAPI_CUSTOMERCRM_CHANGE (If u wish to use a bapi for this).
    Also , Let me know what error you got when implementing other function module.Does the function module didnt return any error but still the value is not changed for pricing condition type?

  • Build field catalog for dynamic data objects

    Hi
    Could you please tell me how to build a field catalog (ooops alv)  for an internal table which is a dynamic data object.
      TYPES: BEGIN OF t_addsubty,
             subty TYPE subty,
             pernr TYPE persno,
             END OF t_addsubty.
      TYPES: ty_addsubty type t_addsubty occurs 1.
    i have data object using these
            CREATE DATA dref3 TYPE (g_type1).
            ASSIGN dref3->* TO <fs_dp>.
    where g_type1 refers a data type which i defined in the program. g_type1 = ty_addsubty. 
    now <fs_dp> refers to an internal table.
    now i want to build a field catalog for this internal table.
    In my program <fs_dp> structure is not always the same. i.e now it is ty_addsubty but for some other conditions the structure is different.
    please help me out.
    regards
    badri

    Here some piece of code, which shows how it works:
    <SNIP>
    type-pools:
         abap.
    DATA:
      lr_tabledescr          TYPE REF TO cl_abap_tabledescr,
      lr_structdescr     TYPE REF TO cl_abap_structdescr.
    field-symbols:
      <lw_component>     type abap_compdescr_tab.
    TYPES:
         BEGIN OF t_addsubty,
              subty TYPE subty,
              pernr TYPE persno,
         END OF t_addsubty.
    TYPES:
         ty_addsubty type t_addsubty occurs 1.
    CREATE DATA dref3 TYPE (g_type1).
    ASSIGN dref3->* TO <fs_dp>.
    lr_tabledescr ?= cl_abap_tabledescr=>describe_by_data( <fs_dp> ).
    assert condition lr_tabledescr is bound.
    lr_structdescr ?= lr_tabledescr->get_table_line_type( ).
    loop at lr_structdescr->components assigning <lw_component>.
    *     do whatever you want with the information about
    *     the components of the structure
    endloop.
    </SNIP>
    Do not forget to reward points...

  • Use of field TEXT_FIELDNAME in Field Catalog for ALV

    Hi Experts,
    Could any one pls  tell me the relevance (purpose) of the field TEXT_FIELDNAME in Field catalog for an ALV ?
    How is it different from the fields such as seltext_l, seltext_m, seltext_s ? When is it necessary to assign a value to this field ?
    Thanks & Regards
    Abhijith

    Hi Abhijit
    Refer to the following
    <b>TEXT_FIELDNAME :</b>     Field name of internal table field. You can use this field to define a reference to a field that is used as the description for the current field. If a subtotal is calculated for the current field, the ALV Grid Control displays the descriptions in the field assigned.
    Example: Your output table contains one column for material numbers and one column for the description of what these numbers mean (such as clockwork). If you calculate subtotals for the material numbers, only these numbers are usually displayed as the subtotals text. Based on the link to TXT_FIELD , you can refer to the corresponding column with the material description. This description is then used as the subtotals text.
    <b>SELTEXT_L :</b>      Long key word (40 chars long). Determines the text to be used in the column selection for the column. A value should be assigned to this field if it does not have a Data Dictionary reference.
    <b>SELTEXT_M   :</b>        Medium key word (20 chars long). Determines the text to be used in the column selection for the column. A value should be assigned to this field if it does not have a Data Dictionary reference.
    <b>SELTEXT_S :</b>     Short key word (10 chars long). Determines the text to be used in the column selection for the column. A value should be assigned to this field if it does not have a Data Dictionary reference.
    Award points if found useful.
    Regards
    Inder

  • Add a custom table for field selection while creating field catalog for LIS

    Hi,
    I have a requirement to add a Custom table to be available for field selection while creating a field catalog for LIS. Its required as there are many custom fields to be used for field catalog creation and adding them in one of the existing tables listed is not a feasible option for us. Please let me knw if its possible..?? If yes how to get it done..??
    Regards,
    Akash Sinha

    hi,
    You need to add your field in the Data Dictionary first. For example, if
    you want the new field in the Order Item field catalog do the following.
    Look at structure MCVBAPUSR (SE11). If you already have a user structure
    appended to this structure then you can add your new field to your existing
    structure. If there is no structure already appended to MCVBAPUSR then you
    must create a new structure with your field in it and then append the new
    structure to this one.
    If you look at structure MCVBAP you will see the data appended to the end
    of it.
    Now you should see it in the field catalog.
    regards,
    balajia

  • Field catalog & internal table are not mutually convertible

    Hi friends,
              please help me for this problem, actually i m trying to display three alv reports from the three buttond i have given on my first basic report. its working fine till first & getting the data into the internal table for the second also. but when coming to the field catalog for the second report its giving syntax error as my "field catalog and internal table are not mutually convertible'".i have tried by giving different fieldcatalog also but its giving the same problem.please help for this & try to give an example if u can. Thanks a lot.
    Regards
    Pankaj

    This is my code :
    TABLES: PLAF,
            MARA,
            MAKT,
            AFPO,
            T023T,
            VSAUFK,
            T006A,
            MBEW,
            ZCDR_D.
    Type Pools for ALV *************************
    TYPE-POOLS: SLIS,
                ABAP.
               KKBLO.
    DATA DECLARATION.  ****************************
    DATA: FLAG TYPE I,
          FLAG1 TYPE I,
          FLAG2 TYPE I,
          FLAG3 TYPE I,
          FLAG4 TYPE I,
          FLAG5 TYPE I.
    ********Declaration for field catalog
    DATA: LAYOUT TYPE SLIS_LAYOUT_ALV,
          IT_FIELDCAT TYPE SLIS_T_FIELDCAT_ALV,
        IT_SORT TYPE SLIS_T_SORTINFO_ALV,
        WA_SORT TYPE SLIS_SORTINFO_ALV,
        WA_SUBT LIKE SLIS_EV_SUBTOTAL_TEXT,
        IT_EVENTS TYPE TABLE OF slis_alv_event WITH NON-UNIQUE DEFAULT KEY
         WITH HEADER LINE INITIAL SIZE 0,
          WA_FIELDCAT TYPE SLIS_FIELDCAT_ALV,
          LAYOUT1 TYPE SLIS_LAYOUT_ALV,
          IT_FIELDCAT1 TYPE SLIS_T_FIELDCAT_ALV,
        IT_SORT TYPE SLIS_T_SORTINFO_ALV,
        WA_SORT TYPE SLIS_SORTINFO_ALV,
        WA_SUBT LIKE SLIS_EV_SUBTOTAL_TEXT,
        IT_EVENTS TYPE TABLE OF slis_alv_event WITH NON-UNIQUE DEFAULT KEY
         WITH HEADER LINE INITIAL SIZE 0,
          WA_FIELDCAT1 TYPE SLIS_FIELDCAT_ALV,
          LAYOUT2 TYPE SLIS_LAYOUT_ALV,
          IT_FIELDCAT2 TYPE SLIS_T_FIELDCAT_ALV,
        IT_SORT TYPE SLIS_T_SORTINFO_ALV,
        WA_SORT TYPE SLIS_SORTINFO_ALV,
        WA_SUBT LIKE SLIS_EV_SUBTOTAL_TEXT,
        IT_EVENTS TYPE TABLE OF slis_alv_event WITH NON-UNIQUE DEFAULT KEY
         WITH HEADER LINE INITIAL SIZE 0,
          WA_FIELDCAT2 TYPE SLIS_FIELDCAT_ALV,
          LAYOUT3 TYPE SLIS_LAYOUT_ALV,
          IT_FIELDCAT3 TYPE SLIS_T_FIELDCAT_ALV,
        IT_SORT TYPE SLIS_T_SORTINFO_ALV,
        WA_SORT TYPE SLIS_SORTINFO_ALV,
        WA_SUBT LIKE SLIS_EV_SUBTOTAL_TEXT,
        IT_EVENTS TYPE TABLE OF slis_alv_event WITH NON-UNIQUE DEFAULT KEY
         WITH HEADER LINE INITIAL SIZE 0,
          WA_FIELDCAT3 TYPE SLIS_FIELDCAT_ALV.
    TYPES DECLARATION.  ****************************
    TYPES: BEGIN OF TY_MARA,
           MATNR LIKE MARA-MATNR,                  " Material Number
           MATKL LIKE MARA-MATKL,                  " Material Group
           END OF TY_MARA.
    TYPES: BEGIN OF TY_PLAF,
           PERTR LIKE PLAF-PERTR,                  " Date
           PLNUM LIKE PLAF-PLNUM,                  " Planned Order Number
           MATNR LIKE PLAF-MATNR,                  " Material number
           PLWRK LIKE PLAF-PLWRK,                  " Plant
           KDAUF LIKE PLAF-KDAUF,                  " Sales Order Number
           KDPOS LIKE PLAF-KDPOS,                  " SO Line Item
           END OF TY_PLAF.
    TYPES: BEGIN OF TY_MAKT,
           MATNR LIKE PLAF-MATNR,                  " Material Number
           MAKTX LIKE MAKT-MAKTX,                  " Material Description
           END OF TY_MAKT.
    TYPES: BEGIN OF TY_AFPO,
           PLNUM LIKE AFPO-PLNUM,                  " Planned Order Number
           MATNR LIKE AFPO-MATNR,                  " Material Number
           KDAUF LIKE AFPO-KDAUF,                  " Sales Order Number
           KDPOS LIKE AFPO-KDPOS,                  " SO Line Item
           AUFNR LIKE AFPO-AUFNR,                  " Production Order
           STRMP LIKE AFPO-STRMP,
           DWERK LIKE AFPO-DWERK,
           END OF TY_AFPO.
    TYPES: BEGIN OF TY_ZCDR_D,
           MANDT LIKE ZCDR_D-MANDT,                " Client
           CBNO LIKE ZCDR_D-CBNO,                  " Customs Book Number
           PLNUM LIKE ZCDR_D-PLNUM,                " Planned Order Number
           MATNR LIKE ZCDR_D-MATNR,                " Material Number
           MAKTX LIKE ZCDR_D-MAKTX,                " Material Description
           KDAUF like ZCDR_D-KDAUF,                " Sales Order Number
           KDPOS like ZCDR_D-KDPOS,                " SO Line Item
           AUFNR LIKE ZCDR_D-AUFNR,                " Production Order
           END OF TY_ZCDR_D.
    TYPES: BEGIN OF TY_VSAUFK,
           INACT LIKE VSAUFK-INACT,                " Status Indicator
           END OF TY_VSAUFK.
    TYPES: BEGIN OF TY_PLAF_MAKT,
           CBNO LIKE ZCDR_D-CBNO,                  " Customs Book Number
           PLNUM LIKE PLAF-PLNUM,                  " Planned Order Number
           CHK TYPE C,                             " Check Box
           MATNR LIKE PLAF-MATNR,                  " Material Number
           MAKTX LIKE MAKT-MAKTX,                  " Material Description
           KDAUF LIKE PLAF-KDAUF,                  " Sales Order Number
           KDPOS LIKE PLAF-KDPOS,                  " SO Line Item
           AUFNR LIKE AFPO-AUFNR,                  " Production Order
           END OF TY_PLAF_MAKT.
    TYPES: BEGIN OF TY_HELP_ITEM,
           CBNO TYPE ZCDR_D-CBNO,                  " Customs Book Number
           PLNUM LIKE ZCDR_D-PLNUM,                " Planned Order Number
           MATNR LIKE ZCDR_D-MATNR,                " Material Number
           MAKTX LIKE ZCDR_D-MAKTX,                " Material Description
           KDAUF LIKE ZCDR_D-KDAUF,                " Sales Order Number
           KDPOS LIKE ZCDR_D-KDPOS,                " SO Line Item
           AUFNR LIKE ZCDR_D-AUFNR,                " Production Order
           END OF TY_HELP_ITEM.
    WORK AREA ******************************
    DATA: WA_MARA TYPE TY_MARA,
          WA_PLAF TYPE TY_PLAF,
          WA_MAKT TYPE TY_MAKT,
          WA_AFPO TYPE TY_AFPO,
          WA_ZCDR_D TYPE TY_ZCDR_D,
          WA_VSAUFK TYPE TY_VSAUFK,
          WA_PLAF_MAKT TYPE TY_PLAF_MAKT,
          WA_HELP_ITEM TYPE TY_HELP_ITEM.
    INTERNAL TABLES ****************************
    DATA: IT_MARA TYPE TABLE OF TY_MARA,
          IT_PLAF TYPE TABLE OF TY_PLAF,
          IT_MAKT TYPE TABLE OF TY_MAKT,
          IT_AFPO TYPE TABLE OF TY_AFPO,
          IT_ZCDR_D TYPE TABLE OF TY_ZCDR_D,
          IT_VSAUFK TYPE TABLE OF TY_VSAUFK,
          IT_PLAF_MAKT TYPE TABLE OF TY_PLAF_MAKT,
          IT_HELP_ITEM TYPE TABLE OF TY_HELP_ITEM.
    *it_events TYPE TABLE OF slis_alv_event WITH NON-UNIQUE DEFAULT KEY
    *WITH HEADER LINE INITIAL SIZE 0.
    TYPES: BEGIN OF TY_BOM,
              MATMK LIKE STPOX-MATMK,
              MTNRV LIKE ZCDR_D-MATNR,
              IDNRK LIKE STPOX-IDNRK,
              MNGLG LIKE STPOX-MNGLG,
              MMEIN LIKE STPOX-MMEIN,
             VPRSV LIKE STPOX-VPRSV,
              UPRICE LIKE MBEW-STPRS,
              TPRICE LIKE MBEW-STPRS,
            END OF TY_BOM,
            BEGIN OF TY_QUAN,
              MATMK LIKE STPOX-MATMK,
              MTNRV LIKE ZCDR_D-MATNR,
              IDNRK LIKE STPOX-IDNRK,
              MNGLG LIKE STPOX-MNGLG,
              MMEIN LIKE STPOX-MMEIN,
              UPRICE LIKE MBEW-STPRS,
              TPRICE LIKE MBEW-STPRS,
            END OF TY_QUAN,
            BEGIN OF TY_T023T,
              MATKL LIKE T023T-MATKL,
              WGBEZ LIKE T023T-WGBEZ,
            END OF TY_T023T,
            BEGIN OF TY_T006A,
              MMEIN LIKE T006A-MSEHI,
              MSEHT LIKE T006A-MSEHT,
            END OF TY_T006A,
            BEGIN OF TY_IMP_FINAL,
              SNO TYPE SY-INDEX,
              HSCODE LIKE ZHSCODE-HSCODE,
              WGBEZ TYPE T023T-WGBEZ,
              SPEC(20) TYPE C,
              MNGLG LIKE STPOX-MNGLG,
              MSEHT LIKE T006A-MSEHT,
              CNTRY(13) TYPE C,
              UPRICE TYPE P LENGTH 16 DECIMALS 2,
              TPRICE TYPE P LENGTH 16 DECIMALS 2,
              CURRCODE TYPE C LENGTH 5,
            END OF TY_IMP_FINAL,
            BEGIN OF TY_MBEW,
              MATNR LIKE MBEW-MATNR,
              VPRSV LIKE MBEW-VPRSV,
              STPRS LIKE MBEW-STPRS,
              VERPR LIKE MBEW-VERPR,
            END OF TY_MBEW.
      DATA: WA_BOM TYPE TY_BOM,
            WA_QUAN TYPE TY_QUAN,
            WA_IMP_FINAL TYPE TY_IMP_FINAL,
            WA_T023T TYPE TY_T023T,
            WA_T006A TYPE TY_T006A,
            WA_MBEW TYPE TY_MBEW.
      DATA: IT_BOM TYPE TABLE OF TY_BOM,
            IT_QUAN TYPE TABLE OF TY_QUAN,
            IT_IMP_FINAL TYPE TABLE OF TY_IMP_FINAL,
            IT_MBEW TYPE TABLE OF TY_MBEW.
    SELECTION-SCREEN **************************
    SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE TEXT-001.
    PARAMETERS : PR_CBNO LIKE ZCDR_D-CBNO OBLIGATORY.      "Customs Book number
    SELECTION-SCREEN END OF BLOCK b1.
    INITIALIZATION  **************************
    INITIALIZATION.
    **PERFORM CLEAR_DATA.
    **CLEAR: wa_layout.
    *PERFORM set_events USING it_events[].
    SELECT OPTION ****************************************
    SELECTION-SCREEN : BEGIN OF BLOCK BLK WITH FRAME TITLE TEXT-002.
    SELECTION-SCREEN SKIP 1.
    SELECT-OPTIONS:
            SO_PERTR for PLAF-PERTR,              "----
    Date
            SO_MATNR for MARA-MATNR,              "----
    Material
            SO_MATKL for MARA-MATKL,              "----
    Material Group
            SO_PLWRK for PLAF-PLWRK OBLIGATORY,   "----
    Plant
            SO_KDAUF for PLAF-KDAUF.              "----
    Sales Order
    SELECTION-SCREEN : END OF BLOCK BLK.
    SELECTION SCREEN F4 HELP  *********************
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR PR_CBNO.
    DATA: DYNFIELDS TYPE TABLE OF DYNPREAD WITH HEADER LINE.
          DYNFIELDS-FIELDNAME = PR_CBNO.
          APPEND DYNFIELDS.
         CALL FUNCTION 'DYNP_VALUES_READ'
              EXPORTING
                    DYNAME                               = SY-CPROG
                    DYNUMB                               = SY-DYNNR
                    TRANSLATE_TO_UPPER                   = 'X'
                  REQUEST                              = ' '
                  PERFORM_CONVERSION_EXITS             = ' '
                  PERFORM_INPUT_CONVERSION             = ' '
                  DETERMINE_LOOP_INDEX                 = ' '
                  START_SEARCH_IN_CURRENT_SCREEN       = ' '
                  START_SEARCH_IN_MAIN_SCREEN          = ' '
                  START_SEARCH_IN_STACKED_SCREEN       = ' '
                  START_SEARCH_ON_SCR_STACKPOS         = ' '
                  SEARCH_OWN_SUBSCREENS_FIRST          = ' '
                  SEARCHPATH_OF_SUBSCREEN_AREAS        = ' '
              TABLES
                    DYNPFIELDS                           = DYNFIELDS
              EXCEPTIONS
                    INVALID_ABAPWORKAREA                 = 1
                    INVALID_DYNPROFIELD                  = 2
                    INVALID_DYNPRONAME                   = 3
                    INVALID_DYNPRONUMMER                 = 4
                    INVALID_REQUEST                      = 5
                    NO_FIELDDESCRIPTION                  = 6
                    INVALID_PARAMETER                    = 7
                    UNDEFIND_ERROR                       = 8
                    DOUBLE_CONVERSION                    = 9
                    STEPL_NOT_FOUND                      = 10
                     OTHERS                               = 11
            IF SY-SUBRC <> 0.
              MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
                  WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
              ENDIF.
         READ TABLE DYNFIELDS WITH KEY FIELDNAME = 'CBNO'.
            PR_CBNO = DYNFIELDS-FIELDVALUE.
            SELECT
                CBNO
                PLNUM
                MATNR
                MAKTX
                KDAUF
                KDPOS
                AUFNR
                FROM ZCDR_D
                INTO TABLE IT_HELP_ITEM .
      CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
        EXPORTING
        DDIC_STRUCTURE         = ' '
          RETFIELD               = 'CBNO'
        PVALKEY                = ' '
         DYNPPROG               = SY-CPROG
         DYNPNR                 = SY-DYNNR
         DYNPROFIELD            = 'PR_CBNO'
        STEPL                  = 0
        WINDOW_TITLE           =
        VALUE                  = ' '
         VALUE_ORG              = 'S'
        MULTIPLE_CHOICE        = ' '
        DISPLAY                = ' '
        CALLBACK_PROGRAM       = ' '
        CALLBACK_FORM          = ' '
        MARK_TAB               =
      IMPORTING
        USER_RESET             =
        TABLES
          VALUE_TAB              = IT_HELP_ITEM
        FIELD_TAB              =
        RETURN_TAB             =
        DYNPFLD_MAPPING        =
      EXCEPTIONS
        PARAMETER_ERROR        = 1
        NO_VALUES_FOUND        = 2
        OTHERS                 = 3
      IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    ***********************SELECTION SCREEN VALIDATION.*******************
    AT SELECTION-SCREEN ON PR_CBNO.
      SELECT SINGLE *
      FROM ZCDR_D
      WHERE CBNO = PR_CBNO.
      IF SY-SUBRC EQ 0.
        MESSAGE E000(ZCBR) WITH PR_CBNO.
      ENDIF.
    AT SELECTION-SCREEN ON SO_PERTR.
      IF SO_PERTR IS NOT INITIAL.
        SELECT SINGLE *
        FROM PLAF
        WHERE PERTR IN SO_PERTR.
        IF SY-SUBRC NE 0.
          MESSAGE W001(ZCBR) WITH SO_PERTR-LOW.
        ENDIF.
      ENDIF.
    AT SELECTION-SCREEN ON SO_MATNR.
      IF SO_MATNR IS NOT INITIAL.
        SELECT SINGLE *
          FROM MARA
          WHERE MATNR IN SO_MATNR.
        IF SY-SUBRC NE 0.
          MESSAGE W002(ZCBR) WITH SO_MATNR-LOW.
        ENDIF.
      ENDIF.
    AT SELECTION-SCREEN ON SO_MATKL.
      IF SO_MATKL IS NOT INITIAL.
        SELECT SINGLE *
          FROM MARA
          WHERE MATKL IN SO_MATKL.
        IF SY-SUBRC NE 0.
          MESSAGE W003(ZCBR) WITH SO_MATKL-LOW.
        ENDIF.
      ENDIF.
    AT SELECTION-SCREEN ON SO_PLWRK.
      IF SO_PLWRK IS NOT INITIAL.
        SELECT SINGLE * FROM PLAF
          WHERE PLWRK IN SO_PLWRK.
        IF SY-SUBRC NE 0.
          MESSAGE W004(ZCBR) WITH SO_PLWRK-LOW.
        ENDIF.
      ENDIF.
    AT SELECTION-SCREEN ON SO_KDAUF.
      IF SO_KDAUF IS NOT INITIAL.
        SELECT SINGLE * FROM PLAF
        WHERE KDAUF IN SO_KDAUF.
        IF SY-SUBRC NE 0.
          MESSAGE W005(ZCBR) WITH SO_KDAUF-LOW.
        ENDIF.
      ENDIF.
    *********************START-OF-SELECTION.*****************************
    START-OF-SELECTION.
      IF so_pertr IS NOT INITIAL.
        FLAG = 1.
      ENDIF.
      IF SO_MATNR IS NOT INITIAL.
        FLAG1 = 1.
      ENDIF.
      IF so_matkl IS NOT INITIAL.
        FLAG2 = 1.
      ENDIF.
      IF so_plwrk IS NOT INITIAL.
        FLAG3 = 1.
      ENDIF.
      IF so_kdauf IS NOT INITIAL.
        FLAG4 = 1.
      ENDIF.
       Select data into its internal table from different database tables
      SELECT
        MATNR
        MATKL
       MTART
        INTO CORRESPONDING FIELDS OF TABLE IT_MARA
        FROM MARA
        WHERE MTART = 'ZFGS'.
      IF FLAG2 NE 0.
        DELETE IT_MARA WHERE
        NOT ( MATKL IN SO_MATKL )
      ENDIF.
      IF FLAG1 NE 0.
        DELETE IT_MARA WHERE
        NOT ( MATNR IN SO_MATNR )
      ENDIF.
      SELECT
         PERTR
         PLNUM
         MATNR
         PLWRK
         KDAUF
         KDPOS
         FROM PLAF
         INTO CORRESPONDING FIELDS OF TABLE IT_PLAF
         FOR ALL ENTRIES IN IT_MARA
         WHERE PLWRK IN SO_PLWRK
         AND MATNR = IT_MARA-MATNR.
        SELECT
          MATNR
          PLNUM
          AUFNR
          KDAUF
          KDPOS
          STRMP
          DWERK
        INACT
          FROM AFPO
          INTO CORRESPONDING FIELDS OF TABLE IT_AFPO
          FOR ALL ENTRIES IN IT_MARA
          WHERE DWERK IN SO_PLWRK
          AND MATNR = IT_MARA-MATNR.
         WHERE MATNR = IT_MARA-MATNR
         AND STRMP = IT_PLAF-PERTR
         AND KDAUF = IT_PLAF-KDAUF
         AND DWERK = IT_PLAF-PLWRK.
        End of Data selection
       Keep only those records which the user wants from his selection screen
      IF FLAG NE 0.
        DELETE IT_PLAF WHERE
        NOT ( PERTR IN SO_PERTR )
        DELETE IT_AFPO WHERE
        NOT ( STRMP IN SO_PERTR )
      ENDIF.
      IF FLAG3 NE 0.
        DELETE IT_PLAF WHERE
        NOT ( PLWRK IN SO_PLWRK )
        DELETE IT_AFPO WHERE
        NOT ( DWERK IN SO_PLWRK )
      ENDIF.
      IF FLAG4 NE 0.
        DELETE IT_PLAF WHERE
        NOT ( KDAUF IN SO_KDAUF )
        DELETE IT_AFPO WHERE
        NOT ( KDAUF IN SO_KDAUF )
      ENDIF.
        SELECT
         MATNR
         MAKTX
         FROM MAKT
         INTO CORRESPONDING FIELDS OF TABLE IT_MAKT
         FOR ALL ENTRIES IN IT_PLAF
         WHERE MATNR = IT_PLAF-MATNR
         AND SPRAS = 'EN'.
      SELECT
        FROM ZCDR_D
        INTO TABLE IT_ZCDR_D.
              Put data into final internal table from different internal tables
    LOOP AT IT_MARA INTO WA_MARA.
      LOOP AT IT_PLAF INTO WA_PLAF WHERE MATNR = WA_MARA-MATNR.
        READ TABLE IT_ZCDR_D
        INTO WA_ZCDR_D
        WITH KEY PLNUM = WA_PLAF-PLNUM.
        IF SY-SUBRC <> 0.
          MOVE WA_PLAF-PLNUM TO WA_PLAF_MAKT-PLNUM.
          MOVE WA_PLAF-MATNR TO WA_PLAF_MAKT-MATNR.
          MOVE WA_PLAF-KDAUF TO WA_PLAF_MAKT-KDAUF.
          MOVE WA_PLAF-KDPOS TO WA_PLAF_MAKT-KDPOS.
          READ TABLE IT_AFPO INTO WA_AFPO WITH KEY PLNUM = WA_PLAF-PLNUM.
              MOVE WA_AFPO-AUFNR TO WA_PLAF_MAKT-AUFNR.
           SELECT
             SINGLE * FROM VSAUFK
             INTO TABLE IT_VSAUFK
             WHERE AUFNR = WA_AFPO-AUFNR
             AND STAT = 'I0012'.
           IF SY-SUBRC <> 0.
             MOVE WA_AFPO-AUFNR TO IT_PLAF_MAKT-AUFNR.
           ELSE.
             CHECK IT_VSAUFK-INACT = 'X'.
             MOVE WA_AFPO-AUFNR TO IT_PLAF_MAKT-AUFNR.
           ENDIF.
        ENDLOOP.
             READ TABLE IT_MAKT
                INTO WA_MAKT
                WITH KEY MATNR = WA_MARA-MATNR.
                MOVE WA_MAKT-MAKTX TO WA_PLAF_MAKT-MAKTX.
                APPEND WA_PLAF_MAKT TO IT_PLAF_MAKT.
                CLEAR WA_PLAF_MAKT.
        ENDIF.
      ENDLOOP.
    ENDLOOP.
    LOOP AT IT_PLAF_MAKT .
    LOOP AT IT_MARA INTO WA_MARA.
    LOOP AT IT_PLAF INTO WA_PLAF WHERE MATNR = WA_MARA-MATNR.
       LOOP AT IT_AFPO INTO WA_AFPO WHERE MATNR = WA_MARA-MATNR.
        READ TABLE IT_ZCDR_D
        INTO WA_ZCDR_D
        WITH KEY PLNUM = WA_AFPO-PLNUM.
        IF SY-SUBRC <> 0.
           LOOP AT IT_AFPO INTO WA_AFPO.
             WHERE MATNR IN SO_MATNR
             AND STRMP = SO_PERTR
             AND PLNUM IN SO_PLNUM
             AND KDAUF IN SO_-KDAUF
             AND MATKL IN SO_MATKL.
            SELECT
              SINGLE INACT FROM VSAUFK
              INTO WA_VSAUFK
              WHERE AUFNR = WA_AFPO-AUFNR
              AND STAT = 'I0012'.
            IF SY-SUBRC <> 0.
              WA_PLAF_MAKT-PLNUM = WA_AFPO-PLNUM.
              WA_PLAF_MAKT-KDAUF = WA_AFPO-KDAUF.
              WA_PLAF_MAKT-KDPOS = WA_AFPO-KDPOS.
              WA_PLAF_MAKT-MATNR = WA_AFPO-MATNR.
              WA_PLAF_MAKT-AUFNR = WA_AFPO-AUFNR.
              READ TABLE IT_MAKT INTO WA_MAKT WITH KEY MATNR = WA_AFPO-MATNR.
              WA_PLAF_MAKT-MAKTX = WA_MAKT-MAKTX.
              APPEND WA_PLAF_MAKT TO IT_PLAF_MAKT .
             APPEND WA_AFPO TO IT_PLAF_MAKT.
             MOVE WA_AFPO-AUFNR TO IT_PLAF_MAKT-AUFNR.
            ELSE.
              CHECK WA_VSAUFK-INACT = 'X'.
              WA_PLAF_MAKT-PLNUM = WA_AFPO-PLNUM.
              WA_PLAF_MAKT-KDAUF = WA_AFPO-KDAUF.
              WA_PLAF_MAKT-KDPOS = WA_AFPO-KDPOS.
              WA_PLAF_MAKT-MATNR = WA_AFPO-MATNR.
              WA_PLAF_MAKT-AUFNR = WA_AFPO-AUFNR.
              READ TABLE IT_MAKT INTO WA_MAKT WITH KEY MATNR = WA_AFPO-MATNR.
              WA_PLAF_MAKT-MAKTX = WA_MAKT-MAKTX.
              APPEND WA_PLAF_MAKT TO IT_PLAF_MAKT .
             APPEND WA_AFPO TO IT_PLAF_MAKT.
             MOVE WA_AFPO-AUFNR TO IT_PLAF_MAKT-AUFNR.
            ENDIF.
            ENDIF.
        ENDLOOP.
         EXIT.
       ENDIF.
      ENDLOOP.
    ENDLOOP.
      LOOP AT IT_PLAF_MAKT INTO WA_PLAF_MAKT.
        WA_PLAF_MAKT-CBNO = PR_CBNO.
        MODIFY IT_PLAF_MAKT FROM WA_PLAF_MAKT TRANSPORTING CBNO.
      ENDLOOP.
    ENDLOOP.
      PERFORM CHANGE_CATALOG.
      PERFORM ALV_DISPLAY.
    *&      Form  CHANGE_CATALOG
          text
    FORM CHANGE_CATALOG.
       LAYOUT-ZEBRA = 'X'.
      DATA: L_POS TYPE I.
      L_POS = L_POS + 1.
      WA_FIELDCAT-col_pos   = L_POS.
      WA_FIELDCAT-SELTEXT_M = 'Planned Order Nos.'.
      WA_FIELDCAT-TABNAME = WA_PLAF_MAKT.
      WA_FIELDCAT-FIELDNAME = 'PLNUM'.
      APPEND WA_FIELDCAT TO IT_FIELDCAT.
      CLEAR WA_FIELDCAT.
      L_POS = L_POS + 1.
      WA_FIELDCAT-COL_POS   = L_POS.
      WA_FIELDCAT-INPUT = 'X'.
      WA_FIELDCAT-SELTEXT_M = 'Check Box'.
      WA_FIELDCAT-TABNAME = WA_PLAF_MAKT.
      WA_FIELDCAT-CHECKBOX  = 'X'.
      WA_FIELDCAT-EDIT = abap_true.
      WA_FIELDCAT-FIELDNAME = 'CHK'.
      APPEND WA_FIELDCAT TO IT_FIELDCAT.
      CLEAR WA_FIELDCAT.
      L_POS = L_POS + 1.
      WA_FIELDCAT-COL_POS   = L_POS.
      WA_FIELDCAT-OUTPUTLEN = '12'.
      WA_FIELDCAT-SELTEXT_M = 'Material'.
      WA_FIELDCAT-TABNAME = WA_PLAF_MAKT.
      WA_FIELDCAT-FIELDNAME = 'MATNR'.
      APPEND WA_FIELDCAT TO IT_FIELDCAT.
      CLEAR WA_FIELDCAT.
      L_POS = L_POS + 1.
      WA_FIELDCAT-COL_POS   = L_POS.
      WA_FIELDCAT-OUTPUTLEN = '35'.
      WA_FIELDCAT-SELTEXT_M = 'Material Description'.
      WA_FIELDCAT-TABNAME = WA_PLAF_MAKT.
      WA_FIELDCAT-FIELDNAME = 'MAKTX'.
      APPEND WA_FIELDCAT TO IT_FIELDCAT.
      CLEAR WA_FIELDCAT.
      L_POS = L_POS + 1.
      WA_FIELDCAT-COL_POS   = L_POS.
      WA_FIELDCAT-SELTEXT_M = 'Sales Order Number'.
      WA_FIELDCAT-TABNAME = WA_PLAF_MAKT.
      WA_FIELDCAT-FIELDNAME = 'KDAUF'.
      APPEND WA_FIELDCAT TO IT_FIELDCAT.
      CLEAR WA_FIELDCAT.
      L_POS = L_POS + 1.
      WA_FIELDCAT-COL_POS   = L_POS.
      WA_FIELDCAT-SELTEXT_M = 'S O Line Item'.
      WA_FIELDCAT-TABNAME = WA_PLAF_MAKT.
      WA_FIELDCAT-FIELDNAME = 'KDPOS'.
      APPEND WA_FIELDCAT TO IT_FIELDCAT.
      CLEAR WA_FIELDCAT.
      L_POS = L_POS + 1.
      WA_FIELDCAT-COL_POS   = L_POS.
      WA_FIELDCAT-OUTPUTLEN = '13'.
      WA_FIELDCAT-SELTEXT_M = 'Production Order'.
      WA_FIELDCAT-TABNAME = WA_PLAF_MAKT.
      WA_FIELDCAT-FIELDNAME = 'AUFNR'.
      APPEND WA_FIELDCAT TO IT_FIELDCAT.
      CLEAR WA_FIELDCAT.
    *GS_LAYOUT-TOTALS_BEFORE_ITEMS = 'X'.
    *data : text like slis_ev_subtotal_text value 'total'.
    *gs_layout-subtotals_text = text.
    *gs_layout-totals_only = 'X'.
    gs_layout-subtotals_text = 'total'.
    endform. "  CHANGE_CATALOG
    *********************event*************************************
    *&      Form  ALV_DISPLAY
          text
    FORM ALV_DISPLAY.
    *data: LC_GLAY TYPE LVC_S_GLAY.
       LC_GLAY-EDT_CLL_CB = 'X'.
       gs_layout-colwidth_optimize = 'X'.
       gs_layout-zebra = 'X'.
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
       EXPORTING
                       I_INTERFACE_CHECK                 = ' '
                       I_BYPASSING_BUFFER                = ' '
                       I_BUFFER_ACTIVE                   = ' '
         I_CALLBACK_PROGRAM                = SY-REPID
         I_CALLBACK_PF_STATUS_SET          = 'SET_PF_STATUS'
         I_CALLBACK_USER_COMMAND           = 'USER_COMMAND'
                       I_CALLBACK_TOP_OF_PAGE            = ' '
                       I_CALLBACK_HTML_TOP_OF_PAGE       = ' '
                       I_CALLBACK_HTML_END_OF_LIST       = ' '
                       I_STRUCTURE_NAME                  =
                       I_BACKGROUND_ID                   = ' '
         I_GRID_TITLE                      = 'PLANNED ORDERS'
                       I_GRID_SETTINGS                   = LC_GLAY
        IS_LAYOUT                         = LAYOUT
         IT_FIELDCAT                       = IT_FIELDCAT[]
                       IT_EXCLUDING                      =
                       IT_SPECIAL_GROUPS                 =
                       IT_SORT                           =
                       IT_FILTER                         =
                       IS_SEL_HIDE                       =
                       I_DEFAULT                         = 'X'
        I_SAVE                            = 'X'
                       IS_VARIANT                        =
                       IT_EVENTS                         = IT_EVENTS[]
                       IT_EVENT_EXIT                     =
                       IS_PRINT                          =
                       IS_REPREP_ID                      =
                       I_SCREEN_START_COLUMN             = 0
                       I_SCREEN_START_LINE               = 0
                       I_SCREEN_END_COLUMN               = 0
                       I_SCREEN_END_LINE                 = 0
                       I_HTML_HEIGHT_TOP                 = 0
                       I_HTML_HEIGHT_END                 = 0
                       IT_ALV_GRAPHICS                   =
                       IT_HYPERLINK                      =
                       IT_ADD_IT_FIELDCAT                   =
                       IT_EXCEPT_QINFO                   =
                       IR_SALV_FULLSCREEN_ADAPTER        =
                     IMPORTING
                       E_EXIT_CAUSED_BY_CALLER           =
                       ES_EXIT_CAUSED_BY_USER            =
        TABLES
          T_OUTTAB                          = IT_PLAF_MAKT
                     EXCEPTIONS
                       PROGRAM_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.
    REFRESH IT_FIELDCAT[].
    ENDFORM.                    "ALV_DISPLAY
    *&      Form  USER_COMMAND
          text
         -->UCOMM      text
         -->SELFIELD   text
    FORM USER_COMMAND
      USING UCOMM LIKE SY-UCOMM
      SELFIELD TYPE SLIS_SELFIELD.
      Data: REF1 TYPE REF TO CL_GUI_ALV_GRID.
    DATA WA LIKE LINE OF IT_PLAF_MAKT.
      CALL FUNCTION 'GET_GLOBALS_FROM_SLVC_FULLSCR'
        IMPORTING
          E_GRID = REF1.
      CALL METHOD REF1->CHECK_CHANGED_DATA.
      CASE UCOMM.
        WHEN '&BACK'.
          LEAVE TO SCREEN 0.
        WHEN  '&EXIT'.
          LEAVE TO SCREEN 0.
        WHEN '&CANC'.
          LEAVE TO SCREEN 0.
        WHEN '&SAVE'.
          CLEAR IT_ZCDR_D[].
          LOOP AT IT_PLAF_MAKT INTO WA_PLAF_MAKT WHERE CHK = 'X'.
            CLEAR WA_ZCDR_D.
            WA_ZCDR_D-MANDT = SY-MANDT.
            WA_ZCDR_D-CBNO = WA_PLAF_MAKT-CBNO.
            WA_ZCDR_D-plnum = WA_PLAF_MAKT-PLNUM.
            WA_ZCDR_D-MATNR = WA_PLAF_MAKT-MATNR.
            WA_ZCDR_D-MAKTX = WA_PLAF_MAKT-MAKTX.
            WA_ZCDR_D-KDAUF = WA_PLAF_MAKT-KDAUF.
            WA_ZCDR_D-KDPOS = WA_PLAF_MAKT-KDPOS.
            WA_ZCDR_D-AUFNR = WA_PLAF_MAKT-AUFNR.
            APPEND WA_ZCDR_D to IT_ZCDR_D.
          ENDLOOP.
          LOOP AT IT_ZCDR_D INTO WA_ZCDR_D.
            INSERT ZCDR_D FROM WA_ZCDR_D.
            CLEAR WA_ZCDR_D.
          ENDLOOP.
          IF SY-SUBRC EQ 0.
            MESSAGE S021(ZCBR) WITH PR_CBNO.
          ENDIF.
          IF IT_ZCDR_D IS INITIAL.
            MESSAGE 'Select Atleast one Check Box' TYPE 'E' .
          ENDIF.
        WHEN 'IMPORT_INF'.
          PERFORM IMPORT_REPORT.
       WHEN 'EXPORT_INF'.
         PERFORM EXPORT_REPORT.
       WHEN 'UNIT_CONSU'.
         PERFORM UNIT_CONSUMPTION.
      ENDCASE.
    ENDFORM.                    "USER_COMMAND
    FORM set_events USING it_events TYPE slis_t_event.
    DATA: x_event TYPE slis_alv_event.
    clear x_event.
    x_event-name = 'USER_COMMAND'.
    x_event-form = 'USER_COMMAND'.
    append x_event to it_events.
    CLEAR x_event.
    call function 'REUSE_ALV_EVENTS_GET'
      EXPORTING
        I_LIST_TYPE           = 0
      IMPORTING
        ET_EVENTS             = IT_EVENTS
      EXCEPTIONS
        LIST_TYPE_WRONG       = 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.
    read table it_events into x_event with key name = slis_ev_user_command.
          if sy-subrc = 0.
          x_event-form = 'USER_COMMAND'.
          modify it_events from x_event index sy-tabix transporting form .
          endif.
    ENDFORM.
    *&      Form  set_pf_status
          text
         -->RT_EXTAB   text
    FORM SET_PF_STATUS USING RT_EXTAB TYPE SLIS_T_EXTAB.
      SET PF-STATUS 'Z_PFSTAT'.
    ENDFORM.            " set_pf_status
    FORM IMPORT_REPORT.
    TYPES: BEGIN OF TY_BOM,
             MATMK LIKE STPOX-MATMK,
             MTNRV LIKE ZCDR_D-MATNR,
             IDNRK LIKE STPOX-IDNRK,
             MNGLG LIKE STPOX-MNGLG,
             MMEIN LIKE STPOX-MMEIN,
             VPRSV LIKE STPOX-VPRSV,
             UPRICE LIKE MBEW-STPRS,
             TPRICE LIKE MBEW-STPRS,
           END OF TY_BOM,
           BEGIN OF TY_QUAN,
             MATMK LIKE STPOX-MATMK,
             MTNRV LIKE ZCDR_D-MATNR,
             IDNRK LIKE STPOX-IDNRK,
             MNGLG LIKE STPOX-MNGLG,
             MMEIN LIKE STPOX-MMEIN,
             UPRICE LIKE MBEW-STPRS,
             TPRICE LIKE MBEW-STPRS,
           END OF TY_QUAN,
           BEGIN OF TY_T023T,
             MATKL LIKE T023T-MATKL,
             WGBEZ LIKE T023T-WGBEZ,
           END OF TY_T023T,
           BEGIN OF TY_T006A,
             MMEIN LIKE T006A-MSEHI,
             MSEHT LIKE T006A-MSEHT,
           END OF TY_T006A,
           BEGIN OF TY_IMP_FINAL,
             SNO TYPE SY-INDEX,
             HSCODE LIKE ZHSCODE-HSCODE,
             WGBEZ TYPE T023T-WGBEZ,
             SPEC(20) TYPE C,
             MNGLG LIKE STPOX-MNGLG,
             MSEHT LIKE T006A-MSEHT,
             CNTRY(13) TYPE C,
             UPRICE TYPE P LENGTH 16 DECIMALS 2,
             TPRICE TYPE P LENGTH 16 DECIMALS 2,
             CURRCODE TYPE C LENGTH 5,
           END OF TY_IMP_FINAL,
           BEGIN OF TY_MBEW,
             MATNR LIKE MBEW-MATNR,
             VPRSV LIKE MBEW-VPRSV,
             STPRS LIKE MBEW-STPRS,
             VERPR LIKE MBEW-VERPR,
           END OF TY_MBEW.
    DATA: WA_BOM TYPE TY_BOM,
           WA_QUAN TYPE TY_QUAN,
           WA_IMP_FINAL TYPE TY_IMP_FINAL,
           WA_T023T TYPE TY_T023T,
           WA_T006A TYPE TY_T006A,
           WA_MBEW TYPE TY_MBEW.
    DATA: IT_BOM TYPE TABLE OF TY_BOM,
           IT_QUAN TYPE TABLE OF TY_QUAN,
           IT_IMP_FINAL TYPE TABLE OF TY_IMP_FINAL,
           IT_MBEW TYPE TABLE OF TY_MBEW.
      DATA:  IT_STPO TYPE STANDARD TABLE OF STPOX,
             WA_STPO TYPE STPOX.
          SELECT
              MATNR
              VPRSV
              STPRS
              VERPR
               FROM MBEW
                INTO CORRESPONDING FIELDS OF TABLE IT_MBEW.
                    WHERE MATNR EQ IT_MARA-MATNR.    "MBEW
    *I_STPO2 TYPE STANDARD TABLE OF STPOX.
    LOOP AT IT_PLAF_MAKT INTO WA_PLAF_MAKT WHERE CHK = 'X'.
      LOOP AT IT_ZCDR_D INTO WA_ZCDR_D .
          CALL FUNCTION 'CS_BOM_EXPL_MAT_V2'

  • Automatic PO adjustment for pricing condition changes sap

    Hello SAP users,
    How to prevent automatic PO adjustment for pricing condition changes to purchase order items that are marked for deletion. Please respond.
    Thanks

    Hi,
    Check the settings in below configuration:
    SPRO>MM>Purchasings>Conditions>Automatic document adjustment-->Control doc. adjustment.
    SAM

  • Standard report for pricing condition.

    Hello everyone,
    Is there any standard report to see the price maintain in particular condition record in VK11 with different key combination. can anybody tell me in which table it is maintain.
    Regards,
    Naveed Ansari.

    Hi
    The Standard report for Pricing condition is V/LD.
    You can get datas like Material prices, Individual prices, discounts & surcharge prices, Material list/Material pricing Group with & without scal display, Price list types with & without scale display.
    V/LB   SAPMV14A       Change Pricing Report
    V/LC   SAPMV14A       Display Pricing Report
    V/LD   SAPMV14A       Execute pricing report
    V/LE   RV14ALLE       Generate pricing reports
    Award if useful to you
    Thank you
    Edited by: narendran vajravelu on Oct 14, 2008 7:23 AM
    Edited by: narendran vajravelu on Oct 14, 2008 7:25 AM

  • Building Field-Catalog for dynamic internal tables

    Hi All,
    I  created a dynamic internal table(<fs_final>,<fs_final_line>)  and populated data into it.Now I want to provide field catalog to these dynamic internal table.
    Can anyone suggest me the how to create a field catalog for existing dynamic internal table.Thanks in advance.
    Regards,
    Chakradhar.
    Moderator message - Please use proper subject line in future.
    Message was edited by: Suhas Saha

    Use this code to get all components of internal table.
    Then build fieldcatlog.
    DATA: tab_return type abap_compdescr_tab,
              components like line of tab_return.
    perform get_int_table_fields using    <fs_it> changing  tab_return.
    loop at tab_return into components.
      wa_fldcat-fieldname  = components-name.               "Field Name
      wa_fldcat-scrtext_m  = components-name.              "Column Heading
      wa_fldcat-inttype    = components-type_kind.     "Data Type
      wa_fldcat-intlen      = components-length.          "Data Lenght
      wa_fldcat-decimals = components-decimals.     "Data Decimal Places
    append wa_fldcat to it_fldcat.
    endloop.
    form get_int_table_fields  using    t_data type any table
                                changing t_return type abap_compdescr_tab.
       data:
       oref_table type ref to cl_abap_tabledescr,
       oref_struc type ref to cl_abap_structdescr,
       oref_error type ref to cx_root,
       text type string.
    *Get the description of data object type
       try.
           oref_table ?=
           cl_abap_tabledescr=>describe_by_data( t_data ).
         catch cx_root into oref_error.
           text = oref_error->get_text( ).
           write: / text.
           exit.
       endtry.
    *Get the line type
       try.
           oref_struc ?= oref_table->get_table_line_type( ).
         catch cx_root into oref_error.
           text = oref_error->get_text( ).
           write: / text.
           exit.
       endtry.
       append lines of oref_struc->components to t_return.
    endform.
    Regards
    Sreekanth

  • New field (Customer group 5) to be added to the Catalog for Pricing.

    Hello friends,
    For the creation of a new Condition table, I require the field, KNVV-KVGR5 i.e Customer group 5 field present in Sales area data ->Extras -> Additional data in Customer master to be added to the Catalog of allowed fields since this field does not exist anywhere.
    I have already gone thru the threads available on adding New field for Pricing which has an example/detailed explanation with the Item category (PSTYVV) field.
    But the field I want i.e KNVV-KVGR5, is a part of Master data, so please guide me with the steps to follow to add this field in the field catalog and hence use it for creation of a new condition table.
    1) Should i add this field in KOMP (i.e item) or KOMK ( i.e Header) or KOMG?
    2) Should i include it in KOMKAZ or KOMPAZ?
    3) Should i create this field as data element or structure and what should be the domain used?
    4) For the value flow, should i use the Item -level user-exits or Header level mentioned in other threads?
    Please guide for the same urgently.

    Dear Friends,
    I was finally able to create a new field for Cust.grp.5 i.e ZZKVGR5 and added to Catalog to be used for Pricing.
    Then i faced a peculiar issue as below:
    For the business requirement, we defined a new tax condition table for determination of tax rates. For this, we are using both standard and custom fields to derive the correct tax rates in sales/billing documents like below
    A859: Country/Distr. Chl/Cust.grp.5/Material (Here Customer.grp 5 was added following the SAP Note: 531835)
    The field was inserted in the communication structure KOMKAZ which is included in both KOMK and KOMP.
    During the document processing, the pricing analysis view shows no value in the customer grp 5 field, though it is maintained for the customer used in the sales order. The code has been written in MV45 and RV60 both as guided in SAP Note: 531835. But the values are not flowing.
    Solved the above problem as below:
    M posting the answer to help the community for similar issue.
    Also, the new field tat i had added was Customer Grp 5 field of Customer master ->Extras->Additional field and I wanted the value to flow in the ZZKVGR5 field before the Pricing for the sales order was called.
    After trying all, we have finally fetched the value from KNVV-KVGR5 and got it moved to ZZKVGR5 field through ABAP coding.
    After this when i select/click on Pricing for a particular item, it gets picked up correctly and properly.
    Thanks to everyone for their valuable guidance and help.
    Regards to all.

  • New field in Pricing field catalog for Item category

    Dear SD colleagues,
    We have scenario of maintaining pricing for Lower level BOM component.
    Like:
    Base price - 100/-
    When BOM explodes - 95/-.
    For this, I have taken ABAPer help and inseted a Z field for Item category in Pricing field catalog.
    Then, a new condition table is been generated using ZPSTYV and included in Access sequence. For Base price condition type, we have maintained record in combination with ZBOM-Item category for lower level BOM item.
    A new pricing routine is created in VOFM for Condition value and same is been assigned to Condition type as Alternative calculation type in pricin gprocedure contro data.
    Whe I create Sales order, value based on ZBOM is being pciked up by system.
    request you to please help in this regard.
    Thanks & regards,
    Praveen.

    Hi Marino,
    I have a requirement to determine the pricing based on "Discount Code", which is not a standard SAP field and i would like to have this as a custom field and linked to  customer in custom table.
    Question: When i add a new custom field and custom table for pricing, what are all the things i need to do in terms of ABAP.
    As per my knowledge, below are the steps...Please check and confirm my understanding is correct and let me know if i miss anything.
    1. Create a new field
    2. Create Custome Table
    3. Add field to Field Catlogue KOMG
    4. Add Field to KOMP (as this is item field)
    5. Add code in userexit USEREXIT_PRICING_PREPARE_TKOMP to make the data avaialable - Sales Order
    5. Add code in userexit USEREXIT_PRICING_PREPARE_TKOMP to make the data avaialable - Billing
    Thanks.

Maybe you are looking for

  • Crystal Reports PDF Export problem

    Hi I'm using Crystal 8.5 for my reports in VB 6.0. We have intrepret as RTF in the report. Now when we export this report to PDF the nested bullets loose formatting. All bullets show up at the same level. Any idea how to fix this? Thanks Sudha

  • Anyone Running iTunes 4.9 Notice It's Not Working Now?  Any Help?

    I've just noticed that my version of iTunes 4.9 is "barely" working now (Saturday 2.3.07). It will do a search and sample play listed music found on a search, and also allow to purchase .... but that's it! I can't select any of the home page selectio

  • Still Major Problems

    After 3 days non stop trying to update my iPhone to 2.0 I still have the the usb and itunes logo on my screen. I havn't been able to use my phone since friday, it seems as though problems are clearing up for most people, but i still am recieving erro

  • Swatch libraries suddenly unavailable

    Having the strangest problem. When I want to edit or create a new swatch, two strange things are happening: 1) in the pull down list of swatch libraries, the list repeats several times ... so it looks as if there are dozens and dozens of libraries, w

  • Why would I go from an unlimited data to a more everything plan

    I have a grandfathered Unlimited data plan and would like to update my device.  I have no use for a MORE everything plan since I only have 1 device and no need to share data with anything else.  I thought it was possible to get a 6gb max plan with th