cancel
Showing results for 
Search instead for 
Did you mean: 

Capturing approved status of Sales Quote in SDK

Former Member
0 Kudos

Hi

I have a requirement where I need to capture the value of fields when the status of Quote is set to Approved. but when the approver clicks on Approve(tick) button no backend logic in sdk is triggered. So where exactly we can put a logic when quote status is getting approved.

Accepted Solutions (0)

Answers (6)

Answers (6)

Bariksanjay09
Explorer
0 Kudos

HI team,

Can we get the approvers name in sdk.

former_member226
Employee
Employee
0 Kudos

I would say yes it is possible but not via direct BO persistence as "Approval" details are not directly stored at the ServiceRequest or its associations. Same has also been explained here: https://answers.sap.com/questions/260934/unable-to-fetch-approvers-from-approval-tab-in-ser.html

However, you can still use data source BTMAPPV01 to get the details within PDI. To do that:

1. Expose this data source as OData.

2. "Build OData Queries" to pull the data from the generated OData.

3. Create an external REST-based integration scenario for the OData Generated.

4. Finally call this OData in ABSL to get the required details.

Note: This solution is not recommended if you plan to do this Synchronously(using AfterModify or BeforeSave ) due to obvious performance reasons. Rather you should do this in the workflow Asynchronously as a background scheduled job.

Former Member
0 Kudos

Hi

But by the time you will reach in Event After Modify status of Quote automatically changes to NotStarted.

Thanks

Saruchi

former_member226
Employee
Employee
0 Kudos

In that case as Horst mentioned you should code in AfterModify.

HorstSchaude
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hello Saurabh,

How did you checked this?
As it is a background execution a breakpoint will not stop here.

Bye,
Horst

former_member226
Employee
Employee
0 Kudos

Hi Horst,

No i havent checked it myself in system but logically it should work ideally as status is binded at ROOT level.

Thanks

Saurabh

HorstSchaude
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hello Saurabh,

Sorry, I've added this comment to the wrong thread 😞
It should go the previous one from Saruchi.

Bye,
Horst

Former Member
0 Kudos

Hi Horst

Yes I checked Event After modify does not got triggered

. @Saurabh: I checked this event but the issue is that I have few custom field details which I need to populate as soon as user click on Approve. This validation on Save will not give me any write access. Also once quote is Approved and I open it till then no event is triggered but as soon as I edit it and event AfterModify gets triggered. but at that point of time Approval Status is changed to Not Started.

HorstSchaude
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hello,

Please keep in mind that a "validation" can only be used to validate data and return a boolean result based upon this.

Only in a "determination" it si allowed to determine new / different values and change data. 🙂

HTH,
Horst

HorstSchaude
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hello Saruchi,

How did you checked this?
As it is a background execution a breakpoint will not stop here.

Bye,
Horst

former_member226
Employee
Employee
0 Kudos

Hi,

You can use event mentioned by Horst or additionally you can use "Action validation: Approve" as attached. This will trigger everytime when a quote is getting approved and you can control if it has to be approved or reject based on some validation but other fields will be in read only mode.

Thanks

Saurabh

HorstSchaude
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hello Saruchi,

If the status is changed to "Approved" the AfterModify method of the Root node should be called.

Did you add this ABSL exit to your Extension BO?

Bye,
Horst