Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Generate SAP Portal URL in ABAP

Former Member
0 Kudos

Hi all

I am faced with a task that involves fetching data from SAP E-Recruiting, and presenting it in an XML document which is indexed by a search engine. The data I extract from E-Recruiting, will be used to display a short listing of available positions in the company on an internal website.

I am able to extract the data, and present it in XML, but the following is a bit more difficult for me.

The challenge is this:

For each position I exctract from E-Recruiting, I need to find a way to generate a complete "portal style" URL. This URL will take users browsing the website, to the E-Recruiting job advertisement in the SAP portal. The SAP Portal will display the complete E-recruiting job advertisement, when the users click a "Read more" link in the short listing.

An example URL is this:

http://<i>server:port</i>/sap(bD1lbiZjPTUwOCZkPW1pbg==)/bc/bsp/sap/hrrcf_req_dovr/application.do?Bsp...

I need to do this in "regular" ABAP / ABAP OO programming, not BSP or something like that. Is there some function module that will do this for me? I collect all my information from the tables HRP51* (i.e. HRP5122).

Any help is greatly appreciated.

Regards,

Thomas K

Message was edited by: Thomas Kjelsrud

Message was edited by: Thomas Kjelsrud

1 ACCEPTED SOLUTION

ferry_lianto
Active Contributor
0 Kudos

Hi Thomas,

Please take a look at this link.

/people/brian.mckellar/blog/2005/06/12/bsp-in-depth-abap-look-and-feel-service

Hope this will help.

Regards,

Ferry Lianto

13 REPLIES 13

ferry_lianto
Active Contributor
0 Kudos

Hi Thomas,

Please take a look at this link.

/people/brian.mckellar/blog/2005/06/12/bsp-in-depth-abap-look-and-feel-service

Hope this will help.

Regards,

Ferry Lianto

0 Kudos

The weblog is not answering my question. Any other ideas? Please...

0 Kudos

the example url you have given is not portal url

An example URL is this:

http://server:port/sap(bD1lbiZjPTUwOCZkPW1pbg==)/bc/bsp/sap/hrrcf_req_dovr/application.do?BspClient=...

its a bsp url.

if you want to generate bsp url you can use the following method from your abap program

DATA: params TYPE tihttpnvp.

FIELD-SYMBOLS: <wa_params> LIKE LINE OF params.

  • fill params table with other url parameters you want

like BspClient=508

APPEND INITIAL LINE TO params ASSIGNING <wa_params>.

<wa_params>-name = 'BspClient'.

<wa_params>-value = '508' .

CALL METHOD

cl_http_ext_webapp=>create_url_for_bsp_application

EXPORTING

bsp_application = 'HRRCF_REQ_DOVR'

bsp_start_page = 'application.do'

bsp_start_parameters = params " other url params

IMPORTING

local_url = url.

if this bsp is running inside portal as an bspiview and you want to reach this iview directly from a url then the url is different , it is basically the path of the iview in the Portal Content Directory

Hope this helps.

Regards

Raja

0 Kudos

Hi Raja,

Thank you for the hints!

You wouldn't happend to know what information in the database tables I need to use as parameters in order to generate an url similar to the one posted? In the table hrp5122 I have something called PINST GUID (Posting Instance GUID). I also have the OBJID (Object ID).. I know I might be pushing my luck now, but I have no clue.

I guess what I need are values for are:

BspClient = '508'

BspLanguage = 'EN'

rcfSpID = ?? What does this mean?

PARAM = ?? What does this mean?

Anyways, thank you!

Regards,

Thomas

0 Kudos

i have not worked with this application so cant be of much help on this application specific.

rfcSPid = sorry dont know

PARAM = the value you see after param is encoded one and i tried to decode it and got the following value , does it mean something to you

encoded

UE9TVF9IUk9CSkVDVD0wMU5DNTAwMDExNTQ%3d

decoded - (of the above string)

POST_HROBJECT=01NC500011547

