cancel
Showing results for 
Search instead for 
Did you mean: 

how to use multiple models in one Function module?

Former Member
0 Kudos

Hi,

In my FM i am using 2 models and if i dont completely exit the Function and use the same fm for another query based on another

model it is giving error saying invalid type.

if iv_type_of_search = 'A'.

  • start the application BT

lv_bol_core = cl_crm_bol_core=>get_instance( ).

lv_bol_core->start_up( 'BP_APPL' ).

  • get an instance of dynamic opporunity query

lr_query = cl_crm_bol_dquery_service=>get_instance( 'BuilHeaderAdvancedSearch' ).

  • Contact Search

elseif iv_type_of_search = 'C'.

  • start the application BT

lv_bol_core = cl_crm_bol_core=>get_instance( ).

lv_bol_core->start_up( 'BP_APPL' ).

  • get an instance of dynamic opporunity query

lr_query = cl_crm_bol_dquery_service=>get_instance( 'BuilContactAdvancedSearch' ).

*Opportunity Search

elseif iv_type_of_search = 'O'.

  • start the application BT

lv_bol_core = cl_crm_bol_core=>get_instance( ).

lv_bol_core->start_up( 'BT' ).

  • get an instance of dynamic opporunity query

lr_query = cl_crm_bol_dquery_service=>get_instance( 'BTQOpp' ).

endif.

Any idea how to over come this or remove the instance of the old query and model every time its run?

it looks like the object of the last run is still there and i cant find any destructor method or way and

if i exit se37 it works fine....

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi George,

Check methods CL_CRM_BOL_DQUERY_SERVICE=>DELETE_QUERY_TEMPLATE and method DQUERY_DELETE of class CL_CRM_BOL_CORE, try calling delete dquery each time you are done using query service.

Regards,

Priyanka

Answers (1)

Answers (1)

BGarcia
Active Contributor
0 Kudos

Hi George,

You can also set up your model (component set) with the components you need.

Check it on:

SPRO->CRM->CRM Cross-Application Components->Generic Interaction Layer/Object Layer->Basic Settings

Kind regards,

Garcia