cancel
Showing results for 
Search instead for 
Did you mean: 

question about method: construct_bsp_url

Former Member
0 Kudos

Hello,

A simple question:

When I call a BSP using (for example):

-


CALL METHOD

cl_bsp_runtime=>construct_bsp_url

EXPORTING

IN_APPLICATION = 'ZEPCTESTMCG'

IN_PAGE = 'index.htm'

IN_PARAMETERS = params

IMPORTING

OUT_LOCAL_URL = url.

-


In the BSP that is called, how do I retrieve the values of the exported table "params"??

Thanks,

Tim

Accepted Solutions (1)

Accepted Solutions (1)

Private_Member_9643
Active Contributor
0 Kudos

hi timothy,

u have to define <b>params</b>in a page attribute as a Table Type using either <b>se11</b> or u just double click on params it will automatically open se11 for u ( only with WAS 6.4), so if ur using WAS 6.2 ,its better u define one Table Type using se11 and assign params as the type u created in page attributes <b>associated type</b> field.

Regards,

kamaljeet

Former Member
0 Kudos

Thank you for your quick response,

I do define params in page attributes as:

ATTRIB AUTO TYPMETH ASSOCI TYPE

-


params | (checked) | TYPE | TIHTTPNVP

I use the following htmlb to display it:

<htmlb:form>

<htmlb:tableView id = "tv1"

visibleRowCount = "10"

selectionMode = "lineEdit"

table = "<%=params%>" />

</htmlb:form>

However, I only see the header Name Value and message "contains no data".

I debugged in the calling BSP, and params is definitely populated before using my "CALL METHOD cl_bsp_runtime=>construct_bsp_url". So I am confused here...

Since I used the method "cl_bsp_runtime=>construct_bsp_url", do I have to call a method to "get" the data into my called BSP?? I am spending so much time on such a simple concept

Thanks for anymore additional insight,

Timothy

Private_Member_9643
Active Contributor
0 Kudos

hi timothy,

u try this code,

call method cl_bsp_runtime=>construct_bsp_url

EXPORTING

<!-- define parameters which u want to pass-->

IMPORTING <b>params = params</b>

EXCEPTIONS

<!-- if any -->

i hope it will work.

Regards,

kamaljeet

Former Member
0 Kudos

Hello again,

I have 2 BSPs - lets say BSP1 and BSP2...

In BSP1 I do the following:

-


<%

CALL METHOD

cl_bsp_runtime=>construct_bsp_url

EXPORTING

IN_APPLICATION = 'BSP2'

IN_PAGE = 'index.htm'

IN_PARAMETERS = params

IMPORTING

OUT_LOCAL_URL = url.

%>

<iframe

id ="BWReport_List"

src="<%= url %>"

style="width:950;height:1000">>

</iframe>

-


So, in the <iframe> I see the results of BSP2... which is my simply displaying contents of table "params" that I passed. I have verified that "params" is indeed filled in BSP1. When running BSP1, the <iframe> also does show the table "params", but says it is empty. I have created in BSP2 the page attributes for "params" (as in my last post) and even set the "auto" checkbox which is suppossed to automatically import any variable passed with the same name.

So why is "params" in BSP2 not getting filled??

I read the help on the parameter "IN_PARAMETERS" of the method "construct_bsp_url"... it says:

"Table with name/value pairs that are to be integrated in the URL as query-string parameters".. which means when I call the url for BSP2, my "params" values are in the url string, like with php i guess.. anyway, do you see my problem? i have a previous post with 0 replies that was posted before this one that explains in more detail..

Please help me with this It has become a "stop" for me in making a time limited development.

Thanks,

Timothy

Former Member
0 Kudos

Hello one more time!

Ok, I have discovered that the call I make to BSP2 from BSP1 using the call method "cl_bsp_runtime=>construct_bsp_url" appears as the following:

/sap/bc/bsp/sap/zepctestmcg/index.htm?pays=France

So, it doesnt pass the table "params", but rather the name (=pays) and the value (=France).

Now, how do I capture this "...?pays=France" into a parameter in my BSP2??

Thanks,

Timothy

Private_Member_9643
Active Contributor
0 Kudos

hi timothy,

