PPF Actions: Recursive action call saving the document
Component | Support Package |
---|---|
BBPCRM | SAPKU70204 |
SAP_ABA | SAPKA73105 |
SAP_BASIS | SAPKB73105 |
WEBCUIF | SAPK-73105INWEBCUIF |
Scenario
PPF and Actions
Solution
METHOD if_ex_exec_methodcall_ppf~execute.
INCLUDE crm_log_states_con.
INCLUDE crm_object_kinds_con.DATA: lo_action_execute TYPE REF TO cl_action_execute,
DATA: lv_guid_ref TYPE crmt_object_guid,
lv_kind_ref TYPE crmt_object_kind.
lv_message TYPE char80.********************************************************************
* not relevant iv preview is active
IF NOT ip_preview IS INITIAL.
MESSAGE s007(crm_action) INTO lv_dummy.
cl_log_ppf=>add_message( ip_problemclass = ‘4’
ip_handle = ip_application_log ).
RETURN.
ENDIF.CREATE OBJECT lo_action_execute.
* get parameter from reference object
CALL METHOD lo_action_execute->get_ref_object
EXPORTING
io_appl_object = io_appl_object
ip_action = ip_action
ii_container = ii_container
IMPORTING
ev_guid_ref = lv_guid_ref
ev_kind_ref = lv_kind_ref.* Only on header level
IF lv_kind_ref NE gc_object_kind-orderadm_h.
MESSAGE s010(crm_action) WITH lv_kind_ref INTO lv_dummy.
cl_log_ppf=>add_message( ip_problemclass = ‘1’
ip_handle = ip_application_log ).
RETURN.
ENDIF.IF cl_action_execute=>action_was_executed_save( iv_head_guid = lv_guid_ref
iv_action = ip_action ) EQ abap_true.
* Prevent endless loop
RETURN.
ENDIF.
cl_action_execute=>action_executed_save( EXPORTING iv_head_guid = lv_guid_ref
iv_action = ip_action ).* Save the document
CALL METHOD lo_action_execute->register_for_save
EXPORTING
iv_source_header_guid = lv_guid_ref
ip_application_log = ip_application_log
* iv_recursive_det =
IMPORTING
rp_status = rp_status.ENDMETHOD.
I know this is not a something very complicated or hard to figure it out, but I looked at scn and I didn’t find it, so why not? 😉
Cheers!
Luis
Hi ,
Will the message adding to log work in both cases i.e. if we execute the action from backend and UI.
Yes, in both cases.
Cheers!
Luis
Hi Luis,
Would be grateful if u could help in a query for PPF Actions.
The requirement is to create a follow up activity for quotation in case sold to party BP was in inactive state and then set action status to Red.
The issue is when i run the action via batch report i.e. rsppfprocess then whenever i set action status to red , the activity creation does not occur and the changes don't commit to database.If i change status to green all changes are committed to database.
I am using register_for_save method of cl_action_execute class after activity creation.Could you guide as to what should be done in this particular case as i cant set action status to green (As per requirement green is only done when all checks on quotation are passed and follow up contract is created successfully )?
However during Immediate action run i.e via crmd_order while creation and save of quotation activity is created successfully , even though i am setting action status to red.