2023 Apr 13 5:51 PM
Dear,
I am reading a table with an INDEX INTO tabix, but I would like to have 2 digits in my LV_TABIX.
DATA(lt_tree) = VALUE wdy_key_value_list(
FOR ls_data IN gi_data
INDEX INTO lv_tabix ( key = lv_tabix ) ) .
Currently, my KEY contains : 1,2,3,4,5
and I would like formatted values like this: 01, 02, 03, 04, 05.
Any idea ?
Thank you in advance.
Best regards,
Rachid
2023 Apr 13 6:36 PM
2023 Apr 13 6:36 PM
2023 Apr 13 7:33 PM
You should avoid creating DDIC types when it's only for internal ABAP processing.
You may use a String Template with the formatting options WIDTH, ALIGN, PAD.
Minimal reproducible example:
DATA(lt_tree) = VALUE string_table(
FOR lv_tabix = 1 WHILE lv_tabix <= 3
( |{ lv_tabix WIDTH = 2 ALIGN = RIGHT PAD = '0' }| ) ) .
ASSERT lt_tree = VALUE string_table( ( `01` ) ( `02` ) ( `03` ) ).<br>
2023 Apr 13 10:22 PM
2023 Apr 16 4:16 PM
Hello,
And even if I delete ALPHA=IN, the result is "1" not "000000000000000000000001".
Best regards,