cancel
Showing results for 
Search instead for 
Did you mean: 

Trap function code of buttons in SRM 7.0

Former Member
0 Kudos

Hi.

We have a requirement to throw an error message from the BBP_DOC_CHECK Badi for Shopping carts - is it possible to throw the error message based on a specific user action, like when the user preses Delete on item level while creating carts then the check should trigger?

Please advice.

Thanks.

Anuradha.

Accepted Solutions (0)

Answers (4)

Answers (4)

Former Member
0 Kudos

Hi Richardo & Soumyaprakash.

The solutions suggested did work and I was able to address the issue.

Thanks a lot for all the help and advice.

Thanks.

Anuradha.

Former Member
0 Kudos

Hi.

I have implemented the code as mentioned in Note # 1334202 in the BBP_DOC_CHECK_BADI BAdi.

DATA: lo_transaction_context TYPE REF TO /sapsrm/if_transaction_context.

data: lv_action type /SAPSRM/PDO_ACTION_TYPE.

lo_transaction_context = /sapsrm/cl_transaction_context=>/sapsrm/if_transaction_context~get_instance( ).

lv_action = lo_transaction_context->get_current_action( ).

However, the value of LV_ACTION is always showing up as blank in this case (no matter what button is pressed in the screen).

Please help.

Thanks.

Anuradha.

Former Member
0 Kudos

are you getting anything inside lo_transaction_context after get_instance method

Former Member
0 Kudos

Yes.

lo_transaction_context returns the class instance.

Thanks.

Anuradha.

Former Member
0 Kudos

if you are getting the class instance then you should be able to get the action code.. can you get into the code for the action code?

Former Member
0 Kudos

Field LO_TRANSACTION_CONTEXT returns value .

But LV_ACTION is always blank.

Thanks.

Anuradha.

ricardo_cavedini
Active Contributor
0 Kudos

Hello,

As stated in note 1334202, only main actions would be triggered.

"Actions that are not contained in the IDR (Identification Region) in the

upper part of the browser window, but in a detail screen, for example,

are not registered automatically. In that case method

"GET_CURRENT_ACTION( )" does not return anything. If this is needed you

can do the modification free enhancement described below to register the

action...."

For example, "check" button would be triggered, but "details" would not.

For these buttons which are not present in the upper part of browser window, suggested workaround specified in this note should be used.

Regards,

Ricardo

Former Member
0 Kudos

Anuradha,

by default it will only return the FPM buttons actions.

so for anything other than that, go into the WD component and for that button press create a post exit on the event and attach a action id to that. then you can capture that in doc_check badi

(its their in the note, follow that)

ricardo_cavedini
Active Contributor
0 Kudos

Hello,

Note 1334202 gives you some information and examples on how to get the action ID for webdynpro components.

Different from ITS, command SY-TCODE for example is not triggered anymore.

Regards,

Ricardo

Former Member
0 Kudos

yes you can. have you searched enough?

note: 1334202