cancel
Showing results for 
Search instead for 
Did you mean: 

Reading an action's status in an order

Former Member
0 Kudos
300

hi,

I need to read the status of the action ( whether it is executed or sheduled ) in a sales order.

There are various actions defined in the action profile for a sales order.

I need to programatically find out whether an action has been executed or not for a particular sales order.

Is there a function module to read this data. Or what is the approach to get this data.

Thanks,

karthik

View Entire Topic
VishnAndr
Active Contributor
0 Kudos

Hello, Karthik.

For this purpose you can use next relations:

BTAdminH -> BTHeaderAction -> ACIActionContext.

There are numbers of next relations. For instance: ACIActiveActionRel, ACIActiveProcessedActionRel, ACIActiveUnprocessedActionRel, ACIInactiveActionRel etc.

Check this in GENIL_MODEL_BROWSER or in GENIL_BOL_BROWSER for ONEORDER component set.

Hope this will help.

Former Member
0 Kudos

Hi Andrei,

Thanks for the reply. I just discovered the table where this actions data is stored - PPFTTRIGG.

By passing the order number to APPLKEY field we are able to get all the details related to the action.

I think directly reading from the table would be easier and faster option.

Thanks,

Karthik

VishnAndr
Active Contributor
0 Kudos

It's your decision anyway

But reading directly from tables is a bad manner. Particularly in SAP CRM world.

What will you get if you need to check anything before document saving when there is nothing in tables yet?

Former Member
0 Kudos

Thanks Andrei,

Yes, totally agree ! So I am changing the code to get the data from BOL entity.

But not sure how to get BTAdminH in Container_ppf badi.

I do have the guid of the order. And I know that we can start the BOL core by the following code:

DATA: lv_bol_core TYPE REF TO cl_crm_bol_core.
  lv_bol_core = cl_crm_bol_core=>get_instance( ).
  CALL METHOD lv_bol_core->start_up
    EXPORTING
      iv_appl_name            = 'ONEORDER'
      iv_display_mode_support = ' '.

Whats next, how do I reach till BTAdminH

Thanks,

karthik

VishnAndr
Active Contributor
0 Kudos

Something like this:

data: lo_core   type ref to cl_crm_bol_core,
      lo_entity type ref to cl_crm_bol_entity.

lo_core = cl_crm_bol_core=>get_instance( ).
lo_core->start_up( 'ONEORDER' ).

try.

    lo_entity ?= lo_core->get_root_entity( iv_object_name = 'BTOrder'
                                      iv_object_guid = iv_guid ). //you should know GUID of BT
    lo_entity = lo_entity->get_related_entity( 'BTOrderHeader' ).
// lo_entity here is BTAdminH
// so keep going to desired related entity from here


  catch cx_root into lx_root.
endtry.