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: 

Enabling and disabling an status button.

Former Member
0 Kudos

Hi......................

i send one prog of deactive print and save icon..... but i want this icon or button at runtime when i click on display button...... so which function module i used for activeted this print, save or my own button of ths this requirement.................

REPORT demo_sel_screen_status.

DATA itab TYPE TABLE OF sy-ucomm.

PARAMETERS test(10) TYPE c.

AT SELECTION-SCREEN OUTPUT.

APPEND: 'PRIN' TO itab,

'SPOS' TO itab.

CALL FUNCTION 'RS_SET_SELSCREEN_STATUS'

EXPORTING

p_status = sy-pfkey

TABLES

p_exclude = itab.

In this example, the Print and Save as variant functions are deactivated. To find out the function codes of the standard GUI status, choose System ® Status and double-click the GUI status field.

Jigar

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi,

Check your modified code..WHen you press display..the update button will show..


***********Naren changes
DATA: itab TYPE STANDARD TABLE OF syucomm WITH HEADER LINE.
DATA: v_display.
TABLES: sscrfields.
PARAMETERS: p_matnr.
***********Naren changes End

SELECTION-SCREEN FUNCTION KEY 1.
SELECTION-SCREEN FUNCTION KEY 2.
SELECTION-SCREEN FUNCTION KEY 3.

INITIALIZATION.
  MOVE 'DISPLAY' TO sscrfields-functxt_01.
  MOVE 'DELETE' TO sscrfields-functxt_02.
  MOVE 'UPDATE' TO sscrfields-functxt_03.

  CALL FUNCTION 'RS_SET_SELSCREEN_STATUS'
       EXPORTING
            p_status  = sy-pfkey
       TABLES
            p_exclude = itab.

AT SELECTION-SCREEN OUTPUT.

***********Naren changes
  REFRESH: itab.
***********Naren changes End.

  APPEND 'ONLI' TO itab.
***********Naren changes
  IF v_display <> 'X'.
    APPEND 'FC03' TO itab.
  ENDIF.
***********Naren changes End.
  CALL FUNCTION 'RS_SET_SELSCREEN_STATUS'
       EXPORTING
            p_status  = sy-pfkey
       TABLES
            p_exclude = itab.
  v_display = ' '.

***********Naren changes
AT SELECTION-SCREEN.

  IF sy-ucomm = 'FC01'.
    v_display = 'X'.
  ENDIF.
***********Naren changes End.

Thanks

Naren

6 REPLIES 6

Former Member
0 Kudos

Hi,

Not sure if I understood your requirement..

Do you want to disable the save and print only when you press some button??

Please explain

Thanks

Naren

0 Kudos

Hi Naren,

In my report i use for dipaly button:

I have 3 button in my report

below my dispaly button code:

selection-screen function key 1.

selection-screen function key 2.

selection-screen function key 3.

INITIALIZATION.

MOVE 'DISPLAY' TO SSCRFIELDS-FUNCTXT_01.

MOVE 'DELETE' TO SSCRFIELDS-FUNCTXT_02.

MOVE 'UPDATE' TO SSCRFIELDS-FUNCTXT_03.

when programn run i have to disable the update:

through this coding :

AT SELECTION-SCREEN OUTPUT.

APPEND 'ONLI' TO itab.

APPEND 'FC03' TO ITAB.

CALL FUNCTION 'RS_SET_SELSCREEN_STATUS'

EXPORTING

p_status = sy-pfkey

TABLES

p_exclude = itab.

now what i want when i click on display button then my update button is activated on the screen.

for deactivated i use this function

AT SELECTION-SCREEN OUTPUT.

APPEND 'ONLI' TO itab.

APPEND 'FC03' TO ITAB.

CALL FUNCTION 'RS_SET_SELSCREEN_STATUS'

EXPORTING

p_status = sy-pfkey

TABLES

p_exclude = itab.

in the program

through APPEND 'FC03' TO ITAB statement i disable the update button.

now i want update button when i click on dispaly button.......

Pl give me suggestion.........

Jigar

Former Member
0 Kudos

Hi,

Check your modified code..WHen you press display..the update button will show..


***********Naren changes
DATA: itab TYPE STANDARD TABLE OF syucomm WITH HEADER LINE.
DATA: v_display.
TABLES: sscrfields.
PARAMETERS: p_matnr.
***********Naren changes End

SELECTION-SCREEN FUNCTION KEY 1.
SELECTION-SCREEN FUNCTION KEY 2.
SELECTION-SCREEN FUNCTION KEY 3.

INITIALIZATION.
  MOVE 'DISPLAY' TO sscrfields-functxt_01.
  MOVE 'DELETE' TO sscrfields-functxt_02.
  MOVE 'UPDATE' TO sscrfields-functxt_03.

  CALL FUNCTION 'RS_SET_SELSCREEN_STATUS'
       EXPORTING
            p_status  = sy-pfkey
       TABLES
            p_exclude = itab.

AT SELECTION-SCREEN OUTPUT.

***********Naren changes
  REFRESH: itab.
***********Naren changes End.

  APPEND 'ONLI' TO itab.
***********Naren changes
  IF v_display <> 'X'.
    APPEND 'FC03' TO itab.
  ENDIF.
***********Naren changes End.
  CALL FUNCTION 'RS_SET_SELSCREEN_STATUS'
       EXPORTING
            p_status  = sy-pfkey
       TABLES
            p_exclude = itab.
  v_display = ' '.

***********Naren changes
AT SELECTION-SCREEN.

  IF sy-ucomm = 'FC01'.
    v_display = 'X'.
  ENDIF.
***********Naren changes End.

Thanks

Naren

0 Kudos

Hi Naren.......................................................

wow, My problem is solved............ thanks buddy

and one more problem ......how can i set cursor in field what i want i updated some value and i want to put the cursor on first field....

for this i use SET CURSOR FIELD 'FIELDNAME'..

but its not working........

so give me some suggestion..

Jigar

Former Member
0 Kudos

Hi,

Check this code

PARAMETERS: p_field1,

p_field2,

p_field3.

AT SELECTION-SCREEN.

IF p_field3 IS INITIAL.

SET CURSOR FIELD 'P_FIELD3'.

MESSAGE e208(00) WITH 'P_FIELD3 is mandatory'.

ENDIF.

Please reward points for helpful answers and close the thread if the problem is solved.

Thanks

Naren

0 Kudos

Thanks

Jigar....