‎2007 Apr 25 7:27 AM
Hi friends,
i am working with module pool programming.
i was going through abapdocu, through below mentioned program, at the end it contains FORM read_data., now my question is that where the corresponding PERFORM will me declared and what the function of this.
PROGRAM demo_dynpro_module.
TABLES demo_conn.
DATA: ok_code TYPE sy-ucomm,
save_ok LIKE ok_code,
wa_spfli TYPE spfli.
CALL SCREEN 100.
MODULE init_screen_100 OUTPUT.
MOVE-CORRESPONDING wa_spfli TO demo_conn.
ENDMODULE.
MODULE status_0100 OUTPUT.
SET PF-STATUS 'STATUS_100'.
SET TITLEBAR '100'.
ENDMODULE.
MODULE clear_ok_code INPUT.
save_ok = ok_code.
CLEAR ok_code.
ENDMODULE.
MODULE get_data INPUT.
MOVE-CORRESPONDING demo_conn TO wa_spfli.
CLEAR demo_conn.
ENDMODULE.
MODULE user_command_0100 INPUT.
CASE sy-dynnr.
WHEN 0100.
CASE save_ok.
WHEN 'CANCEL'.
LEAVE PROGRAM.
WHEN 'DISPLAY'.
PERFORM read_data.
WHEN 'CLEAR'.
CLEAR wa_spfli.
ENDCASE.
...
ENDCASE.
ENDMODULE.
<b>FORM read_data.
SELECT SINGLE
cityfrom airpfrom cityto airpto fltime deptime arrtime
INTO CORRESPONDING FIELDS OF wa_spfli
FROM spfli
WHERE carrid = wa_spfli-carrid AND connid = wa_spfli-connid.
ENDFORM.</b>
‎2007 Apr 25 7:43 AM
Hi Rohit,
In this program, the form is called when the USER_COMMAND = 'DISPLAY' in MODULE user_command_0100 INPUT.
If the MODULE ends with INPUT that is for PAI.
If it is OUTPUT that is for PBO.
For this program this FORM will get the data from the table SPFLI for corresponding CARRID and CONNID.
Thanks & Regards
Santhosh
‎2007 Apr 25 7:33 AM
Hi Rohit,
Consider this Simple Example.
We are going to Add two Numbers Using Perform.
Data : A Type i value "1",
B Type I value "2",
Total Type I,
Temp type I.
If Temp = 1.
Perform Add.
else if temp = 2.
Perform sub.
endif.
form add.
total = A + B.
endform.
form Sub.
total = A - B.
endform.
Thanks.
Reward If Helpful.
‎2007 Apr 25 7:41 AM
thanks for explaining that....
can you please explain me the output of this program ....i am not getting how the fields are been displayed on the screen.....
‎2007 Apr 25 7:50 AM
In the screen 100 u have 2 input/ouput fields. one is CARRID( Airline code) and CONNID (Flight Connection Number).
The data is retrieved according to the inputs provided on the screen from the table SPFLI(Flight schedule) and it is retrieved data is displayed on the same screen when the USER_COMMAND = 'DISPLAY'.
Thanks & Regards
Santhosh
‎2007 Apr 25 7:55 AM
thanks santosh...it really helped me....
can u pls tell me how to make input/output fields of table field type on screen....
‎2007 Apr 25 8:12 AM
In the screen LAYOUT u ll have options to choose the I/O fields.
Go to SE51-> u ll find the tab called LAYOUT in the application toolbar.
It ll take u to the screen where u can define I/O fields, Pushbuttons etc...
Thanks & Regards
Santhosh
‎2007 Apr 25 7:36 AM
Hi Rohit,
Regarding To your coding, The Perform Read_data is defined under Function 'Display'. So you Click the Display Push Button In your Screen, Then Using Perform Statement The datas are read from Database Table and then It will be Displayed.
Thanks.
‎2007 Apr 25 7:43 AM
Hi Rohit,
In this program, the form is called when the USER_COMMAND = 'DISPLAY' in MODULE user_command_0100 INPUT.
If the MODULE ends with INPUT that is for PAI.
If it is OUTPUT that is for PBO.
For this program this FORM will get the data from the table SPFLI for corresponding CARRID and CONNID.
Thanks & Regards
Santhosh
‎2007 Apr 25 8:15 AM
Hi,
create screen 100 in screen painter.and in the layout of that screen click on the button standard tool bar button dictionary/program fields(3rd from last in standard tool bar).enter ur table name and click on get from dictionary.select the fields u want in screen and press enter.
reward all helpful answers.
rgds,
bharat.