cancel
Showing results for 
Search instead for 
Did you mean: 

URL Redirection using SAP PI

Former Member
0 Kudos

Hello,

We have one scenario ion which we have to do URL redirection using SAP PI.

For Example if say user logs in to www.abc.com and enters some information in a form (like company code, address etc.) . Now this Company code information should go to SAP PI and based upon condition in SAP PI upon company codes the URL should be redirected to a new address.

Like if company code is 1234 and then after pressing submit at the first screen user should be automatically redirected to new screen based on condition written in PI.

and if Comapny code is 1100 then it should get redirected to a different URL.

Is this scenario possible?? and if possible then how can we achieve this.

Please help.

Regards

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

I can see it as straight forward scenario...

create a webservice using PI with input parameter as company code and other stuff, and output parameter will be url based on conditions and input (do it in mapping) .

your first web session (app1) will access this service after input from user, and based on retun from PI service it will redirect to second web session (url 2 or url 3...).

let me know if there is any understanding gap..

former_member190624
Active Contributor
0 Kudos

Hi Gaurav,

Your requirement can be done using dynamic configuration .provide more details like

1.what is your scenario ?

2.synchronous or asynchronous ?

3.exact requirement etc.

sample UDF code for url redirecting ,

public String Redirect( String SUMID ,String QUALF, Container container) throws StreamTransformationException{

DynamicConfiguration conf = (DynamicConfiguration)container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);

DynamicConfigurationKey key = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/HTTP","url");

String myurl ="";

if (SUMID=="CONDITION")

{

myurl="http://<host>:<port>/path/querystring";

conf.put(key,myurl);

}

else

{

myurl="http://<host>:<port>/path/querystring";

conf.put(key,myurl);

}

return myurl;

}

Regards

Hari.

Former Member
0 Kudos

Hello Hari,

Thanks for your response.

My requirement is a synchronous scenario in which if user opens one URL on browser and enter purchase order number then based on some condition written in PI it should be automatically redirected to another URL for further processing.Then user can continue entering details on the new URL and then submit the purchase order.

Regards

Gaurav

former_member190624
Active Contributor
0 Kudos

Gaurav,

Then above UDF will work(if receiver is HTTP ) . What is the scenario actually ? Is it proxy to HTTP or proxy to SOAP?

Regards

Hari.

Former Member
0 Kudos

Hello Hari,

We can any of the adapters but the point here is whether it is possible or not??

Its like PI will work as a web dispatcher and based on some condition written user will be redirected to new URL automatically.

The UDF that you have given in that i am not clear even if we return URL then how to use this for redirection.

There is no ECC involved just WEB session -> PI(Based on condition) -> New web session .

Regards

former_member190624
Active Contributor
0 Kudos

yes, PI will support your scenario. Go ahead develop your scenario . If u have any issues , then come back. We will help you .

Regards

Hari.