Once the program 'ZSALESORDSCREEN' is created Saved and Activated, run Transaction SE51.
Enter screen number '9000'
Screen numbers can be up to 4 characters long, all of which must be digits. Screen numbers from 9000 are reserved for customer-specific screens.
In the Screen Painter enter a short Description and Activate the screen.
Click on Element List and type Ok_Code and Activate.
Now click on Flow Logic.
You should see the following code in the Flow Logic.
PROCESS BEFORE OUTPUT.
MODULE STATUS_9000.
PROCESS AFTER INPUT.
MODULE USER_COMMAND_9000.
Create MODULE STATUS_9000 by double clicking on it. The following code will be automatically created.
INCLUDE ZSALESORDERTOP . "
* INCLUDE ZSALESORDERO01 . *
* INCLUDE ZSALESORDERI01 . *
* INCLUDE ZSALESORDERF01 . *
*&---------------------------------------------------------------------*
*& Module STATUS_9000 OUTPUT
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
MODULE STATUS_9000 OUTPUT.
* SET PF-STATUS 'xxxxxxxx'.
* SET TITLEBAR 'xxx'.
ENDMODULE. " STATUS_9000 OUTPUT
Uncomment the following code.
SET PF-STATUS 'ZSALES'. ------------------ Menu Bar for the custom Sales Order Screen.
SET TITLEBAR 'ZSL'. -------------------- Title.
Give appropriate names to PF-STATUS and TITLE BAR. Once the code is uncommented and the appropriate names are given. Double click on the name ZSALES. Once you see the prompt click on create object.
You will see the following three options in the resulting screen.
Menu bar Status for Sales Order Screen
Application toolbar Status for Sales Order Screen
Function keys Status for Sales Order Screen
Click on the Function Keys Drop Down Box. You will see the Standard Tool Bar with Icons that you normally see in the SAP Screen.
Enter the following values in the empty fields.
Standard Toolbar
Ente SAVE BACK EXIT CANCEL PRINT FIND FINDNEXT FIRSTPAGE PREVP NEXT LAST
Activate the PF-STATUS.
You will be prompted to enter the Function Text and Info Text for the button Enter.
Please enter the following values.
Function Text 'Ente'
Info Text 'Enter'
Execute Transaction SE80 and Activate the complete program by right clicking on it.
We will now create a transaction code for our program. To create a transaction code right click on the main program and from the pop-up menu select Create-----Transaction.
In the dialog box enter the following values.
Transaction Code 'ZSALESORD'
Short Description 'Create Sales Order'
And Click on Save.
You will now be asked to enter Program name and Screen Number. Enter the following values.
Program ZSALESORDSCREEN
Screen 9000
Save and Activate the Program
Now we need to enter code to create the Sales order. We also need to create the Screen Elements.
In transaction SE80 in the left pane click on Screens and then double click on 9000.
Now from the menu click on LAYOUT button.
We need to create Labels and Text Boxes for the following fields.
Filed (Label Display) Label Name TextBox Name Def Length
Order Type lblordtyp txtordtyp 2
Sales Org lblsalesorg txtsalesorg 4
Distribution Channel lbldistchnl txtdistchnl 2
Division lbldiv txtdiv 2
Sold-to Party lblsoldto txtsoldto 10
Ship-to Party lblshipto txtshipto 10
Purchase Ord lblpurchord txtpurchord 10
Material lblmat txtmat 18
Quantity lblqty txtqty 13
We also need to create a command button as follows
Label Name
Create Order lblcreateord
We will now look at the property box which is displayed after double clicking on each screen element.
Order Type (Label)
Name lblordtyp
Text Order_Type
Order Type (Text Box)
Name txtordtyp
Text
Def. Length 2
Similarly fill the Property box for other fileds
Important
Property Box for Command Button in this case the Function Code is important
Create Order
Name cmdord
Text Create Order
Fct Code ORDE
SAP ABAP Tutorial: Module Pool Programming. Part 3
No comments:
Post a Comment