Regards

Raja

0 Kudos

The decoded version I can produce if concatenate a few table fields.. Do you think the create_url_for_bsp_application will encode it for me if I pass it as a parameter to it?

Ex.:

APPEND INITIAL LINE TO params ASSIGNING <wa_params>.

<wa_params>-name = 'PARAM'.

<wa_params>-value = '01NC500011547'.

CALL METHOD

cl_http_ext_webapp=>create_url_for_bsp_application

EXPORTING

bsp_application = 'HRRCF_REQ_DOVR'

bsp_start_page = 'application.do'

bsp_start_parameters = params " other url params

IMPORTING

local_url = url.'

Regards,

Thomas

0 Kudos

no it wont automatically encode it , but you dont have to encode it for it to work, without encoding in the url it will still work.

but if you still want to encode it you can use the following method.

CL_HTTP_UTILITY=>IF_HTTP_UTILITY~ENCODE_BASE64

Regards

Raja

0 Kudos

Here's what I have done:

APPEND INITIAL LINE TO params ASSIGNING <wa_params>.

<wa_params>-name = 'BspClient'.

<wa_params>-value = '508' .

APPEND INITIAL LINE TO params ASSIGNING <wa_params>.

<wa_params>-name = 'BspLanguage'.

<wa_params>-value = 'EN' .

APPEND INITIAL LINE TO params ASSIGNING <wa_params>.

<wa_params>-name = 'rcfSpID'.

<wa_params>-value = '0003'.

APPEND INITIAL LINE TO params ASSIGNING <wa_params>.

<wa_params>-name = 'PARAM'.

<wa_params>-value = '01NC500011547'.

CALL METHOD

cl_http_ext_webapp=>create_url_for_bsp_application

EXPORTING

bsp_application = 'HRRCF_PINST_PBL'

bsp_start_page = 'application.do'

bsp_start_parameters = params " other url params

IMPORTING

local_url = url.

This produces the following url:

/sap/bc/bsp/sap/hrrcf_pinst_pbl/application.do?BspClient=508&BspLanguage=EN&rcfSpID=0003&PARAM=01NC50001154

When I try to paste it in the browser like this:

http://server:port/sap(bD1lbiZjPTUwOA<b>==)/bc/bsp/sap/hrrcf_pinst_pbl/application.do?BspClient=508&...; I only get a blank page.

Any clues?

Message was edited by: Thomas Kjelsrud

0 Kudos

modify the following in your code.

from

APPEND INITIAL LINE TO params ASSIGNING <wa_params>.

<wa_params>-name = 'PARAM'.

<wa_params>-value = '01NC500011547'.

to

APPEND INITIAL LINE TO params ASSIGNING <wa_params>.

<wa_params>-name = 'PARAM'.

<b><wa_params>-value = 'POST_HROBJECT%3d01NC500011547'.</b>

try this and let me know.

Regards

Raja

0 Kudos

The resulting URL is now this:

http://akosl-msap15.res.no.enterdir.com:8008/sap(bD1lbiZjPTUwOA==)/bc/bsp/sap/hrrcf_pinst_pbl/applic...

But sadly the page is still blank.

Regards,

Thomas

0 Kudos

do this.

in your browser (IE) go to

tools->internet options->advanced

in there uncheck the checkbox against "Show friendly HTTP error messages"

restart the browser and run this url again, now what do you see in the screen. if its still blank may be the backend system is busy trying to compile bsp application hrrcf_pinst_pbl. in this case go to se80 and activate the whole application and try again.

Regards

Raja

0 Kudos

Hi

I think I found the database field that needed to be converted into BASE64 before I added it to the PARAM parameter like you told me to. Sending PINST_GUID='value of pinst_guid field in table' to the encode_BASE64 returns the correct PARAM value.

Thank you so much for taking the time to help me with this.. this is a vital part of my humble program.

Regards,

Thomas Kjelsrud

0 Kudos

Glad i was able to help.

Raja