cancel
Showing results for 
Search instead for 
Did you mean: 

SAP PO, how to pass multiple values in URL

former_member331912
Participant
0 Kudos

Hello everyone,

I am using PO 7.5 and developing a REST to RFC scenario. I am exposing BAPI_GOODSMVT_GETDETAIL, which takes 2 inputs. This means, URL will be of the form http://<server>:<port>/RESTAdapter/...?MaterialDocument=<value>&MaterialDocYear=<value>.

In sender channel, I have made this:

My Message Type is

So in UDF, I need to pass two inputs? Can someone guide me for that. I havent found any solution over the internet yet.

Without UDF and simple mapping, I get this error

"Cannot create target element /ns1:BAPI_GOODSMVT_GETDETAIL/MATDOCUMENTYEAR. Values missing in queue context. Target XSD requires a value for this element, but the target-field mapping does not create one. Check whether the XML instance is valid for the source XSD, and whether the target-field mapping fulfils the requirement of the target XSD: Runtime Exception when executing application mapping program com/sap/xi/tf/_MM_REQ_BAPIGOODSMOVEMENTDETAIL"

Looking forward towards response.

Thanks

Accepted Solutions (1)

Accepted Solutions (1)

former_member331912
Participant
0 Kudos

Hi,

I resolved the issue by creating 2 separate UDF's. Not sure if its an effecient solution.

Thanks.

former_member202642
Participant
0 Kudos

Hi Iqbal,

Could you please share the URL pattern and the code you wrote to get two different values in payload.

former_member202642
Participant
0 Kudos

Hi,

Please suggest how did you fix multiple values issue.

Answers (3)

Answers (3)

former_member331912
Participant
0 Kudos

On another note, if I need to pass 3 parameters like

http://<server>:<port>/RESTAdapter/...?MaterialDocument=<value>&MaterialDocYear=<value>&Var=<Value>, how will I get 3 variables in UDF? And in channel configuration.

former_member190293
Active Contributor
0 Kudos

Hi!

The most straight-forward way, I see (and which is described in mentioned blog), is to create UDF with two input parameters (one - for DC attribute name and the other - for attribute namespace). After that you'll be able to use the same UDF for mapping different DC attributes to target fields.

Regards, Evgeniy.

former_member202642
Participant
0 Kudos

Hi,

Please suggest on how to do the same to pick multiple values from URL .

e.g.

https://host:port/RESTAdapter/<Endpoint>/<Input_Parameter1>/<Input_Parameter2>/<Input_Parameter3>/<I...;

former_member190293
Active Contributor
0 Kudos

Hi!

You might refer to this blog (or even others from the series) for better understanding:

https://blogs.sap.com/2014/12/18/pi-rest-adapter-exposing-a-function-module-as-restful-service/

Regards, Evgeniy.

former_member331912
Participant
0 Kudos

Thank you for commenting.

This is an example for 1 input value, and I am using these as UDF in other cases where I have only 1 input.

My question is how will I cater for 2 values?