Skip to Content
0
Sep 27, 2010 at 06:02 PM

screen programming

45 Views

hi all ,

i m new in SAP-ABAP world,can any one help me plz,

my question is, perofrm mathemetical operation on two nos, like add, subtract, etc.

what i have done is,

........................

i have created a screen name 500,

on layout, i have taken three i/o box name io1,io2 and io3

have takne 5 push botton name add, sub, mul, div and exit,

on PAI of screen 500 , i have doubl clicked

----


***INCLUDE MZOPONNUM_USER_COMMAND_0500I02 .

----


&----


*& Module USER_COMMAND_0500 INPUT

&----


  • text

----


MODULE USER_COMMAND_0500 INPUT.

data : IO1 TYPE I,

IO2 TYPE I,

IO3 TYPE I,

OK_CODE TYPE SY-UCOMM.

CALL SCREEN 500.

*clear OK_CODE.

ENDMODULE. " USER_COMMAND_0500 INPUT

&----


*& Module STATUS_0500 OUTPUT

&----


  • text

----


MODULE STATUS_0500 OUTPUT.

  • SET PF-STATUS 'xxxxxxxx'.

  • SET TITLEBAR 'xxx'.

*

CASE OK_CODE.

WHEN 'ADD'.

IO3 = IO1 + IO2.

WHEN 'SUB'.

IO3 = IO1 - IO2.

WHEN 'MUL'.

IO3 = IO1 + IO2.

WHEN 'DIV'.

IO3 = IO1 + IO2.

WHEN 'EXIT'.

EXIT.

ENDCASE.

ENDMODULE.

my tranjection name is- zgytest,

and when i m trying to execute it, it is giving message like- Transaction contains inconsistencies. Do you

want to execute it anyway?

IF I M EXECUTING IT, and debugging it,, in the io1 and io2 variable, i m getting value, but when cursor is coming to

check OK_CODE, its not checking and hence result is not getting printed in i03 box,

so can any one tell what is the solution for this plz,