06-23-2009 5:35 AM
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
06-23-2009 5: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.
06-23-2009 5:48 AM
hi,
pls check this link
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.
06-23-2009 5:54 AM
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
06-23-2009 6: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.
06-23-2009 6:47 AM
06-23-2009 6: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