‎2007 Feb 06 5:25 AM
hi, may i know how to write the below syntax.
if the first sy-ucomm is 'CON' and the following sy-ucomm is 'SAVE' then only will continue the processing. the first sy-ucomm happens is when a dialog box asking for confirmation. after user click a button which is 'CON' and the next button in gui status to click is 'SAVE' then only will continue.
either if will continue else exit
if sy-ucomm = 'CON' and the next sy-ucomm triggered is 'SAVE' then will continue
or
if sy-ucomm = 'SAVE' then will continue
thanks
‎2007 Feb 06 5:37 AM
Hi,
the first one will work in this case. But you need to capture the Sy-ucomm 'CON' in another variable since when you press enter or any other button then its corresponding sy-ucomm will be present in sy-ucomm field. so declare a variable like sy-ucomm and try with the first one.
Thanks,
Prashanth
‎2007 Feb 06 5:38 AM
data: g_ucomm like sy-ucomm.
if sy-ucomm = 'CON'.
g_ucomm = sy-ucomm.
endif.
if sy-ucomm = 'SAVE'.
if g_ucomm = 'CON'.
continue.
endif.
clear g_ucomm.
endif.
if sy-ucomm = 'EDIT'.
g_ucomm = 'EDIT'.
endif.
‎2007 Feb 06 5:53 AM
hi,
when i click save 'SAVE' in gui status, a dialog box asking if to continue. the button in dialog box is 'CON'. after i click 'CON' button, in debug mode, the sy-ucomm is 'CON' but 'SAVE' no where to find anymore.
may i know how do i get the 'SAVE' and store in variable before 'CON'.
i try the method from the reply here but still cannot get 'SAVE'.
thanks alot
‎2007 Feb 06 5:57 AM
Declara a global variable.
When you click 'SAVE" button check the sy-uccom and save to one variable.
‎2007 Feb 06 5:55 AM
Hi,
Create a globle variable..WHich means in the top include of the module pool program..
**IN THE TOP INCLUDE..
DATA: GV_UCOMM TYPE SYUCOMM.
GV_UCOMM = SY-UCOMM.
**CALL THE POPUP..
IF GV_UCOMM = 'SAVE'.
.....
ENDIF.
Thanks,
Naren
‎2007 Feb 06 6:06 AM
data : flag,
counter type i.
at user-command.
case sy-ucomm.
when 'CON'.
flag = 'X'.
counter = 1.
when 'SAVE'.
if flag = 'X' and counter = 1.
continue processing.
clear : flag,counter.
elseif flag = '' conter = 0.
continue processing.
clear : flag,counter.
endif.
when '<ANY OTHER fncode>.
clear counter.
endcase.
regards
shiba dutta
‎2007 Feb 06 6:13 AM
Hi,
why don't you use the function module "POPUP_TO_CONFIRM" for confirmation, rather than working with user commands twice.
I would suggest that, when the user selects the save button, call the function module "popup_to_confirm", based on the result, you can continue the "SAVE" logic.
Regards,
Prasanth
Reward if it helps
‎2007 Feb 06 6:22 AM
hi,
actually i am doing the exit in a function module.
when click save button 'SAVE' in gui status, it shows a dialog box. user will click yes button.
the problem is sy-ucomm only captures yes button 'CON' whereas 'SAVE' i do not know where to track.
i tried all the methods in the reply yet not able to get 'SAVE'.
thanks
‎2007 Feb 06 6:27 AM
can you check in debug mode what are the values it is taking in sy-ucomm and let us know that?
regards
shiba dutta
‎2007 Feb 06 6:23 AM