‎2006 Nov 07 10:37 AM
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.
‎2006 Nov 07 11:57 AM
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
‎2006 Nov 07 11:57 AM
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
‎2006 Nov 07 1:12 PM
‎2006 Nov 07 1:12 PM
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
‎2006 Nov 07 4:59 PM
hi
jus check for the sample code in the transaction ABAPDOCU
Cheers,
Abdul Hakim
‎2006 Nov 07 6:45 PM
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