How to pass subclass to variable of super class ?

class /EVUIT/EXCH_PRD_GUI definition
public section.
  methods CONSTRUCTOR
    importing
      value(I_APPLICATION) type ref to /UIT/EXCH_PRD_APP optional
      value(I_REPID) like SY-REPID .
class /UIT/EXCH_PRD_VERT_NN_MODEL definition
  public
  inheriting from /EVUIT/EXCH_PRD_APP
  create public .
DATA: l_vert_nn_model type ref to /uit/exch_prd_vert_nn_model.
DATA: l_gui type ref to /uit/exch_prd_gui_vbeleg.
   CREATE OBJECT l_vert_nn_model
        EXPORTING
          I_ALV_RECORDS = gt_alv_records[].
CREATE OBJECT l_gui
   EXPORTING
     I_APPLICATION = l_vert_nn_model
     I_REPID = sy-repid .{color}
Problem i am facing is for l_gui the parameter i_application is of type super class of l_vert_nn_model.
Any suggestions, how can i pass this subclass object to the parameter which is of type super class?

Hello Trivenn
On SAP basis release 7.00 the following coding works:
*& Report  ZUS_OO_DUMMY
REPORT  zus_oo_dummy.
*       CLASS lcl_local DEFINITION
CLASS lcl_local DEFINITION.
  PUBLIC SECTION.
    METHODS:
      constructor
        IMPORTING
          value(io_instance)  TYPE REF TO zcl_edi_uk_svcs_out. " super class
  PRIVATE SECTION.
    data: mo_instance         type ref to object.
ENDCLASS.                    "lcl_local DEFINITION
*       CLASS lcl_local IMPLEMENTATION
CLASS lcl_local IMPLEMENTATION.
  METHOD constructor.
    mo_instance ?= io_instance.
  ENDMETHOD.                    "constructor
ENDCLASS.                    "lcl_local IMPLEMENTATION
DATA: go_super    TYPE REF TO zcl_edi_uk_svcs_out,
      go_sub      TYPE REF TO zcl_edi_uk_svcs_out_customer,
      go_local    type ref to lcl_local.
START-OF-SELECTION.
  CREATE OBJECT go_super.
  CREATE OBJECT go_sub.
  create object go_local
    exporting
      io_instance = go_sub.
  BREAK-POINT.
END-OF-SELECTION.
Regards
  Uwe

