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

sy-ucomm

Former Member
0 Likes
2,406

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

10 REPLIES 10
Read only

Former Member
0 Likes
1,374

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

Read only

Former Member
0 Likes
1,374

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.

Read only

0 Likes
1,374

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

Read only

0 Likes
1,374

Declara a global variable.

When you click 'SAVE" button check the sy-uccom and save to one variable.

Read only

Former Member
0 Likes
1,374

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

Read only

Former Member
0 Likes
1,373

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

Read only

Former Member
0 Likes
1,373

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

Read only

0 Likes
1,373

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

Read only

0 Likes
1,373

can you check in debug mode what are the values it is taking in sy-ucomm and let us know that?

regards

shiba dutta

Read only

Former Member
0 Likes
1,373

Hi,

Which user exit are you using??

THanks,

Naren