Skip to Content
avatar image
Former Member

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

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.

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

4 Answers

  • avatar image
    Former Member
    Jul 10, 2015 at 05:59 AM

    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

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Jul 06, 2015 at 06:22 AM

    Hi Sri.

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

    Br.

    Per

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Jul 09, 2015 at 12:29 AM

    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

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      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

  • avatar image
    Former Member
    Jul 09, 2015 at 10:00 AM

    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

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      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