Design a User Exit Macro to Meet DP and SNP Complex Requirements

  • by Shreekant W. Shiralkar, Global Head, SAP Analytics CoE, Tata Consultancy
  • Bharat Patel, SAP BW System Manager, Bharat Petroleum, India
  • October 1, 2006
Using these step-by-step instructions, you can customize a user exit macro to perform tasks not offered by standard functionality, such as calculating deviations from actual sales.
Key Concept

Macros are an essential component of Demand Planning and Supply Network Planning planning books, as they facilitate a planner’s job by performing tasks in the planning book. For example, macros can calculate the difference between the values in two cells, copy planning figures from one row to another, or change the cell colors based on threshold values. In addition, macros can trigger pop-up messages for cell values that fall below a threshold value.

Either planners or the system can activate macros. Planners execute macros directly in interactive planning. The system executes them automatically at a predefined point during a background job or when a user performs a task such as opening the planning book or saving the planning entry.

A recent project required the planner to calculate the deviation from actual sales for April and May 2006. The planner needed to figure out the difference between the actual sales and the cumulated annual plan figure for this two-month period. If the difference is a deficit (if actual sales are lower than what was in the plan), the planner must take this into consideration for future planning.

To figure out this difference, you cannot use a standard macro, so we designed a macro with a user exit to create macro functions unavailable with standard macros. (For more information about standard macros, refer to the sidebar, “Two Macro Books in APO.”) In user exit macros, you can code user exit answers to complex requirements (such as an include) as needed.

We will explain the step-by-step process for designing such a macro. Not much documentation is available about this process, so we experimented quite a bit to figure out how to use this feature. The technique essentially has two steps. We added an extra debugging step to check if the user exit code is performing the task correctly.

 

Shreekant W. Shiralkar

Shreekant W. Shiralkar is a senior management professional with experience on leading and managing business functions as well as technology consulting. He has authored best selling books and published many white papers on technology. He also holds patents for innovations. Presently he is global head of the SAP Analytics Centre of Excellence at Tata Consultancy.

See more by this author

Bharat Patel

Bharat Patel is experienced in managing data warehouse technology for the petroleum industry. He is an SAP-certified BW and ABAP consultant, has authored a book on SAP BW, and teaches courses on BW and ABAP at the Sapient Academy and SAP Labs India. Bharat has presented papers about BW at Business Intelligence India Group (BIIG) conferences. He presently manages the SAP BW system at Bharat Petroleum, India.

See more by this author


Comments

No comments have been submitted on this article. 


Please log in to post a comment.

To learn more about subscription access to premium content, click here.