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: 

Problem with Back button in ALV Grid

Former Member
0 Kudos
4,341

Hello Guru's,

I developed one Z-program using  CL_GUI_ALV_GRID &   CL_GUI_CUSTOM_CONTAINER in which i was copied GUI status MAIN100 from standard program  BCALV_GRID_DEMO.  Program working fine as per the bussiness logic but When I Press BACK button in ALV Grid Output screen.. It was not going back to Selection-screen. one Blank screen appearing first and then on second (BACK)click it was going to Selection screen. Here I want to avoid blank screen.

Could you please help me out and do the needful.

Regards,

Sankarbabu

6 REPLIES 6

Former Member
0 Kudos
1,455

hi,

While you check user command, Try using Leave to screen 0 on 'BACK', and check whether back button is assigned same command text or not.

Regards,

shun

Former Member
0 Kudos
1,455

Hi,

You first activate your PF-STATUS for this copied program.

or

write code

if sy-ucomm.   " for back button

leave screen to 0.

endif

but first try to activate your copied programs PF-STATUS.

former_member184158
Active Contributor
0 Kudos
1,455

Hi

you just tell him which screen schould be displayed, so when BACK,  leave to screen 0.

in PAI .

MODULE PAI INPUT.

*   to react on oi_custom_events:

     call method cl_gui_cfw=>dispatch.

   CASE OK_CODE.

     WHEN 'EXIT'.

     leave screen to 0.

     WHEN OTHERS.

*     do nothing

   ENDCASE.

   CLEAR OK_CODE.

I hope, it will help you .

Regards

Ibr

SwadhinGhatuary
Active Contributor
0 Kudos
1,455

HI,

USE set screen 0.

leave screen.

in back button action.

kartikrajag
Participant
0 Kudos
1,455

I ran into similar (same) issue, the cause in my case was a SKIP statement in SELECTION-SCREEN. The BACK button on ALV is taking to a blank screen (whose Program(GUI) = SAPMSSY0 & GUI status = STLI).

SKIP statement on selection-screen causes a NEW-LINE written(WRITE statement) in program SAPMSSY0, put a break point at FORM new-line & debug BACK button to get a feel of it.

Remove SKIP from selection screen and try.

KKURTKAN
Newcomer
0 Kudos
1,267

Hello,

Its possible that you are facing this problem because you might call avl function inside PAI Module. It causes a nested Calling of functions. First it calls the screen then the avl function. So when you back out it closes the avl function and displays you a blank screen. I solution i found is this;

  FORM disp_avl.
 SET PF-STATUS 'STATUS_0100'.
 SET TITLEBAR 'TITLE_0100'.



 SELECT FROM zhr_t_customer3 INTO TABLE gt_customer3.

cl_salv_table=>factory(
  IMPORTING
    r_salv_table  go_salv
   CHANGING
     t_table      gt_customer3

    ).

go_salv->display).
    ENDFORM.


and then you need to call it outside the PAI module. like this;

SELECTION-SCREEN BEGIN OF BLOCK b11 WITH FRAME.
  PARAMETERSrb_rapor RADIOBUTTON GROUP gr1,
              rb_entry  RADIOBUTTON GROUP gr1.
SELECTION-SCREEN END OF BLOCK b11.

START-OF-SELECTION.

IF rb_report 'X'.
 PERFORM disp_avl.
   ENDIF.
  IF rb_entry 'X'.
    CALL SCREEN '0200'.
  ENDIF.