Similar Messages

  • How to pass a JavaScript variable into a java method

    I would like to know how to pass a JavaScript variable into a java method with in a <% %> tag inside a JSP file like so:
    <%@ page contentType="text/html;charset=windows-1252"%>
    <html>
    <head>
    <script LANGUAGE="JavaScript">
    myValue = someDynamicValue;
    <% System.out.println(myValue)%>
    </script>
    </head>
    <body>
    </body>
    </html>
    obviously "System.out.println(myValue)" will not work because myValue is seen as a java variable and not a JavaScript variable.
    I would like to know how to let the jsp file, that I wrote in the above code, see myValue as a JavaScript variable and not a java variable so that I can pass it to a java method.
    NOTE: the java method does not have to be a println() method, it can be any method of my choice.
    NOTE: someDynamicValue is a JavaScript value that can dynamically change

    I don't believe you can. JSPs are really just elaborate templates that an engine such as Tomcat parses and generates an HTML page based on. That page is then displayed to the user. By the time you want to use some function in Javascript, the JSP has already been parsed and generated.
    Basically, Javascript and JSPs can't talk to each other. One's server-side and the other is client-side.

  • How to pass a jsp variable into javascript??

    <p><%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c" %>
    <p><%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %>
    <p><html>
    <p><c:set var="binrmapi" value="http://localhost/paas-api/bingorooms.action;jsessionid=XXXXXX?userId=TEST2&sessionId=1&key=1" />
    <p><c:import var="testbinrm" url="${fn:replace(binrmapi, 'XXXXXX', jsessionid)}"/>
    <p><c:set var="tuples" value="${fn:split(testbinrm, '><')}" />
    <p>Time until next game
    <p><c:forEach var="tuple" items="${tuples}">
    <p><c:if test="${fn:contains(tuple, 'row ')}">
    <p> <p><code>
    <p> <c:set var="values" value="${fn:split(tuple, '=\"')}" />
    <p> <font color="blue">
    <p> <c:out value="${values[17]}" />
    <p><c:set var="remainingtime" value="${values[17]}" />
    <p> </font>
    <p> </code>
    <p></c:if>
    <p></c:forEach>
    <p><form name="counter"><input type="text" size="8" name="d2"></form>
    <p><script>
    <p>var milisec=0
    <p>var seconds=eval("document.myForm.remaining").value;
    <p>function display(){
    <p> if (milisec<=0){
    <p> milisec=9
    <p> seconds-=1
    <p>}
    <p>if (seconds<=-1){
    <p> milisec=0
    <p> seconds+=1
    <p> }
    <br>else
    <p> milisec-=1
    <p> document.counter.d2.value=seconds+"."+milisec
    setTimeout("display()",100)
    <p>}
    <p>display()
    <p></script>
    <p></body>
    <p></html>
    <p>This is my code that i was working on, in the jsp part of the script, i get a api call and save a value of time in the variable remainingtime.. and in the javascript, i try to have a countdown clock counting down the remaining time.. but i guess it doesnt work.. how can i get that working? thanks alot
    Message was edited by:
    hamham3001
    Message was edited by:
    hamham3001
    Message was edited by:
    hamham3001
    Message was edited by:
    hamham3001

    Re: How to pass a jsp variable into javascript??Here is the sameple one, hope it will solves your problem.
    <html>
    <body>
    <form name=f>
    <%!
    String str = "A String"
    %>
    <script>
    var avariable = <%=str%>
    <script>
    </form>
    </body>
    </html>
    Let me know if you face any problem

  • How to pass the USER variable to RPD in 11g?

    I am trying to figure out how to pass the USER variable to the RPD in 11g.
    In 10g, I had define an intializtion block to store the USER variable and pass it to a statement that has to be executed before the query is executed.
    We use the Oracle VPD technology that allows to restrict data access. This is the statement that has to be executed before a query can run.
    select vpd_adwh.setclnvpdcontext_fnc('VALUEOF(NQ_SESSION.cuser)', UPPER(:USER))) from dual
    That is the 10g version and it works fine.
    In 11g, I tried to use
    select vpd_adwh.setclnvpdcontext_fnc('VALUEOF(NQ_SESSION.cuser)', UPPER('VALUEOF(NQ_SESSION.USER)')) from dual
    but this is not working.
    Any help?

    any ideas?

  • How to pass Unix environment variable to a SQL procedure or SQL * Plus

    Can any body suggest me how to ,
    How to pass Unix environment variable to a SQL procedure or SQL * Plus file..
    I am trying to invoke a SQL Procedure from Unix
    by passing the value of a Unix environment variable.
    Is it possible..?
    Thanks in advance.
    Regards,
    Srinivas Jaltaru

    Within your shell script you can use what is known as a "here document" which is basically a way of wrapping a call to Oracle. The following call to Oracle loops and writes rows to files with numerically increasing file names. Two unix shell variables are used, one in a select statement and one in a spool command :
    <pre>
    #!/bin/bash
    export ORACLE_SID=DEV05
    FILENO=1007351
    while [ ${FILENO} -le 1008400 ]
    do
    FILENAME=farm_${FILENO}.txt
    DUMMY=`sqlplus -s user20/user20 <<SQLSTOP
    set lines 73
    set pages 0
    set head off
    set termout off
    set echo off
    set feedback off
    select rpad(searchx, 8)
    from blastx@PRODUCTION
    where searchx = ${FILENO} ### here's a shell variable
    spool /export/home/user20/sql/psiblast/BACKUP2_D/${FILENAME} ### here's a shell variable
    spool off
    SQLSTOP`
    FILENO=`expr ${FILENO} + 1`
    done
    exit 0
    </pre>

  • How to pass values to variables in WAD 7.0 using java script

    Hi.,
    My requirement is based on WAD 7.0.
    The sales value has to displayed in WAD using graph with various chart types.
    I have created variables for plant and material group in a query.
    I have created drop down box for plant with all plants in it, check box for material group and a Submit button in WAD in FORM tag of HTML coding.
    Once all the values are set in drop down box, checkbox and if the user clicks on submit button, the values has to captured by the variables for which I have created and the graph has to be aligned to the new values in variables.
    Kindly help me how to use java script to get the values from FORM and pass it to variables.
    Regards,
    Selva

    Hi Selva,
    You do not need to use Javascript for this. Instead you can achieve this by using API Commands in WAD 7.0.
    Please configure Action on the ButtonGroup webitem to use 'Commands'.
    ->Choose Command 'Set Variables Values / SET_VARIABLES_STATE' under Commands for Web Templates
    ->Set Display Variable Screen setting to OFF
    ->Choose Query Variable for Plant, Select Variable Type as 'Binding Type', Binding Type as 'Data Provider Selection', Data Provider as the one you have assigned to the Dropdown webitem, Characteristic as 0PLANT or as that assigned to the Dropdown webitem
    ->Repeat above steps for Query Variable Material Group
    Now when you make a selection from the Dropdown webitems, the Chart output will change accordingly. Let me know if this helps.
    --Priya

  • How to pass table type variable into function from SQL*PLUS ?

    How to pass a table type variable from sql*plus prompt into a function ?
    Thanx in advance.

    Krishna,
    Do you mean like this?SQL> DECLARE
      2      TYPE t_tbl IS TABLE OF VARCHAR2(20);
      3      l_sample_tbl           t_tbl;
      4
      5      FUNCTION print_contents ( p_tbl IN t_tbl )
      6      RETURN VARCHAR2
      7      IS
      8          l_string            VARCHAR2(1000);
      9      BEGIN
    10          FOR i IN 1..p_tbl.COUNT LOOP
    11              IF (i = 1) THEN
    12                  l_string := p_tbl(i);
    13              ELSE
    14                  l_string := l_string || ', ' || p_tbl(i);
    15              END IF;
    16          END LOOP;
    17          RETURN (l_string);
    18      END print_contents;
    19
    20  BEGIN
    21      l_sample_tbl := t_tbl();
    22      l_sample_tbl.EXTEND;
    23      l_sample_tbl(1) := 'one';
    24      l_sample_tbl.EXTEND;
    25      l_sample_tbl(2) := 'two';
    26      l_sample_tbl.EXTEND;
    27      l_sample_tbl(3) := 'three';
    28      l_sample_tbl.EXTEND;
    29      l_sample_tbl(4) := 'four';
    30      l_sample_tbl.EXTEND;
    31      l_sample_tbl(5) := 'five';
    32      DBMS_OUTPUT.PUT_LINE(print_contents(l_sample_tbl));
    33  END;
    34  /
    one, two, three, four, five
    PL/SQL procedure successfully completed.
    SQL> HTH,
    T.

  • How To pass a period variable

    Hi experts!
    I have a model in visual composer that calls a query which has a filter on the characteristic 0FISPER, when I execute this query in the query Designer, the period of fiscal year is asked in the format "009.2007 - 008.2008".
    The problem is that I don't know how to pass this value in VC, because if I indicate the static text "009.2007 - 008.2008" in the field "Fiscal year period" in the connector between the inputform and the query, when I execute the VC model the following error appears:
    "Nested Exception. Failure to execute native function. Nested Exception.
    INVALID_VARIABLE_VALUES"
    Do you have any idea how to pass the values of the period to the variable of the query??
    Thnks in advance!!!

    Hi Roberto,
    the solution is available in the WIKI:
    <a href="https://www.sdn.sap.com/irj/sdn/wiki?path=/display/vc/howtoselectranges&">https://www.sdn.sap.com/irj/sdn/wiki?path=/display/vc/howtoselectranges&</a>
    Best Regards,
    Marcel Salein

  • How to pass a shell variable to rman scripts

    I want to backup datafile to different directory
    depending on the current time,and I can do this to
    pass a shell variable to rman scripts,and this
    variable will used as part of format ,like this:
    backup incremental level=0
    tag rman_inc0_bck
    filesperset 5
    format '$(DIR)/rman_fulldb_%u_%s_%p_%d'
    (database include current controlfile)
    and $(DIR) is shell variable ,but rman will not
    recognize this ,how to achieve this?

    You could send your script to rman thru a pipe | or <<
    echo "backup incremental level=0
    tag rman_inc0_bck
    filesperset 5
    format '$(DIR)/rman_fulldb_%u_%s_%p_%d'
    (database include current controlfile);" | rman target /You could also create a "temp script" and then use it from rman with cmdfile
    sed "s,XXXDIR,$(DIR)," yourtemplate > /tmp/rmanscript.$$
    rman target / cmdfile /tmp/rmanscript.$$
    rm /tmp/rmanscript.$$

  • How to pass a javascript variable to a query in BEx?

    Hi All,
    We're using BEx SAP BW 3.x
    I'm using portal eventing to pass a variable to a BW template.  While I can pick up this value using javascript, I do not know how to pass it to the query.
    Let me just say, I am new to BEx, so any guidance you could give me would be most welcome.
    Thanks in advance,
    Liz.

    Hi,
    Perhaps this JavaScript can help?
    document.appletName.getQueryObject().setParam(1, param value);
    Call this peice of code on some event, for example the click event of a Button.
    There are many more examples on this forum, search for more.
    Regards,
    Michael

  • How to pass Applet form variables without showing it on top ?

    I am running one applet with some form variables. After submit I want to pass those to .asp file to store into database.
    If I use URL method then all are getting displayed on URL location of browser which I do not want. I want to pass many form variables to another .asp file, so it may not be good also.
    What is the best way of doing it ? Need urgent help about it.

    Well If you create a POST request instead as a GET request the variables will not show up in the URL.
    On tips how to do that you can either check out this thread:
    http://forums.java.sun.com/thread.jsp?forum=31&thread=56388
    or one of these:
    http://search.java.sun.com/Search/java?qt=applet+GET+POST+variables&col=javafrm&rf=0
    Sjur

  • How to pass a presentation variable to new window?

    Hi Experts,
    I need to give a link on Dashboard1 which opens Dashboard2 in new window. Is there any way that I can pass a presentation variable value of Dashboard2 from Dashboard1's link??
    Thanks.

    Yeah, that's been a problem. If you use Link or Image, you can open the link in a new window, but Presentation Variables won't pass. If you use Guided Navigation, you can pass Presentation Variables, but you don't have the option of opening the link in a new window. One or the other unless someone else has a workaround... I haven't discovered one yet. Sorry.

  • How to pass OSB fault variables into input payload

    Hi ,
    I am very new to OSB. as we know that OSB has some predefined variable structure like body,header, fault,inbound,outbound,..My requirement is that I want pass the fault variable elements(errorCode,reason,details..) to input payload elements. I want to see the faulted data in my payload elements which is generated by fault variables.
    Ex:-> If any validation fault occur then my payload fault variables will display errorCode---->BEA-382525, errorMessage-->Variable targeted for validate is not XML or MFL..
    Could you please help me out.I tried but i did not get the result what I expected .. Thanks in advance
    Thanks,
    Viswas

    Hi Vlad,
    I tried what you said in the Otherwise section.
    Step 1:-->This is my xQuery code:
    declare namespace ns1 = "http://www.bea.com/wli/sb/context";
    declare namespace ns0 = "http://xmlns.itc.com/emf/xsd/04/2013/v1.0/loggingService";
    declare namespace xf = "http://tempuri.org/GreetingService/xquery/faultToGreetingService/";
    declare function xf:faultToGreetingService($fault1 as element(ns1:fault))
        as element(ns0:logInfo) {
            <ns0:logInfo>
                <ns0:HeaderInfo>
                    <ns0:faultCode>{ data($fault1/ns1:errorCode) }</ns0:faultCode>
                </ns0:HeaderInfo>
            </ns0:logInfo>
    declare variable $fault1 as element(ns1:fault) external;
    xf:faultToGreetingService($fault1)
    Note: My requirement is I want pass this errorCode into ns0:faultCode which is the input element for publish action (This is publish action would call the logging Service, It is one-way process)
    Step2:-->I used a replace action-->XQuery Resource tab--> I browse the xQuery ..Here In the Variable Name section it is showing fault1 and what value we need to give in the Binding section.
              a)  If i did not provide any value it is giving the error message as "XQuery expression validation failed:XQuery error for the variable "fault1": line1,column1:                                 {err}XP0003:invalid...  "            
              b) If i provide $fault1 or $fault1/*:errorCode or $body in Binding section then the public action would not calling the logging service.
    Can anybody provide me the answer.
    Thanks,
    Viswas

  • Call function, pass value, access variable in movieclip class from main stage

    i am new to flash as.
    I got quite confused on some problems. as the function here
    is quite different from c and asp.net.
    I have a movieClip named MC, and it's enabled with action
    script, with the class name MC_Rectangle
    and a Stage.
    I override the MC_Rectangle class file in a mc_rectangle.as
    external file.
    here is the code:
    package{
    import flash.display.*;
    import flash.events.*;
    public class MC_Rectangle extends MovieClip {
    var sequence:int = new int();
    function setSequence(data:int):void{
    sequence = data;
    function addSequence():void{
    sequence ++;
    I have new a object in the main stage var
    mc_rect:MC_Rectangle = new MC_Rectangle()
    question:
    in main stage:
    1. how can i access the variable "sequence" in "mc_rect"
    2. how can i pass parametre from main stage to mc_rect via
    function setSequence(data:int)?
    3. how can i call the function in addSequence() in mc_rect.
    in asp.net, i usually use mc_rect.sequenct,
    mc_rect.setSequence(data), mc_rect.addSequence() to achieve my
    goals......
    btw, can function in mc_rect return out result to main stage?
    thanks in advance.

    Your as-file must be named MC_Rectangle.as (same upper/lower
    case as in the Class name)
    Ad 1) You have to declare sequence as a public property
    "public var sequence;" or - better - define a getter-function for
    sequence.
    Ad 2) mc_rect.setSequence(8); e. g. (you must write "public"
    in the Class-declaration of setSequence)
    Ad 3) mc_rect.addSequence(); e. g. (you must write "public"
    in the Class-declaration of addSequence)
    ... and yes, your methods can return a value: Replace "void"
    with the proper data type (int, String, ...) and place a "return
    myNumber;" or the like in the method's body.

  • How to pass internal table to method of class

    Hi all,
    I am new to abap objects, i want to pass one internal table to class.
    i am trying in this way.
    class c1 definition.
    method get_material importing t_stpo  type any table
                                   exporting t_mast type any table.
    endmethod.
    endclass.
    class c1 implementation.
    method get_material.
    select f1 f2 f3 from <tab> into table t_mast
            for all entries in t_stpo
            where stlnr = t_stpo-stlnr.
    endmethod.
    endclass.
    ERROR:
    "stlnr" is not available
    if i use this way. its not giing error.
    class c1 definition.
    method get_material exporting t_mast type any table.
    endmethod.
    endclass.
    class c1 implementation.
    method get_material.
    select f1 f2 f3 from <tab> into table t_mast
            for all entries in it_stpo
            where stlnr = it_stpo-stlnr.
    endmethod.
    endclass.
    how to pass internal table with some specific reference may be using like or type <it_xxxx>
    thanks

    Try this.
    TYPES : BEGIN OF ty_stpo,
             stlnr TYPE stpo-stlnr,
             idnrk TYPE stpo-idnrk,
             menge TYPE stpo-menge,
            END OF ty_stpo,
            BEGIN OF ty_mast,
             matnr TYPE mast-matnr,
             werks TYPE mast-werks,
             stlnr TYPE mast-stlnr,
            END OF ty_mast,
            tt_stpo TYPE TABLE OF ty_stpo,
            tt_mast TYPE TABLE OF ty_mast.
    DATA : it_stpo TYPE tt_stpo,
           it_mast TYPE tt_mast.
    *       CLASS c1 DEFINITION
    CLASS c1 DEFINITION.
      PUBLIC SECTION.
        METHODS : get_bom_numbers EXPORTING ex_stpo type tt_stpo,
                  get_parent_material IMPORTING im_stpo TYPE tt_stpo
                                      EXPORTING ex_mast TYPE tt_mast.
        endclass.
    *       CLASS c1 IMPLEMENTATION
    CLASS c1 IMPLEMENTATION.
      METHOD get_bom_numbers.
      ENDMETHOD.                    "get_bom_numbers
      METHOD get_parent_material.
      ENDMETHOD.                    "get_parent_material
    START-OF-SELECTION.
      DATA : obj TYPE REF TO c1.
      CREATE OBJECT obj.
      CALL METHOD obj->get_bom_numbers
        IMPORTING
          t_stpo = it_stpo.
      CALL METHOD obj->get_parent_material
        EXPORTING
          im_stpo = it_stpo
        IMPORTING
          ex_mast = it_mast.
    Regards,
    Rich Heilman

Maybe you are looking for

  • I had to restore my computer that i had Itunes on and reinstalled itunes.

    I had to restore my computer to factory. Then I re-installed Itunes. Now every I pod is prompted to remove everything, erase it and start again. It is the same computer, Itunes logins, ect. Is there some other way than to erase all of our playlists,

  • Microsoft Word - Notebook layout has taken over.

    Every time I open a word document it automatically opens in Notebook Layout view. I have changed the original settings and all the the settings of the files to the way I want before saving, but upon re-opening they immediately go back to Notebook Lay

  • Change language of Apps?

    Can I change the language of my Apps, which is currently in German or do I have to uninstall and reinstall? This may have occurred several years ago, from the original install. However my Itunes is in English.

  • Really Weird Problem AIM account won't let me video

    Here is the weird situation I'm dealing with. Hope this makes sense. I have an iMac, three MacBooks and a MacBook Pro. For...each member of our family. So, we are enjoying video chatting. Everything fine, but....my son can't video chat. He can log in

  • How to access Previous Records' Data from within a Query?

    Hi All, I am making a report in which I need to compare my "Registration Start Date" with "Registration End Date" of previous registration of same customer. This is to check if there are gaps between any customer's registrations. In scenario shown be