|
Overview In this example we would like to create a simple application to release purchase requisitions can be released (SAP transaction ME54N).
|
|
Step 1: Automatic generation of an S10 application
based on the EBAN table
To do this, we start the generation tool (transaction /S10/UTIL) and specify the table EBAN. Then we select some fields to be displayed in the application and press "Save and generate":
As a basis, we now have an up and running application in which purchase requisitions are listed. However, these are neither assigned to a specific user (we will use the cost center for this later), nor can they be released. Therefore, we will add this functionality in the next steps. |
|
Step 2: Extending the interface for reading the purchase requisitions The cost center can be saved as a user parameter. Therefore we read this parameter to use it later in the selection of the purchase requisitions: ABAP
We need the internal format for the SELECT statement later, so we convert the determined value of the cost center with the S10 method s10userinput. We then extend the conditions for the selection to include the query for the cost center: ABAP
To read the data, we use the S10 method s10databaseselect,
which can be used to read data directly from the database into
the ABAP object:
ABAP
|
|
Step 3: Extending the HTML table with a "Release" column The generation tool has automatically generated the HTML page eban_manager.list.html, which displays the list of purchase requisitions. We add there another column " Release ", first the heading: HTML
Then we define the corresponding column as HTML output field. That is, the HTML code for this element is generated directly in an ABAP method and later interpreted by the browser: HTML
The field is defined in the ABAP class "eban_short" and a build
method there later creates the HTML code that displays a button:
ABAP
The implementation of the method: ABAP
The method checks the release status FRGZU to decide whether a button should be displayed "Release" or " Withdraw". If the status changes, the build method is automatically called again and the display or button is updated. |
|
Step 4: Implementing the ABAP method for releasing a purchase requisition In step 2 it was defined in the HTML code that the ABAP method "release" resp. is called as soon as the user presses the button. In the method, the line in which this button is located is determined and then the number of the purchase requisition and the position are passed to the function module BAPI_REQUISITION_RELEASE.: ABAP
|
|
Download You can download all project files here: s10_banf_example.zip The .ZIP archive contains the HTML views and a text file with the ABAP program "/s10/banf_main". To import the HTML views you can use the report "BSP_UPDATE_MIMEREPOS" as described in the documentation under the point "Development environment". Please adjust the number of the client in the file "user.logon.html" if necessary. You can find details about this in the documentation under the item S10Logon() |
|
Component: S10 Framework |