on 01-28-2008 10:29 AM
Dear SAP gurus,
I'll need your expertise.
We want to implement SC approval. But it's not possible to determine the approver automatically. We want the creator of the SC to add an approver manually. When the approver isn't added an error message should be displayed.
Is there a way we can accomplish this in an easy way?
We now have a setup that it's mandatory for a requester to add an approver. But when the SC is put on Held or the approver makes changes in the SC the error message is shown again, but the approver still exists in the approval-preview.
We couldn't just set an error message in the BBP_DOC_CHECK badi because then the approver isn't recognized. Because an approver is sent at first when the SC is saved. But this is not possible because of the error message.
So we have implemented a function module which will see that an approver is there and the error message is gone and the SC can be ordered.
But unfortunately this doesn't work for the approver.
Is there an other way we can set this up with the current workflow (WS 10000060)?
Thank you in advance for your reply.
Best regards,
Jean-Pierre
Hi Jean-Pierre,
to customize the approval step of the SC we use the workflow WS90000016 and in addition we the implement the badi BBP_WFL_APPROV_BADI. In this badi there is the possibility of add the approver of the SC.
When we order a SC starts the WS90000016 wich call the badi BBP_WFL_APPROV_BADI to determine the approvers.
BR,
Norberto.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Dear Jean-Pierre,
for example if you have a workflow like WS14000145 you can implement the method GET_REMAING_APPROVERS of the BADI BBP_WFL_APPROV_BADI.
You must append your approver to the table APPROVAL_TABLE, for example:
CALL FUNCTION 'BBP_OM_STRUC_GET_USER_FROM_ORG'
EXPORTING
START_OBJECTS = lv_obj
SEL_DATE = SY-DATUM
RESOLVE_ALL_ORGS = 'X'
AUTHORITY_CHECK = 'X'
IMPORTING
USER_TAB = lt_user
EXCEPTIONS
PATH_NOT_FOUND = 1
ERROR_READING_STRUCTURE = 2
NO_ROOTS = 3
INVALID_ROOTS = 4
INTERNAL_ERROR = 5
OTHERS = 6.
IF SY-SUBRC eq 0.
loop at lt_user into ls_user.
move ls_user-uname to bapiname.
ls_approver-approval_index = ACT_INDEX.
CONCATENATE 'US' ls_user-uname into ls_approver-approval_agent.
ls_approver-name = 'name'.
if ACT_INDEX eq 1.
ls_approver-approval_description = 'Approver First step'.
else.
ls_approver-approval_description = 'Approver Second step'.
endif.
APPEND ls_approver TO approval_table.
endloop.
ENDIF.
This is only an extract of our code, the code depends on how to you want to get the approver.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.