2015 Sep 15 10:34 AM
Hi,
Recently I noticed a "strange" dump during some developments.
Here is the detail:
***CODE***
<The code>
lv_day = 1.
WHILE lv_day < lv_datum+6(2).
SHIFT lv_day LEFT DELETING LEADING '0'.
CONCATENATE 'DAY' lv_day INTO lv_fname.
ls_lineformat-fieldname = lv_fname.
ls_lineformat-style = cl_gui_alv_grid=>mc_style_disabled.
APPEND ls_lineformat TO lsx_output-lineformat.
MODIFY gtx_output FROM lsx_output TRANSPORTING lineformat.
lv_day = lv_day + 1.
ENDWHILE.
***DECLARATIONS***
<Just to some context>
ls_lineformat TYPE lvc_s_styl,
lv_fname TYPE lvc_fname,
lv_day TYPE numc2,
lsx_output LIKE LINE OF gtx_output,
gtx_output TYPE STANDARD TABLE OF ty_lpca_mdpd,
TYPES:BEGIN OF ty_lpca_mdpd.
INCLUDE TYPE ty_t_lpca_mdpd.
TYPES: cellcolor TYPE lvc_t_scol,
lineformat TYPE lvc_t_styl,
linecolor(4) TYPE c,
edit TYPE c.
TYPES: END OF ty_lpca_mdpd.
***DUMP***
<The problem>
So far what I noticed was that as long as the creation of DAY1; DAY2; DAY3; ... DAY9; DAY10 stays without a 0 prefix on the number, we get the dump, otherwise if we comment the SHIFT lv_day LEFT DELETING LEADING '0'. and by doing that we get something like DAY01; DAY02; DAY03 ... DAY09; DAY10 we don't get the dump.
It's strange to me the management which leads the dump, it's supposed?
Thank you for some kind of enlightenment.
Hi,
Recently I noticed a "strange" dump during some developments.
Here is the detail:
***CODE***
<The code>
lv_day = 1.
WHILE lv_day < lv_datum+6(2).
SHIFT lv_day LEFT DELETING LEADING '0'.
CONCATENATE 'DAY' lv_day INTO lv_fname.
ls_lineformat-fieldname = lv_fname.
ls_lineformat-style = cl_gui_alv_grid=>mc_style_disabled.
APPEND ls_lineformat TO lsx_output-lineformat.
MODIFY gtx_output FROM lsx_output TRANSPORTING lineformat.
lv_day = lv_day + 1.
ENDWHILE.
***DECLARATIONS***
<Just to some context>
ls_lineformat TYPE lvc_s_styl,
lv_fname TYPE lvc_fname,
lv_day TYPE numc2,
lsx_output LIKE LINE OF gtx_output,
gtx_output TYPE STANDARD TABLE OF ty_lpca_mdpd,
TYPES:BEGIN OF ty_lpca_mdpd.
INCLUDE TYPE ty_t_lpca_mdpd.
TYPES: cellcolor TYPE lvc_t_scol,
lineformat TYPE lvc_t_styl,
linecolor(4) TYPE c,
edit TYPE c.
TYPES: END OF ty_lpca_mdpd.
***DUMP***
<The problem>
So far what I noticed was that as long as the creation of DAY1; DAY2; DAY3; ... DAY9; DAY10 stays without a 0 prefix on the number, we get the dump, otherwise if we comment the SHIFT lv_day LEFT DELETING LEADING '0'. and by doing that we get something like DAY01; DAY02; DAY03 ... DAY09; DAY10 we don't get the dump.
It's strange to me the management which leads the dump, it's supposed?
Thank you for some kind of enlightenment.
2015 Sep 15 10:44 AM
Hi..
Hands up! It's an illegal statement Well I suppose that if your key is a char key, you have to use 01,02,03 because sort makes a lexicographical order and you need 0 or you'll have something like
1, 10, 11, 12,13,...19, 2, 21...etc...
Hope to help.
2015 Sep 15 11:15 AM
The reason it is giving dump is that append always try to insert the record at the end and it is viaolating you sort order for sorted table lsx_output-lineformat.
Use INSERT ls_lineformat INTO TABLE lsx_output-lineformat.
R
2015 Sep 15 1:19 PM
Rudra has right.
lvc_t_styl is sorted table. Append-statement is invalid for sorted tables. Use insert-statement instead.
2015 Sep 15 1:55 PM
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |