Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

problem regarding alv

Former Member
0 Likes
389

Hi All,

In report i am using alv grid control with push buttons on the toolbar using oops concept .when i execute the report and click on button for first time ievent is triggered but when i click second time or another button on tool bar control is coming out of program .can u please tell me how to resolve it.

thanks in advance.

2 REPLIES 2
Read only

uwe_schieferstein
Active Contributor
0 Likes
359

Hello Aruna

I assume you are doing the entire event handling within you event handler method (e.g. HANDLE_USER_COMMAND).

However, I recommend to use a different approach. Within your event handler method trigger PAI using the following coding:


METHOD handle_user_command.

  CASE e_ucomm.
    WHEN 'EXECUTE_FUNCTION'.
        CALL METHOD cl_gui_cfw=>set_new_ok_code
           EXPORTING
              ok_code = 'EXECUTE_F1'.
..

" Result: This method call triggers PAI of the screen with a defined ok-code
ENDMETHOD.

MODULE user_command_0100. " PAI
  CASE gd_okcode.
    WHEN 'EXECUTE_F1'.
      perform CALL_FUNCTION_F1.
...
ENDMODULE.

The advantage of this approach is that after executing the function you are always at a defined in the flow logic, i.e. after PBO when the screen is displayed.

Note the normal event handling does NOT trigger PAI which may be required depending on your program logic.

Regards

Uwe

Read only

Former Member
0 Likes
359

Hi ,

Problem is resolved