‎2009 Mar 24 6:03 AM
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
‎2009 Mar 24 6:15 AM
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
‎2009 Mar 24 6:07 AM
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
‎2009 Mar 24 6:08 AM
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
‎2009 Mar 24 6:10 AM
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...
‎2009 Mar 24 6:12 AM
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
‎2009 Mar 24 6:15 AM
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
‎2009 Mar 24 9:07 AM
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
‎2009 Mar 24 6:15 AM
hi,
if ok_code = 'CHECK'.
"Create a another PF-Status and make Save button as active.
SET PF-STATUS 'PF!'.
endif..Thanks & Regards
‎2009 Mar 24 6:30 AM
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
‎2009 Mar 24 2:36 PM
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