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

new to module pool program

Former Member
0 Likes
634

hi all,

i am new to module pool program .

so if anyone of u have any documents regarding it then plz share with me.i will be grateful to u for ur efforts.

if any one has created a module pool prog then he/she can send me tha source coding with screen shots which will be very useful for me .

i am looking for ur help.

i will reward ur efforts.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
596

ABAP Program :

Below

Process before output.

*Module Status_0100.

Process After Input.

Module User_command_0100.

PROCESS ON VALUE-REQUEST.

FIELD ZCOUNTRY-COUNTRY MODULE GET_F4_COUNTRY.

FIELD ZSTATES-STATE MODULE GET_F4_STATE.

&----


*& Report ZDEMO_F4_HELP *

*& *

&----


*& *

*& *

&----


REPORT ZDEMO_F4_HELP .

TABLES : ZCOUNTRIES,

ZSTATES.

DATA : IT_COUNTRIES LIKE TABLE OF ZCOUNTRIES,

IT_states LIKE TABLE OF Zstates.

data : It_return like ddshretval occurs 0 with header line.

&----


*& Module USER_COMMAND_0100 INPUT

&----


  • text

----


module USER_COMMAND_0100 input.

CASE SY-UCOMM.

WHEN 'BACK'.

LEAVE TO SCREEN 0.

ENDCASE.

endmodule. " USER_COMMAND_0100 INPUT

&----


*& Module GET_F4_COUNTRY INPUT

&----


  • text

----


module GET_F4_COUNTRY input.

SELECT * INTO TABLE IT_COUNTRIES FROM ZCOUNTRIES.

CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'

EXPORTING

  • DDIC_STRUCTURE = ' '

retfield = 'ZCOUNTRIES-COUNTRY'

  • PVALKEY = ' '

DYNPPROG = 'ZDEMO_F4_HELP'

DYNPNR = '0100'

DYNPROFIELD = 'ZCOUNTRIES-COUNTRY'

  • STEPL = 0

  • WINDOW_TITLE =

  • VALUE = ' '

VALUE_ORG = 'S'

  • MULTIPLE_CHOICE = ' '

  • DISPLAY = ' '

  • CALLBACK_PROGRAM = ' '

  • CALLBACK_FORM = ' '

tables

value_tab = IT_COUNTRIES

  • FIELD_TAB =

RETURN_TAB = IT_RETURN

  • DYNPFLD_MAPPING =

  • EXCEPTIONS

  • PARAMETER_ERROR = 1

  • NO_VALUES_FOUND = 2

  • OTHERS = 3

.

IF sy-subrc = 0.

read table It_return index 1.

ZCOUNTRIES-COUNTRY = It_return-fieldval.

ENDIF.

endmodule. " GET_F4_COUNTRY INPUT

&----


*& Module GET_F4_STATE INPUT

&----


  • text

----


module GET_F4_STATE input.

REFRESH IT_RETURN.

SELECT * INTO TABLE IT_STATES FROM ZSTATES where

COUNTRY = ZCOUNTRIES-COUNTRY.

CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'

EXPORTING

  • DDIC_STRUCTURE = ' '

retfield = 'ZSTATES-STATE'

  • PVALKEY = ' '

DYNPPROG = 'ZDEMO_F4_HELP'

DYNPNR = '0100'

DYNPROFIELD = 'ZSTATES-STATE'

  • STEPL = 0

  • WINDOW_TITLE =

  • VALUE = ' '

VALUE_ORG = 'S'

  • MULTIPLE_CHOICE = ' '

  • DISPLAY = ' '

  • CALLBACK_PROGRAM = ' '

  • CALLBACK_FORM = ' '

tables

value_tab = IT_STATES

  • FIELD_TAB =

RETURN_TAB = IT_RETURN

  • DYNPFLD_MAPPING =

  • EXCEPTIONS

  • PARAMETER_ERROR = 1

  • NO_VALUES_FOUND = 2

  • OTHERS = 3

.

IF sy-subrc = 0.

*IT_RETURN HAS THE VALUE THAT IS SELECTED

read table It_return index 1.

ZSTATES-STATE = It_return-fieldval.

ENDIF.

endmodule. " GET_F4_STAte

This is code for a sample program for the F4 help. Means In the First screen when u enter the country name then the next field has the States in the Country...

Just Check this out.

Bye

Murthy

Message was edited by: Ramana Murthy

Message was edited by: Ramana Murthy

5 REPLIES 5
Read only

Former Member
0 Likes
597

ABAP Program :

Below

Process before output.

*Module Status_0100.

Process After Input.

Module User_command_0100.

PROCESS ON VALUE-REQUEST.

FIELD ZCOUNTRY-COUNTRY MODULE GET_F4_COUNTRY.

