cancel
Showing results for 
Search instead for 
Did you mean: 

Ask about function import is redefines from BOPF

Former Member
0 Kudos

Hi Experts,

I am new with BOPF and  function imports in gateway. I am facing with a problem about the create service for EHSM4.0

I am create a odata service from SAP gateway with tcode segw.

I redefined from BOPF service with Business Object is EHHSS_INCIDENT, default query is SELECT_ALL.

I imported all actions of this BO,

The my issue is : I can not run any function import with URL because I always see Function Import parameter is ENTITY_NAME and NODEID like this:


I don't know what value have to input for this function, what is NODE_ID,

Who can help me on this? How can I run this URI?

Thanks you for your help

Best regards

Chinh Pham

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Thanks Atanu and Askwin,

because that all function imports is used for this service I was redefined from Business Object : EHHSS_INCIDENT . All functions is actions of this BO.  I see that  the parameter names of those function is different from the method that is implement with the class.

Please see my picture:

So I don't know what values I have to input for this

Best regards

Chinh

former_member184867
Active Contributor
0 Kudos

Function import in OData can not take take structures as input parameters. In you screen shot I see the Action Parameter structure is  EHHSSS_INC_SNAPSHOT_PARAMS.

In the Gateway OData service you see the attributes of the same structure as input parameters of your function import, so it is not different.

Now you need to check how do you call your BO and with what values, the same values should be passed to your function import as well, but of course not as a structure.

Message was edited by: Atanu Mallik

AshwinDutt
Active Contributor
0 Kudos

Hello Pham,

Explicitly add the fields as function Import parameters.

U cant send the structure directly as inputs.

Regards,

Ashwin

former_member184867
Active Contributor
0 Kudos

A Function import can be invoked using the following URL pattern

Http://<SERVICEURL>/<FUNCTIONIMPORTNAME>?PARAM1=VALUE1&PARAM2=VALUE2

Note that multiple URL Parameters are passed using '&' operator.

So in your case this becomes,

Http://<SERVICEURL>/CREATE_SNAPSHOT_ROOT?ENTITY_NAME=VALUE1&FORM_NAME=VALUE2&LANGU=VALUE3&NODE_ID=VA...

More information about the format available at URI Conventions | Open Data Protocol under section 3.3.

AshwinDutt
Active Contributor
0 Kudos

Hello Atanu,

Yes it should be & separated.

Thanks for the correction.

But the values need to be passed inside single quotes

We get 'Malformed URI literal syntax',

if we pass like


/sap/opu/odata/sap/ZASH_TEST_USER_SRV/test?ID=AA&IS=XX.

Correct would be ->

/sap/opu/odata/sap/ZASH_TEST_USER_SRV/test?ID='AA'&IS='XX'

Regards,

Ashwin

former_member184867
Active Contributor
0 Kudos

There is no such rule, the quotes/no-quotes are influenced by the  EDM type of the Parameter in use.

AshwinDutt
Active Contributor
0 Kudos

Yes i too agree with that it depends on the edm types used.

AshwinDutt
Active Contributor
0 Kudos

Hello Pham,

Please correct the URL.

The URL convention is shown below ->

/sap/opu/odata/sap/SAMPLE_SRV/Products?Prod_ID='AA'

If there are multiple parameters then it will be comma separated.


In ur case the URL would be ->


/sap/opu/odata/sap/ZCH_INCIDENT_BOPFFULL_SRV_01/CREATE_SNAPSHOT_ROOT?ENTITY_NAME='AA',FORN_NAME='BB',LANGU='EN',NODE_ID='XX'


Please refer to this for technical help which will describe how parameters can be captured which are sent as part of ur URL inside method  /iwbep/if_mgw_appl_srv_runtime~execute_action



Regards,

Ashwin