on 03-30-2012 6:51 AM
Hi,
I have a requirement like in select-option i have to give dates. and click on sbmit buttion .In alv report i have to show the number of months in alv
like if i give 20.10.2010 and 01.12.2010
then in alv it will show columns like oct2010 nov2010 dec2010 with 3 fields i have to show in alv.
eg:2 i give 20.8.2010 and 01.12.2010
then in alv it will show columns like aug2010 sept2010 oct201 .......dec2010 with 4 fields ihave to show
Here i have to show dynamic alv columns...
I know how to use alv with static structure, But I dont no how to proceed it dynamically.....Pls help me.
I have a question for you.
eg:2 i give 20.11.2010 | and 01.2.2011 |
Is this test case value in your case, In case do you want to show Nov 2010, dec 2010, jan 2011, feb 2011 columns.
I can guide you further if this is cleared.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Refer to this link for more information
In the above link they have populated a field catalog with 2 columns.
You have to determine the number of columns to be generated first and modify the code accordingly.
data lv_col_id type string.
DO LV_COUNT TIMES. "LVcount for number of columns calculation
concatenate 'FLD' sytabix into lv_col_id. "you can give oct,nov as per your requriement
condense lv_col_id no-gaps.
lw_fieldcat-fieldname = lv_col_id.
lw_fieldcat-datatype = 'string'. "or 'C' if you know the length
lw_fieldcat-outputlen = '24'.
lw_fieldcat-coltext = lv_col_id.
lw_fieldcat-seltext = lw_fieldcat-coltext.
append lw_fieldcat to lt_fieldcat.
ENDDO.
Rest of the logic refer to the link.
There is a FM that reruns the names of the month "MONTH_NAMES_GET" you can use for column Id change code accordingly.
Hope this helps.
User | Count |
---|---|
95 | |
11 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.