Assigning Transactions to Layouts 
You use this procedure to specify the BDoc, segment, import list, and export list, using which data must be retrieved for the layout.
On the navigation bar, choose .
The Document Generation/Layout Maintenance tile set appears; it allows you to search for and select the layout, which you have created.
Choose the required layout.
The Document Generation/Layout Information tile set appears with the details of the selected layout.
Choose the Transaction pushbutton and enter the required data on the Transaction Data tile.
The transaction that you assign can be either a BDoc type or a business object.
If you want to use a business object as the transaction, you can enter either an exclamation point (!) or an ampersand (&) before the name of the business object as shown in the following table:
Notation |
Description |
Example |
|---|---|---|
Exclamation mark (!) |
Returns a single value at runtime |
!BOCAPGEN |
Ampersand (&) |
Returns a record-set at runtime |
&BOCAPGEN |
Choose New on the Import List tile and enter the required data. The import list is used to define parameters to retrieve the data.
The Import field is the name that must be used for generating the filtering criteria in the BDoc type.
The Used As field indicates the order of parameters and the key of the business object or the BDoc type. You specify the sequence of parameters in the reverse order. If there is only one parameter, then you must specify the key of the business object.
If, for example, a report must be generated for a campaign, then you must specify the key of the campaign. This indicates the specific campaign for which the report must be generated.
In most cases, the Import and Used As fields are the same.
If the import parameter is mandatory for this transaction, select the Mandatory indicator.
If, for example, an import parameter called “group” exists for a transaction and you specify it as mandatory, then the system returns an error if this parameter is not filled when the transaction is executed.
The Static indicator signifies that the data element gets its value from the description specified for the import parameter.
Choose New on the Export List tile and enter the required data. The export list consists of segment fields that you can choose from a BDoc type. These fields are then used as data elements for the layout.
If, for example, you want to include the start date of a campaign in a document, then enter the segment field corresponding to the start date in the export list.
The Export Field field corresponds to the name of the field in the user database.
The Export As field is the name of the export field that must be used while generating the document. You can also use the same name as Export Field. This is used internally.
In the Formula field, enter a formula to arrive at a calculated value during runtime.
The formula can include simple numbers, functions, totals, counts, or string manipulations. The formula can have either one or two parameters. The parameter can be a constant, such as a number, or another export field. In the formula ROWPRICE*0.16, for example, ROWPRICE is the export field and 0.16 is the constant. The order of parameters within the formula has no significance.
Example
A sales order has an order header, which exports the order value (TOTALSUM). In addition, it has line items, which export the quantity (QTY) and price (PRICE). In this case, you can use the following formulas in the existing export list of the line item transaction element:
Export QTY*PRICE as ROWPRICE to calculate the line item price
Export ROWPRICE*0.16 as ROWTAXES to calculate value-added tax per line item
Export SUM(ROWPRICE) as SUMTOITEM to calculate the subtotal of each line item
Save your entries.