Sunteți pe pagina 1din 9

MODULE-POOL Program to Display SFLIGHT data based on selection GO TO SE38, CREATE A PROGRAM

In the next window provide Title and choose Type as Module Pool from the drop down as shown below and click on save.

In the next screen provide a package in which the program needs to be saved or click on Local Object.

Write a statement call screen in the report

In the next screen a pop-up raises saying that the screen 100 doesnt exist create Object? Click on yes.

In the next screen provide short description and select Radio Button Normal as shown in the below screen. Save it and click on layout.

Wait for the screen painter to load. In the screen painter we design our screen. On the left side we can see UI element, In This example we use elements that are shown below.

First select the element Box and Drag Up to the area you need and the screen should look like this as shown below.

Double click on the BOX and provide the information in the pop-up. You can give any name, and in the Text field provide the text that has to appear on the Box and close the pop-up.

The result should like this.

Similarly Drag two Input/output elements and Give their Names as CARRID and CONNID and also provide labels to them using Text Filed and name them as Airline and Flight Number respectively The Final result of the screen should look like as shown below. Input/Output Name: Carrid , Name : Connid. TextFiled Airline,Flight Number Airline CARRID, Flight Number - CONNID

Now we have to put a BUTTON in the BOX and double click on it and give the information as shown below. FctCode is important to trigger the event when Button is pressed.

Now drag Table Control on to the screen and beside the Box as shown below and double-click on it.

Provide the info in the pop-up as shown below and close the pop-up.

Now in the tool bar click on Dictionary/Program Fields as shown below.

Now a Pop-up rises, in that provide the table name as SFLIGHT and select the required Fields and press ENTER.

And put them in the Table Control now the Table Control should look like as shown below.

Now we have complete our screen and the final design look like below.

Save and activate the screen and click on back button in the tool bar to go back to the screen. In the screen under the Flow Logic tab uncomment the modules and write the code as shown below.

Save it and click on back button to go back to our report and write the code as shown below.
PROGRAM ZTEST_MODULEPOOL. DATA : LT_SFLIGHT TYPE TABLE OF SFLIGHT, WA_SFLIGHT LIKE LINE OF LT_SFLIGHT, CARRID TYPE SFLIGHT-CARRID, CONNID TYPE SFLIGHT-CONNID. CONTROLS TABLE TYPE TABLEVIEW USING SCREEN 100. START-OF-selection. call screen 100. module STATUS_0100 output. SET PF-STATUS 'STATUS'. CASE SY-UCOMM. WHEN 'BACK'. LEAVE PROGRAM. WHEN OTHERS. ENDCASE. endmodule. module USER_COMMAND_0100 CASE SY-UCOMM. WHEN 'SUBMIT'. clear lt_sflight. IF CARRID IS INITIAL SELECT * FROM SFLIGHT else. SELECT * FROM SFLIGHT ENDIF. WHEN OTHERS. ENDCASE. endmodule. input.

OR CONNID IS INITIAL. INTO TABLE LT_SFLIGHT WHERE CARRID = CARRID OR CONNID = CONNID. INTO TABLE LT_SFLIGHT WHERE CARRID = CARRID AND CONNID = CONNID.

Double Click on STATUS . a pop-up raises saying that the GUI Status STATUS does not exist Create Object ?

Click on yes and in the next screen expand Function Keys and write BACK for Back button as shown below.

Save and activate the status and go back to the report. Save and activate the report and screen. Note: Dont forget to Active all the Work what we have done in this example and give the same names what I have used. Since it is a module pool program we cannot execute it directly so we need to create a transaction to our report and then execute it. Go to transaction se93 and give a transaction code that you want to create and click on create button.

In the next screen provide the description and select the radio button as shown in the below screen shot

Save it in the local object and provide the Program name and other information as shown as in the below screen shot.

Save your setting and run the transaction which you have created and the result should be as shown below.

S-ar putea să vă placă și