Run Time structure identification of a variable.

Hi Experts,
I have a requirement where i need to identify the structure type assigned to the variable at run time. i.e. if i have the variable name at run time i shold be able to find the structure type assigned in that program.
Please help. let me know if you need any further information.
BR,
Raj.

Check this:
TYPE-POOLS: abap.
DATA: gc_mara TYPE mara,
      gc_marc TYPE marc.
PERFORM check_struct USING gc_mara.
PERFORM check_struct USING gc_marc.
*&      Form  check_struct
*       text
*      -->P_STRUCT   text
FORM check_struct USING p_struct TYPE any.
  DATA: lcl_struc TYPE REF TO cl_abap_structdescr,
        lv_struc_name TYPE abap_abstypename.
  lcl_struc ?= cl_abap_structdescr=>describe_by_data( p_struct ).
  CHECK lcl_struc IS BOUND.
  * Get the DDIC structure of the formal param P_STRUC
  lv_struc_name = lcl_struc->absolute_name. "\TYPE=<DDIC Structure>
  WRITE: / lv_struc_name.
ENDFORM.                    "check_struct
BR,
Suhas

Similar Messages

  • Run-Time Type Identification question

    Let's say I have a class Chart and 2 subclasses BarChart. and LineChart. I have a method that takes in the type of chart to create as a parameter and then creates the appropriate chart. Something like:
    public void createChart(int type){
    Chart ch = ChartFactory.getChart(type); //type could be Chart.LINE or Chart.BAR
    //Line x
    Now, at Line x above, if I want to call a method that is specific to BarChart such as getBarWidth(), how would I go about it?
    Thanks.

    You're only going to call getBarWidth() in a context that knows it's dealing with a BarChart. The question is how to get your design in such a form so it doesn't have to say "If this is a BarChart then call getBarWidth()". I don't exactly know how you would do that but I suggest it should be your desire to do that.
    Let me give a crude example that may or may not have anything to do with your project.
    You display a chart and you want to give the user a panel of controls so they can tinker with the way it looks. Controls like the width of the bars in a bar chart, whether or not one of the pieces is offset from the others in a pie chart, the dottedness of the line in a line chart, and so on.
    In this case the factory should have a method that takes a chart type (or maybe a chart) and returns a panel of suitable controls. This panel will have only the controls that are suitable for that chart type, and it will be given a reference to a chart that it assumes is of that type.
    And similarly. Each time you feel like using instanceof, go back and see if you can't get the factory to do the work.

  • How to check the value of the structure component at run time

    Dear Friends,
    Kindly, through some idea for the below query:
    Step 1: I have a structure name as STRUCT with components COMP1, COMP2, COMP3,......, COMP99. At run time in this structure few components may have values and few may not have.
    Step 2: Now I have a variable of type char name as LV_CHAR, at run time this variable may have value as any of the structure components given in the above step such as COMP1 or COMP2 or .....or COMP99.
    Step 3: Let us assume the variable LV_CHAR have value COMP11 and now I need to check whether the strucutre componet STRUCT-COMP11 is initial or not using this variable.
    Could you please give me the steps what needs to be done to handle it.
    Thanks & regards,
    Mallikarjuna M.

    PatanGova wrote:
    Hi,
    Can someone help me out to divide a Hexadecimal number say"ABCD" and display 
    1) each value of hexadecimal number like 'A','B','C','D' in separate indicators and
    2)each value of hexadecimal number like 'A','B','C','D' into their respective decimal number and to show in separate indicators.
    Thanks.
    That has absolutely nothing to do this thread.  Start a new thread.
    There are only two ways to tell somebody thanks: Kudos and Marked Solutions
    Unofficial Forum Rules and Guidelines

  • URGENT: I want to pass a variable to a stored procedure at run time

    Post Author: aruplabs
    CA Forum: Data Connectivity and SQL
    I work for a health care provider and I have reports that pull PHI (Protected Health Information) about patients that needs to be logged according to federal HIPAA regulations. One of the pieces of information that needs to be logged is the username of the person who ran the report. Since these reports will be run from our Crystal Enterprise server I can get this from the CurrentCEUserName variable but I am looking for a way to pass this value to a stored procedure that will not only return the records for the report, but also log the disclosure in our PHI disclosure tracking table. I know you can pass a parameter to a stored procedure but I dont know how, or if it is even possible, to pass a run time variable. This is an urgent problem that I need to find a solution for. Any help would be appreciated.
    Thank you.

    Here it is. Right now, when i press te "Go" it runs for the specific time i've set and when its done the variable "Run" is set true. When i call this VI from another VI it waits for the loop to be finished before it will read the variable.
    Regards
    Viktor
    Attachments:
    Untitled 2.vi ‏26 KB

  • How to get value in data control at run time based on bind variable in VO

    Hi,
    we are capturing the value of customer id at run time. we are associating the captured value of customer id to bind variable of the view object.
    View object is returning the data of that customer id, this view object is part of the application module ,this application module is exposed as data control,so than we have drag and drop this view object response on the
    page from data control.
    How ever after assigning the customer id to bind variable but still it is not showing on jsf page,even we refreshed the data control manually with the help of java code so kindly provide some solution for it.

    Hi,
    If i got your post correctly,you can filter your VO using defining view criteria see following samples
    Oracle ADF - Create View Criteria and Execute using Bean.
    http://adf-lk.blogspot.com/2011/05/oracle-adf-create-view-criteria-and_4727.html

  • Using XML-based object structures to represent data in code/at run-time

    Hello,
    I have quite a "high level" question which has be bothering me for some time, and I haven't found the subject tackled in any books. I believe J2SE/J2EE is not an important divide here.
    Lets say I want to develop a J2SE game application with two programs: a "level designer", and a "level viewer", and I want to store the level files in an XML format.
    My question, and I use this example only to try and illustrate it, is:
    when coding the level designer or viewer, is it reasonable to use an XML-based object hierarchy for representing a level in code/at run-time, i.e. using the standard Java DOM APIs? Or should one (as I would have done before XML came along) develop a set of classes much closer to modelling the real form of a level, and then add a means to convert those objects to/from to XML format?
    This second option of course I would use/would have used if I wasn't thinking about XML, but isn't it sometimes easier to just read in an XML file into a DOM representation and just use the data straight out of that structure, rather than go through the bother of parsing the XML into a set of unrelated objects defined by a different family of classes? What shapes your decision here? And if the second option is best, what is the easiest way of converting to/from the XML?
    Thank you for any advice.
    Greg

    Hi Christian,
    Can I ask: what about if your domain was quite 'close' to an object/DOM representation of XML?
    For instance, what if a game operated by acting out a theatrical script, a spoken conversation, between two characters, perhaps somehow influenced at points by the user, and a particular level was just a different script for the characters.
    One could imagine that the object representation of this would in the end be quite similar to how you'd represent XML, i.e. like a tree of nodes, where each node was a line from the script, and some nodes were a decision point where different nodes could be chosen from.
    Would you still want to avoid using XML-based classes to represent the underlying 'game', or is there a point where you would 'give it' to the similarity and use existing XML structures directly?
    Thank you for any advice
    Greg

  • Loading the final static variables at run time.. Please help

    Hello, fellow developers & Gurus,
    Please help me figure out the best way to do this:
    I need to load all my constants at run time. These are the public static final instance variables. The variables values are in the DataBase. How do I go about loading them.

    Your original question was diffeent, but your further posts show what you really want to do:
    1) all constants in 1 class
    2) available readonly for other classes
    3) updatable during runtime by changing in the database
    Did I understand you right?
    Then smiths' approach solves point 2):
    Instead, make the variables available through a method
    call - that way you avoid the whole final variable
    versus read-only attributes problem.
    //GLOBAL VARIABLES EXPOSED AS PUBLIC PROPERTIES
    public final class GlobalProperties
    public static int getTableSize();
    public static int getRowSize();
    Each "constant" should be a private static variable, and these methods simply return their values.
    The variables are initialized in a static initializer by accessing the db. Ok.
    You habe a table with one row containing as columns all the constants.
    A method readConstants() does a "select constant1, constant2, ... from const_table" and sets all the variables.
    The static initializer calls this method.
    Right?
    Ok, then you simply call readConstants() everytime you want to synchronize with the actual content of const_table.
    Was it this?

  • How to change value of instance variable and local variable at run time?

    As we can change value at run time using debug mode of Eclipse. I want to do this by using a standalone prgram from where I can change the value of a variable at runtime.
    Suppose I have a class, say employee like -
    class employee {
    public String name;
    employee(String name){
    this.name = name;
    public int showSalary(){
    int salary = 10000;
    return salary;
    public String showName()
    return name;
    i want to change the value of instance variable "name" and local variable "salary" from a stand alone program?
    My standalone program will not use employee class; i mean not creating any instance or extending it. This is being used by any other calss in project.
    Can someone tell me how to change these value?
    Please help
    Regards,
    Sujeet Sharma

    This is the tutorial You should interest in. According to 'name' field of the class, it's value can be change with reflection. I'm not sure if local variable ('salary') can be changed - rather not.

  • Load a variable at run time

    I have the following code to load in some images and
    display/move them:
    this.createClassObject(mx.controls.Loader, "myLoader", 1);
    this.createClassObject(mx.controls.Loader, "myLoader2", 2);
    this.createClassObject(mx.controls.Loader, "myLoader3", 3);
    this.createClassObject(mx.controls.Loader, "myLoader4", 4);
    this.createClassObject(mx.controls.Loader, "myLoader5", 5);
    myLoader.scaleContent = false;
    myLoader2.scaleContent = false;
    myLoader3.scaleContent = false;
    myLoader4.scaleContent = false;
    myLoader5.scaleContent = false;
    var images:Array = ["
    http://www.mysite.com/images/image_01.jpg",
    http://www.mysite.com/images/image_01.jpg",
    http://www.mysite.com/images/image_01.jpg",
    http://www.mysite.com/images/image_01.jpg",
    http://www.mysite.com/images/image_01.jpg"
    myLoader.contentPath = images[0];
    myLoader._x = 0;
    myLoader._y = 0;
    myLoader2.contentPath = images[1];
    myLoader2._x = 320;
    myLoader2._y = 0;
    myLoader3.contentPath = images[2];
    myLoader3._x = 640;
    myLoader3._y = 0;
    myLoader4.contentPath = images[3];
    myLoader4._x = 960;
    myLoader4._y = 0;
    myLoader5.contentPath = images[4];
    myLoader5._x = 1280;
    myLoader5._y = 0;
    This works great, but what I'm wondering is, can I load in
    the images array variable at run time from an external file so I
    could edit that file on the server in order to change images,
    without having to re-publish the flash file? Thanks for any help.
    Bob

    Adrian,
    Have a look at: http://www.oracle.com/technology/products/database/htmldb/howtos/howto_create_upload_spreadsheet_form.html
    It's not 100% what you're looking for (as it requires you to cut & paste from the spreadsheet), but it may do what you're after.
    Thanks,
    - Scott -

  • Pass value at run time from one structure to diffrent structure

    hi  experts.
    i  m  workin on  crm domain  and faching problem to pass value  from one stucture to another . problem is that i want the output in xml file so i need all the values interm  of segment.
    initialy  i have  this structure.
    DATA: BEGIN OF struc1 occurs 0,
           ST_ORDERADM_H TYPE CRMT_ORDERADM_H_WRKT,
           ST_PRICING    TYPE CRMT_PRICING_WRKT,
           ST_ORGMAN     TYPE CRMT_ORGMAN_WRKT,
           ST_PARTNER    TYPE CRMT_PARTNER_EXTERNAL_WRKT,
          END OF struc1.
    and using fm CALL FUNCTION 'CRM_ORDER_READ' i got values  on this structure at run time.
    MOVE LT_ORDERADM_H  to STRUC1-ST_ORDERADM_H.
    MOVE LT_ORGMAN      to STRUC1-ST_ORGMAN.
    MOVE LT_PARTNER     to STRUC1-ST_PARTNER.
    MOVE LT_PRICING     to STRUC1-ST_PRICING.
    and after that using
    try.
      CALL TRANSFORMATION id
        SOURCE data_node = STRUC1
        RESULT XML xmlstring.
        CATCH cx_st_error.
    endtry.
    CLEAR:   tab_xstring,
             lv_filename,
             lv_path,
             lv_fullpath,
             lv_user_action.
    REFRESH: tab_xstring.
    lv_bytes = XSTRLEN( xmlstring ).
    IF lv_bytes > 0.
      lv_xstring = xmlstring.
      DO.
        APPEND lv_xstring TO tab_xstring.
        lv_xcnt = XSTRLEN( lv_xstring ).
        IF lv_xcnt > xsize.
          lv_xstring = lv_xstring+xsize.
        ELSE.
          EXIT.
        ENDIF.
      ENDDO.
    now it  convert to xml file .
    problem is  it gives  me value of all field associated with  standared structure.
    but  client requirment is that  he want only selected values of given structure.
    so i think i make  a new structure for given value  but  i m not able  to get values in new structure.
    thanks

    Hi,
    create a structure in se11 with following fields
    ST_ORDERADM_H.
    ST_ORGMAN.
    ST_PARTNER.
    ST_PRICING.
    for example as STRUCT2.
    data : begin of i_struct2 occurs 0.
       include structure struct2.
    data : end of i_struct2.
    MOVE LT_ORDERADM_H to i_STRUCt2-ST_ORDERADM_H.
    MOVE LT_ORGMAN to i_STRUCt2-ST_ORGMAN.
    MOVE LT_PARTNER to i_STRUCt2-ST_PARTNER.
    MOVE LT_PRICING to i_STRUCt2_PRICING.
    then
    try.
    CALL TRANSFORMATION id
    SOURCE data_node = i_STRUCt2
    RESULT XML xmlstring.
    CATCH cx_st_error.
    endtry.

  • Exporting DI batch to BAT and set DI parameter/variable at run time

    Hi All,
    We are looking to call DI batch job externally and pass parameter/variable at run time.
    We tried exporting DI batch to a bat file and setting substitution parameters during export.
    In the exported .bat file, it references a .txt file which shows the name of the substitution paramemters but the value of the parameters are encrypted.
    Does anyone know how to pass parameter/variable to a DI batch job at run time externally?
    Thanks,
    Bobby

    I tried out this method and I have some additional issues.
    1. if we use the BOE scheduler the text parameter file is using a specific naming convention that is not clearly documented. it is like : -GV"$VAR=ENCRYPTEDVALUE;"... trying to modify it with a clear value like -GV"$VAR=MYVALUE;" was simply ignored by the scheduler... seems also that BOE did not sent any scheduling request to the DI Job Launcher...
    What is the proper convention please?
    2.Is there a better way to enter this parameter than editing the TXT file. Most of the BOE InfoView users are not allowed to modify or store documents.. This is not very convenient if they cannot enter simply the parameter values in a let say more confortable way...
    Thank you and cheers

  • Variable to hold the value at run time

    Dear Friends,
         I have a requirement in customer ageing report to select a particluar record from the cube based on the record selected by the query. Is there any option for holding a value of the dimension selected by the query in to a variable at run time. kindly let me know if am not clear.
    Thanks
    Prem

    you want to :
    Exeute a query - this will select a particular record and this is to be used to select another reord from a cube. I assume that the seletion from the cube will also happen through a query - then try using a prequery - have a variable on the query on the cube which is filled using replacement path from the previous query..?

  • LabVIEW 8.0 Run-Time engine & shared variables

    Has LabVIEW 8.0 Run-Time Engine the shared variable's support, I wonder?
    The thing is that .exe with globals/locals runs alright, but beeing replaced with shared variables it refuses to run.
    What's wrong? May be need in library(s) absend?
    Thanks.

    You can use the Shared Variable in the Run-Time Engine (you do not need DSC).
    Can you be more specific about what happens when it refuses to run? Are you seeing an error message?
    If you are using Network-Published shared variables, they need to be deployed before you run the application.  You can either deploy them manually with the project, or your application can programmatically deploy them.  You can find some more information about this in the LabVIEW Help under "Shared Variables and Stand-Alone Applications or Shared Libraries" (follow this link and scroll down to the bottom):
    http://zone.ni.com/reference/en-XX/help/371361A-01/lvconcepts/project_variables/
    -Chris

  • Variable Creation During Run Time

    Is there anyway to create new instances of variables during run time based off of user input from a command line prompt. Thnx~!

    Depends what you mean .. if you mean the user can type "a = 8", and it creates a variable "a" with the value 8, then no.
    But you can implement something very similar using a HashMap. Use put("a", new Integer(8)), or whatever, and then get it out later with get("a").

  • CPM- Run Time variable

    Hi SEM Gurus,
    In CPM -BSC, there are two types of CPM variables, one is Design CPM variable which is used to define the char value at the time of designing the BSC and other is runtime (Presentation)CPM variable which can be used to pass the value of char at the runtime or executing the BSC. The problem is that The second variable ( Run time ) is not working i.e. in value field of measure designing we have to assign this created runtime cpm variable to char but we cant see this cpm variable while assigning this to char.
    Please help me to solve this problem.
    Could anybody will confirm that this is possible in BSC? basically this is possible in management cockpit and it must work in BSC but unfortunatly it is creating a problem for us.
    Thanks/ hari

    Hi Hari,
    I'm now starting a BSC implementation and I'm facing the same issue. I created a CPM run time variable and I can't assign it in the BSC.
    Did you find a way to do this?
    Thanks in advance.
    Best Regards,
    Sofia Silva

Maybe you are looking for

  • Idle in transaction

    Hi to everyone, My situation With Netbeans 6.1 I developed a java application to manage data which uses jre 6u7 and jdbc4 to connect to a postgres 8.2.5 database, in the code I use entity manager and persistence unit. All fine, BUT apparently randoml

  • Trouble connecting in-game on PS3

    Hi, guys! Okay, so, specs: -Airport Express Base Station -Cable internet -PS3 (one generation back) -NAT Type 2 I can connect wirelessly from both computers in the apartment just fine, and I can also connect to the PS3 network without a problem (send

  • Going to next ppt slide with full screen dashboard problem

    Hi, we're using Dashboards 6.0.7.0 and Powerpoint 2010. I want to use interactive dashboards in my presentations, e.g. with a slider or mouse-over. I have embedded the dashboards into my ppt, that is I used the export to ppt functionality and copied

  • Stretch a graphic/layer only horiztonally

    Hi all, So here's my problem. I'm designing a site where a small beige box serves as the background for the content of each page on the site. However, my problem is that, while I'd like the rest of the content and images and shapes on the page not to

  • Setting up ML cards in 454 so that Spanning Tree one side blocks

    Currently we have two ML 1000 cards in our Main ONS 454. We have spanning tree set up on a 3560G switch that brings the IP portion of the SONET to all the other 310's in our network. Now when I do a sh spanning tree on the both ports on the switch th