Skip to Content
author's profile photo Former Member
Former Member

SY-UCOMM

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?

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

1 Answer

  • Best Answer
    Posted on Feb 09, 2005 at 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

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      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

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.