01-14-2005 12:25 PM
HI ,
How can i get the name of the pushbutton on the selection-screen.
01-14-2005 12:40 PM
I think you define the pushbutton so you give the name.
Can you explain your need in detail.
01-14-2005 12:40 PM
I think you define the pushbutton so you give the name.
Can you explain your need in detail.
01-14-2005 12:46 PM
Hi
On my selection screen i have three push buttons , when i click on them three different reports are to be generated.
so i have assigend user command to all the push buttons as ONLI , but now to differentiate between them in the at seleciton-screen event , i need to get some unique parameter . what could be this parameter.
in the structure SSCRFIELDS there is a field FUNCTXT_01 , but it does not contain any value.
regards
Arun
01-14-2005 12:53 PM
Hi Arun,
I think you'd better assign 3 different okcodes, each one for each pushbutton.
sorry!
BR,
Alvaro
01-14-2005 12:54 PM
if i use three different okcodes , then i will not be able to display the list
01-14-2005 1:12 PM
Use radiobuttons with three options for each of your different lists.
Use one pushbutton and check the value of radiobuttons to decide to generate one of your list outputs.
-
If it helps please give points.
01-14-2005 6:38 PM
Hi Arun,
> if i use three different okcodes , then i will not be
> able to display the list
I am not sure if this is true.
Below is a small program to illustrate how you can use pushbuttons on selection screen to execute different lists.
REPORT ztestaks4 LINE-SIZE 80 LINE-COUNT 65 NO STANDARD PAGE HEADING.
TABLES: sscrfields.
DATA: v_flag.
DATA: BEGIN OF i_excl_tab OCCURS 0,
pfkey LIKE sy-pfkey.
DATA: END OF i_excl_tab.
*-- display or maintain options
SELECTION-SCREEN PUSHBUTTON: /10(20) update USER-COMMAND upda,
35(20) display USER-COMMAND disp.
*-------------------
AT SELECTION-SCREEN.
*-------------------
CASE sscrfields-ucomm.
WHEN 'UPDA'.
v_flag = 'U'.
sscrfields-ucomm = 'ONLI'.
WHEN 'DISP'.
v_flag = 'D'.
sscrfields-ucomm = 'ONLI'.
WHEN OTHERS.
ENDCASE.
*--------------
INITIALIZATION.
*--------------
MOVE: 'Update'(006) TO update,
'Display'(007) TO display.
*--------------------------
AT SELECTION-SCREEN OUTPUT.
*--------------------------
REFRESH i_excl_tab.
MOVE 'ONLI' TO i_excl_tab-pfkey.
APPEND i_excl_tab.
CLEAR i_excl_tab.
CALL FUNCTION 'RS_SET_SELSCREEN_STATUS'
EXPORTING
p_status = '%_00'
p_program = 'RSSYSTDB'
TABLES
p_exclude = i_excl_tab.
*------------------
START-OF-SELECTION.
*------------------
IF v_flag = 'U'.
WRITE:/ 'I am now updating.'.
ELSEIF v_flag = 'D'.
WRITE:/ 'I am now displaying.'.
ENDIF.
Let me know if this helps.
Srinivas
01-14-2005 12:44 PM
01-14-2005 6:01 PM
Fuat's suggestion in regard to using radiobuttons sounds like a good one. Then you do not need a button, the user would hit the regular execute button.
One of the principals of screen processing is that your ABAP only needs to understand the function codes and NOT where/how the function code was invoked. For example, the same function might be available from a button, a menu and a function key. Your ABAP would only need to understand what to do when the user requested the function and does not need to know how the user did it.
It you are determined to have 3 buttons, it can be done but is more complicated. I assume you need your 3 buttons plus some selection screen objects like select-options.
Define a regular screen and create a subscreen area. Outside the subscreen area, put your 3 buttons with 3 different function codes. In the subscreen area, put a selection screen defined as a subscreen.
You can do help on command SELECTION-SCREEN and look at the option for BEGIN OF SCREEN nnn AS SUBSCREEN.
Demo program demo_sel_screen_as_subscreen might also help.
I have a few notes that might be helpful:
1. define the selection screen with a number in the range 1001 thru 1100. If not, the normal selection screen events are not available.
2. set PF2=OPTI in the status for your screen or selection options will not work. Add the button as well as it appears on a regular selection screen.
Let us know how it goes.
01-15-2005 7:26 AM
Dear Arun,
First of all Thanks for giving me points for your 'Time Query'.
It was my first inauguration in sdn.
Regarding this 'Button Name' Query,
It seems to me that your problem is still not solved.
All the answers provided do 'Something Else'
and your 'Real Questions' remains unsolved.
Its a very good question. I also tried much and
presently conclude that for achieving this :
1. Some Discipline in Naming Convention has to be followed.
2. This discipline is between
a) Name of button
b) user command for this button
3. I have written a sample code in which
a) 3 buttons appear on screen.
b) press any one button
c) then press 'Execute' Button For displaying name
4. The main logic is to
a) search by using a 'Loop at Screen'
b) In the loop, in the name field search the ucomm.
5. I hope this will be satisfactory till time. If it get
something more, i will let u know.
6. Once again please give points if u feel satisfied.
Thanks & Regards,
Amit Mittal.
*----
REPORT abc.
DATA : btnname(8) TYPE c.
*----
REQUIRED
TABLES sscrfields.
*----
Create Button
*----
Note : Name Of Button 'U1_HELLO'
*----
Starts with 'U1' (assigned user command)
*----
This kind of discipline required
SELECTION-SCREEN PUSHBUTTON /10(20) u1_hello USER-COMMAND u1.
SELECTION-SCREEN PUSHBUTTON /10(20) u2_hello USER-COMMAND u2.
SELECTION-SCREEN PUSHBUTTON /10(20) u3_hello USER-COMMAND u3.
*----
Init
INITIALIZATION.
MOVE 'BUTTON 1' TO u1_hello.
MOVE 'BUTTON 2' TO u2_hello.
MOVE 'BUTTON 3' TO u3_hello.
*----
AT SELECTION-SCREEN.
*------- Loop at Screen
LOOP AT SCREEN.
IF screen-name CS sscrfields-ucomm.
*----
FOUND
btnname = screen-name.
ENDIF.
ENDLOOP.
*----
END-OF-SELECTION.
*----
WRITE: 'BUTTON NAME IS ' , btnname.