cancel
Showing results for 
Search instead for 
Did you mean: 

Display error message based on User Action - 'SAVE', 'CHECK' or 'Order' on SRM UI5 screen

Former Member
0 Kudos

Hi,

Application Detail -> SRM Shopping Cart  - SRMNXP New UI5 Screen: Whenever the user clicks on ‘CHECK’, ‘SAVE’ or ‘ORDER’ on shopping
carts, a set of validations must be performed at the shopping cart item level as per custom logic and criteria which
should display corresponding error messages on the screen

Issue - >   This requirement is implemented using BBP_DOC_CHECK BADI in which user action can be accessed using transaction
context, but these transaction contexts does not get populated when action is triggered from the SRM UI5 screen .

As in the SRMNXP UI5 Screen when user clicks on ‘CHECK’, ‘SAVE’ or ‘ORDER’ onshopping carts , this trigger respective ODATA method of data provider class /SRMNXP/CL_INTL_PDO_SC .

These method does not populate transaction context details for BBP_DOC_CHECK BADI as there were no event based execution at UI5 screen , all the execution is based on ODATA service call due to which our custom validation is not get executed

Can some one please let me know , if there is way to find the user action on the UI screen if yes please let us know the way to capture the action. If no please provide suggestion so that the requirement can be achieved.

Thanks and regards.

Accepted Solutions (0)

Answers (4)

Answers (4)

Former Member
0 Kudos

Hi All.

I have just solved my issue.

I need to know when the Shopping Cart is being ordered. This information is needed in the BBP_DOC_CHECK BAdI, therefore I added a break point there.

Then I performed the action of ordering a Shopping cart - when the debugger showed up, I looked in the call stack to determine a fitting place to Enhance.

I found a method "ORDER" in class "/SRMNXP/CL_BO_DA_PDO_CART", where I set the Action type as mentioned in SAP Note 1334202, in the pre-exit of the method and blanking it again in the post-exit.

I hope others can use this information or be inspired by this.

Best regards

Per

Former Member
0 Kudos

Hi Sri,

You can try this.

DATA : lv_action    TYPE /sapsrm/pdo_action_type.

IF ( lv_action = /sapsrm/if_pdo_action_c=>gc_action_check OR "CHECK

            lv_action = /sapsrm/if_pdo_action_c=>gc_action_save  OR "SAVE

            lv_action = /sapsrm/if_pdo_action_c=>gc_action_order OR "ORDER

            lv_action = space                                    OR

            lv_action = /sapsrm/if_pdo_action_c=>gc_action_submit ). "SUBMIT

Rewards points if the answer is helpful.

Regards,

AkkI

Former Member
0 Kudos

Hi Akkl.

I think the question is going more on the question, where to get the value of lv_action when coming from a UI5 app.

BR

Per

Former Member
0 Kudos

Hi Srisumalatha,

You can use the comination of parameters IV_MODE, IV_PARK, IV_SAVE in the BBP_DOC_CHECK_BADI to implement your logic.

Cheers,

Archish

Former Member
0 Kudos

Hi Archish.

Unfortunately, that doesn't seem to be enough in my case.

I have some code that should only be executed when the ORDER button has been activated.

I have created an OSS for this and SAP tells me that the functionality I ask for is not implemented.

I will now investigate where in the call stack I can get the needed information.

Best regards

Per

Former Member
0 Kudos

Hi Sri.

Did you ever find out how to distinguish what screen/button is activated in UI5, inside the DOC_CHECK BAdI?

Br.

Per