Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

how to use multiple models in one Function module?

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....

Tags:
Former Member

Helpful Answer

by
Not what you were looking for? View more on this topic or Ask a question