Automate CO Data Loads With BATCHMAN

11
Automate CO Data Loads with BATCHMAN by Darshan Shah, Platinum Solutions Consultant, itelligence Consulting CO An SAP R/3 Enterprise functionality called BATCHMAN enables the easy upload of selective CO data, including activity rates and statistical key figures for allocations and reporting. Key Concept Most SAP CO implementations need CO data periodically entered in SAP R/3. That could be loading the activity prices for use in calculation of standard costs or statistical key figure values by cost centers for use in allocations. Usually this data is stored in Microsoft Excel spreadsheets and manually entered in CO by users. Sometimes this data is entered into R/3 by custom programs or the Legacy System Migration Workbench (LSMW). Transaction BATCHMAN puts the control of these data loads in the hands of the controlling department by providing an efficient user interface. SAP R/3 Enterprise has a standard functionality, BATCHMAN, that allows you to automate some of your data loads to CO using Business Application Programming Interface (BAPI) technology. BATCHMAN is a front-end transaction to a BAPI that makes the BAPI easier to configure and use for CO data loads. You use the R/3-delivered BAPIs in combination with Business Add-Ins (BAdIs), which take care of the user interface and message handling. BATCHMAN eliminates the need to write custom ABAP code or to use the Legacy System Migration Workbench (LSMW) to load monthly data. Note BATCHMAN is a built-in transaction of R/3 Enterprise Release 4.7 and is not related to the third-party software BatchMan, which is used for job scheduling.

description

automate CO data loads

Transcript of Automate CO Data Loads With BATCHMAN

Page 1: Automate CO Data Loads With BATCHMAN

Automate CO Data Loads with BATCHMAN

by Darshan Shah, Platinum Solutions Consultant, itelligence Consulting CO

An SAP R/3 Enterprise functionality called BATCHMAN enables the easy upload of selective CO data, including activity rates and statistical key figures for allocations and reporting.

Key Concept

Most SAP CO implementations need CO data periodically entered in SAP R/3. That could be loading the activity prices for use in calculation of standard costs or statistical key figure values by cost centers for use in allocations. Usually this data is stored in Microsoft Excel spreadsheets and manually entered in CO by users. Sometimes this data is entered into R/3 by custom programs or the Legacy System Migration Workbench (LSMW). Transaction BATCHMAN puts the control of these data loads in the hands of the controlling department by providing an efficient user interface.

SAP R/3 Enterprise has a standard functionality, BATCHMAN, that allows you to automate some of your data loads to CO using Business Application Programming Interface (BAPI) technology. BATCHMAN is a front-end transaction to a BAPI that makes the BAPI easier to configure and use for CO data loads. You use the R/3-delivered BAPIs in combination with Business Add-Ins (BAdIs), which take care of the user interface and message handling. BATCHMAN eliminates the need to write custom ABAP code or to use the Legacy System Migration Workbench (LSMW) to load monthly data.

Note

BATCHMAN is a built-in transaction of R/3 Enterprise Release 4.7 and is not related to the third-party software BatchMan, which is used for job scheduling.

I’ll show you how easy it is to set up BATCHMAN, including undocumented tips, using the example of loading statistical key figure values to cost centers, which can then be used for the reporting and allocation purposes. Let me first explain the relationship among BAPIs, BadIs, and BATCHMAN. BAPIs are a standard R/3 interface designed to perform specific business tasks. They are stored as function modules in the Function Builder of ABAP Workbench. BAdIs enable you to distinguish between enhancements that can have no more than one implementation and those that can be actively used by any number of customers at the same time. BATCHMAN is a standard R/3 transaction that depicts a front-end screen for data transfer to CO. The BAdI EXT_CO_ACTUAL_DATA must be implemented to use BATCHMAN. If it is not implemented, data is not transferred. Depending on the CO transaction, the BAdI implementation transfers the uploaded data to the output tables of a BAPI. In turn, the relevant BAPI posts the data to CO tables.BATCHMAN supports the following CO functions:

Page 2: Automate CO Data Loads With BATCHMAN

Activity allocation

Primary cost reposting

Revenue reposting

Manual cost allocation

Non-allocatable activities

Statistical key figures

Reversal

Note

For the list of BATCHMAN-supported CO processes, refer to SAP note 737917.

