The following article shows how to upload CATS data from an SQL server table by using SSIS and the Xtract IS BAPI component.
About BAPI_CATIMESHEETMGR_INSERT #
The BAPI BAPI_CATIMESHEETMGR_INSERT creates Time Sheet entries in SAP.
- Input: Important input fields for BAPI_CATIMESHEETMGR_INSERT are the import parameters PROFILE and TESTRUN and the table CATSRECORDS_IN.
The results are available in the tables CATSRECORDS_OUT and RETURN.
The RETURN table contains different types of messages, e.g., warnings, information, errors, etc. If the input records do not have any errors, then the table CATSRECORDS_OUT will be populated with the same number of input records, otherwise it will not contain any entries.
The ROW fields in the RETURN table can be used to identify errors, see Checking for Errors.
Example: If the second and third entries have errors then the ROW of table RETURN will be populated as 2 and 3.
Input Table #
The format of an input table (column names and data types) must be compatible with the parameters of the BAPI, see Online Help: Mapping Input Tables.
The following table is stored on an SQL Server:
Table Name: BAPICATSINPUT
The table has the following content:
Setup in SSIS #
For information on how to use Xtract components, see Online Help: Getting Started with Xtract IS.
- Create a new Data Flow and add a Connection Manager that connects to your SAP system, see Online Help: Connection Manager.
- Add the Xtract BAPI component to the workflow.
- Assign the Connection Manager to the Xtract BAPI component manually or by double clicking on the component.
- Open the Xtract BAPI component and look up the BAPI BAPI_CATIMESHEETMGR_INSERT.
- Provide the PROFILE “TEST” and TESTRUN “ “ as import parameters.
- Add the tables CATSRECORD_OUT and RETURN to the output.
- Add a source. In this example, add an OLE DB Source to the workflow and map it with the input table BAPICATSINPUT.
- Connect the OLE DB Source to the Xtract BAPI component. The window “Input Putput Selection” opens.
- Select the table CATSRECORD_IN to map the data from the input table to CATSRECORD_IN.
The table fields are mapped automatically. For this, the name and data types of the table columns must match. If the input table and CATSRECORD_IN do not match, add a Deprived Column component between the OLE DB Source and the Xtract BAPI component to format the input table accordingly.
- Create two OLE DB destinations for the tables CATSRECORDS_OUT and RETURN of the Xtract BAPI component.
- Execute the workflow and check the SQL output tables.
- Use the transaction CAT3 to check the data in SAP.
Checking for Errors #
The ROW fields in the RETURN table can be used to identify errors. Example:
- To produce an error, set the the value for ABS_ATT_TYPE in the input table BAPICATSINPUT to 0005.
- Run the SSIS package.
The output table CATSRECORDS_OUT does not have any entries. This means that the data in SAP is not updated.
- Query the SQL table RETURN to identify the error.
The numbers in the ROW column show which rows contain the erroneous records.
The message displayed in the MESSAGE column indicates that the attendance/absence type (0005) is not maintained.
Note: When using BAPI_CATIMESHEETMGR_INSERT, note that only records without errors are posted. If an error occurs during posting, none of the data – including records without errors – is posted. We recommend including only a small number of records in each posting.