Skip to Content
author's profile photo Former Member
Former Member

Integration of WAD into BPS Web Interface


I'm trying to default a number of variable values from BPS into a Bex web application integrated into a BPS web interface using the How to.. guide as a reference for the HTML code, etc. The hierarchy variable for profit centre is giving a problem in that in BPS the controlling area is defaulted into the variable value which in turn is not recognised by the query. Controlling area is hard-coded in the query and in the planning level. It also seems that the field "Planning Level" in the Selector Variable Value component in the WIB is not relevant for hierarchy variables? Is extra coding required in the HTML code to address compounded charateristics using hierarchical variables?



Add a comment
10|10000 characters needed characters exceeded

Related questions

4 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Sep 21, 2005 at 08:47 AM

    Howzit Paul,

    How are you mate?

    Not sure as I have not tried linking to the WAD using a variable of the type hierarchy, but as a work-around you could do the following:

    1. Create a second variable of the type exit (VAR2). Feed the results of your hierarchy variable into it without the controlling VAR2 = result in VAR1 (hierarchy) without controlling area. See the "How to variables" guide and use a simple relation (you might need to change it a bit so it feeds from a hierarhcy selection).

    2. Make VAR2 a hidden variable in the WIB, create a text component (HTML = true) and launch your WAD templates using VAR2.

    I will include below the simple relation code (an e.g. of deriving a pc in one variable from a list of pc's in another variable), and also the HTML component code for launching web applications in a new window.

    Good luck and regards,


    ........variable of the type exit:



    ""Local Interface:




    • Change constant according to your needs


    lc_source_var TYPE upc_y_variable

    VALUE 'ZB12V003',

    lc_source_area TYPE upc_y_area

    VALUE 'ZBA00012',

    lc_buffer_call TYPE boole-boole VALUE ''.


    l_profit_ctr LIKE /bi0/mprofit_ctr-profit_ctr,

    l_type LIKE upc_var-vartype,

    l_subrc LIKE sy-subrc,

    ls_return LIKE bapiret2,

    ls_varsel TYPE upc_ys_charsel,

    lt_chavl LIKE /bi0/mprofit_ctr


    lto_chanm TYPE upc_yto_cha,

    lto_var TYPE upc_yto_charsel,

    lto_varsel TYPE upc_yto_charsel,

    lto_varsel_all TYPE upc_yto_charsel.

    • Read source value



    i_area = lc_source_area

    i_variable = lc_source_var

    i_buffer = lc_buffer_call


    e_subrc = l_subrc

    es_return = ls_return

    e_type = l_type

    eto_varsel_all = lto_varsel_all

    eto_varsel = lto_varsel

    eto_chanm = lto_chanm.

    IF l_subrc <> 0.

    MESSAGE i136(upc_fw) WITH lc_source_var.

    • Values for variable cannot be determined



    LOOP AT lto_varsel

    INTO ls_varsel

    WHERE chanm = '0PROFIT_CTR'.

    APPEND ls_varsel TO eto_charsel.




    <a href="#1" onclick="open_url();return false;"

    class="urBtnStd" id="OpenButton1" ct="Button"


    OnMouseOver="javascript:window.status = 'Open BEx Application';return true;"

    title="Open BEx Application">

    <nobr>Open BEx Application</nobr>



    <script type="text/javascript">

    function open_url () {

    var url = '/sap/bw/BEx?cmd=ldoc&TEMPLATE_ID=';


    // Example using fiscal year 2004 and variant K4: K4/2004 => comp = #K4/#

    var comp = '';

    var appl = '<b>YOURAPPLICATION</b>';

    var varvl = '<%=descr(<b>VAR2</b>/value)%>';

    // Option: Adjust the ' SELECT ' to your local language

    if (varvl != "" && varvl != "-- SELECT --"){

    // expected formatting of variable selector: Text(Key) or Key

    var convert = /\((.*)\)/;


    // If there is value in brackets it is the key

    if ( RegExp.$1 != "") varvl = RegExp.$1;

    // create URL

    url = url + appl + filter + comp + varvl;

    // remove possible white spaces

    url = url.replace(/ /,"");



    var window1 =,"Window1","");



    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Sep 21, 2005 at 02:30 PM

    Hi Rael

    Thanks for your help.

    The user exit specified returns the individual profit centre values under the selected node (without the preceeding CoAr)as opposed to the hierarchy node which is required in the query. Any other ideas...??



    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Sep 21, 2005 at 03:13 PM

    Hi Paul,

    Sorry, I initially thought you were trying to call a report based on the profit centre selected in the BPS hierarchy variable....

    If you are actually trying to base the report on the hierarchy node.....then I am afraid I don't know the answer.

    I suspect that if you can find the technical names for the hierarchy nodes, then you should be able to call the URL with the node in the filter...

    I will ask a friend of mine and get back to you if I can get an answer.



    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Sep 27, 2005 at 11:38 PM


    Just wondering if you have found a solution to pass a hierarchy node...



    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.