Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

arithmetic program using dialog module

Former Member
0 Likes
291

hai,

am created the dialog module program . the program is as shown below,

&----


*& Module pool SAPMYSP2

*&

&----


*&

*&

&----


INCLUDE MYSP2TOP . " global Data

  • INCLUDE MYSP2O01 . " PBO-Modules

  • INCLUDE MYSP2I01 . " PAI-Modules

  • INCLUDE MYSP2F01 . " FORM-Routines

INCLUDE MYSP2_O01.

INCLUDE MYSP2_I01.

top include program

&----


*& Include MYSP2TOP Module pool SAPMYSP2

*&

&----


PROGRAM SAPMYSP2.

DATA:INPUT1(4) TYPE C,

INPUT2(4) TYPE C,

OUTPUT1(4) TYPE C,

OK_CODE TYPE SY-UCOMM,

SAVE_CODE LIKE OK_CODE.

pbo program

----


***INCLUDE MYSP2_O01 .

----


&----


*& Module INIT_SCREEN_100 OUTPUT

&----


  • text

----


MODULE INIT_SCREEN_100 OUTPUT.

ENDMODULE. " INIT_SCREEN_100 OUTPUT

pai program

----


***INCLUDE MYSP2_I01 .

----


&----


*& Module USER_COMMAND_0100 INPUT

&----


  • text

----


MODULE USER_COMMAND_0100 INPUT.

SAVE_CODE = OK_CODE.

CLEAR OK_CODE.

CASE SAVE_CODE.

WHEN 'ADD'.

OUTPUT1 = INPUT1 + INPUT2.

WHEN 'SUB'.

OUTPUT1 = INPUT1 - INPUT2.

WHEN 'MUL'.

OUTPUT1 = INPUT1 * INPUT2.

WHEN 'EXIT'.

LEAVE PROGRAM.

ENDCASE.

ENDMODULE. " USER_COMMAND_0100 INPUT

the program is described about receives the two integer values in the input field ,add the two values ,and the resultant value is shown in the output field. but the probs is while am click the pushbutton namely add it does not shown in the output field.

regards

surender

1 REPLY 1
Read only

ak_upadhyay
Contributor
0 Likes
271

Hi Surender,

Try This.

go to screen painter > select ur input n output fields > properties > Attributes > Dic > change format CHAR to NUMC.

save it n Execute.

i hope it will work..

Reward points if useful.

Cheers.