u can even catch the values in an internal table which is passed by functional module code. u just try this:

i am assumming that u defined <b>params</b>in a page attribute of BSP1 page, and u also created associated type for that using se11 and assign it to params in page attribute.

<b>NOTE:</b> hope u not defined <b>params</b> associated type in <b>type definition</b>tab of BSP page.

now you can access that associated type which you define in params attribute, anywhere in ABAP workbench, now you just have to append values in an internal table in the functional module with the associated type which u defined for params , and send it back to your BSP page using export paramter in functional module paratmeter definition.

and just define params in the list of Importing type in your BSP application, so in this way u can access the values of an internal table into BSP application.

Reagrds,

kamaljeet

Former Member
0 Kudos

Thanks for your response,

I dont follow you really... did you see my previous post? That is the real issue here, that the call to BSP2 (from BSP1) is in the form that I put in my previous post (... ?pays=France...)

Any solution to capture this?

Thanks

Private_Member_9643
Active Contributor
0 Kudos

so u like to catch<b> pays</b> in BSP2, so just decalre <b>pays</b> as a page attribute in your BSP2 and make it as auto. <b>No need to make pays as auto in BSP1.</b>

now you can access the value of <b>pays</b> directly into BSP2.

<b>

NOTE:</b> when u decalre any page attribute as AUTO it just take the value automtically from the query string, here in ur case it is ...? pays='....'.

and if not as auto attribute then if u have assign value top that attribute or take as a input from user side.

so whenever u are calling any page, so in the calling page make that attribute whose auto is not setted as true, and in the called page declare the same attributes with same name and just make it auto ,it will take value automatically from calling page.

reagrds,

kamaljeet<b></b>

Private_Member_9643
Active Contributor
0 Kudos

Hi timothy,

still having any problem, so please post it.

or maek the question as solved.

regards,

kamaljeet

Former Member
0 Kudos

Great, I will just do that...

Did you see my other topic? It is related to this in that at the moment I pass ?pays=France ... BUT, actually, I want to pass a variable that was created using Web Interface Builder. The value I want to pass is as follows:

-


........

........

<htmlb:gridLayoutCell id = "Container1-1-2"

columnIndex = "2"

rowIndex = "1" >

<bsp:call url="upwb.do">

<bsp:parameter name="view_name" value="Selector.view" />

<bsp:parameter name="view_component_id" value="<b>VarvlSel19</b>" />

</bsp:call>

</htmlb:gridLayoutCell>

</htmlb:gridLayout> <%-- Container1 --%>

<%

DATA: params TYPE tihttpnvp,

wa TYPE ihttpnvp,

url TYPE string.

MOVE: 'pays' to wa-name,

'<b>VarvlSel19</b>' to wa-value .

APPEND wa to params .

CALL METHOD

cl_bsp_runtime=>construct_bsp_url

EXPORTING

IN_APPLICATION = 'BSP2'

IN_PAGE = 'index.htm'

IN_PARAMETERS = params

IMPORTING

OUT_LOCAL_URL = url.

%>

<iframe

id ="BWReport_List"

src="<%= url %>"

style="width:950;height:1000">>

</iframe>

.......

.......

-


So in my <iframe> I output the results of BSP2... but how do I assign this "<b>VarvlSel19</b>" parameter (which is a dropdownlistbox value automatically generated from Web Interface Builder) to "wa-value" in

(MOVE: 'pays' to wa-name,

'<b>VarvlSel19</b>' to wa-value .)

???? Any idea? Is it just <b>'&VarvlSel19' to wa-value</b>??

Thanks, Timothy

Private_Member_9643
Active Contributor
0 Kudos

u just add it

<% DATA: listbox TYPE REF TO <b>CL_BSP_PARAM_ELEMENT</b>

<b>listbox</b> ?= 'here some class name will come which u have to checkout, as we uses CL_HTMLB_MANAGER in case of HTMLB'=>GET_DATA( request = request <b>id = id</b> name = 'view_component_id' ). %> in ur code.

and u must add ID as a attribute in your BSP:PARAMETER tag with value as id.

Now u can acces the value of ur parameter view_component_id, just by writing <b>listbox->value</b>, in place of VarvlSel19.

reagrds,

kamaljeet

