02-09-2005 11:03 PM
Hi,
I have three buttons in screen 0100. And their names are A, B, C respectively. When user pushes any of these buttons, I want to know which button is pushed. I wrote code, and I tried to learn which button is pushed. But, result of SY-UCOMM is only blank. There is nothing in SY-UCOMM. My full code is:
*&----------------------------------------------------
*& Program ZPROJECT
PROGRAM zproject.
DATA: save_code TYPE sy-ucomm,
ok_code TYPE sy-ucomm.
CALL SCREEN '0100'.
INCLUDE ZPAIMODULES.
*-----------------------------------------------
* INCLUDE ZPAIMODULES.
MODULE user_command_0100 INPUT.
SAVE_CODE = OK_CODE.
DATA wa TYPE I.
CASE SAVE_CODE.
WHEN 'A'.
WA = 5.
WHEN 'B'.
WA = 9.
WHEN OTHERS.
WA = 500.
ENDCASE.
ENDMODULE.
*--------------------------------------------------
*SCREEN '0100'
PROCESS BEFORE OUTPUT.
MODULE STATUS_0100.
*
PROCESS AFTER INPUT.
MODULE USER_COMMAND_0100.
I also wrote OK_CODE in element list of Screen 0100 for the last entry that type is OK. There is no code as I wrote above. I watched the execution of the program. And I watched SAVE_CODE value. It is all the time blank. I mean there is no value for it. Where is wrong? What should I do?
02-09-2005 11:13 PM
Hi Huseyin
What OK_CODE can contain is the function code that you assign to a button, not its name. So, check whether you have assigned any function code to the buttons.
You can assign a function code to a button at Screen Painter. When you double-click the button element at the middle of attributes side-screen you can see the field to enter the function code.
By the way, you'd better restructuring your main program as:
PROGRAM zproject.
DATA: save_code TYPE sy-ucomm,
ok_code TYPE sy-ucomm.
INCLUDE ZPAIMODULES.
START-OF-SELECTION .
CALL SCREEN '0100'.
...
Hope this helps
*--Serdar
02-09-2005 11:13 PM
Hi Huseyin
What OK_CODE can contain is the function code that you assign to a button, not its name. So, check whether you have assigned any function code to the buttons.
You can assign a function code to a button at Screen Painter. When you double-click the button element at the middle of attributes side-screen you can see the field to enter the function code.
By the way, you'd better restructuring your main program as:
PROGRAM zproject.
DATA: save_code TYPE sy-ucomm,
ok_code TYPE sy-ucomm.
INCLUDE ZPAIMODULES.
START-OF-SELECTION .
CALL SCREEN '0100'.
...
Hope this helps
*--Serdar
02-10-2005 1:52 AM
Hi Serdar,
As you had said I wrote some key values that help me to learn which button is pressed into the function code tab. So, I solved problem.
Tesekkurler Serdar.
02-10-2005 5:34 AM
Hi,
Good to know that the problem has been resolved. If you find it appropriate, please mark the thread as answered.
Regards
Message was edited by: Shehryar Khan
02-10-2005 12:06 PM
Hi Huseyin
As Shehryar stated, you should close the thread either by assigning a 10 points or checking related checkbox at one of your reply post edit screen.
By the way, I recall your name? Are you a graduate of METU EE?
*--Serdar
02-11-2005 12:55 AM
Hi,
I checked the related checbox. Because of I am new on this form,first I did not see such an application. Excuse..
Serdar, Now, I am at Dokuz Eylul University, Computer Engineering department, Class 4. I am deal with ABAP at a company that I am training at. I don't have any relation with METU EE. But, it is nice that there is an ABAP well-formed Turkish person at this form.
02-11-2005 4:58 AM
Hey Huseyin,
The thread's still not closed... We do understand you are new to the forum Please close the thread by awarding Serdar 10 points (Problem Solved) radio button. This would not only close the thread, it would also award Serdar his rightfully deserved points.
Also, its really gr8 to have people like Serdar, Poornanand, Subramanian, Shehryar, and the likes to help us with our petty issues Thanks guys!
Regards,
Madhur