For BATCHMAN to load the data for a particular CO transaction, a corresponding BAPI must be available. Table 1 shows which CO transactions have a BAPI.

CO transaction

Description

CPH4N Standard hierarchy for business processes — change

CPH5N Standard hierarchy for business processes — display

OKEON Standard hierarchy for cost centers — change

OKENN Standard hierarchy for cost centers — display

KCH5N Standard hierarchy for profit centers — change

KCH6N Standard hierarchy for profit centers — display

KB11N (not for CO-PA) Enter manual reposting of primary costs

KB21N Enter direct activity allocation

KB31N Enter statistical key figures

KB41N Enter manual reposting of revenue

Table 1 BAPI availability for CO transactions (source: SAP note 314528)

BATCHMAN Setup

Page 3: Automate CO Data Loads With BATCHMAN

To load the statistical key figures to Cost Center Accounting (CO-OM-CCA), first create an implementation using transaction SE18 for the BAdI used by the BATCHMAN function in the background. The BAdI is EXT_CO_ACTUAL_DATA. Then implement the IMPORT method, which is already done in most R/3 Enterprise installations. You can easily confirm this by looking at the Interface tab for the definition, as shown in Figure 1. You may need the help of a technical resource to activate the definition if it is not already activated. This is the only technical step in the entire process, and it’s a one-time step.

Figure 1 Definition of EXT_CO_ACTUAL_DATA as delivered by R/3

Note

You have to create a transaction-specific layout to store the data before loading. See Table 2 for a list of the header and line-item BAPIs available in CO. Once you find the required BAPI from Table 2, the table structure of the respective BAPI tells you the layout requirement. (This is not well documented in the help documents.) For example, to load the statistical key figure values for Cost Center Accounting, I created the layout shown in Figure 2. You can also use the documentation for each BAPI for understanding the requirements of the layout using transaction BAPI in R/3..

Transaction

Header BAPI Line-item BAPIHeader output table

Line-item output table

Activity allocation BAPIAAHDR BAPIAAITM AA_HEADERS AA_ITEMS

Primary cost repostings BAPIRCHDR BAPIRCITM RC_HEADERS RC_ITEMS

Revenue repostings BAPIRRHDR BAPIRRITM RR_HEADERS RR_ITEMS

Manual cost allocations BAPIMAHDR BAPIMAITM MA_HEADERS MA_ITEMS

Non-allocable activities BAPIIAHDR BAPIIAITM IA_HEADERS IA_ITEMS

Statistical key figures BAPISKFHDR BAPISKFITM SKF_HEADERS SKF_ITEMS

Reversals BAPIDOCHDRR   REV_HEADERS  

Page 4: Automate CO Data Loads With BATCHMAN

Table 2 List of header and line-item BAPIs for transactions in CO (source: SAP note 314528)

Figure 2 Data layout to load statistical key figure values to Cost Center Accounting

As you can see in Figure 2, the layout has header and line-item sections. This layout was created using the table structures BAPISKFHDR and BAPISKFITM. The table structures (transaction SE11) are shown in Figures 3 and 4.

Figure 3 Structure of BAPISKFHDR displays the list and sequence of fields to determine the header section of the layout for statistical key figure values loaded in Cost Center Accounting

Figure 4 Structure BAPISKFITM displays the list and sequence of fields to determine the line-item section of the layout for statistical key figure values loaded in Cost Center

Page 5: Automate CO Data Loads With BATCHMAN

Accounting

Note

The line-item section must contain the CO_AREA and DOC_NO columns. The values in the DOC_NO column for header and line item create a unique relationship between two sections. In my example, document number 0000000001 is for statistical key figure EMP and 0000000002 is for statistical key figure CONS, as seen in Figure 2.

Data Load Process: Managed by Controlling DepartmentThe statistical key figure values are used for the assessment/distribution function and reporting in Cost Center Accounting. Many companies load the statistical key figure values periodically in CO. I have used the example of two statistical key figures (EMP = number of employees and CONS = number of consultants) values to be loaded to two cost centers (3030 and 3040). You can use transaction KB31N to manually load these values. The goal is to replace the manual transaction with BATCHMAN.First, using the layout created in Figure 1, enter the values for statistical key figures EMP and CONS for cost centers 3030 and 3040. Then save the file as a .txt (tab delimited) file.Now start the transaction BATCHMAN via menu path Accounting>Controlling>Cost Center Accounting>Actual Postings>BATCHMAN — Transfer of External Data or transaction BATCHMAN. You will see the screen shown in Figure 5.

