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

Integration of WAD into BPS Web Interface

Hi

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?

Regards,

Paul

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 area....so 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,

    Rael

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

    FUNCTION Z_SIM_REL_ZB12V003.

    *"----


    ""Local Interface:

    *" EXPORTING

    *" REFERENCE(ETO_CHARSEL) TYPE UPC_YTO_CHARSEL

    *"----


    • Change constant according to your needs

    CONSTANTS:

    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 ''.

    DATA:

    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

    OCCURS 0 WITH HEADER LINE,

    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

    CALL FUNCTION 'Z_VARIABLE_GET_DETAIL'

    EXPORTING

    i_area = lc_source_area

    i_variable = lc_source_var

    i_buffer = lc_buffer_call

    IMPORTING

    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

    EXIT.

    ENDIF.

    LOOP AT lto_varsel

    INTO ls_varsel

    WHERE chanm = '0PROFIT_CTR'.

    APPEND ls_varsel TO eto_charsel.

    ENDLOOP..

    ENDFUNCTION.

    ........in the WIB

    <span>

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

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

    style="white-space:nowrap;"

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

    title="Open BEx Application">

    <nobr>Open BEx Application</nobr>

    </a>

    </span>

    <script type="text/javascript">

    function open_url () {

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

    var filter = '&FILTER_IOBJNM=<b>PROFIT_CTR</b>&FILTER_COLLAPS=&FILTER_VALUE_EXT=';

    // 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 = /\((.*)\)/;

    convert.exec(varvl);

    // 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(/ /,"");

    }

    // OPEN WINDOW

    var window1 = window.open(url,"Window1","");

    }

    </script>

    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...??

    Cheers,

    Paul

    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.

    Regards,

    Rael

    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

    Hi,

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

    Thanks

    David

    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.