Co41 enhancement for add field in ALV output

I must add a custom filed to ALV output of transaction CO41 and i trying to use all the 25 enhancements provided (that i find in other post CO41- Enhancement ), but i haven't found any way to get the desired results.
Can any body help me?
Thanks in advance.

Hi,
I had the same requirement to add a custom field to ALV output of transaction CO41.
1. I first added the custom field to an new append-structure to the structure SFC_POCO.
2. Then i added this field to the Dynpro-Screen 200 in the function-group COUP (by choosing the table control, pressing F6 and then adding the custom field of SFC_POCO).
3. At last i added an Enhancement to the function CO_UP_PLANNED_ORDERS_SELECT and filled my custom field with data there.
Please reward if useful.
Regards,
Henry

Similar Messages

  • How to pass custom search help(F4 help) for a field in ALV output?

    Hi,
    I want to activate the F4 help in ALV output for a field for which we do not have search help assigned at table ,data element and domain level.
    In field catalog i have enabled it by below line.
    ls_fcat-F4AVAILABL = 'X'.
    but because there are no standard input help available it is giving message as "No input help is available".
    so how to pass our custom search help (g_search) for any field in ALV output.
    I am using object oriented ALV grid display.
    Thanks!!!
    Rajesh Gupta.

    hi,
    check this out:
    http://www.sdn.sap.com/irj/scn/index?rid=/library/uuid/b3d5e890-0201-0010-c0ac-bba85ec2ae8d
    http://www.sdn.sap.com/irj/scn/index?rid=/library/uuid/acdefb13-0701-0010-f1a2-8eeefa7d3780
    http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/b3d5e890-0201-0010-c0ac-bba85ec2ae8d?quicklink=index&overridelayout=true

  • Negative sign for DMBTR field in ALV output

    Hi Experts,
    Before posting I have searched for more than 3 hours in the forums to get a solution for this.
    I did not get any solution so I am posting this problem which I need to resolve.
    I have to display the DMBTR field in ALV output for which a grand total will have to be displayed.
    Here for all the values in DMBTR which are negative are getting displayed as '-        6673.56','-       289956.23' as I am using the edit mask 'V_____________.__'.
    I have to get the value shown as '-6673.56', '-289956.23'.
    I tried to use convert this DMBTR to String and have successfully displayed the negative sign correctly in front of the value but I am not getting the totals which I need to have
    PLease check and suggest for a solution.
    Regards
    Kishore

    Hi,
      If this is the case, then you can use character field to display the sign on the left. Sum up the total and use the event end of list to display the same. Remember to set the TECH and NO_OUT in the field catalog.
    Hope this helps.
    Regards,
    Siva

  • Color  for a Field in alv output

    Hi All,
    I use a field in the ALV grid output which needs to display color (red or green) depending on certain validations. Please tell me how to display color for this field. The program uses oops.
    Thanks.

    Hi
    1. add one more field to ur final internal table say COLOR(4)
    2. in layout wa_layout-style_fname = 'COLOR'. " if its grid
    wa_layout-style_fieldname = 'COLOR'. "if its list
    3. read table itab index 3.
    itab-color = 'C410'.
    modify itab index 3
    4. see program SHOWCOLO for all color codes
    1. Add a field of data type CHAR(3) to the internal output table.
    2. Enter the color code in the appropriate field of the row to be colored in the internal
    output table:
    Code: 'Cxy'
    C = Color (all codes begin with 'C')
    x = color number ('1' - '9')
    y = highlight ('0' = off, '1' = on)
    3. Assign the internal output table color code field name to the IS_LAYOUT importing
    structure IS_LAYOUT-INFO_FIELDNAME field and pass this structure in the ALV call
    interface.
    To enable row coloring, you should add an additional field to your list data table. It should be of character type and length at least 4. This field will contain the color code for the row. So, let’s modify declaration of our list data table “gt_list”.
    you should fill the color code to this field. Its format will be the same as explained before at section C.6.3. But how will ALV Grid know that you have loaded the color data for the row to this field. So, you make it know this by passing the name of the field containing color codes to the field “INFO_FNAME” of the layout structure.
    e.g.
    ps_layout-info_fname = <field_name_containing_color_codes>. “e.g. ‘ROWCOLOR’
    You can fill that field anytime during execution. But, of course, due to the flow logic of screens, it will be reflected to your list display as soon as an ALV refresh occurs.
    You can color an entire row as described in the next section. However, this method is less time consuming.
    Coloring Individual Cells
    This is the last point about coloring procedures for the ALV Grid. The procedure is similar to coloring an entire row. However, since an individual cell can be addressed with two parameters we will need something more. What is meant by “more” is a table type structure to be included into the structure of the list data table. It seems strange, because including it will make our list data structure deep. But anyhow ALV Grid control handles this.
    The structure that should be included must be of type “LVC_T_SCOL”. If you want to color the entire row, this inner table should contain only one row with field “fname” is set to space, some color value at field “col”, “0” or “1” at fields “int” (intensified) and “inv” (inverse).
    If you want to color individual cells, then for each cell column, append a line to this inner table which also contains the column name at field “fname”. It is obvious that you can color an entire column by filling this inner table with a row for that column for each row in the list data table.
    Reward points if useful
    Regards
    Anji

  • Fixed length for the fields of  ALV output

    Hi,
          How to fix a field in the ALV output to its max length..For example..if a field's max length is 10...that coloumn should not be dragged or moved to right..Its lenght shluld be fixed to 10...Could any bod suggest me how to perform this...thanks..
    Shyam.

    Hi,
    U can better optimize the width.it will be good.
    data : W_LAYOUT TYPE SLIS_LAYOUT_ALV.
    W_LAYOUT-COLWIDTH_OPTIMIZE = 'X'.
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
        EXPORTING
          I_CALLBACK_PROGRAM     = SY-REPID
          I_STRUCTURE_NAME       = 'T_ALV'
          IS_LAYOUT              = W_LAYOUT
          IT_FIELDCAT            = T_FIELDCAT_ALV
          I_CALLBACK_TOP_OF_PAGE = 'ALV_TOP_OF_PAGE'
        TABLES
          T_OUTTAB               = T_ALV
        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.

  • Add List box for one field in ALV GRID

    Hi All,
      I need to add drop down list box for one field in ALV Grid.
      If any body knows, please help.
    Thanks in advance.
    Regards
    Manglesh

    Hi,
    Here is the ex where i have used for date parameter in the sel screen
    type-pools: vrm.
    data: name type vrm_id,
          list type vrm_values,
          value like line of list.
    parameters :    p_date like p_date2
                                  as listbox visible length 15.
    at selection-screen output.
      name = 'P_DATE'.
      value-key = '1'.
      value-text = 'Today'.
      append value to list.
      value-key = '2'.
      value-text = 'Last 7 days'.
      append value to list.
      value-key = '3'.
      value-text = 'Last 30 days'.
      append value to list.
      value-key = '4'.
      value-text = 'Last 90 days'.
      append value to list.
      value-key = '5'.
      value-text = 'Last year'.
      append value to list.
    Call the ''VRM_SET_VALUES' to display the values in Listbox
      call function 'VRM_SET_VALUES'
        exporting
          id     = name
          values = list.
    at selection-screen.
      if sy-ucomm = 'CLI1'.
        sscrfields-ucomm = 'ONLI'(001).
      endif.
      if p_date = '1'.
        p_date11 =  sy-datum .
      elseif p_date = '2'.
        p_date11 = ( sy-datum - 7 ).
      elseif p_date = '3'.
        p_date11 = ( sy-datum - 30 ).
      elseif p_date = '4'.
        p_date11 = ( sy-datum - 90 ).
      elseif p_date = '5'.
        p_date11 = ( sy-datum - 365 ).
      endif.
    Hope this helps u..
    Please reward points if useful.
    Regards,
    Sreenivas

  • How to add F1 help for a field on ALV grid

    Hi All,
    When we execute a program, the output is displayed using ALV grid.
    on the ALV grid, if we press F1 on a field, it should popup the help document.
    How to add F1 help for a field on ALV grid.
    Thank you all in advance.

    fill field LVC_S_FCAT-ROLLNAME of your fieldcatalog in method SET_TABLE_FOR_FIRST_DISPLAY
    A.

  • How to add a search help for a field in alv?

    HI!Everyone ,
    i want to add a search help created by myself for one field in alv,
    and i want to use this function "HELP_VALUES_GET_WITH_TABLE".
    can anyone help me ?
    thanks!

    HI,Vijay.
    My code like this :
          PERFORM build_fcat.
          PERFORM build_objects.
          PERFORM layo_build.
          PERFORM set_drdn_table .
          CALL METHOD alv_grid->set_table_for_first_display
            EXPORTING
             i_structure_name = 'STU_S'
              is_layout        = s_layo
            CHANGING
              it_outtab        = itab_out
            it_fieldcatalog  = i_fcat
            ."Period
          IF sy-subrc <> 0.
            EXIT.
          ENDIF.
    for example, there is a field 'UNAME' IN Structure 'STU_S',
    i want to add a search help for 'UNAME'.
    the 'UNAME'  is not users in SAP R/3 , i want to add some data by myself or from a table .

  • I am not getting the headings of the fields in ALV output.

    I am not getting ALV out put but  the headings of the fields in ALV output.
    Please see my below code .
    TYPES : BEGIN OF ty_zgxmit.
              INCLUDE STRUCTURE zgxmit.
    TYPES : END OF ty_zgxmit.
    DATA : gt_zgxmit TYPE TABLE OF ty_zgxmit.
    *&      Form  alv_display                                              *
    This subroutine is to display the out put in ALV.                    *
    FORM alv_display .
    Local data
      DATA: y_x          LIKE boole  VALUE 'X'.
    DATA: lt_fieldcat  TYPE slis_t_fieldcat_alv.
      DATA: lf_fieldcat  TYPE slis_fieldcat_alv.
      DATA: lh_index     LIKE lf_fieldcat-col_pos.
    For variant
    DATA: ws_repid LIKE sy-repid,
          g_save TYPE c VALUE 'A',
          g_exit TYPE c,
          g_variant LIKE disvariant,
          gx_variant LIKE disvariant.
      For 1st field.( RPT_LOC )
        CLEAR lf_fieldcat.
        lf_fieldcat-fieldname = 'RPT_LOC'.
        lf_fieldcat-tabname = 'GT_ZGXMIT'.
        lf_fieldcat-ref_tabname = 'RPT_LOC'.
        lf_fieldcat-ref_fieldname = 'ZGXMIT'.
        lh_index = lh_index + 1.
        lf_fieldcat-col_pos = lh_index.
        lf_fieldcat-key = y_x.
        lf_fieldcat-no_sum = y_x.
        APPEND lf_fieldcat TO lt_fieldcat.
    For 2nd field.( BAL_XMIT )
        CLEAR lf_fieldcat.
        lf_fieldcat-fieldname = 'BAL_XMIT'.
        lf_fieldcat-tabname = 'GT_ZGXMIT'.
        lf_fieldcat-ref_tabname = 'BAL_XMIT'.
        lf_fieldcat-ref_fieldname = 'ZGXMIT'.
        lh_index = lh_index + 1.
        lf_fieldcat-col_pos = lh_index.
        lf_fieldcat-key = y_x.
        lf_fieldcat-no_sum = y_x.
        APPEND lf_fieldcat TO lt_fieldcat.
    For 3rd field.( INC_XMIT )
        CLEAR lf_fieldcat.
        lf_fieldcat-fieldname = 'INC_XMIT'.
        lf_fieldcat-tabname = 'GT_ZGXMIT'.
        lf_fieldcat-ref_tabname = 'INC_XMIT'.
        lf_fieldcat-ref_fieldname = 'ZGXMIT'.
        lh_index = lh_index + 1.
        lf_fieldcat-col_pos = lh_index.
        lf_fieldcat-key = y_x.
        lf_fieldcat-no_sum = y_x.
        APPEND lf_fieldcat TO lt_fieldcat.
    For 4th field.( Z500_XMIT )
        CLEAR lf_fieldcat.
        lf_fieldcat-fieldname = 'Z500_XMIT'.
        lf_fieldcat-tabname = 'GT_ZGXMIT'.
        lf_fieldcat-ref_tabname = 'Z500_XMIT'.
        lf_fieldcat-ref_fieldname = 'ZGXMIT'.
        lh_index = lh_index + 1.
        lf_fieldcat-col_pos = lh_index.
        lf_fieldcat-key = y_x.
        lf_fieldcat-no_sum = y_x.
        APPEND lf_fieldcat TO lt_fieldcat.
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
           EXPORTING
                i_callback_program       = 'ZJV_2245'
                it_fieldcat              = lt_fieldcat
           TABLES
                t_outtab                 = gt_zgxmit
           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.
    ENDFORM.                    " alv_display

    You can force the headings like so.
    CLEAR lf_fieldcat.
    lf_fieldcat-fieldname = 'RPT_LOC'.
    lf_fieldcat-tabname = 'GT_ZGXMIT'.
    lf_fieldcat-ref_tabname = 'RPT_LOC'.
    lf_fieldcat-ref_fieldname = 'ZGXMIT'.
    lf_fieldcat-reptext_ddic  = 'Whatever Heading'.    "<-  Right here
    lh_index = lh_index + 1.
    lf_fieldcat-col_pos = lh_index.
    lf_fieldcat-key = y_x.
    lf_fieldcat-no_sum = y_x.
    APPEND lf_fieldcat TO lt_fieldcat.
    Regards,
    Rich Heilman

  • How to display the fields in ALV Output without using Field catalog?

    How to display the fields in ALV Output without using Field catalog?
    Could you pls tell me the coding?
    Akshitha.

    Hi,
    u mean without building field catalog. is it? I that case, we can use the FM REUSE_ALV_FIELDCATALOG_MERGE.
    data: itab type table of mara.
    CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
    EXPORTING
    i_program_name = sy-repid
    i_structure_name = itab
    CHANGING
    ct_fieldcat = lt_fieldcat[]
    EXCEPTIONS
    inconsistent_interface = 1
    program_error = 2
    OTHERS = 3.
    *Pass that field catalog into the fillowing FM
    call function 'REUSE_ALV_GRID_DISPLAY'
           exporting
                i_callback_program      = gd_repid
                i_grid_title            = 'REPORTING'
                is_layout              = gt_layout
                it_fieldcat             = lt_fieldcat[]
           tables
                t_outtab                = itab.

  • Enhancements to add fields to purchaseorder

    hi,
           how to Enhancements to add fields to purchaseorder in ME22 transaction using enhancements MM06E005. What is the MM06E005. plz explain.

    Hi radha krishna ,
    MM06E005 is the  enhancement number in which we have fuction module exits and sceen exits where you can add customer specific fields to the PO ie Me22 in the screen exits available in the  MM06E005(Customer fields in purchasing document) enhancement number.
    first go to CMOD(Transaction code)>create an enhancement project>click on enhancement assignment button on application tool bar and in enhancement colum give MM06E005 enhancement number and then click on components you will get all the fuction module exits and screen exits.
    fuction module exits:
    EXIT_SAPMM06E_006.
    EXIT_SAPMM06E_007.
    EXIT_SAPMM06E_008.
    EXIT_SAPMM06E_009.
    EXIT_SAPMM06E_012.
    EXIT_SAPMM06E_013.
    EXIT_SAPMM06E_014.
    EXIT_SAPMM06E_016.
    EXIT_SAPMM06E_017.
    EXIT_SAPMM06E_018.
    screen exits TO ADD CUSTOMER FIELDS TO THE PO CREATION SCREEN.
    SAPLXMO6  0101.
    SAPLXMO6  0111.
    SAPLXMO6  0201..
    SAPLXMO6  0211..
    SAPLXMO6  0301..
    SAPLXMO6  0311.
    select apppropriate exit to add the fields according to your requirement.
    Thanks and Regards,
    Pavan

  • Enhancements to add fields to PO in ME22 transaction using MM06E005

    HI,
         any one can help me, how Enhancements to add fields to Purchase order in ME22 transaction using  Enhancements MM06E005.What is ME22 transaction and  Enhancements MM06E005. Plz explain

    HI,
    FOLLOW THIS STEP
         GO TCODE CMOD
        ENTER PROJECT NAME
        CLICK CREATE
        CLICK ENHANCEMENT
       ENTER MM06E005.
       PRESS ENTER
       CLICK COMPONENT
      IT WILL DISPLAY THE ALL ENHANCEMENT IN MM06E005
       DOUBLE CLICK FIRST SCREEN EXIT
    IN ATTRIBUTE CLICK SUBSCREEN
    GOTO LAYOUT
    CREATE FIELD WHICH YOU WANT
    IT IS SUBSCREEN .SO SELECT LINE 0 AND COLOUM 0 IN SCREEN ATTRIBUTES.( WHEN YOU DOUBLE CLICK ON FIELD IT WILL DISPLAY)
    SAVE AND ACTIVATE
    GOTO FLOWLOGIC
    ACTIVATE
    GO BACK
    ACTIVATE PROJECT
    GOTO TCOD ME22
    ENTER PO
    PRESS ENTER
    GOTO MENU HEADER -> DETAIL
    IN THE BOTTOM YOU CAN SEE THE YOUR ENHANCEMENT
    REGARDS
    ASHOK KUMAR

  • What name Properties in Bussiness Partner Object for add fields TypWTRepr

    What name Properties in Bussiness Partner Object for add fields OCRD.TypWTReprt

    DDE,
    I do not see that there is a property exposed by the SDK for this in Business One 2005A SP01.  Apologies ...
    Eddy

  • Add new selection fields and ALV output  fields in VA05

    Hi,
    I want to add two new selection fields in VA05 'Further selection criteria' screen, also want to add some more fields in VA05 ALV output.
    Please help me how i can do it using user exit ?
    Thanks ,
    Archana

    hi,
    You have to copy the standard program SAPMV75A to ZSAPMV75A, change them accordingly.

  • Not allowing totaling of a field in alv output

    hi,
    I had made a ALV in which i have to hide 1 field for getting it totaling.
    i.e. if somebody try to make total of it ,it should not be allowed on dat field . is dere any solution for this problem?
    plzz provide me guidelines for it.

    Please please it this. I made the total for every field other than RACCT and SUM_COMM.
    *&      Form  sub_prepare_display_output
          Display output
    -->  No Parameter
    FORM sub_prepare_display_output .
    Local variables
      DATA: l_lead_col   TYPE char25,       " Lead column
            l_progname   TYPE sy-repid,     " Program name
    Local internal tables
            l_oref_layout TYPE REF TO cl_salv_layout, "Layout
    Local work area
            l_wa_key      TYPE salv_s_layout_key,     "Work area for key
            l_except1   TYPE REF TO cx_salv_msg,"Exception
            l_text1     TYPE string.            "Exception msg
    If profit center is checked
      IF p_prfctr = c_check.
        l_lead_col = 'Profit Center'(041).
    If product catagory is checked
      ELSEIF p_prodc = c_check.
        l_lead_col = 'Product Category'(042).
    If material is checked
      ELSEIF p_smatnr = c_check.
        l_lead_col = 'Material No.'(043).
      ENDIF.
    Create ALV instance with class-method cl_salv_table=>factory
      TRY.
          CALL METHOD cl_salv_table=>factory
            EXPORTING
              list_display = if_salv_c_bool_sap=>false
            IMPORTING
              r_salv_table = v_oref_table
            CHANGING
              t_table      = i_final.
        CATCH cx_salv_msg INTO l_except1.
          l_text1 = l_except1->get_text( ).
          MESSAGE i000 WITH l_text1.
          LEAVE LIST-PROCESSING.
      ENDTRY.
    Make header of the report
      PERFORM sub_header_report USING v_oref_table.
    Get the toolbar
      v_oref_functions = v_oref_table->get_functions( ).
    For activating application toolbar
      v_oref_functions->set_all( abap_true ).
      v_oref_columns = v_oref_table->get_columns( ).
    It populate the key fields which are always displayed
      PERFORM sub_fill_fields_of_fcatalog USING:
    'SUM_COMM'        l_lead_col                ' ',
    'RACCT'          'Account Number'(035)      ' ',
    'FOBAC'          'FOB Acrual'(023)          'X',
    'EXCESS'         'Excess'(024)              'X',
    'OBSOLE'         'Obsolescence'(025)        'X',
    'PPV'            'Puchachse Price Var'(026) 'X',
    'FR_VAR'         'Freight Variance'(027)    'X',
    'PROD_OR_VAR'    'Produc Ord Var'(028)      'X',
    'DEP_VAR'        'Dept. Variance'(029)      'X',
    'OTH_PROD_VAR'   'Other Prod Var'(030)      'X',
    'PR_OR_SCRP_VAR' 'Scrap Variance'(031)      'X',
    'COST_OF_ACC'    'Cost of Sales Accnt'(032) 'X',
    'INV_ACC'        'Inventory Account'(033)   'X'.
    Optimize the columns
      v_oref_columns->set_optimize( value = 'X' ).
    Setting the layout
    get the LAYOUT object
      l_oref_layout = v_oref_table->get_layout( ).
    set the layout key
      l_progname = sy-repid.
      l_wa_key-report = l_progname.
      l_oref_layout->set_key( value = l_wa_key ).
    set save restriction:
    none / only user-dependent / only user-independent
      l_oref_layout->set_save_restriction(
      value = if_salv_c_layout=>restrict_none  ).
    set: setting of default layout is allowed / isnu2019t allowed
      l_oref_layout->set_default( value = 'X' ).
    Dispaly the output
      v_oref_table->display( ).
    ENDFORM.                    " sub_prepare_display_output
    *&      Form  sub_header_report
        Create the header of the report
         -->P_v_oref_TABLE  table name
    FORM sub_header_report  USING    p_v_oref_table TYPE REF TO
                                               cl_salv_table .
      DATA : l_oref_grid TYPE REF TO cl_salv_form_layout_grid.
      CREATE OBJECT l_oref_grid.
    Add  text items for top of page
      l_oref_grid->create_text( row = 1  column = 1  text = 'Program'(022)
      l_oref_grid->create_text( row = 1  column = 2  text = sy-repid  ).
      l_oref_grid->create_text( row = 2  column = 1
      text = 'User Name'(021) ).
      l_oref_grid->create_text( row = 2  column = 2  text = sy-uname  ).
      l_oref_grid->create_text( row = 3  column = 1  text = 'Date'(020) ).
      l_oref_grid->create_text( row = 3  column = 2  text = sy-datum ).
      l_oref_grid->create_text( row = 3  column = 3  text = 'Time'(019)  ).
      l_oref_grid->create_text( row = 3  column = 4  text = sy-uzeit  ).
      l_oref_grid->create_text( row = 4  column = 1  text = 'System'(018) ).
      l_oref_grid->create_text( row = 4  column = 2  text = sy-sysid ).
      l_oref_grid->create_text( row = 4  column = 3  text = 'Client'(017) ).
      l_oref_grid->create_text( row = 4  column = 4  text = sy-mandt ).
    Declare grid as header of list
      p_v_oref_table->set_top_of_list( value = l_oref_grid ).
    ENDFORM.                    " sub_header_report
    *&      Form  sub_fill_fields_of_fcatalog
          This subroutine populates the field catalog excluding
          period fields
         -->P_FIELDNAME Table field name
         -->P_NAME      Field description
         -->P_DEC       Decimal value flag
    FORM sub_fill_fields_of_fcatalog  USING p_fieldname TYPE lvc_fname
                                            p_name      TYPE c
                                            p_dec       TYPE c.
      DATA: l_char_l TYPE scrtext_l,  "For short text
            l_char_m TYPE scrtext_m,  "For medium text
            l_char_s TYPE scrtext_s,  "For long text
            l_except1   TYPE REF TO cx_salv_not_found,"Exception
            l_text1     TYPE string,            "Exception msg
            l_orf_aggregs TYPE REF TO cl_salv_aggregations.
    Getting the text long/short/medium into variables
      l_char_l = p_name.
      l_char_m = p_name.
      l_char_s = p_name.
    Setting the long/short/medium text and fix the key fileds
      TRY.
          CALL METHOD v_oref_columns->get_column
            EXPORTING
              columnname = p_fieldname
            RECEIVING
              value      = v_oref_column1.
        CATCH cx_salv_not_found INTO l_except1.
          l_text1 = l_except1->get_text( ).
          MESSAGE i000 WITH l_text1.
          LEAVE LIST-PROCESSING.
      ENDTRY.
      v_oref_column ?= v_oref_column1.
      v_oref_column->set_long_text( l_char_l ).
      v_oref_column->set_medium_text( l_char_m ).
      v_oref_column->set_short_text( l_char_s ).
      v_oref_column->set_key( value = 'X' ).
      v_oref_columns->set_key_fixation( value = 'X' ).
    Set the decimal length
      IF p_dec = 'X'.
        v_oref_column->set_decimals( value = '2' ).
      ENDIF.
      IF p_fieldname = 'RACCT' AND p_gl <> c_check.
        v_oref_column->set_visible( value = space ).
      ENDIF.
      IF p_gl = c_check.
        v_oref_columns->set_column_position( columnname = 'RACCT'
                                               position = 2 ).
      ENDIF.
      IF p_fieldname NE 'RACCT' AND p_fieldname NE 'SUM_COMM'.
        l_orf_aggregs = v_oref_table->get_aggregations( ).
        l_orf_aggregs->add_aggregation( columnname = p_fieldname
                       aggregation = if_salv_c_aggregation=>total ).
      ENDIF.
    ENDFORM.                    " sub_fill_fields_of_fcatalog

Maybe you are looking for