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?
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
Add a comment