Application Development and Automation 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: 
Read only

Screen Application toolbar.

Former Member
0 Likes
1,883

Hi Experts,

I have created two buttons on application toolbar i.e. SAVE And CHECK.

my requirement is when any one click on CHECK button then only SAVE button should active.

how to do this?

Thanks,

Abhishek

1 ACCEPTED SOLUTION
Read only

I355602
Product and Topic Expert
Product and Topic Expert
0 Likes
1,382

Hi,

Say you have created a pf-status with two button save and check in application toolbar with function code SAVE and CHECK respectively.

So use code like:-


START-OF-SELECTION.
  SET PF-STATUS '<pf_status_name>' EXCLUDING 'SAVE'. "disable save button

AT USER-COMMAND.
  CASE sy-ucomm.
    WHEN 'CHECK'.
      SET PF-STATUS '<pf_status_name>'. "enable save button when CHECK is clicked
      "other code
  ENDCASE.

Hope this helps you.

Regards,

Tarun

9 REPLIES 9
Read only

Former Member
0 Likes
1,382

Hi,

Use the screen attributes.

Loop through the screen and check for the button name and then change the attributes according to your condition. Use "Modify screen" statement

Regards

Akshay

Read only

former_member673464
Active Contributor
0 Likes
1,382

hi,

You can change the screen properties if you have those buttons in screen. If you have those in pf status you can use the new pf-status using excluding key word for it.

regards,

Veeresh

Read only

Former Member
0 Likes
1,382

Try like this

At USER COMMAND.
When 'CHECK'.

DATA: itab TYPE TABLE OF sy-ucomm. 
APPEND 'CHECK' TO itab. 

SET PF-STATUS 'XXX' EXCLUDING itab.

Hope this helps...

Read only

Former Member
0 Likes
1,382

Hi Abhishek,

Use the EXCLUDING keyword to exclude the save button in normal case when the CHECK is not clicked . By IMMEDIATELY keyword you can get the save button immediately after clicking CHECK.

Try the following code --

SET  PF-STATUS 'status_name'  EXCLUDING  'SAVE'.
AT USER-COMMAND.
  CASE sy-ucomm.
    WHEN 'check'.
      SET  PF-STATUS 'status_name'  IMMEDIATELY.
.
.
.
.
ENDCASE.

Regards

Pinaki

Read only

I355602
Product and Topic Expert
Product and Topic Expert
0 Likes
1,383

Hi,

Say you have created a pf-status with two button save and check in application toolbar with function code SAVE and CHECK respectively.

So use code like:-


START-OF-SELECTION.
  SET PF-STATUS '<pf_status_name>' EXCLUDING 'SAVE'. "disable save button

AT USER-COMMAND.
  CASE sy-ucomm.
    WHEN 'CHECK'.
      SET PF-STATUS '<pf_status_name>'. "enable save button when CHECK is clicked
      "other code
  ENDCASE.

Hope this helps you.

Regards,

Tarun

Read only

Former Member
0 Likes
1,382

Hi Tarun,

I didn't understand whether it would work with the code you have given,

START-OF-SELECTION.
  SET PF-STATUS '<pf_status_name>' EXCLUDING 'SAVE'. "disable save button
 
AT USER-COMMAND.
  CASE sy-ucomm.
    WHEN 'CHECK'.
      SET PF-STATUS '<pf_status_name>'. "enable save button when CHECK is clicked
      "other code
  ENDCASE.

once you have set the pf-status, i doubt if it would work without using the immediately option...

please check it out...

Hi Abhishek,

is it working without immediately option as well.... please do let me know as I tried from my end tarun's code was not working without immediately option and it worked with the code I pasted just before tarun.

Regards,

Pinaki

Read only

Mohamed_Mukhtar
Active Contributor
0 Likes
1,382

hi,

if ok_code = 'CHECK'.
"Create a another PF-Status and make Save button as active.
SET PF-STATUS 'PF!'.
endif..

Thanks & Regards

Read only

Former Member
0 Likes
1,382

Hi,

i added this code in BPO and its working.

module modify.

module modify.

if sy-ucomm = 'PUSH'.

loop at screen.

if screen-name = 'SAVE'.

screen-invisible = 0.

modify screen.

endif.

endloop.

endif.

endmodule.

and make the SAVE button as invisible by default in the screen painter.

SORRY IGNORE THIS. didn't notice its for Application tool bar.

guru

Edited by: Guru Ram on Mar 24, 2009 7:30 AM

Edited by: Guru Ram on Mar 24, 2009 7:36 AM

Read only

Former Member
0 Likes
1,382

Hi Tarun,

I didn't understand whether it would work with the code you have given,

START-OF-SELECTION.
  SET PF-STATUS '<pf_status_name>' EXCLUDING 'SAVE'. "disable save button
 
AT USER-COMMAND.
  CASE sy-ucomm.
    WHEN 'CHECK'.
      SET PF-STATUS '<pf_status_name>'. "enable save button when CHECK is clicked
      "other code
  ENDCASE.

once you have set the pf-status, i doubt if it would work without using the immediately option...

please check it out...

Hi Abhishek,

is it working without immediately option as well.... please do let me know as I tried from my end tarun's code was not working without immediately option and it worked with the code I pasted just before tarun.

Regards,

Pinaki