cancel
Showing results for 
Search instead for 
Did you mean: 

Get action triggered within BBP_DOC_CHECK_BADI

RicardoRomero_1
Active Contributor
0 Kudos

Hi all,

I have some checks in an implementation of badi BBP_DOC_CHECK_BADI for Confirmations.

Some of these checks shouldn't be performed if the user is rejecting the confirmation.

So, I need to know wich action is been triggered from the work overview to skip these checks... but I don't know how.

I've tried with this code, but the var lv_action is empty;

  DATA  lv_action TYPE /sapsrm/pdo_action_type.
  DATA: lo_transaction_context TYPE REF TO /sapsrm/cl_transaction_context,
        lo_factory TYPE REF TO /sappssrm/if_instance_factory.


  CALL FUNCTION '/SAPPSSRM/BO_BASE_FACTORY'
    IMPORTING
      eo_factory = lo_factory.
  lo_transaction_context ?= /sapsrm/cl_transaction_context=>/sapsrm/if_transaction_context~get_instance( ).
  lv_action = lo_transaction_context->/sapsrm/if_transaction_context~mv_current_action.


Do you know how can I get the action triggered?

Thanks in advance.

Accepted Solutions (0)

Answers (2)

Answers (2)

RicardoRomero_1
Active Contributor
0 Kudos

Finally, I've created an enchancement point in FM /SAPSRM/FU_WF_RFC_DECISION and I'm doing an EXPORT to Memory to do the IMPORT in the badi CHECK...

Works fine, but I don't like so much this solution... if someone have other better idea...

Thanks

laurent_burtaire
Active Contributor
0 Kudos

Hello Ricardo,

if you use the NetWeaver Business Client, "Approve", "Reject" buttons are linked to EventHandler ONACTIONTOOLBAR_FUNCTION_APP from VIEW_TABLE view (WDC SALV_WD_TABLE).

So, follow the "Workaround for other actions" from OSS note 1334202 - How to get current action ID and transaction group in order to get CURRENT_ACTION inside your BAdI Check.

If you use Portal, i do not know how you could do.

Regards.

Laurent.

Former Member
0 Kudos

Hi Ricardo,

Did you try using iv_mode? In DOC_CHECK_BADI there is parameter IV_MODE available which we have used to see if button is hit check or create as IV_MODE = "T" whenever check button clicked and IV_MODE = "C" whenever new shopping carts being created.

Hope this helps.

Thank you

Ritesh

RicardoRomero_1
Active Contributor
0 Kudos

Hi Ritesh,

Thanks for reply.

Yes, I've chequed the parameter IV_MODE. But is not useful for this purpose; in this case is set to U.

I'm debugging and the seeing the ABAP stack, and I can see some places to add an enhancement point to get the action and do an EXPORT to Memory to do the INPORT in the badi... but I don't like this solution...

Any other idea?


Thanks.

Former Member
0 Kudos

Hi Ricardo,

See if you can use the below

get_transaction_mode of the class /SAPSRM/IF_CLL_TASK_CONTAINER and get the ev_sub_trans_mode , this will have the mode . See if this mode is of any help. It gives you revision, create, approval etc modes.

Regards,

Naveen

RicardoRomero_1
Active Contributor
0 Kudos

Hi Naveen,

Thanks for reply.

I've also tried with this, but I only get 'DISPLAY' or 'EDIT'.

    DATA: lv_trans_mode         TYPE /sapsrm/pdo_inst_mode,
         lr_mo_task_container  TYPE REF TO /sapsrm/if_cll_task_container,
         lo_task_factory       TYPE REF TO /sapsrm/if_cll_taskcon_factory.


      lo_task_factory = /sapsrm/cl_ch_wd_taskcont_fact=>get_instance( ).
     lr_mo_task_container = lo_task_factory->get_task_container( ).
     lr_mo_task_container->get_transaction_mode( IMPORTING ev_pdo_trans_mode = lv_trans_mode ).