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

ABAP OO GRID on selection screen

glauco
Active Contributor
0 Likes
1,177

Hi friends.

Please. I want help about a grid I put on selection screen of a executable program.

This grid works only with 10 lines and one column. So user can put up to 10 sales orders numbers, so it can be processed when he clicks on execute button (F8).

- Program is type 1-executable.

- Grid is on screen 0100.

- This screen 0100 is called on start-of-selection event of program.

- grid is type ref cl_gui_alv_grid.

- F8 button was added by status gui.

Problem:

Works almost fine until now. But when user change a value on grid and press F8 without give enter. This value is processed with old value, because the event handle_data_changed  was not executed.

The grid do not catch the F8 press. So, the cell value was changed on screen but not in internal table of grid.

I saw in forum a tip to put a command "CALL METHOD wo_grid_sel->check_changed_data( )." in PAI of screen 0100 so it forces a change. BUT, my program process entire program before run the method handle_data_changed, so real change and my custom error message are given too late, after program processing.

thanks.

Glauco

Hi friends.

Please. I want help about a grid I put on selection screen of a executable program.

This grid works only with 10 lines and one column. So user can put up to 10 sales orders numbers, so it can be processed when he clicks on execute button (F8).

- Program is type 1-executable.

- Grid is on screen 0100.

- This screen 0100 is called on start-of-selection event of program.

- grid is type ref cl_gui_alv_grid.

- F8 button was added by status gui.

Problem:

Works almost fine until now. But when user change a value on grid and press F8 without give enter. This value is processed with old value, because the event handle_data_changed  was not executed.

The grid do not catch the F8 press. So, the cell value was changed on screen but not in internal table of grid.

I saw in forum a tip to put a command "CALL METHOD wo_grid_sel->check_changed_data( )." in PAI of screen 0100 so it forces a change. BUT, my program process entire program before run the method handle_data_changed, so real change and my custom error message are given too late, after program processing.

thanks.

Glauco

4 REPLIES 4
Read only

RaymondGiuseppi
Active Contributor
0 Likes
791

Why don't you actually put the ALV grid on the selection screen. Use a CL_GUI_DOCKING_CONTAINER to attach a container at bottom of selection-screen, e.g. in INITIALIZATION, and manage the ALV grid in AT SELECTION-OUTPUT and  in the AT SELECTION-SCREEN EVENT use the CL_GUI_ALV_GRID->CHECK_CHANGED_DATA (CL_GUI_CFW=>FLUSH should not be required) before the F8 raise the START-OF-SELECTION event.

Regards,

Raymond

Read only

0 Likes
791

Hi Raymond!

I tryied the way you have said. It's not working.

It's hapenning the same problem of PAI, but now in start-of-selection.

best regards.

Glauco

Message was edited by: Glauco Kubrusly

Read only

0 Likes
791

Create the docking container attached to the selection-screen dynpro (CREATE in INITIALIZATION event) and use this container as the parent of the ALV grid. Then put your PBO code in AT SELECTION-SCREEN OUTPUT and your PAI code in AT SELECTION-SCREEN event.

So use the CL_GUI_ALV_GRID->CHECK_CHANGED_DATA in AT SELECTION-SCREEN event. (and CL_GUI_CFW=>FLUSH if required)

You could also create NO-DISPLAY parameters that will save the content and layout of the ALV grid in variants, provided you add some code in PBO/PAI to copy information between thiose hidden parameters and the actual ALV grid.

Using keywords CL_GUI_DOCKING_CONTAINER SELECTION-SCREEN you will easily find some samples to attach a container to selection screen for grid, picture or text editor.

Regards,

Raymond

Read only

0 Likes
791

Hi Raymond.

Thank you a lot. But I found the answer by myself.

The solution I found was as following:

MODULE user_command_0100 INPUT.

* Ações do User

  CASE wc_okcode.

    WHEN cc_exec.

      IF wo_event_rec IS BOUND AND

         wo_grid_sel  IS BOUND.

*       apply changes on the GRID (in case of user clicks on F8 after changing)

        CALL METHOD wo_grid_sel->check_changed_data( ).

        cl_gui_cfw=>flush( ). " <----- This line force/calls screen changes to internal table

*       This is the solution. New method checking the MT_PROTOCOLL errors table.

        CHECK wo_event_rec->check_erro_calca_arriada( ) = abap_false.

(...PAI processing...)

thanks a lot.

Glauco