Dear all,
I am facing a short dump while using the ALV fieldcatalog do_sum.
I tried to search the solutions online but to no avail. Anyone can help me to take a look at these codes:
Below are my sample codes:
DATA: BEGIN OF itab_s_ar OCCURS 0, item(2), kunnr LIKE kna1-kunnr, name1 LIKE kna1-name1, waers LIKE bsis-waers, total LIKE bsis-dmbtr, dmbtr1 LIKE bsis-dmbtr, dmbtr2 LIKE bsis-dmbtr, dmbtr3 LIKE bsis-dmbtr, dmbtr4 LIKE bsis-dmbtr, END OF itab_s_ar. g_itab = 'ITAB_S_AR'. CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE' EXPORTING i_program_name = ly_repid i_internal_tabname = g_itab * I_STRUCTURE_NAME = * I_CLIENT_NEVER_DISPLAY = 'X' i_inclname = ly_repid * i_bypassing_buffer = 'X' * i_buffer_active = 'X' CHANGING ct_fieldcat = t_fieldcat * EXCEPTIONS * INCONSISTENT_INTERFACE = 1 * PROGRAM_ERROR = 2 * OTHERS = 3 . IF sy-subrc <> 0. * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO * WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4. ENDIF. LOOP AT t_fieldcat INTO s_fieldcat. CASE s_fieldcat-fieldname. WHEN 'ITEM'. s_fieldcat-outputlen = '3'. s_fieldcat-seltext_l = '#'. s_fieldcat-just ='C'. WHEN 'KUNNR'. s_fieldcat-outputlen = '13'. s_fieldcat-seltext_l = 'Customer Code'. s_fieldcat-key = ' '. s_fieldcat-just = 'C'. WHEN 'NAME1'. s_fieldcat-outputlen = '35'. s_fieldcat-seltext_l = 'Customer Name'. WHEN 'WAERS'. s_fieldcat-outputlen = '4'. s_fieldcat-seltext_m = 'LCur'. WHEN 'TOTAL'. s_fieldcat-outputlen = '16'. s_fieldcat-seltext_m = 'Total'. s_fieldcat-seltext_l = 'Total'. s_fieldcat-reptext_ddic = 'Total'. s_fieldcat-cfieldname = 'WAERS'. s_fieldcat-do_sum = 'X'. s_fieldcat-just = 'C'. WHEN 'DMBTR1'. s_fieldcat-outputlen = '16'. s_fieldcat-seltext_m = '0 - 30'. s_fieldcat-seltext_l = '0 - 30'. s_fieldcat-reptext_ddic = '0 - 30'. s_fieldcat-cfieldname = 'WAERS'. s_fieldcat-just = 'C'. WHEN 'DMBTR2'. s_fieldcat-outputlen = '16'. s_fieldcat-seltext_m = '31 - 60'. s_fieldcat-seltext_l = '31 - 60'. s_fieldcat-reptext_ddic = '31 - 60'. s_fieldcat-cfieldname = 'WAERS'. s_fieldcat-just = 'C'. WHEN 'DMBTR3'. s_fieldcat-outputlen = '16'. s_fieldcat-seltext_m = '61 - 90'. s_fieldcat-seltext_l = '61 - 90'. s_fieldcat-reptext_ddic = '61 - 90'. s_fieldcat-cfieldname = 'WAERS'. s_fieldcat-just = 'C'. WHEN 'DMBTR4'. s_fieldcat-outputlen = '16'. s_fieldcat-seltext_m = '90+'. s_fieldcat-seltext_l = '90+'. s_fieldcat-reptext_ddic = '90+'. s_fieldcat-cfieldname = 'WAERS'. s_fieldcat-just = 'C'. ENDCASE. MODIFY t_fieldcat FROM s_fieldcat. ENDLOOP.
Your help will be muc appreciated!
Thanks
Hi,
WHEN 'TOTAL'.
s_fieldcat-outputlen = '16'.
s_fieldcat-seltext_m = 'Total'.
s_fieldcat-seltext_l = 'Total'.
s_fieldcat-reptext_ddic = 'Total'.
s_fieldcat-cfieldname = 'WAERS'.
s_fieldcat-do_sum = 'X'.
s_fieldcat-just = 'C'.
comment the field : s_fieldcat-reptext_ddic = 'Total' and s_fieldcat-cfieldname = 'WAERS'.
Assign filedcatalog as s_fieldcat-fieldname = 'WAERS'.
Definitly you will get good solution.
Good Luck
here's my coding to that problem:
read table cat2 with key fieldname = 'TOTAL' into cat. zind = sy-tabix. cat-do_sum = 'X'. modify cat2 from cat index zind. ...
try it without filling just, ouputlength and cfieldname...
grx
A.
Hey
there is a problem withn your code.
s_fieldcat-outputlen = '16'.
s_fieldcat-seltext_m = 'Total'.
s_fieldcat-seltext_l = 'Total'.
s_fieldcat-reptext_ddic = 'Total'.
s_fieldcat-cfieldname = 'WAERS'.
s_fieldcat-do_sum = 'X'.
s_fieldcat-just = 'C'.
you are using vase for fieldname 'TOTAL'
and you are trying to change the fieldname to 'WAERS', obvuously it will dump.
correct your code and try 100% sure this will work 😊
Thanks,
Vinayaka
Add a comment