Figure 5 User interface for executing the BATCHMAN transaction in R/3

When you click on the Execute button, it takes you to the main screen for the data load, which is shown in Figure 6.

Page 6: Automate CO Data Loads With BATCHMAN

Figure 6 Main screen to execute the BATCHMAN transaction, which specifies where the data file is located

I recommend that you run the transaction in test mode by selecting the Test button. Make sure the Ignore warnings field is not selected, as it provides useful information if the layout is wrong or if you are loading the same file again.In the File Name of Posting Data field, map the path of the .txt data file you stored with values earlier. Now you are ready to execute the data load by using the execute icon shown in Figure 6. Next you get a list of messages, as shown in Figure 7.

Figure 7 Messages for the execute function in BATCHMAN

The messages screen informs you of any data error or master data error. For example, if you enter statistical key figure Cons instead of CONS (all caps) in the data sheet, you get the following message: Stat. Key figure Cons does not exist in controlling area 3000.If all the messages are in green status, go back one screen to Figure 6. Now activate the Post button and run the transaction again.You get the actual CO document numbers (400000000 and 400000001) assigned to this posting, as seen in Figure 8. External documents entered in the data sheet are displayed only for reference purposes at this point.

Figure 8 Messages from Post run in BATCHMAN

You can display the actual CO document shown in Figure 9 to see the CO posting done by BATCHMAN.

Page 7: Automate CO Data Loads With BATCHMAN

Figure 9 CO document 400000000 for statistical key figure posting by the BATCHMAN transaction

Tip!

As all the CO documents are assigned a unique number, R/3 expects a CO document number when you load the data using BATCHMAN. You can use either internal or external number assignment for CO documents. I have used the internal number assignment in the example. In case you use the internal numbers assignment (by not activating the External Document No. Assignt field in Figure 6), the external number assigned in the data sheet is used for reference purposes only.

Reversal FunctionalityIf you need to reverse a posting to fix the data errors, such as a duplicate posting, you can go back to the main screen (Figure 5) of BATCHMAN and select the Reverse button. Once you get to the screen shown in Figure 10, the next step would be to find the batch you want to reverse. For that, use the search (F4) functionality in the field Data Transfer to be Reversed and locate the batch you want to reverse.

Figure 10 Execute the reversal of data loaded using BATCHMAN

Page 8: Automate CO Data Loads With BATCHMAN

In certain cases the reversal is not possible if the CO transaction does not support reversal. For example, if the statistical key figure is set as Fixed values, reversal is not possible and you will get the message Only line items containing key ratios of type 1 (fixed value) exist. BATCHMAN does not yet support the uploading of statistical key figures to Profit Center Accounting.Additional Tips

Keep a different file name each month for upload of similar data. This way you can keep track of what was loaded using the BATCHMAN functionality. R/3 gives you a warning message if you try to use the same file name for upload again.

Pay attention to the number of characters. For example, if you have four-digit cost centers, you have to provide six leading zeroes as padding to the cost center field in the file. The internal length of the cost center field is 10, and BATCHMAN expects 10 characters, as seen in Figure 3.

Pay attention to date formatting: YYYYMMDD vs. MMDDYY.

The user name should be a valid user name in R/3.

Standardize the header and line-item text on the layout for auditing purposes and retrieval for reversals.

In the Microsoft Excel file (layout you created earlier as a part of setup), once the values are entered, left-align the columns. Then save the file as a .txt (tab delimited) file.

Darshan Shah is a platinum solutions consultant with itelligence Consulting. itelligence is a leading global mid-market SAP provider that offers a full scope of SAP services, including SAP consulting, licensing, managed hosting, customer support, and education. It is one of only 12 consulting firms to earn SAP Global Partner status and one of only six to earn SAP Global Hosting Partner status. With an MBA degree in finance, Darshan has managed and implemented several SAP projects over the last nine years in North America and Asia. He has extensive experience in designing and implementing solutions in conjunction with SAP. He is skilled in helping clients to make strategic decisions for overall ERP implementations. You may reach him via email at [email protected].