FIELD ZSTATES-STATE MODULE GET_F4_STATE.

&----


*& Report ZDEMO_F4_HELP *

*& *

&----


*& *

*& *

&----


REPORT ZDEMO_F4_HELP .

TABLES : ZCOUNTRIES,

ZSTATES.

DATA : IT_COUNTRIES LIKE TABLE OF ZCOUNTRIES,

IT_states LIKE TABLE OF Zstates.

data : It_return like ddshretval occurs 0 with header line.

&----


*& Module USER_COMMAND_0100 INPUT

&----


  • text

----


module USER_COMMAND_0100 input.

CASE SY-UCOMM.

WHEN 'BACK'.

LEAVE TO SCREEN 0.

ENDCASE.

endmodule. " USER_COMMAND_0100 INPUT

&----


*& Module GET_F4_COUNTRY INPUT

&----


  • text

----


module GET_F4_COUNTRY input.

SELECT * INTO TABLE IT_COUNTRIES FROM ZCOUNTRIES.

CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'

EXPORTING

  • DDIC_STRUCTURE = ' '

retfield = 'ZCOUNTRIES-COUNTRY'

  • PVALKEY = ' '

DYNPPROG = 'ZDEMO_F4_HELP'

DYNPNR = '0100'

DYNPROFIELD = 'ZCOUNTRIES-COUNTRY'

  • STEPL = 0

  • WINDOW_TITLE =

  • VALUE = ' '

VALUE_ORG = 'S'

  • MULTIPLE_CHOICE = ' '

  • DISPLAY = ' '

  • CALLBACK_PROGRAM = ' '

  • CALLBACK_FORM = ' '

tables

value_tab = IT_COUNTRIES

  • FIELD_TAB =

RETURN_TAB = IT_RETURN

  • DYNPFLD_MAPPING =

  • EXCEPTIONS

  • PARAMETER_ERROR = 1

  • NO_VALUES_FOUND = 2

  • OTHERS = 3

.

IF sy-subrc = 0.

read table It_return index 1.

ZCOUNTRIES-COUNTRY = It_return-fieldval.

ENDIF.

endmodule. " GET_F4_COUNTRY INPUT

&----


*& Module GET_F4_STATE INPUT

&----


  • text

----


module GET_F4_STATE input.

REFRESH IT_RETURN.

SELECT * INTO TABLE IT_STATES FROM ZSTATES where

COUNTRY = ZCOUNTRIES-COUNTRY.

CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'

EXPORTING

  • DDIC_STRUCTURE = ' '

retfield = 'ZSTATES-STATE'

  • PVALKEY = ' '

DYNPPROG = 'ZDEMO_F4_HELP'

DYNPNR = '0100'

DYNPROFIELD = 'ZSTATES-STATE'

  • STEPL = 0

  • WINDOW_TITLE =

  • VALUE = ' '

VALUE_ORG = 'S'

  • MULTIPLE_CHOICE = ' '

  • DISPLAY = ' '

  • CALLBACK_PROGRAM = ' '

  • CALLBACK_FORM = ' '

tables

value_tab = IT_STATES

  • FIELD_TAB =

RETURN_TAB = IT_RETURN

  • DYNPFLD_MAPPING =

  • EXCEPTIONS

  • PARAMETER_ERROR = 1

  • NO_VALUES_FOUND = 2

  • OTHERS = 3

.

IF sy-subrc = 0.

*IT_RETURN HAS THE VALUE THAT IS SELECTED

read table It_return index 1.

ZSTATES-STATE = It_return-fieldval.

ENDIF.

endmodule. " GET_F4_STAte

This is code for a sample program for the F4 help. Means In the First screen when u enter the country name then the next field has the States in the Country...

Just Check this out.

Bye

Murthy

Message was edited by: Ramana Murthy

Message was edited by: Ramana Murthy

Read only

Former Member
0 Likes
596

Hi,

Check out this Thread:

might be useful

Read only

Former Member
0 Likes
596

Hullo,

Try the following links (the documents are based on old SAP R/3 versions (iirc 4.0) but the principles explained in these documetns are still very valid today).

<a href="http://www.allsaplinks.com/files/intro_to_dialog_prg.pdf">An introduction to dialog programming</a>

Plus the files section of this site (allsaplinks) contains more material on Dialog programming (= module pool programming):

http://www.allsaplinks.com/dialog_programming.html

Hope this Helps.

Remi Ebus

Read only

abdul_hakim
Active Contributor
0 Likes
596

hi

jus check for the sample code in the transaction ABAPDOCU

Cheers,

Abdul Hakim

Read only

Former Member
0 Likes
596

Hi Sanjeev,

Try the transaction code DWDM..there are a lot of sample programs.You can juss drag and drop or double-click to execute it.

Thanks and Regards