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

simple module pool programming.

Former Member
0 Likes
720

hi,

can anybody tell me how to go about doing module pool programming ....... to start with ....... how to add 2 nos. using screen with 2 i\o fields for user to input 2 nos. and a output field for result.........

can u tell the coding and the wat plz ..

5 REPLIES 5
Read only

Former Member
0 Likes
609

Transaction ABAPDOCU has lot of demo programs on Dialog Programming. Hope it is of help to you.

Thanks and regards,

Pavithra

Read only

Former Member
0 Likes
609

Hi,

Frist create program ztest in SE38

PROGRAM ztest.

DATA: input  TYPE i,
      output TYPE i,
      radio1(1) TYPE c, radio2(1) TYPE c, radio3(1) TYPE c,
      box1(1) TYPE c, box2(1) TYPE c, box3(1) TYPE c, exit(1) TYPE c.

Save and activate your program now goto SE51 give program name ztest and give screen name as 100

see the following

*In SE51 *

PROCESS BEFORE OUTPUT.
  MODULE init_screen_100.

PROCESS AFTER INPUT.
  MODULE user_command_0100.

Now goto again your program in SE38

CALL SCREEN 100.

MODULE init_screen_100 OUTPUT.
  CLEAR input.
  radio1 = 'X'.
  CLEAR: radio2, radio3.
ENDMODULE.

MODULE user_command_0100 INPUT.
  output = input.
  box1 = radio1.
  box2 = radio2.
  box3 = radio3.
  IF exit NE space.
  LEAVE PROGRAM.
ENDIF.
ENDMODULE.

Regards,

Mahi.

Read only

Former Member
0 Likes
609

that program is known to me but its not of help .... i want the exact coding

Read only

0 Likes
609

Hey deepak i think you are very new to module pool programming but it is very difficutlt to explain step by step process but easyest programming.

do the following steps

1. Create a program in SE38 ex: prog name is ztest create the program as executable program

2. Write a code in that program like this.

data: w_no1 type i,

w_no2 type i.

3. Just save the program and activate it, and now go back to SE38 tcode.

4. Now goto SE51 transaction

5. give ztest in the program name and give screen number as 100 now press create button

6. give the short test and press the Layout button

7. In the there are some buttons in the left side in that press the second button Text field and now drag and drop in the flag screen give the name and text for that

8. and now press the third button from the top and grag and drop it now give the name as W_NO1

9. do the 7th and third steps for second number but give the name for the second field as w_NO2

10. save it activate it and press the Flowlogic button

11. Now uncomment the * MODULE USER_COMMAND_0100* and double click on that in the Main program and write the code in this.

see the following.

PROGRAM  ZTEST20.

data: w_no1 type i,
w_no2 type i.

call screen 100.


*&---------------------------------------------------------------------*
*&      Module  USER_COMMAND_0100  INPUT
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
module USER_COMMAND_0100 input.

 *write the code here

endmodule.                 " USER_COMMAND_0100  INPUT

<REMOVED BY MODERATOR>

Mahi.

Edited by: Alvaro Tejada Galindo on Feb 22, 2008 6:18 PM

Read only

Former Member
0 Likes
609

HI

goto se80....give the program name and then right click and create a screen ...give some screen number...there goto layout tab and then u can select all the feilds which u want from a particular table directly u can drag and drop...

and then u can write code in includes...

INCLUDE mz50875sd_modp_assignmenttop . " global Data

  • INCLUDE MZ50875SD_MODP_ASSIGNMENTO01 . " PBO-Modules

  • INCLUDE MZ50875SD_MODP_ASSIGNMENTI01 . " PAI-Modules

  • INCLUDE MZ50875SD_MODP_ASSIGNMENTF01 . " FORM-Routines

&----


*& Module STATUS_0888 OUTPUT

&----


MODULE status_0888 OUTPUT.

LOOP AT SCREEN.

IF screen-group1 = 'G1'.

screen-input = '0'.

ENDIF.

MODIFY SCREEN.

ENDLOOP.

ENDMODULE. " STATUS_0888 OUTPUT

&----


*& Module USER_COMMAND_0888 INPUT

&----


MODULE user_command_0888 INPUT.

CASE sy-ucomm.

WHEN 'DISP'.

SELECT kunnr

land1

name1

ort01

pstlz

regio FROM kna1

INTO TABLE it_kna1

WHERE kunnr = p_kunnr.

IF sy-subrc = 0.

LOOP AT it_kna1 INTO wa_kna1.

v_land1 = wa_kna1-land1.

v_name1 = wa_kna1-name1.

v_ort01 = wa_kna1-ort01.

v_pstlz = wa_kna1-pstlz.

v_regio = wa_kna1-regio.

CLEAR wa_kna1.

ENDLOOP.

ELSE.

MESSAGE text-000 TYPE 'I'.

CLEAR : p_kunnr , v_land1 , v_name1 , v_ort01 , v_pstlz , v_regio .

ENDIF.

WHEN 'EXIT'.

LEAVE PROGRAM.

ENDCASE.

ENDMODULE. " USER_COMMAND_0888 INPUT