on 2020 May 21 7:24 PM
I have customised workflow of MM where I have 4 approval level, So my requirement is to hide , invisible and greyed out the fields based on the approval levels.
So i am using BADI :
USMD_ACC_FLD_PROP_CUST_DEP_SET
But what the issue is that after clicking on submit button, it should ideally go to 1st approver means next CR step.
But in this BADI the correct CR Step number is not getting captured due to which I am not able to change the properties of the fields based on step types.
Please help in this. how to approach it. as I need to handle this workflow based on steps. Or is there any way where I can get the capture the workflow steps like on submission which step it is going ?
Thanks
Request clarification before answering.
Hi Mahak,
You should get the step of the workflow by using below code snippet.
DATA:
ls_sibflporb TYPE sibflporb,
lt_cr_wi TYPE swrtwihdr,
ls_cr_wi TYPE swr_wihdr,
ls_cr_step TYPE usmd_s_step_action,
lt_wi_cont TYPE swrtcont,
ls_wi_cont TYPE swr_cont.
CHECK iv_cr_number IS NOT INITIAL . "iv_cr_number = IV_CREQUEST
CLEAR: lt_cr_wi,ls_sibflporb.
CONCATENATE iv_cr_number '000000' INTO ls_sibflporb-instid.
ls_sibflporb-typeid = 'BUS2250'.
ls_sibflporb-catid = 'BO'.
CALL FUNCTION 'SAP_WAPI_WORKITEMS_TO_OBJECT'
EXPORTING
object_por = ls_sibflporb
TABLES
worklist = lt_cr_wi.
IF lines( lt_cr_wi ) EQ 1.
ls_cr_wi = lt_cr_wi[1].
IF sy-subrc IS INITIAL.
CALL FUNCTION 'SAP_WAPI_READ_CONTAINER'
EXPORTING
workitem_id = ls_cr_wi-wi_id
TABLES
simple_container = lt_wi_cont.
IF lines( lt_wi_cont ) GT 0.
READ TABLE lt_wi_cont
INTO ls_wi_cont
WITH KEY element = 'STEP_ACTION'.
IF sy-subrc IS INITIAL.
ls_cr_step = ls_wi_cont-value. " Step and action should be avaiable
ENDIF.
ENDIF.
ENDIF.
ENDIF.
Regards
Pavan Bhamidipati
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
49 | |
6 | |
5 | |
5 | |
5 | |
4 | |
3 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.