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

sample module pool program

Former Member
0 Likes
3,915

Hi All!

Can anybody provide me the sample module pool program.I am having an input field which i have to validate and a push button after that to execute.Please provide me the logic in the PAI and PBO and also what to give as parameters in the fetch code of a button.

regards

pavan

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,815

Hi Kumar,

this is a sample code with five push buttons one of which is a cancel button and i/o field..

DATA: OK_CODE LIKE SY-UCOMM,
SAVE_OK LIKE OK_CODE,
OUTPUT(8) TYPE C.
CALL SCREEN 100.

<b>MODULE USER_COMMAND_0100 INPUT.</b>
SAVE_OK = OK_CODE.
CLEAR OK_CODE.
CASE SAVE_OK.
WHEN 'BUTTON_EXIT'.
LEAVE PROGRAM.
WHEN 'BUTTON_1'.
OUTPUT = 'Button 1'(001).
WHEN 'BUTTON_2'.
OUTPUT = 'Button 2'(002).
WHEN 'BUTTON_3'.
OUTPUT = 'Button 3'(003).
WHEN 'BUTTON_4'.
OUTPUT = 'Button 4'(004).
WHEN OTHERS.
OUTPUT = SAVE_OK.
ENDCASE.
ENDMODULE.

in this..The screen flow logic is as follows...

PROCESS BEFORE OUTPUT.
MODULE INIT_SCREEN_0100.

PROCESS AFTER INPUT.
MODULE USER_COMMAND_0100...

When the user chooses a pushbutton, the PAI event is triggered...

The function code

of the pushbutton is assigned to the screen field OK_CODE, which is then passed

onto the ABAP field with the same name...

The module USER_COMMAND_0100 is

then processed....

a text symbol is assigned to the OUTPUT field

according to the button that the user chose. This is displayed in the output field on

the screen. If the user chooses Cancel, the program ends.

..

6 REPLIES 6
Read only

Former Member
0 Likes
1,815

Hi,

for module programs there are so many examples in the ABAPDOCU it self.

did you check those ..<b>demo_dynpro_push_button</b>

Regards

vijay

Read only

Former Member
0 Likes
1,815

There are some demo programs in ABAPDOCU tcode.

Go through the same...

Read only

Former Member
0 Likes
1,815

Hi,

check this example <b>demo_dynpro_value_select</b>

this one will validate the input, and push button also there..

regards

vijay

Read only

Former Member
0 Likes
1,815

Hi kumar pavan

Check out this link

http://sap.mis.cmich.edu/sap-abap/abap09/index.htm

Regards

Deepak

reward points if helpful.

Read only

Former Member
0 Likes
1,816

Hi Kumar,

this is a sample code with five push buttons one of which is a cancel button and i/o field..

DATA: OK_CODE LIKE SY-UCOMM,
SAVE_OK LIKE OK_CODE,
OUTPUT(8) TYPE C.
CALL SCREEN 100.

<b>MODULE USER_COMMAND_0100 INPUT.</b>
SAVE_OK = OK_CODE.
CLEAR OK_CODE.
CASE SAVE_OK.
WHEN 'BUTTON_EXIT'.
LEAVE PROGRAM.
WHEN 'BUTTON_1'.
OUTPUT = 'Button 1'(001).
WHEN 'BUTTON_2'.
OUTPUT = 'Button 2'(002).
WHEN 'BUTTON_3'.
OUTPUT = 'Button 3'(003).
WHEN 'BUTTON_4'.
OUTPUT = 'Button 4'(004).
WHEN OTHERS.
OUTPUT = SAVE_OK.
ENDCASE.
ENDMODULE.

in this..The screen flow logic is as follows...

PROCESS BEFORE OUTPUT.
MODULE INIT_SCREEN_0100.

PROCESS AFTER INPUT.
MODULE USER_COMMAND_0100...

When the user chooses a pushbutton, the PAI event is triggered...

The function code

of the pushbutton is assigned to the screen field OK_CODE, which is then passed

onto the ABAP field with the same name...

The module USER_COMMAND_0100 is

then processed....

a text symbol is assigned to the OUTPUT field

according to the button that the user chose. This is displayed in the output field on

the screen. If the user chooses Cancel, the program ends.

..

Read only

Former Member
0 Likes
1,815

Hello Kumar,

in PROCESS AFTER INPUT.u need to write logic for validation..

FIELD f1 module valide_f1.

Module valide_f1.

checking logic for F1.

message exxx(xx).

endmodule.

for push button..

u need to check ok code.

CASE OK-CODE.

WHEN 'XXXX'.<-- this code is allocated to the button.

endcase.