Skip to Content

Problem with Toolbars in LVC_S_LAYO

Dear all,

i am using structure LVC_S_LAYO.

Here in my toolbar some icons like show next,summation are inactive.

Also i am using LVC_T_FCAT where i have set DO_SUM = 'X'.

When i see in debugging the value X is getting passed from my it_fieldcatalog table but still

the sum of the desired column is not displayed.what must be the problem?

Why are these icons inactive in the toolbar.?What should i do to Activate them?

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

5 Answers

  • Posted on Dec 02, 2007 at 11:59 AM

    The column you want to sum, the data type of that variable must be declared as type integer (type i) or packed (type p).

    Cheers,

    Sougata.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Dec 02, 2007 at 12:09 PM

    Rahul,

    Can you paste your code?

    Regards,

    Satish

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Dec 03, 2007 at 05:17 AM

    Dear Sougata,

    I am still unable to display the sum by declaring hte column i want to sum up as P or I.

    What can be the problem?

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Dec 03, 2007 at 08:17 AM

    If you are using the OO model cl_gui_alv_grid you won´t need any of the fcat models as the sum facility is included on the standard toolbar.

    Just select the column and then press the SUM button.

    If you switch to the OO model you don`t need to do very much coding and there are a lot less chances of getting errors.

    However if you DO program the toolbar then you will need some code like

    1) in the constructor set the handler for the ON TOOLBAR event.

    SET HANDLER z_object->on_toolbar FOR grid1.

    also have one for ON_USER_COMMAND

    SET HANDLER z_object->on_user_command FOR grid1.

    2) in the the toolbar method activate the buttons you need

    For example

    method ON_TOOLBAR.

    type-pools icon.

    CLEAR ls_toolbar.

    MOVE 0 TO ls_toolbar-butn_type.

    MOVE 'EXIT' TO ls_toolbar-function.

    MOVE space TO ls_toolbar-disabled.

    MOVE icon_system_end TO ls_toolbar-icon.

    MOVE 'Click2Exit' TO ls_toolbar-quickinfo.

    APPEND ls_toolbar TO e_object->mt_toolbar.

    CLEAR ls_toolbar.

    MOVE 0 TO ls_toolbar-butn_type.

    MOVE 'SAVE' TO ls_toolbar-function.

    MOVE space TO ls_toolbar-disabled.

    MOVE icon_system_save TO ls_toolbar-icon.

    MOVE 'Save data' TO ls_toolbar-quickinfo.

    APPEND ls_toolbar TO e_object->mt_toolbar.

    CLEAR ls_toolbar.

    MOVE 0 TO ls_toolbar-butn_type.

    MOVE 'EDIT' TO ls_toolbar-function.

    MOVE space TO ls_toolbar-disabled.

    MOVE icon_toggle_display_change TO ls_toolbar-icon.

    MOVE 'Edit data' TO ls_toolbar-quickinfo.

    MOVE 'EDIT' TO ls_toolbar-text.

    APPEND ls_toolbar TO e_object->mt_toolbar.

    CLEAR ls_toolbar.

    MOVE 0 TO ls_toolbar-butn_type.

    MOVE 'PROC' TO ls_toolbar-function.

    MOVE space TO ls_toolbar-disabled.

    MOVE icon_businav_process TO ls_toolbar-icon.

    MOVE 'Process.' TO ls_toolbar-quickinfo.

    MOVE 'PROC' TO ls_toolbar-text.

    APPEND ls_toolbar TO e_object->mt_toolbar.

    CLEAR ls_toolbar.

    MOVE 0 TO ls_toolbar-butn_type.

    MOVE 'EXCEL' TO ls_toolbar-function.

    MOVE space TO ls_toolbar-disabled.

    MOVE icon_xxl TO ls_toolbar-icon.

    MOVE 'Excel' TO ls_toolbar-quickinfo.

    MOVE 'EXCEL' TO ls_toolbar-text.

    APPEND ls_toolbar TO e_object->mt_toolbar.

    MOVE 0 TO ls_toolbar-butn_type.

    MOVE 'REFR' TO ls_toolbar-function.

    MOVE space TO ls_toolbar-disabled.

    MOVE icon_refresh TO ls_toolbar-icon.

    MOVE 'Refresh' TO ls_toolbar-quickinfo.

    MOVE 'REFR' TO ls_toolbar-text.

    APPEND ls_toolbar TO e_object->mt_toolbar.

    • ...

    endmethod.

    What the above code does is set the variable E_UCOMM with the value in the toolbar function for example if I press the EXCEL button E_UCOMM is set to EXCEL.

    Now the method ON_USER_COMMAND is called where you can then choose your method / action for the toolbar.

    method ON_USER_COMMAND.

    • FOR EVENT before_user_command OF cl_gui_alv_grid

    • IMPORTING

    • e_ucomm

    • sender.

    CASE e_ucomm.

    WHEN 'EXIT'.

    LEAVE PROGRAM.

    WHEN 'EXCEL'.

    CALL METHOD me->download_to_excel.

    WHEN 'SAVE'.

    WHEN 'PROC'.

    CALL METHOD me->process.

    WHEN 'REFR'.

    CALL METHOD me->refresh.

    ENDCASE.

    • ...

    endmethod.

    Note that the routine ON Data Changed Finished is always called before the user command handling if you set a handler for the event data changed finished;

    Your data of course must still be correct for summing it must be NUMERIC.

    Cheers

    jimbo

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Dec 03, 2007 at 08:20 AM

    Hi,

    If you are making do_sum for the field in field catalog, then it will display the total for the field.It is not having any relation with sum icon.

    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.