2010 Mar 01 8:24 AM
I have an ALV report that have ALV layout selected by user. My requirement is i need to get same set of fields from the layout selected. and using this i need to create the internal table at runtime
Any info on this appreciated.
a®
I have an ALV report that have ALV layout selected by user. My requirement is i need to get same set of fields from the layout selected. and using this i need to create the internal table at runtime
Any info on this appreciated.
a®
2010 Mar 01 8:35 AM
Hi,
<li>Check the below sample code how you have to get build internal table at run time.
Thanks
Venkat.O
*----------------------------------------------------------------------*
* Form GET_FIELDCAT_FROM_VARIANT
*----------------------------------------------------------------------*
* Retrieve the fieldcatalog stored for the variant
*----------------------------------------------------------------------*
form get_fieldcat_from_variant using disvar like disvariant
itab_head type c
itab_item type c.
data: fieldcat_new type kkblo_t_fieldcat.
call function 'REUSE_ALV_TRANSFER_DATA'
exporting
it_fieldcat = fieldcat
is_layout = layout
importing
et_fieldcat = fieldcat_kkb
es_layout = layout_kkb.
call function 'LT_VARIANT_LOAD'
exporting
i_tabname = itab_head
i_tabname_slave = itab_item
i_dialog = space
i_user_specific = 'X'
importing
et_fieldcat = fieldcat_new
changing
ct_default_fieldcat = fieldcat_kkb
cs_layout = layout_kkb
cs_variant = disvar
exceptions
wrong_input = 1
fc_not_complete = 2
not_found = 3
others = 4.
if sy-subrc = 0.
refresh fieldcat.
call function 'REUSE_ALV_TRANSFER_DATA_BACK'
exporting
it_fieldcat = fieldcat_new
importing
et_fieldcat = fieldcat.
clear: fieldcat_ln.
modify fieldcat from fieldcat_ln transporting no_out
where no_out <> 'X'.
endif.
endform. " GET_FIELDCAT_FROM_VARIANT
*----------------------------------------------------------------------*
2010 Mar 02 10:26 AM
| User | Count |
|---|---|
| 5 | |
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |