Skip to Content
avatar image
Former Member

BSP Parameters from URL

Hi

I have a simple BSP Page , which is calling a function module, which requires four parameters.

I want to send those parameters from URL.

My question is how to send those parameters and set them to the input variables for the function module.

I am newbie to BSP and any help is greatly appreciated.

Thanks

Rajesh

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

3 Answers

  • Best Answer
    Sep 10, 2009 at 10:52 PM

    Hi Rajesh,

    in your BSP page define page attributes for each of the four variables and ensure you set the "Auto" checkbox selected.

    Now call URL like this...

    http://sapserver.mydomain.com/sap/bc/bsp/sap/zbspapp/page.htm?var1=value1&var2=value2&var3=value3&var4=value4

    ...replacing "varx" with the variable names you have defined.

    The BSP runtime will populate the page attributes for you as long as the value passed matches the datatype and the "Auto" attribute is set on.

    Cheers

    Graham Robbo

    Add comment
    10|10000 characters needed characters exceeded

    • You can use the debugger to answer your questions.

      Certainly you are not passing the date and time variables in the expected format. If you want to pass them in the formats in your example you will need to define the page attributes as type STRING and then convert them into the type the function module expects.

      Cheers

      Graham Robbo

  • Sep 11, 2009 at 01:28 PM

    Hi,

    assunction your f-module requires input1, ..., input4.

    You to the pages attributes tab and define 4 variables with the same name and set the auto flag. This instructs the system,

    if your url for your bsp-page is like:

    http://.....my_page.htm

    you can call it like

    http://.....my_page.htm?input1=value1&...∈put4=value4

    so in the event oninitialization you have the input1 - ... - input4 automatically filled with value1 - .. - value4.

    Best regards,

    Stefan

    Add comment
    10|10000 characters needed characters exceeded

  • Sep 10, 2009 at 08:08 PM

    Hi Rjain,

    Suppose there are two pages in your BSP application. Page1 calls Page2 and in Page2 you are calling a FM.

    In Page1:

    For calling page2 use the method CL_BSP_RUNTIME->CONSTRUCT_BSP_URL to generate URL of Page2, and concatenate name value pair in this URL so that parameters are passed with URL to next page i.e. Page2 .

    In Page2:

    Define page attributes with the same name as you are passing in URL in Page1 and check the Auto flag. Now these parameters will be filled with values you are passing in URL in Page1.

    You can use these parameters and pass them to the FM in any event handler except OnCreate.

    Search the forum for code sample of construct_bsp_url method.

    Regards,

    Anubhav

    Add comment
    10|10000 characters needed characters exceeded