cancel
Showing results for 
Search instead for 
Did you mean: 

SC approval

Former Member
0 Kudos

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

Accepted Solutions (0)

Answers (1)

Answers (1)

0 Kudos

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.

0 Kudos

I'm sorry, I've forgotten to say you that the workflow WS90000016 is custom; but if you have to build a new workflow wich will call the badi BBP_WFL_APPROV_BADI you can use the standard workflow for PO WS14000145 as model.

Norberto.

Former Member
0 Kudos

Dear Norberto,

Do you have some examples how I can implement a custom Workflow and how to adapt the BADI so that only the possibility to add an approver is active.

Thank you in advance.

Best regards,

Jean-Pierre

0 Kudos

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.

Former Member
0 Kudos

Dear Norberto,

Thank you for your reply.

Only this isn't useful for us.

Because we can't determine an approver via the org structure. We can only add approvers manually to the approval flow.

Any ideas on this one?

Best regards,

Jean-Pierre

0 Kudos

Dear Jean-Pierre,

in our system (SRM 5.5) when we create a SC, into the tab approval preview there is the pushbutton "Add approver". With it is possible to add an approver manually to the standard workflow.

BR,

Norberto.