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: 

Menu in Selection Screen

Former Member
0 Kudos

Hi ,

How can i attach a menu in my selection scren .

i have set the pf status in the

at selection-screen output event

, tough the menu appears , but i am not able to use it as the sy-ucomm is not set equal to the value of the menu option when i click the menu option.

Regards

arun

7 REPLIES 7

Former Member
0 Kudos

A little confused here. As your question is "How can I attach a menu in my selection screen" and below , you mention, that you have attached the menu, but not able to get the function code.

Nevertheless, let us know, whether the menu that you see in the selection screen is the same menu that you have set in the PF-STATUS. Also, where have you set the PF-STATUS, under which event ?

Can you also post your code ? (or do you want us to post a code ? )


AT SELECTION-SCREEN OUTPUT.
 SET PF-STATUS 'ABCD' 

Double check, whether you have attached a function code to all the new functions(menu items) entered in the PF-STATUS. Also check whether the PF-STATUS is activated.

If all the above steps are done properly(and if I have not overlooked any steps), I think the selection screen should work fine.

In case you have found the answer, do share it with us.

Regards,

Subramanian V.

0 Kudos

Hi ,

Yes the menu that i have on the selection screen is same as that which i set in PF-STATUS.

Yes the event is at AT SELECTION-SCREEN OUTPUT.

I will just lliustrate my problem :

i have a menu with 2options

Display : DIS

Exit : EXT

  • EACH MENU OPTION IS ATTACHED WITH ITS FUNCTION CODE.

Now IN THE SELECTION SCREEN WHEN I GIVE THE INPUT AND CLICK THE Display option , SY-UCOMM must be set equal to DIS , but when i debug my program no value is assigned to it.

Please suggest some options.

Regards

Arun

0 Kudos

Hi Arun

This may occur if the type for your function (i.e. 'DIS') is NOT <b>"Application Function"</b> (i.e. = space)? You can see this at GUI status maintenance screen when you double click the function code.

Or

May have you cleaned sy-ucomm before the point you stop for break-point?

Look also at the content of <b>"SSCRFIELDS-ucomm"</b>. It shoul also contain the function code.

*--Serdar

0 Kudos

Hi Arun,

I just wrote this program(first thing in the morning) and it worked perfectly fine. I believe, you are checking your sy-ucomm in

a) <b>AT USER-COMMAND</b>

b) <b>START-OF-SELECTION</b>

c) <b>END-OF-SELECTION</b>

One of the reasons, why sy-ucomm will not be present, here, is these events are for the list and not for the selection-screen. So you need to check it in the event:

<b>AT SELECTION-SCREEN</b>.


SELECTION-SCREEN BEGIN OF BLOCK BLK_001.
parameters: p_lifnr type lfa1-lifnr.
SELECTION-SCREEN END OF BLOCK BLK_001.

AT SELECTION-SCREEN OUTPUT.
SET PF-STATUS 'PFST'.

AT SELECTION-SCREEN.
CASE SY-UCOMM.
WHEN 'MENU1'.
  message i184(bctrain) with 'YAY its working'.
ENDCASE.

P.S. - If this works, make sure you mark the question as answered

0 Kudos

Hi ,

The option is working , but my requiremet is that based on the option selected i want to display a list. Now when i debug it the start-of-selection event is not executed.

My partial code is attached

at selection-screen output.

set pf-status 'TEST'. " My Menu

at selection-screen.

CASE SY-UCOMM.

WHEN '0002'.

perform basic_list. " Function to populate an

internal table

test1 = '0002'.

endcase.

START-OF-SELECTION.

if test1 = '0002'.

perform print1.

endif.

Kindly look into the code and suggest a way out.

Regards

Arun

0 Kudos

I think this code, would not work. It would not be possible to easily mix Selection Screen events and List events.

If you change your Function Code to 'ONLI', it will go to start-of-selection, but for any other Function Code, I doubt, it will go to the start-of-selection event.

Regards,

Subramanian V.

0 Kudos

Hello Arun,

The main problem, as I see it is the use of the SY-UCOMM value in your program to catch the function-code. In all selection-screen processing, you are to use SSCRFIELDS structure defined in the ABAP dictionary. There is a field called UCOMM in this structure which you are supposed to use for selection-screen PAI.

For more information, refer to the following link in the SAP Online documentation :

http://help.sap.com/saphelp_46c/helpdata/en/aa/aeb23789e95378e10000009b38f8cf/content.htm

And here's another post on SDN where I have explained about the usage of SSCRFIELDS.

Remember you would have to declare the SSCRFIELDS structure in your program with a tables statement.

For example...

====================================



tables sscrfields.

data: ..........
      ..........

parameters: ........
            ........

AT SELECTION-SCREEN OUTPUT.
  set pf-status 'TEST'


AT SELECTION-SCREEN.
  case sscrfields-ucomm.
    when 'DIS'.
      perform display.
    when 'EXT'.
      perform exit_program.
  endcase.

START-OF-SELECTION.
 

====================================

Hope I have struck the right note.

Regards,

Anand Mandalika.

p.s. if this solves your problem, don't forget to reward the points .