cancel
Showing results for 
Search instead for 
Did you mean: 

SRM workflow doubts....

Former Member
0 Kudos

Hi,

This is john and i am new to this SDN world. first of all i would like to thank every body to share your knowleadge with others.

<b>i have assigned to start work of new SRM-EBP 5.0. i came to know there is new n-step shopping cart item level workflow came into picture.</b>

<b>i have gone through couple of documents in help.sap.com as well as i have gone through the simple coding in se18 t.code.</b>

<b>my question is only one level approval is possible using that BADi or more than one level?

how BAdi does work if more than one level approval come into picture. can you please give me some hints for three level approval.</b>

thank you very much,

Regards,

John.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi John,

using n-step shopping cart item level workflow, you can go upto any number of levels.

If you are having one level or two level approvals then there are other workflows. You don't have to do anything with BAdI. You can activate one step / two step approvals using START CONDITIONS (Transaction : SWB_PROCUREMENT). I implemented n-step BADI, if you need any help please let me know.

Regards.

Pras

Former Member
0 Kudos

John,

You can activate Workflow WS10000129 for one step approval and Workflow WS10000031 for two step approval using start conditions but inboth the cases, a proper organization structure should be maintained.

If you are having bit complex scenario to get approvers i.e. by reading cost center / WBS elements etc then you will have to use BAdI BBP_WFL_APPROV_BADI. A sample coding will give you a starting point. If you need more help please do not hesitate to ask me.

If you find this very helpful, please reward few points.

Warm Regards.

Pras

Former Member
0 Kudos

Hi Pras,

thank you.

<b> i have assigned to work N-step Item Level Approval Workflow. the Workflow id is (WS14500015) and BADI is

BBP_WFL_APPROV_BADI.

i have gone through the simple example given in se18, but only one step approval they given. if it's 2 level or 3 level means do i increase APPROVAL_INDEX? for 2 level or 3 level. please see my below scenario and give me some hints.

as i told you if 2 level approval or 3 level approval come into picture. take the following as scenario.

my SC is having 3 items . each item is different cost centre.

1 item is CC 1000, 2 item is CC 2000 , 3 item is CC 3000.

1 item should be approved by 'MANAGER 1'.

2 item should be approved by 'MANAGER 2'.

3 item should be approved by 'MANAGER 3'.

finally those three items should come as single workitem and approved by 'MANAGER 4'.

once 'MANAGER 4' approved all items or any two then only follow on document should create in back end system.

friends why don't you give me some hints.</b>

thank you.

Regards,

john.

Former Member
0 Kudos

Hi John,

Yes this n-step approval of shopping cart at item level is bit complex compared to the header one.

But don't worry.

Basically, the whole workflow is driven by the approval objects, which you need to define within your BAdI. The three tables you need to populate works like this:

Approval_table:

This table contains the list of approvers who will need to approve a given shopping cart. Each approver needs to be linked to an approval object (approval object guid)

Item_approval_table:

This table links the item guid to the approval object guid. It is possible to have more than one approval object for on line or more than on line for a given approval object.

Item_approval_object:

This table should contain a definition of each unique approval object which needs to be approved in a given shopping cart and the relevant guid.

This workflow works very different from any other workflow in SAP. The shopping cart transaction will trigger and update the workflow containers directly when a shopping cart is ordered or changed.

The three main workflow containers Approverlist, ApprovalItemList and ItemAppObjTable more or less correspond to the three tables listed above. These containers are usefull to look at when you want to analyse a given workflow.

There may be a different scenario in your case. Just follow these steps -

  • Implement BAdI - BBP_WFL_APPROV_BADI using SE19.

*Activate Workflow WS14500015 using PFTC -> triggering event -> make it active.

  • Make sure an entry in event linkage table using transaction SWETYPV. You will see BUS2121 / WS14500015 as active entry.(checkbox).

  • Copy a sample ( item based complex one) into your BAdI implementation in Method GET_REMAING_APPROVERS.

you will see cases related to different amounts. Change amounts according say -

amount < 100

Amount < 1000

Amount < 10000

Keep an eye on variable <b>approval_index</b>, if approval index is 1 then Work item will go to first approver in your cases when you append APPROVAL_TABLE, you will have to give approval index 1 to MANAGER1, MANAGER2 and MANAGER3. For second level, approval index should be 2, in your case when you append APPROVAL_TABLE for MANAGER4, approval index will be 2.

You can just right a sample code for testing purpose

Just Append Approval table with different users and set approval index as 1 , 2 , 3 etc. Make sure to add US with user name for example if your user id JOHN then you need to add USJOHN. Once this is done.

Create a shopping cart and look at approval preview, you will see approvers at different level. Then you can write complex code to get your cost centre managers etc.

Don't hesitate to reply if you are having any problem.

Hope I deserve full points John

😉

Regards

Pras

Former Member
0 Kudos

Hi,

Thank you once again.

for timing as you said i am going hard code my approval agent and other stuff.

thanks again. i hope it won't take more than one hour . so i'll get back to you after hour later.

Regards,

John.

