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

Custom button click issue

former_member627573
Participant
0 Likes
2,225

I added a button to IW32/33 in the Enhancement tab to display a report upon button click. Once the user has seen the report and returns to the order and makes presses ENTER button, the program redirects back to the report. How do I curb this? I tried clearing SY-UCOMM in the PBO but that didn't work as in the PAI upon pressing ENTER the previous SY-UCOMM appears again.

1 ACCEPTED SOLUTION
Read only

former_member627573
Participant
2,090

I used the solution provided in the blow link and it worked perfectly.

https://answers.sap.com/questions/3641107/clearing-syucomm-in-subscreen.html

9 REPLIES 9
Read only

FredericGirod
Active Contributor
0 Likes
2,090

When you press your button, you need to clear the content of this variable before calling your report

Read only

0 Likes
2,090

Could you please elaborate?

Read only

0 Likes
2,090

should be something like that

Case sy-ucomm.
when 'Blabla'.
call screen 101 .. 

when 'YourCommand'.
call transaction .... and return. 
(or submit)

endcase

so before this, just do a



when 'YourCommand'.
clear sy-ucomm.
call transaction .... and return. 

Read only

0 Likes
2,090

I have already done this.

My problem is that sy-ucomm get populated with the previous sy-ucomm value even though it is cleared.

It's cleared both at PBO and PAI but it still captures the previous value on pressing ENTER.

Read only

Sandra_Rossi
Active Contributor
2,090

Because SY-UCOMM is not set to empty when Enter is pressed (normal behavior), SAP recommends to use the "OK field" of the dynpro, i.e. use a custom global variable.

Read only

former_member627573
Participant
2,091

I used the solution provided in the blow link and it worked perfectly.

https://answers.sap.com/questions/3641107/clearing-syucomm-in-subscreen.html

Read only

2,090

So, you mean clearing the OK field via dirty ASSIGN (so that to reach the OK field of the standard program).

Read only

0 Likes
2,090

This is not a solution ... I hope you have a code-review team to check that

Read only

0 Likes
2,090

Sandra Rossi & Frederic Girod: If either of you has a better solution do let me know.