2011 Dec 17 5:19 AM
Hellow Experts,
i got the some code to genrate auto genrated column based on date my out put is as follow
StudentID Day00 Day01 Day02 ......Day31
178 20 30 40 50
My Code for genrate day is
LOOP AT gt_cols INTO gs_col.
TRY.
CONCATENATE 'DATE' gs_col-date INTO g_col. "Define Column name
gr_column ?= gr_columns->get_column( g_col ). "Get column
CONCATENATE 'Day' gs_col-date+6(2) INTO g_txt. "Define new label (Day01, .., Day31)
gr_column->set_long_text( g_txt ). "Set label long text
CATCH cx_salv_not_found. "#EC NO_HANDLER
ENDTRY.
* CATCH cx_salv_not_found. "#EC NO_HANDLER
* ENDTRY.
ENDLOOP.
My requirment is i dont need 'Day00' like follow
StudentID Day01 Day02 ......Day31
178 30 40 50
PLz help me and Ammend my above code to remove Day00.Thanks
2011 Dec 19 6:27 AM
Hi Neha,
While copying the code from somewhere else please try to know what s written and understand it. Your problem is indicated in your code itself. You do not need a help for this simple thing.
Kesav
Hellow Experts,
i got the some code to genrate auto genrated column based on date my out put is as follow
StudentID Day00 Day01 Day02 ......Day31
178 20 30 40 50
My Code for genrate day is
LOOP AT gt_cols INTO gs_col.
TRY.
CONCATENATE 'DATE' gs_col-date INTO g_col. "Define Column name
gr_column ?= gr_columns->get_column( g_col ). "Get column
CONCATENATE 'Day' gs_col-date+6(2) INTO g_txt. "Define new label (Day01, .., Day31)
gr_column->set_long_text( g_txt ). "Set label long text
CATCH cx_salv_not_found. "#EC NO_HANDLER
ENDTRY.
* CATCH cx_salv_not_found. "#EC NO_HANDLER
* ENDTRY.
ENDLOOP.
My requirment is i dont need 'Day00' like follow
StudentID Day01 Day02 ......Day31
178 30 40 50
PLz help me and Ammend my above code to remove Day00.Thanks
2011 Dec 19 3:54 AM
Hi Neha ,
if you have date ranges at the selection screen , then you need to use FM DAY_ATTRIBUTES_GET to get dates in given date ranges....and it wil determines no of columns needed for the output...
or simply put following code corrections
LOOP AT gt_cols INTO gs_col whre date is not initial."Added By Prabhu , no point to have a column if date is initial.
TRY.
CONCATENATE 'DATE' gs_col-date INTO g_col. "Define Column name
gr_column ?= gr_columns->get_column( g_col ). "Get column
CONCATENATE 'Day' gs_col-date+6(2) INTO g_txt. "Define new label (Day01, .., Day31)
gr_column->set_long_text( g_txt ). "Set label long text
CATCH cx_salv_not_found. "#EC NO_HANDLER
ENDTRY.
* CATCH cx_salv_not_found. "#EC NO_HANDLER
* ENDTRY.
ENDLOOP.
2011 Dec 19 5:15 AM
Hi Neha,
can you share some more code like the declaration's.
Regards,
Abhisek.
2011 Dec 19 6:27 AM
Hi Neha,
While copying the code from somewhere else please try to know what s written and understand it. Your problem is indicated in your code itself. You do not need a help for this simple thing.
Kesav
2011 Dec 25 4:35 AM
Thanks Kehsv ,
yes u was right, i sloved problm my self. only i make one condition ststment if Day00 then execute
any way many thanks to all of you.
Regards
Neha
2011 Dec 25 4:36 AM
| User | Count |
|---|---|
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |