FBS1 step by step: Posting Accrual/Deferral documents
This document describes how you can use Winshuttle Transaction to post accruals/ deferrals in the SAP Business Suite from data in Microsoft Excel using the SAP transaction FBS1 (Enter Accrual/Deferral Document). The example here will show how to use the Transaction Do-While loop feature to upload multiple-line entries from an Excel file into SAP.
The FBS1 transaction is very similar to the FB01 (Post Document), F-02 (Enter G/L Account Posting), and F-43 (Enter Vendor Invoice) transactions, and the steps that are shown here can also be used for those transactions.
- Start Winshuttle Transaction from the desktop shortcut or from the Windows Start menu.
- Click New.
- Enter transaction code FBS1 in the Transaction Code box, and then click Go.
An SAP Log On screen appears.
- Click the SAP system that you want to use, and then click OK.
- Enter the appropriate User Data in the SAP Logon window, and then click the OK button.
If you do not see the SAP system that you want, click the System button and choose a different system.
- For the recording mode, click Non-Batch Input Mode and click Without SAP Controls.
Note: Non-Batch Input Mode Without Controls will work for most transactions. Non-Batch modes are necessary for downloading information from SAP transactions, or for Finance or HR transactions in which there are Dynamic Actions executing or user parameter values being used; otherwise, if you do not have access to Non-Batch modes, you can try recording in Batch Mode. The difference between Without SAP Controls and With SAP Controls is just a matter of what tools are on the transaction screens. For more information, see the Recording modes topic (Connect mode or Central mode).
- Enter any additional properties in the appropriate fields.
- To prevent people from editing the script, check the Lock TRANSACTION script box. This will password-protect the script, preventing anyone from changing it.
- Click the Next button.
The FBS1 transaction starts.
Note: The following screens may vary according to the way your SAP system has been configured.
To make this process repeatable by Transaction, there will be a few changes to the process compared with how you would manually create a material. These differences will be identified throughout the rest of this document.
- Enter data into the header section:
- Document Date
- Company Code
- Posting Date
- Document Header Text
- Reversal Reason
- Reversal Date
- Posting Key
- Press the Enter key.
- Enter data for the first line item:
Important: These steps will most likely be different from manual entry.
- After you enter the item data, click the Back button.
- Now enter the next posting key and account number, and then press the Enter key.
Important: Because the header screen changes after the first line item entry, we will be starting our loop from here. So one line item entry will remain in our header section later on when we get into the Mapper.
- Enter data for the second line item:
- After you enter the item data, click the Back button.
Important: While you record this transaction, the line item screen here will change, based on the account type of the posting key. If you will be using multiple posting keys in this transaction, you will need to account for the different screen numbers.
- Click the Save button. This will also end the recording and take you back to the Transaction screen.
It is now time to create the mapping for this transaction. Mapping a script is just a matter of connecting SAP fields to fields in your data file. Transaction provides a Mapper to facilitate this process.
Auto Mapping will map the entire script to an Excel spreadsheet and in order. Because of the complexity of this transaction, we will choose the Create Mapping option instead.
- In the Map pane, click Create Mapping.
- The screenshot below shows the Expert tab of the Mapper.
In each of the rows of the Mapper, you will see:
- Mapper Row number: This is just a reference number.
- Enable flag: only enabled Mapper rows will be executed by Transaction.
- Screen / Screen Number: Technical screen information from the recorded transaction.
- Field Description: The label associated with the SAP technical field name.
- Field Name: The SAP technical field name.
- Mapping Type: Fixed Value, Excel to SAP, SAP to Excel (or, if mapping to Access: Access to SAP, SAP to Access).
- Value: Values assigned to the SAP field; either fixed values or values to or from the assigned data source.
- Notes: Freeformat notes to provide useful information to runners of the Transaction script.
- To map the script to the data source, you will drag in the direction that the data will move. For this script, you are uploading data from Excel to SAP, so you will drag from Excel to the Mapper.
Drag column B up and drop it onto Document Date in row 5.
Continue this process for all of the fields that you want to update, including the posting key, account, amount, and item text for both line items.
- There are two sections where you input the posting key/account number and then the amount and item text. The first entry will remain in the header, and you will create a loop around the second entry.
Highlight the entire second line item entry, in this case rows 21 through 30, and then click the Loop button.
The Do While Properties box opens with default values, which you can change:
- The start and end row refer to the rows in the Mapper that contain the loop (the highlighted rows—in this case, 21 through 30).
- The MS Excel ID Column box displays the column in the spreadsheet that will contain the Header and Detail (line item data) identifiers.
- The Header ID and Line Item ID displays the values that will identify the Header (H) and Line Item (D) rows.
- Click the OK button to insert the loop around the selected Mapper rows.
The Mapper reflects the following changes as a result of inserting the loop:
- The graphical depiction of the Loop around the selected lines indicates which Mapper rows will be contained within the loop.
- The ID Column has been identified in the Preview screen.
- Row 2 contains the first Header ID value, and row 3 contains the Line Item ID value.
Note: This will appear in the preview file only if you are mapping to a blank file.
- The next step is to save the script file (.TxR) and the Excel preview file (.xlsx). Click the Back arrow button at the top on the File menu.
The best practice is to name the Excel spreadsheet the same name as the script unless an Excel spreadsheet will be used for multiple scripts.
Note: If you want to use an existing Excel file that already has the data set up, you can skip saving the preview file and save the script file by clicking the Save button on the File menu.
- Transaction prompts you to save the Excel preview file.
- Click Yes, and then enter the Excel file name.
- Transaction prompts you to save the script.
- Click Yes, and then enter the script’s name.
Add the data
Transaction loads the Run pane.
If necessary, you can navigate back to the Mapper by clicking the Update Mapping link on the Map pane.
- Click the Excel icon to the right of the Select Data File box. This will open the mapped Excel file that is listed in the Selected Data File box.
Note: Transaction will automatically assign the Log column to the next available column after the last mapped column (in this case, column S).
- Type the data in the columns, including the Header and Line Item identifiers in the ID Column, and then save the Excel file.
After you enter the data into the Excel spreadsheet, you can run the script.
Back at the Transaction Run pane, you can specify a start and end row, specify the Excel sheet that contains the data, and change the Log column.
- To execute the upload, click the Test button, if you are a Central user, or click the Run button if you are not a Central user.
- In the SAP Logon window, if necessary, click the System button to select the appropriate SAP system.
- Enter the appropriate user data, and then click OK.
The document will now be posted based on the data in the spreadsheet.
- In the bottom left corner, Transaction displays a message when the run has finished.
- Open the Excel sheet and check the log column. The run was successful and the messages returned from SAP were entered into the log column.