Private_Member_9643
Active Contributor
0 Kudos

so what else timothy? its already 11 P.M. , so just trying to end up with ur problem as solved one, if still have something in mind so lets discuss, otherwise good-night dear.

regards,

kamaljeet

Former Member
0 Kudos

Hi,

I followed your suggestion and am partly successful... I posted a new topic just now... can you see?

Thanks,

Timothy

Former Member
0 Kudos

Basically my other post directly relates towhat we did together (don't know why I opened another post!

So here it is:

I have a list box for which I want to capture its value in a variable and pass it to another BSP. The original BSP was generated by Web Interface Builder. It uses the controller upwb.do, class CL_UPWB_CONTROLLER. I do the following:

-


DATA: r_country TYPE ref to if_upwb_c_selector,

params TYPE tihttpnvp,

wa TYPE ihttpnvp,

url TYPE string.

r_pays ?= cl_upwb=>get_component( 'VarvlSel18' ).

MOVE: 'pays' to wa-name,

r_pays->get_value( ) to wa-value .

APPEND wa to params.

-


The problem is that r_pays->get_value( ) reads the SEL_KEY field of r_pays->mt_value (a table), not the TEXT field (which I need). I tried copying r_pays->mt_value and reading in the TEXT field, but I don't succeed as there is no header line...

How can I get this TEXT field???

Private_Member_9643
Active Contributor
0 Kudos

hi timothy,

first tell me ur code,

->r_pays ?= cl_upwb=>get_component( <b>'VarvlSel18'</b> ).

->MOVE: 'pays' to wa-name,

<b>r_pays->get_value( )</b> to wa-value .

Is VarvlSel18 a <b>ID</b> of ur component??

and i think u use <b>r_pays->value</b> rather then get_value().

reagrds,

kamaljeet

Former Member
0 Kudos

Hello Kamaljeet,

Yes, actually the htmlb code to display <b>VarvlSel18</b> is:

<bsp:call url="upwb.do">

<bsp:parameter name="view_name" value="Selector.view" />

<bsp:parameter name="view_component_id" value="VarvlSel19" />

</bsp:call>

And <b>VarvlSel18</b> is a listBox, so when I <b>get_component</b>, it gets a table of all values in the list into a table which is <b>r_pays->mt_value</b>. Then <b>get_value</b> chooses the SEL_KEY field of <b>r_pays->mt_value</b>, not the TEXT field, which is what I want.

You see my problem? It is small but strange. And specific to this class maybe. Any ideas?

Thanks!

Timothy

Private_Member_9643
Active Contributor
0 Kudos

hi timothy,

can u please check that <b>r_pays->value</b> is giving what output ?

Regards,

kamaljeet

Former Member
0 Kudos

I found the solution:

-


DATA: ls_value type upwb_ys_sel_option.

DATA: r_pays type ref to if_upwb_c_selector.

DATA: params TYPE tihttpnvp,

wa TYPE ihttpnvp,

url TYPE string,

descr TYPE string.

clear: params, wa, url.

refresh: params.

r_pays ?= cl_upwb=>get_component( 'VarvlSel17' ).

clear: descr, ls_value.

descr = r_pays->get_value( ).

check descr is not initial.

read table r_pays->mt_value into ls_value with key sel_key = descr.

if sy-subrc = 0.

MOVE: 'pays' to wa-name,

<b>ls_value-text</b> to wa-value .

APPEND wa to params.

endif.

-


I found this routine as a method in SAP standard:

-


method if_upwb_component~get_bps_description.

    • resolving description (redefined in subclasses if needed)

    • new type: value

  • importing value(field) type string

  • returning value(descr) type string.

data: ls_value type upwb_ys_sel_option.

case field.

when 'value'.

descr = get_value( ).

check descr is not initial.

read table mt_value into ls_value

with key sel_key = descr.

if sy-subrc = 0. " found

descr = ls_value-text.

endif.

when others.

descr = super->if_upwb_component~get_bps_description(

field ).

endcase.

endmethod. "if_upwb_component~get_bps_description

-


I think I can call instead get_bps_description directly, but my solution in using the actual code for the method in my BSP works fine...

Thanks for your help, you can close the item

Timothy

Answers (0)