Hello Reader. First allow me to say Happy New Year 2017. Ok today i would like to explain step by step to create user exit substitution in SAP PS. This post is taken from my project case, as you know create Project, WBS and Network Activity can do via upload using BAPI.
So far upload processing is successfuly but we found some not right in Network and Activity Object currency, this currency always filled with currency from configuration and do not filled currency from Project or WBS automatically.
Therefore we need to create user exit substitution within Network and Activity to change Object Currency and must follow currency from Project/WBS.
1.Execute tcode SPRO and go to path menu Project System -> Structures -> Operative Structures ->Network -> Maintain Substitutions to open substitution workbench.
2. To create substitution in Network and Activitiy you need to select Network Activity node and click button Substitution, next you need to input name and description for the new substitution.
3.Create Step and left-click to expand Step node, left-click on node Substitution and click + button to add certain substitutable fields. For this article we choose AFVGD-OWAER for substitutble field.
4. Copying RGGBS001 to ZRGGBS001, You can write your ABAP Code for user exit substitution.
5. Write this ABAP Code in subroutine GET_EXIT_TITLES to give the name for new user exit substitution subroutine.
EXITS-NAME = 'U102'.
EXITS-PARAM = C_EXIT_PARAM_CLASS.
EXITS-TITLE = TEXT-102. "Sum is used for the reference.
6. Create new subroutine with the name same with EXITS-NAME before, then you can write ABAP Code like this to get currency from WBS or Project and return that’s currency to return.
FORM u902 USING im_owaers.
DATA : lv_wbs TYPE ps_posid.
DATA : lv_proj TYPE bapipr-project_definition,
lv_det_proj TYPE bapi_project_definition_ex.
CALL FUNCTION 'CONVERSION_EXIT_ABPSP_OUTPUT'
input = caufvd-pspel
output = lv_wbs.
"Get Data Project , WBS level 1 = Project Code
lv_proj = lv_wbs.
CALL FUNCTION 'BAPI_PROJECT_GETINFO'
project_definition = lv_proj
e_project_definition = lv_det_proj.
im_owaers = lv_det_proj-project_currency.
7. If you need to substitute field that’s does not exist in selection, you can add new substitutable field using SM30 and maintain VWTYGB01 view then insert new data.
8. Back to step 1 and if you click button + to add substitutable fields then you can found your new substitutable field that you create before.
9. After you create user exit substitution you need to configure Network Profile.
Select your substitution in field of Network Activities then save.