Former Member
0 Kudos

John,

If you look at the following sample code, in this case MANAGER1 will get work item first, once MANAGER1 approves the shopping cart, MANAGER2 and MANAGER4 will get the work item ( second level).

You will have to append APPROVAL_TABLE with proper APPROVAL_INDEX. Thats it.

Just copy following bit in your BAdI and create a shopping cart.

Regards.

Pras

IF ls_header-total_value < 490000000.

      • 2 step approval

ls_approver-approval_index = 1.

ls_approver-approval_agent = 'USMANAGER1'.

ls_approver-name = 'Arthur Manager1'.

ls_approver-approval_description = 'First approval step'.

APPEND ls_approver TO approval_table.

ls_approver-approval_index = 2.

ls_approver-approval_agent = 'USMANAGER2'.

ls_approver-name = 'Arnold Manager2'.

ls_approver-approval_description = 'Second approval step'.

APPEND ls_approver TO approval_table.

ls_approver-approval_index = 2.

ls_approver-approval_agent = 'USMANAGER4'.

ls_approver-name = 'Thomas Manager4'.

ls_approver-approval_description = 'Second approval step'.

APPEND ls_approver TO approval_table.

ENDIF.

Former Member
0 Kudos

hi,

i just came to know from functional saying that based on Product Category workitem should go for approval not Cost Centre.

the new scenario is given below. please give me some hints.

the scenario is SC having 3 items. 3 are different Product Category.

First Category is 'A' should approved by 'MANAGER 1'.

First Category is 'B' should approved by 'MANAGER 2'.

First Category is 'C' should approved by 'MANAGER 3'.

final approvel should be done by 'MANAGER 4'.

before i start my coding i just want your help.

i copy the simple coding from se18

( SAP_LIA_BADI_EX_SIMP ).

that coding which i copied from SAP_LIA_BADI_EX_SIMP is correct or not?

please i want to know before i start my coding. give me your hints please.

thank you,

John.

Former Member
0 Kudos

Hi Pras,

if you find free time , can you please look over the coding which i done. is it possible for you?

if you say yes i'll post my coding for your review.

thank you,

Regards,

John.

Former Member
0 Kudos

Hi John,

Yes, it will not make huge difference.

You need to call function module BBP_PD_SC_GETDETAIL to check product category or cost centre. ( It will be in Item table).

I suppose,you are maintaining product categories in attributes of Org structure. I will dig my code written for one client and will try to provide a suitable example.

Will try to send you after lunch.

Regards.

Pras

Former Member
0 Kudos

Hi pras,

Thank you,

i got a problem after i written the coding similar like simple example given by se18.

the problem is 2 workitems created for 2 same items for approval MANAGER 1.

take the following as an example. my cart is having 4 items

1st is 'Item1' Belongs 'A' Product Category 'MANAGER 1'.

2nd is 'Item2' Belongs 'B' Product Category 'MANAGER 2'.

3rd is 'Item3' Belongs 'A' Product Category 'MANAGER 1'.

4th is 'Item4' Belongs 'B' Product Category 'MANAGER 2'.

in this above scenario how workitem should create like this.

1st item and 3rd item should compine as single workitem and go for 'MANAGER 1'

2nd item and 4th item should compine as single workitem and go for 'MANAGER 2'

am i correct?

but workitems create like this .

if you see MANAGER 1 inbox. there are workitems 1st workitem display 1st item only. 2nd workitem display both ( 1st and 3 rd )

similarly MANAGER 2 inbox.

can you give some hints.

thank you once again.

regards,

John.

Former Member
0 Kudos

Hi Pras,

Thank you very much for your help.

the problem which i am facing is over. i done by myself with your help.

if i'll face any problem in feature . i'll post once again with different subject.

thank you once again for your hints.

Request.

i have given points for your each reply , if you find any think not given please let me know , i'll check once again and give points for you.

because without your help i won't finished this task.

regards,

john.

Former Member
0 Kudos

Well done John.

You are a star.

Currently I am working on sending attachments from SRM to R/3. If you are having any idea, please let me know.

Regards.

Pras

Former Member
0 Kudos

Hi Pras,

Can you please give me brief detail about ur scenario . if i know i'll try to give some hints.

thank you,

regards,

john.

Former Member
0 Kudos

Hi, I'm new to workflow creation.Need your help.

I have to create an workflow for two step approval.

The scenario is like this:

Employee can order the shopping cart without approval when the order is <100$

Order between 100$- 1000$, can be approved by Manager1

Order beyond 1000$ can be approved by Manager2.

Now, for assigning roles & corresponding users for this type of WF, how to proceed?

Is there any documentation available on this? Can anyone guide me in this regard. Your help is sincerely appreciated.

Regards,

Sonali

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi John,

I am having problems activating the item level approval workflow. I have activated event linkage and triggering event but still i am not able to start it ie. "No Workflow found" error is obtained. Please help me out with it.

Also I would like to know if I can get item-level functionality using header level workflow ie. using WS14000133???As i am required to activatre only this workflow.

Kindly help me out ASAP.

Thanks.