Application Development 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: 

ALV Grid Display - Cannot exit

Former Member
0 Kudos

Experts,

I have an ALV grid displayed correctly. The code is below. However, when the alv display is executed and displayed, I cannot exit without keying in another transaction. All of my tool bar icons are underintensified. I think I need to do something in my PF-STATUS. Can anyone point me in the right direction?

Thank-You.

report zmm_zrecipes_errs_query.

data: ok_code like sy-ucomm,

lt_zrecipes_errs like table of zrecipes_errs,

grid1 type ref to cl_gui_alv_grid,

g_custom_container type ref to cl_gui_custom_container.

start-of-selection.

******************************************************************

  • Fill report table and call screen to display alv *

******************************************************************

select * from zrecipes_errs into table lt_zrecipes_errs.

call screen 100.

******************************************************************

  • Process Before Output Modules *

******************************************************************

module setup output.

set pf-status 'MAIN100'.

if g_custom_container is initial.

create object g_custom_container

exporting container_name = 'MY_CONTROL_AREA'.

create object grid1

exporting i_parent = g_custom_container.

call method grid1->set_table_for_first_display

exporting

i_structure_name = 'ZRECIPES_ERRS'

changing

it_outtab = lt_zrecipes_errs.

endif.

endmodule. "setup OUTPUT

*******************************************************************

  • Process After Input Modules *

*******************************************************************

module check_exit input.

case ok_code.

when 'EXIT'.

leave program.

endcase.

clear ok_code.

endmodule. "check_exit INPUT

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi Tom

Firstly you should use the statement before <b>case</b> statement in PAI module.

ok_code = sy-ucomm.

Then after endcase you should clear the ok_ code value. for using the sy-ucomm you have to use the statement in glaobal as:

tables: sscrfields.

7 REPLIES 7

Former Member
0 Kudos

Hello Tom.

In the PBO of ur screen 100.

Flow logic.

PBO:

Module status_output.

In report:

Module status_output.

Set PF-SATAUS 'STATUS'.

ENDMODULE:

Create the status in SE41.

In PAI.

Case sy-ucomm.

WHEn 'BACK'.

leave Program.

endcase.

If useful reward points.

REgeards,

vasanth

Former Member
0 Kudos

Hi, With your code as example , You need to give the function code EXIT to the symbols BACK (green arrow) (yellow arrow ) or red symbols which you see at the top of your screen. This needs to be defined by double clicking your PF-STATUS MAIN100 in your PBO

One another solution is goto SE41 give the program name SAPSALV and for STATUS give 'STANDARD'. Then click on COPY STATUS button and in this give your program name and STATUS as MAIN100. This will definitely solve your problem

Former Member
0 Kudos

Hi Tom

Firstly you should use the statement before <b>case</b> statement in PAI module.

ok_code = sy-ucomm.

Then after endcase you should clear the ok_ code value. for using the sy-ucomm you have to use the statement in glaobal as:

tables: sscrfields.

Former Member
0 Kudos

Hi Tom,

I assume that you have given an exit button in the screen painter and then when you are clicking on the exit button , it is not going back.

One of the reasons is your screen may not activated.

Double click on the screen number 100 in the ABAP statement

CALL SCREEN 100.

and check if it is active or not.

If it is not activated, do it.

Mostly this error comes just because you haven't activated the screen.

If you haven't created an exit button, go to the screen painter and create one and give the function code as EXIT and uncomment the PAI Module.

I think my point is clear.

Regards,

SP.

Former Member
0 Kudos

HI

GOOD

HAVE YOU USED THE PF STATUS IN YOUR ALV REPORT, IF YOU HAVE NOT USED THAN WHICH PF STATUS YOU HAVE MENTIONED.

IT MAY BE THE PROPRETIES OF YOUR REPORT WHICH IS underintensifiNG YOUR NORMAL PF STATUS, SO YOU HAVE TO USE ANOTHER TCODE TO COME OUT FROM THAT PARTICULAR SCREEN.

YOU CAN CREATE YOUR OWN PFSTATUS TO COMEOUT OF THAT SCREEN, YOU CAN USE EXIT AS YOUR PF STATUS.

THANKS

MRUTYUN

former_member188685
Active Contributor
0 Kudos
report zmm_zrecipes_errs_query.

data: ok_code like sy-ucomm,
lt_zrecipes_errs like table of zrecipes_errs,

grid1 type ref to cl_gui_alv_grid,
g_custom_container type ref to cl_gui_custom_container.

start-of-selection.

******************************************************************
* Fill report table and call screen to display alv *
******************************************************************

select * from zrecipes_errs into table lt_zrecipes_errs.

call screen 100.

******************************************************************
* Process Before Output Modules *
******************************************************************

module setup output.
<b>set pf-status 'MAIN100'.</b>"is it activated

if g_custom_container is initial.

create object g_custom_container
exporting container_name = 'MY_CONTROL_AREA'.

create object grid1
exporting i_parent = g_custom_container.

call method grid1->set_table_for_first_display
exporting
i_structure_name = 'ZRECIPES_ERRS'
changing
it_outtab = lt_zrecipes_errs.

endif.

endmodule. "setup OUTPUT

*******************************************************************
* Process After Input Modules *
*******************************************************************
module check_exit input.

case ok_code.
when 'EXIT'.
leave program.
endcase.

clear ok_code.

endmodule. "check_exit INPUT

Regards

Vijay

Former Member
0 Kudos

hi tom.

if you create the ALV in a TABSTRIP, take care with the data object that refer the sy-ucomm field system, because the wizard that create the tabstrip automatically put in your report the data object ok_code.