Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 2695

Re: Function Import: Optional Parameters: Example

$
0
0

Hi Ankit,

 

Yes Define_action will come once you create Function Import.

It should be possible to set same property as nullable, as it will be defined under different Function Import.

This is how it should works in case of 2 Function import having same Import parameter.

 

lo_action = model->create_action( 'FunctionImport1' ).

lo_action->set_return_entity_type( 'Entity' ).

lo_action->set_http_method( 'GET' ).

lo_action->set_return_multiplicity( 'M' ).

 

lo_parameter = lo_action->create_input_parameter( iv_parameter_name = 'Field1'    iv_abap_fieldname = 'FIELD1' ).

lo_parameter->/iwbep/if_mgw_odata_property~set_type_edm_string( ).

 

lo_parameter = lo_action->create_input_parameter( iv_parameter_name = 'Field2'    iv_abap_fieldname = 'FIELD2' ).

lo_parameter->set_nullable( abap_true ).


lo_parameter->/iwbep/if_mgw_odata_property~set_type_edm_string( ).

lo_action->bind_input_structure( iv_structure_name  = 'Function import Structure Type' ).

 

lo_action = model->create_action( 'FunctionImport2' ).

lo_action->set_return_entity_type( 'Entity' ).

lo_action->set_http_method( 'GET' ).

lo_action->set_return_multiplicity( 'M' ).

 

lo_parameter = lo_action->create_input_parameter( iv_parameter_name = 'Field2'    iv_abap_fieldname = 'FIELD2' ).

lo_parameter->/iwbep/if_mgw_odata_property~set_type_edm_string( ).

lo_parameter->set_nullable( abap_true ).


lo_parameter = lo_action->create_input_parameter( iv_parameter_name = 'Field3'    iv_abap_fieldname = 'FIELD3' ).

lo_parameter->/iwbep/if_mgw_odata_property~set_type_edm_string( ).

 

lo_parameter->/iwbep/if_mgw_odata_property~set_type_edm_string( ).

lo_action->bind_input_structure( iv_structure_name  = 'Function import Structure Type' ).

 

Regards,

Tarun


Viewing all articles
Browse latest Browse all 2695

Trending Articles