Skip to Content
author's profile photo Former Member
Former Member

ALV list do_sum with run time field symbol not assigned

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

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

3 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Oct 07, 2010 at 10:33 AM

    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

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Oct 07, 2010 at 07:38 AM

    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.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Oct 07, 2010 at 09:11 AM

    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
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.