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 Problem - User command Back Cancel Exit

Former Member
0 Kudos

Hi Guys,

I was trying to use the ALV grid and my problem is, on the grid display, when i try to hit the back button or exit or cancel, then a blank screen appears and i need to hit either back or other buttons one more time to go back to the selection screen.

Is there any thing I am missing here? Please suggest me the solution.

Thanks in advance,

Srinivas.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Please tell us what you are doing in your code to process the back/exit/cancel.

For example, in ALV I do the following in PAI module:

  IF sy-ucomm = 'BACK'
  OR sy-ucomm = 'EXIT'
  OR sy-ucomm = 'CANCEL'.

    LEAVE TO SCREEN 0.

  ELSE.

    (other stuff.)

  ENDIF.

What are you doing when these keys are hit?

Good luck

Brian

6 REPLIES 6

Former Member
0 Kudos

Are u calling this ALV through module pool if so please check

menu bar title bar . se41.

Thanks

Former Member
0 Kudos

Please tell us what you are doing in your code to process the back/exit/cancel.

For example, in ALV I do the following in PAI module:

  IF sy-ucomm = 'BACK'
  OR sy-ucomm = 'EXIT'
  OR sy-ucomm = 'CANCEL'.

    LEAVE TO SCREEN 0.

  ELSE.

    (other stuff.)

  ENDIF.

What are you doing when these keys are hit?

Good luck

Brian

0 Kudos

Hey Brian,

FORM user_command USING r_ucomm LIKE sy-ucomm

rs_selfield TYPE slis_selfield.

CASE r_ucomm.

WHEN '%BCK'.

LEAVE TO SCREEN 0."1000.

WHEN '%EXT'.

LEAVE PROGRAM.

WHEN '%CNC'.

LEAVE PROGRAM.

ENDCASE.

ENDFORM. "user_command

This what i was doing in my code for the user command.

I dont see any problem.

Thanks in advance for your help,

Regards,

Srinivas.

0 Kudos

Hello Srinivas,

I think you are using ALV Grid FM .. if you are using PF Status then use user command in Menu painter (SE41) ( BACK,CANC,EXIT) -> system will understand only these Function code.

if you are not using Pf -status then do not use Function code ..

get rid of the whole code related to BACK,CANC,EXIT..

Please use Upper case incase you are using Function code.

Thanks

Seshu

Former Member
0 Kudos

hi srinivas,

we have 2 options in this case.

1) i think ur using EVENTS_GET function module. If u use sometimes we are facing this kind of problem. i think accroding to my knowliege its bug in SAP....

2) See in debug mode what is the user command for this back button everty time USERCOMMAND FOR BACK BUTTON not 'BACK' .If it ios correct plaese add the code for back button in user command event.

if u dont want to face that problem remove that events_get fm and write the code manually. i am not sure abt ur code.

i hope u got the point what i am saying.

Thanks,

Maheedhar

0 Kudos

Thanks for all you guys for helping me. I solved this problem. There was skip command after the alv grid display. This causes the blank screen after i hit the back button. I removed that one and now it is working fine.

Once again, Thanks for your help.

Regards,

Srinivas kari.

Points were awarded.

Message was edited by:

srinivas kari