Create Simple Report
Let’s take a simple example :
Create a SAP report having “Name” as an input field on the selection screen and output should display the value of this “Name” field.
Step 1 : Go to T-Code SE38.
Step 2 : Enter the name of the report as shown below in the RED highlighted area . The name should ALWAYS start with Z or Y (why?(hyperlink)). Then click on Create button.
Now enter description of the report, select Type as “Executable Program” and click on save.
Now once you click on Save button, a popup window will appear asking for package details. For now, lets click on Local object.
You will now see a not so good looking screen, where we will write our ABAP Code.
Step3 : Let’s create the selection screen. Write below code ( Avoid copy paste because we are learning here so copy paste will not put things in the brains ) in the space provided as per below screenshot.
PARAMETERS : p_name TYPE C LENGTH '40'.
Step 4 : Let’s write the Main logic/functionality to display the value of “Name” field on the output screen.
Write below code and click on the Activate button or press CTRL+F3 ( as shown below ).
WRITE : p_name
Select your report name and click on tick button.
Step 5 : Execute (press F8) the report. You will see the screen like below. Now enter any name or text as shown in the highlighted space 1, then press execute button ( highlighted 2) or press F8.
Below is the output you will get.
These are the main steps to create a SAP Report. If you observe carefully, we have used the 3 parts of the report (as we discussed in the Introduction section) i.e. Selection Screen( step 3) »» Main Logic( step 4) »» Output Screen( step 5).
All SAP reports follows the same approach.
Important Key points to remember when gathering requirement
- What are the Selection screen parameters.
- What all tables will be used ( this normally changes if the business requirements as complex or not freezed).
- What all BAPIs will be used ( functional consultant normally provides you, in case he doesn’t provide you then you can search on you own and ask for the test data from the functional consultant to test the BAPI ).
- What all columns should be displayed on the output screen. ( If Report output is an ALV output)
- What all data should be displayed on the output screen, if there is no ALV output.
These points should be clear before starting the development of the report.