‎2008 Apr 24 7:56 AM
HI,
I have created 2 buttons in application tool bar and i need to hide the butttons.i have tried using this code but its not working properly. plz anyone explain me how to do this..
TABLES: SSCRFIELDS.
DATA: itab TYPE TABLE OF sy-ucomm.
PARAMETERS: NAME(10) TYPE C.
APPEND 'DEL' TO itab.
APPEND 'SEL' TO itab.
AT SELECTION-SCREEN OUTPUT.
SET PF-STATUS 'STA3' EXCLUDING itab.
AT SELECTION-SCREEN.
CASE SSCRFIELDS-UCOMM.
WHEN 'BACK'.
LEAVE PROGRAM.
ENDCASE.
thanku.
regards,
dhaya.
‎2008 Apr 24 8:00 AM
Hi,
Give ur statement in AT LINE_SELECTION. or AT USER_COMMAND Event and try
SET PF-STATUS <stat> [EXCLUDING <f><itab>]
Specify <itab> to deactivate all function codes stored in the internal table <itab>. Field <f> and the lines of table <itab> should be defined with reference to the system field SY-UCOMM.
check this program
REPORT set_pf_status_1.
DATA: fcode TYPE TABLE OF sy-ucomm,
wa_fcode TYPE sy-ucomm.
START-OF-SELECTION.
wa_fcode = 'FC1 '. APPEND wa_fcode TO fcode.
wa_fcode = 'FC2 '. APPEND wa_fcode TO fcode.
wa_fcode = 'FC3 '. APPEND wa_fcode TO fcode.
wa_fcode = 'FC4 '. APPEND wa_fcode TO fcode.
wa_fcode = 'FC5 '. APPEND wa_fcode TO fcode.
wa_fcode = 'PICK'. APPEND wa_fcode TO fcode.
SET PF-STATUS 'TEST'.
WRITE: 'PF-Status:', sy-pfkey.
AT LINE-SELECTION.
IF sy-lsind = 20.
SET PF-STATUS 'TEST' EXCLUDING fcode.
ENDIF.
WRITE: 'Line-Selection, SY-LSIND:', sy-lsind,
/ ' SY-PFKEY:', sy-pfkey.
AT USER-COMMAND.
IF sy-lsind = 20.
SET PF-STATUS 'TEST' EXCLUDING fcode.
ENDIF.
WRITE: 'User-Command, SY-LSIND:', sy-lsind,
/ ' SY-UCOMM:', sy-ucomm,
/ ' SY-PFKEY:', sy-pfkey.reward if helpful
raam
‎2008 Apr 24 8:05 AM
Hi,
Check the documentation given below
SET PF-STATUS ]
This statement sets the status parameters. To display an ampersand character &, repeat it in the title &&.
Examples
Example for dialog status in a list.
REPORT demo_list_menu_painter.
START-OF-SELECTION.
SET PF-STATUS 'TEST'.
WRITE: 'Basic list, SY-LSIND =', sy-lsind.
AT LINE-SELECTION.
WRITE: 'LINE-SELECTION, SY-LSIND =', sy-lsind.
AT USER-COMMAND.
CASE sy-ucomm.
WHEN 'TEST'.
WRITE: 'TEST, SY-LSIND =', sy-lsind.
ENDCASE.
This program uses a status TEST, defined in the Menu Painter.
Function key F5 has the function code TEST and the text Test for demo.
Function code TEST is entered in the List menu.
The function codes PICK and TEST are assigned to pushbuttons.
The user can trigger the AT USER-COMMAND event either by pressing F5 , or by choosing List ® Test for demo, or by choosing the pushbutton Test for demo.The user can trigger the AT LINE-SELECTION event by selecting a line.
Example of setting a dialog status for the current list
REPORT demo_list_set_pf_status_1.
DATA: fcode TYPE TABLE OF sy-ucomm,
wa_fcode TYPE sy-ucomm.
START-OF-SELECTION.
wa_fcode = 'FC1 '. APPEND wa_fcode TO fcode.
wa_fcode = 'FC2 '. APPEND wa_fcode TO fcode.
wa_fcode = 'FC3 '. APPEND wa_fcode TO fcode.
wa_fcode = 'FC4 '. APPEND wa_fcode TO fcode.
wa_fcode = 'FC5 '. APPEND wa_fcode TO fcode.
wa_fcode = 'PICK'. APPEND wa_fcode TO fcode.
SET PF-STATUS 'TEST'.
WRITE: 'PF-Status:', sy-pfkey.
AT LINE-SELECTION.
IF sy-lsind = 20.
SET PF-STATUS 'TEST' EXCLUDING fcode.
ENDIF.
WRITE: 'Line-Selection, SY-LSIND:', sy-lsind,
/ ' SY-PFKEY:', sy-pfkey.
AT USER-COMMAND.
IF sy-lsind = 20.
SET PF-STATUS 'TEST' EXCLUDING fcode.
ENDIF.
WRITE: 'User-Command, SY-LSIND:', sy-lsind,
/ ' SY-UCOMM:', sy-ucomm,
/ ' SY-PFKEY:', sy-pfkey.
Suppose that the function codes FC1 to FC5 are defined in the status TEST and assigned to pushbuttons: The function code PICK is assigned to function key F2 .
When the program starts, the user can create detail lists by selecting a line or choosing one of the function codes FC1 to FC5. For all secondary lists up to level 20, the user interface TEST is the same as for the basic list:
On list level 20, EXCLUDING ITAB deactivates all function codes that create detail lists. This prevents the user from causing a program termination by trying to create detail list number 21.
Example of setting a dialog status for the current list
REPORT demo_list_set_pf_status_2.
START-OF-SELECTION.
WRITE: 'SY-LSIND:', sy-lsind.
AT LINE-SELECTION.
SET PF-STATUS 'TEST' IMMEDIATELY.
After executing the program, the output screen shows the basic list and the user interface predefined for line selection (with function code PICK).
When you choose Choose, the user interface changes. However, since the AT LINE-SELECTION processing block does not contain an output statement, the system does not create a detail list: The status TEST is defined as in the previous example.
Example: Titles of detail lists.
REPORT demo_list_title .
START-OF-SELECTION.
WRITE 'Click me!' HOTSPOT COLOR 5 INVERSE ON.
AT LINE-SELECTION.
SET TITLEBAR 'TIT' WITH sy-lsind.
WRITE 'Click again!' HOTSPOT COLOR 5 INVERSE ON.
In this program, a new title is set for each detail list. The title is defined as follows: "Title for Detail List &1".
Regards,
Raj.
‎2008 Apr 24 8:16 AM
Hi
Check the below link
http://help.sap.com/saphelp_nw04/helpdata/en/e7/0eb237e29bc368e10000009b38f8cf/content.htm
Hope it helps you .
Regards
Mohamed Mansoor