cancel
Showing results for 
Search instead for 
Did you mean: 

PCW for Purchase order value change

0 Kudos

Hi Gurus,

We have implemented PCW workflow for POs in SRM, which is triggering for both create and change of workflow.

No issues as far as workflow working for creation of PO. Regarding the change of PO, regardless of change the workflow is re-triggering the process from the beginning. Right now, we dont have any logic that handles the change of po requirement.

Could someone please let me know how can I accomplish this.

I think I might need to place some code in the scheme determination method to read the change of PO to find the old value and new value.

If there is no difference in the value then dont do anything, that means the previous workflow which was triggered already at the time of creation.

If there is a change then re-trigger the workflow starting from the 1st process.

I need to know how I can do this technically.

This is really urgent for me to complete the task, really thanks in advance for  your guidance.

Regards

A_vind

Accepted Solutions (0)

Answers (2)

Answers (2)

suresh_murugan
Explorer
0 Kudos

Hi Aravind,

You can check the CDHDR ( Header) and CDPOS( Item )  tables to find if the PO got changed or not.

These tables hold the name of the field which got changed recently  and also hold the old and the new value of the changed field.

By Checking the above tables you will be able to find if the total price has changed or not. Since CDHDR and CDPOS tables are very huge tables, always select on key field of tables, i.e. OBJECTCLAS, OBJECTID and CHANGENR.


Regards,

Suresh

0 Kudos

Hi Suresh,

Thanks for your response. Yes I have already thought of checking CDHDR and CDPOS for total value change. But this comes secondary as my primary issue is, if you read my previous post, with not getting the BADI  /SAPSRM/IF_EX_WF_PROC_RESTART~VALIDATE_RESTART triggered at all times when the PO is changed. It is triggering only when PO is changed with awaiting approval status. It is not triggering when user changes the PO at ordered and saved status. This is one issue.

And the second issue with the RESP_RESOLVER BADI, which is triggering every time user clicks on edit button, nothing changed, and bringing the new approver list. This is fine if the PO is not approved yet, but this is a problem when the PO is approved as this action setting the approval from the first approver.

I hope I made it clear.  Can you please let me know how to handle it. If I know how to handle this situation then I can use change tables to re-trigger the workflow or not.

Thanks

Aravind

vinita_kasliwal
Active Contributor
0 Kudos

And the second issue with the RESP_RESOLVER BADI, which is triggering every time user clicks on edit button, nothing changed, and bringing the new approver list. This is fine if the PO is not approved yet, but this is a problem when the PO is approved as this action setting the approval from the first approver.

>> I did not quite understand on what is meant by once PO is approved ?? If an PO is approved why does a need arise to edit the SC ?

I did not also understand the first issue maybe if you can elaborate ,,

0 Kudos

Hi Vinita,

Not editing of SC. Sorry I am not talking about SC here at all.

Lets say, the PO approval determined 2 process levels with 1 approver for each.

The 1st approver approved the PO.

Then later the PO is opened in display mode, then you can see the PO is approved by the first approver and waiting for the second approver under the approval tab.

Now lets open the PO in edit mode, I have a break point at BADI that determines the first approver, so I see that the BADI is executing, and when I see the approval tab, it is resetting the first approver status as OPEN. I have not changed anything in the PO yet. We do not want this happen unless the PO is really changed the total value.

Thanks


0 Kudos

First issue is..

The BADI  /SAPSRM/IF_EX_WF_PROC_RESTART~VALIDATE_RESTART  is NOT triggering (I have a break point) When the PO is in ORDERED or SAVED status, and edited and saved. I have tried editing amount value in a line item and also header notes.

I might be wrong but I am expecting it to be triggered after I click on save button every time the PO is edited regardless of the change and status of the PO so I can check if the amount is changed by going to change tables.

I noticed the BADI is triggering only when PO is changed with awaiting approval status.

I hope I am clear now.

0 Kudos

Please Gurus,

Can someone please flash some light, I am sure I am missing something here, but not able to figure out. I just need to make PO PCW re-trigger when only the price changes.

It does not stop at the break point at  /SAPSRM/IF_EX_WF_PROC_RESTART~VALIDATE_RESTART every time when I change the PO. But it is re-determining the approver via the BADI resp_resolver. I am in kind of hard stop here how to proceed.

I don't think that I am doing anything new or uncommon, no idea why it is becoming so difficult for me.

Thanks


0 Kudos

Hi Vinita,

I found answers to some of my questions. Let me re-phrase my question.

1. I have a PO which is ordered and the workflow triggered and sent to an approver.

2. Approver approved the PO

3. Then the PO is opened in edit mode changed some data and ordered.

4. Now the workflow triggered again, BUT it did not stop at the break point in BADI /SAPSRM/IF_EX_WF_PROC_RESTART~VALIDATE_RESTART.

What I expecting was it would stop at BADI so I can check what has been changed and decide if I want to trigger the workflow or not.

If this BADI is not right for this scenario, could you please tell me what is the other way I can achieve this.

Thanks

Aravind G

Former Member
0 Kudos

Hi Aravind,

Did you check if it is creating a changed version of the PO.

Use the changed version of PO guid and original version of PO guid to find the differences between the POs. These FMs can be used in the schema determination evaluation id to retrigger the workflow.

BBP_PD_PO_GET_DIFF or BBP_PROCDOC_GET_DIFF.

Regards,

Karthik

0 Kudos

Hi Karthik,

Yes, it is creating changed version every time the PO is changed and saved/ordered.

Just for time being I kind of solved it by adding logic to check if the change version & price difference OR not a change version at each of the evaluation approval level in expression, which is working fine for the after-approved scenario.

I am planning to add logic to check the price-difference in  /SAPSRM/IF_EX_WF_PROC_RESTART~VALIDATE_RESTART badi so I can decide trigger the wf or not.

I will keep you posted how it goes.

Thanks

Aravind G

vinita_kasliwal
Active Contributor
0 Kudos

Hey Aravind ,

Did you check the BADI:   /SAPSRM/BD_WF_PROCESS_RESTART

method /SAPSRM/IF_EX_WF_PROC_RESTART~VALIDATE_RESTART.

SAP Note: 1613263  WF Process restart missing after document change

SAP Note: 1588449  Approval process configuration in case of restart

0 Kudos

Hi Vinita,

Thanks for your reply. I will check the BADI and keep you posted.

Thanks again,

Aravind

0 Kudos

Hi Vinita,

I observed that this BADI is triggering only when the PO is changed with approval awaiting status.

The BADI is not triigering at all when the PO is edited and saved when the PO is in SAVED or ORDERED status. But this action is triggering the RESP_RESOLVER BADI and deteriming the approver immediately when clicked on EDIT button without any change in PO.

This is causing the "approved PO" to open status for the approver from the first lavel.

I need the PO to re-determine the approver and re-trigger the wf only when the total price is changed. Otherwise nothing should happen for any other changes.

Thanks a lot for your help.