2008 Feb 04 1:02 PM
PROGRAM SAPMZVALIDATION.
data: NUM1 type i,
NUM2 type i,
ANS type i,
OK_CODE type SY-UCOMM.
odule USER_COMMAND_0089 input.
CASE OK_CODE.
WHEN 'SUM'.
ANS = NUM1 + NUM2.
WHEN 'EXIT'.
LEAVE PROGRAM.
ENDCASE.
endmodule. " USER_COMMAND_0089 INPUT
i made this program but it is not working with layout. no push button is link with result.
how to do.
PROGRAM SAPMZVALIDATION.
data: NUM1 type i,
NUM2 type i,
ANS type i,
OK_CODE type SY-UCOMM.
odule USER_COMMAND_0089 input.
CASE OK_CODE.
WHEN 'SUM'.
ANS = NUM1 + NUM2.
WHEN 'EXIT'.
LEAVE PROGRAM.
ENDCASE.
endmodule. " USER_COMMAND_0089 INPUT
i made this program but it is not working with layout. no push button is link with result.
how to do.
2008 Feb 04 2:18 PM
HI Ruchi,
i think you forgot to declare the ok_code in Screen Element List.Please check the element list of the screen.Give one Ok_Code to the push button in the screen field attributes.Activate entire program and run the program
Message Edited
Shibu
2008 Feb 04 2:32 PM
2008 Feb 04 3:30 PM
Hi
use this
PROGRAM SAPMZVALIDATION.
data: NUM1 type i,
NUM2 type i,
ANS type i,
OK_CODE type SY-UCOMM.
odule USER_COMMAND_0089 input.
CASE SY-UCOMM.
WHEN 'SUM'.
ANS = NUM1 + NUM2.
WHEN 'EXIT'.
LEAVE PROGRAM.
ENDCASE.
endmodule. " USER_COMMAND_0089 INPUT
Check that Fcode that is used is also there in ur menu...
Check that your menu is in active mode..
<REMOVED BY MODERATOR>
Gaurav J.
Edited by: Alvaro Tejada Galindo on Feb 4, 2008 6:07 PM
2008 Feb 04 4:01 PM
MName Type LinColDefVisHeiScrFormatInpOutOutpDicDictProperty list
NUM1 Text 4 4 4 4 1
NUM1 I/O 4 23 20 20 1 INT4
NUM2 Text 6 4 4 4 1
NUM2 I/O 6 23 20 20 1 INT4
ANS Text 8 3 3 3 1
ANS I/O 8 24 19 19 1 INT4
EXIT Push 10 8 4 4 1
SUM Push 10 20 3 3 1
OK_CODE OK 0 0 20 20 1 OK
this element list and this is activated
2008 Feb 04 6:29 PM
Hi Ruchi,
you are not getting the ok_code value of the button while debugging ?can you delete the button and redo the same.it is working for me .i copied your code and tested the same.
regards
shibu
2008 Feb 04 6:48 PM
Try this
Assign SY-UCOMM to OK_CODE
OK_CODE = SY-UCOMM.
CASE OK_CODE.
WHEN 'SUM'.
ANS = NUM1 + NUM2.
WHEN 'EXIT'.
LEAVE PROGRAM.
ENDCASE.
2013 Jun 13 11:16 AM
2013 Jun 13 12:58 PM
Check function code of button is same or not as specified in the program.
2013 Jun 13 1:07 PM
Hi Ruchi,
Double click the button in the screen.
The SY-UCOMM / OK_CODE will contain the value specified in the FCODE field in properties.
I suppose you are validating with the name of the button.
Cheers