Skip to Content
avatar image
Former Member

How to create Dynamic Fieldcatalog ?

Dear all

I want to create dyanamic fieldcatalog .

It is like this :

I have 15 Columns rem1 rem2 ..........................rem15 .

Like suppose filling the final internal table i have data in first 10 fields .

In tht case the empty columns i want to delete dyanamically . Is there any option avaibable while generating the field catalog . Please suggest .

Thanks

Aryan

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

5 Answers

  • avatar image
    Former Member
    Jun 23, 2009 at 04:45 AM

    Hi,

    You can build the Field catalog in this way..

    You need to find the number of fields you need to have in the field catalog..

    DO N TIMES.  " N is the count of the fields in the table
    
    CONCATENATE 'REM' SY-INDEX INTO FIELD.
    
    APPEND field to field catalog.
    
    ENDDO.

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Jun 23, 2009 at 04:48 AM

    hi,

    pls check this link

    report output screen when used cl_alv_table_create=>create_dynamic_table

    use dynamc internal table

    CREATE DATA dyn_line LIKE LINE OF <dyn_table>.

    ASSIGN dyn_line->* TO <dyn_wa>.

    LOOP AT it_out_w.

    MOVE-CORRESPONDING it_out_w TO <dyn_wa>.

    APPEND <dyn_wa> TO <dyn_table>.

    ENDLOOP.

    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'

    EXPORTING

    i_callback_program = v_repid

    is_layout = x_layout

    it_fieldcat = it_fcat

    it_sort = it_sort

    it_events = it_event

    i_save = 'A'

    TABLES

    t_outtab = <dyn_table>

    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 comment
    10|10000 characters needed characters exceeded

    • Former Member

      Dyanamic internal table is the right way i know but the thing is i have developed the whole report now making changes at this level not possible

  • avatar image
    Former Member
    Jun 23, 2009 at 05:02 AM

    Hi ,

    You can Achieve this by using field symbols.

    DO n times.

    assign field value to field symbol.

    and if it is found then you move and append this to a dynamic internal table.

    Please let me know fi you still need any help.

    Thanks and regards,

    Rajeshwar.

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Jun 23, 2009 at 05:47 AM

    hi,

    go through the following link..

    [Dynamic Fieldcatalog|dynamic-table-and-fieldcatalog;

    hopes this helps

    Regards

    RItesh J

    Add comment
    10|10000 characters needed characters exceeded

  • Jun 23, 2009 at 05:55 AM

    Hi,

    Refer:-

    to create dynamic field catalog in alv use:-

    https://www.sdn.sap.com/irj/scn/wiki?path=/display/abap/dynamic%252bfield%252bcatalog%252bin%252balv

    Hope this helps you.

    Regards,

    Tarun

    Add comment
    10|10000 characters needed characters exceeded