Currently Being Moderated

A. What is CVC?
CVC, Characteristic Value Combination is a master data of APO Demand Planning. It is group of characteristic values (hence known as combination) which is used in forecasting process. In CVC, we define, with what characteristics (values) forecasting can be done.  To learn more about CVC please check - http://goo.gl/qjkwB

B. Steps to create CVC
CVCs can be created in transaction /n/SAPAPO/MC62 using following different options:-

  • Create Single Characteristic Combination
  • Create Characteristic Combination --> Create Manually
  • Create Characteristic Combination --> Load to Worklist w/ data source Planning object Structure
  • Create Characteristic Combination --> Load to Worklist w/ data source InfoProvider
  • Create Characteristic Combination --> Load to Worklist w/ data source File
  • Create Characteristic Combination --> Load to Worklist w/ data source Business Add-In
  • Create Characteristic Combination --> Generate Immediately w/ data source Planning object Structure
  • Create Characteristic Combination --> Generate Immediately w/ data source InfoProvider
  • Create Characteristic Combination --> Generate Immediately w/ data source File
  • Create Characteristic Combination --> Generate Immediately w/ data source Business Add-In
  • Create Characteristic Combination --> Generate in Background w/ data source Planning object Structure
  • Create Characteristic Combination --> Generate in Background w/ data source InfoProvider
  • Create Characteristic Combination --> Generate in Background w/ data source File
  • Create Characteristic Combination --> Generate in Background w/ data source Business Add-In

 

C. Problem faced by our client?

  • APO Demand Planning will not worry about the real integration with ECC. So irrespective of whether CVC value is valid or invalid, it will anyway create CVC combination. Our client wanted to do real time check with R/3 and that CVC should be created only if valid characteristic values are used to create CVCs.
  • Also, this check should be done irrespective of the method used for creating CVC.

 

D. What options we tried...

  • Whenever it comes to CVC validation, BAdi /SAPAPO/SDP_MASTER Method CHECK_MANUAL_INPUT is the first option which comes to mind. But the issue with this option was that this method was getting called only for Create Single Characteristic Combination method of creating CVC. So we had to rule this out.
  • Next after some analysis, we thought creating an implicit enhancement at start of class method /SAPAPO/CL_SCMB_PSTRU_PLOB=>CREATE_PLOBS may be helpful. After some debugging we were able to confirm that this point gets called in all the methods of creating CVC and thus may be best point to add validation. But later we found that, class didn't allow CVC table parameter to be modified. Hence we were not able to remove invalid CVC combination from CVC internal table to prevent it from creation. Hence even this option was out.

 

E. Final solution!!
Some more (actually lot more…) analysis and debugging took us back to BAdi /SAPAPO/SDP_MASTER but this time method COMBI_ENRICH. Documentation of this BAdi method suggests that this can be use to enhance CVC values just before creation. So this is the place where we can modify CVC values as required. This method also gets called in all the above ways of creating CVCs. Thus we decided to use BAdi /SAPAPO/SDP_MASTER~COMBI_ENRICH. Technical pseudo logic is discussed in section below and gives clear picture on how we used this BAdi method for our validation scenario.

F. Technical Pseudo Logic

  1. Create implementation for BAdi /SAPAPO/SDP_MASTER method COMBI_ENRICH.
  2. To log error message for invalid CVC to application log, we will need application log handle. When control comes to this point use function module /SAPAPO/TS_GENER_CODING by passing planning object and program class 'PSTRU_PLOB_CREATE' to get internal generated program name for respective planning object. Variable ‘(Generated program name)GV_LOGHANDLE’ from ABAP memory will give handle of application log currently being used.
  3. All CVCs are available in table parameter CT_PLOB_VALUES_TAB of this Badi method. Pass this CVC to RFC function module in R/3 for real time validation and get back the error message.
  4. If error message is returned for respective CVC, log this error message in application log using handle reteived from ABAP memory, as explained in point 2 above. Also delete respective CVCs from table parameter CT_PLOB_VALUES_TAB so that same is not created.
  5. From performance point of view, it is advisable to pass all CVCs in single RFC call to R/3, get the validation done there and let error message be send back to APO.
  6. We also store the CVC context when logging error message to application log. This helps in understanding which CVC lead to respective error.  Check below screen shot to get an idea how error message will appear in application log.

          IMG01.jpg

      IMG02.jpg

G. Conclusion
I hope this helps anyone who have similar requirement on CVCs validation with ECC.

Comments

Actions

Filter Blog

By author:
By date:
By tag: