
With this batch input program you generate sessions in order to create and change purchase requisitions in the system.
The program reads the sequential file that is specified in it as a parameter and generates one or more batch input sessions from this file.

Requirements
Before you generate the session, you must extract the data that is to be adopted from the source system and write it to a sequential file using a program you have written yourself. As an example, you can take a look at report RM06BBIE, which generates such a sequential file with the required structure.
The data is expected on the sequential file in the following sequence:
- One session record per session (BGR00, record type 0)
All further records up to the next session record are assigned to the last-read session unless the session reaches the prescribed maximum number of transactions per session. - One header record per transaction (BEBA0, record type 1)
All further records up to the next header record are assigned to the last-read transaction.
The header record contains the transaction code, the document type, the requisition number (if the number is to be assigned externally), and an indicator for automatic source determination. - For each requisition item, a record with the data of this item (BEBAN, record type 2, table name BEBAN).
All records for purchase requisition items are combined under a transaction until- the next session record follows
- the next header record follows
- an item record contains a different, external requisition number
- the maximum number of items for the transaction has been reached.
- For each account assignment of a requisition item, a record with the account assignment data (BEBKN, record type 3, table name BEBKN).
All account assignments for an item must follow directly after the record for the item (BEBAN). - For each subcontracting component of an item, a record with the component data (BKOMP, record type 4, table name BKOMP).
All components for an item must follow directly after the record for the item (BEBAN) or any existing account assignments for the item. - For each line of long text, a record (BLINES, record type 5, table name BLINES).
All lines of a text type must follow consecutively and are kept together through specification of the same two-character number in the field BLINES_TBNAM. With this number, you also determine which text type is filled with the relevant text. Example: BLINES-TBNAM = ’02’ causes the second text on the text overview screen for the requisition to be filled with text lines.
All text types for an item must follow directly after the item or any existing account assignments or components of the item. - The release of purchase requisitions is not supported by this batch input session.
- Items can be deleted by setting the field BEBAN-LOEKZ. Cancellation of the deletion is not supported.
Procedure
- Extract the data that is to be transferred using the relevant program, in the process writing the data to the sequential file.
- Generate a session with the batch input program. At this stage, your data will be checked for the first time. Errors will be logged.
- Run the session. The data will be adopted into the system and saved.
Note
- During creation, the number can be assigned both internally and externally. When changing, you must always specify the number.
A purchase requisition that has been newly created with internal number assignment immediately beforehand in a run cannot be changed in the same run. - For each field you must define an entry. This can be:
- an explicitly entered field value (in order to transfer a certain value)
- a blank (to delete an entry when changing)
- a special character (to transfer no value)
The special character must be defined in the session record in the field “BGR00-NODATA” (default special character is ‘/’).
- You must specify all fields in output format.
- The following authorizations must be noted when running the session:
- If a session is run in the foreground, the user running it must have the relevant authorizations for the maintenance of purchase requisitions.
- If a session is run in the background, the user who is entered in the session record under “USER-ID” must have the relevant authorizations for the maintenance of purchase requisitions.
Further information is available in the SAP Library under CA Data Transfer Workbench.



