Skip to Content
author's profile photo Former Member
Former Member

how to edit a field catalogue

hi experts,

How can we edit feild catalogue in an alv and after editing it the output should display in an new output list or in a new report after we press a button

thanks

harish

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

5 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Dec 18, 2008 at 07:49 AM

    hi Harish,

    you can make field catalog manually as shown below:

    PERFORM build_fieldcat TABLES i_fieldcat[]
      USING :
    
    *-Output-field Table          Len   Ref tab   Ref field    Heading     Col_pos
       'VBELN'       'T_ITAB1'     10   'VBAP'  'VBELN'       ''                 1,
       'POSNR'       'T_ITAB1'     6    'VBAP'  'POSNR'      ''                 2,
       'WERKS'       'T_ITAB1'     4    'VBAP'  'WERKS'     ''                3,
       'LGORT'       'T_ITAB1'     4    'VBAP'  'LGORT'        ''                4.

    and now u can make changes in it as per your format of output you want.

    regards

    rahul

    Edited by: RAHUL SHARMA on Dec 18, 2008 8:50 AM

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Dec 18, 2008 at 07:49 AM

    Hi,

    Simply change the table with field catalog for columns you want:

    DATA ls_fcat type lvc_s_fcat,
             pt_fieldcat type lvc_t_fcat.  "fieldcatalog
    
    LOOP AT pt_fieldcat INTO ls_fcat .
        CASE pt_fieldcat-fieldname .
           WHEN 'CARRID' .    "for particular column
             ls_fcat-outpulen = '10' .
             ls_fcat-coltext = 'Airline Carrier ID' .
             MODIFY pt_fieldcat FROM ls_fcat .  "change fieldcatalog
           WHEN 'PAYMENTSUM' .   "for another column
             ls_fcat-no_out = 'X' .
             MODIFY pt_fieldcat FROM ls_fcat .  "change it too
          ENDCASE .
    ENDLOOP .
    

    Then refresh your display

    CALL METHOD gr_alvgrid->refresh_table_display.
    

    Regards

    Marcin

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Dec 18, 2008 at 07:54 AM

    Hi

    program BCALV_EDIT_02 in the SLIS package

    Change the field catalog edit property as

    data: ft_cat type lvc_s_fcat.

    Create field catalog.

    If ft_cat-fieldname = 'MATNR'.

    ft_cat-edit = 'X'.

    endif.

    {CODE ENDS)

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Dec 18, 2008 at 07:58 AM

    hello rahul thanks for ur info but after editing the fields they must be displayed in a seperate report ,the edited fields shuld be diplayed in a seperate report .

    let me explain u all clearly "In an ALV their is a "submit" button ,and we shuld edit the fields and after editing if we click that "submit " button the edited fields must be displayed in a seperate report or seperate output must be displayed

    regards

    harish

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Dec 18, 2008 at 08:00 AM

    Hi,

    data: i_modified TYPE STANDARD TABLE OF mara,"For getting modified rows
            w_modified TYPE mara.
    
    
    CASE e_ucomm.
          WHEN 'EDIT'.
    
          perform save_database.
          CALL METHOD ref_GRID->REFRESH_TABLE_DISPLAY.
    
        ENDCASE.
    
    
    FORM SAVE_DATABASE .
    data: i_selected_rows TYPE lvc_t_row,                "Selected Rows
          w_selected_rows TYPE lvc_s_row.
    
    
    * Getting the selected rows index
        CALL METHOD ref_grid->get_selected_rows
                    IMPORTING  et_index_rows = i_selected_rows.
    
    * Through the index capturing the values of selected rows
        LOOP AT i_selected_rows INTO w_selected_rows.
        READ TABLE it_tab INTO wa_it_tab INDEX w_selected_rows-index.
        IF sy-subrc EQ 0.
          MOVE-CORRESPONDING wa_it_tab TO w_modified.
          APPEND w_modified TO i_modified.
        ENDIF.
      ENDLOOP.
      MODIFY mara FROM TABLE i_modified.
    
    

    Thanks & Regards,

    Krishna...

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.