Create dynamic data type in structure

Hi Experts,
I am new to ABAP.
In my scenario data type is varying for the field. for that I need to create dynamic data type in structure, this structure I am using for  internal table for OVS search input.
Please suggest the solution for this.
Advance thanks,
Regards,
BBC

Thanks for your quick reply,
I used your logic like this.
data:
ls_component type abap_componentdescr,
lt_component type abap_component_tab.
*... (1) define structure components :
clear ls_component.
ls_component-name = 'NVALUE'.
ls_component-type ?= cl_abap_typedescr=>describe_by_name( <fs_seg_v>-fieldname ).
insert ls_component into table lt_component.
*... (2) create structure
data lr_strucdescr type ref to cl_abap_structdescr.
data lr_data_struc type ref to data.
lr_strucdescr = cl_abap_structdescr=>create( lt_component ).
create data lr_data_struc type handle lr_strucdescr.
field-symbols <fs> TYPE any.
assign lr_data_struc->* to <fs>.
your logic is working fine.
here I am getting feild name (<fs_seg_v>-fieldname) from internal table.
But I need to assign same field name structure to query parameter.
FIELD-SYMBOLS: <ls_query_params> TYPE lty_stru_input.
Please can you suggest how I can refer the field name structure?
Regards,
BBC

Similar Messages

  • Dynamically create data type for structure

    Hello Experts.
    how to create dynamic data type for structres. for example.
    data lv_struc_name type strukname.
    lv_struc_name = get_struct_name( )  ****** this method gives the structure name('ct_struc')
    now I want to create one data type, which is having the type of lv_struc_name content.(ct_struct)
    thanks
    Tim

    Hi,
    here is the link to really good presentation about generic programming ABAP351.
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/b332e090-0201-0010-bdbd-b735e96fe0ae
    It contains examples how to create dynamic structure and tables.
    Cheers

  • How do I Change the plot waveform colour on a Dynamic Data type Graph?

    I have multiple different plots on different graphs, and I want to set the colours of the different waveforms.
    In order to display the waveforms on different graphs, I switched to Dynamic data type and then split the wire
    according to how many channels I have.
    I can set the graph background colour with a property node, and create cursors of different colours no problem
    using the array of references that I have created, so there is nothing wrong with my array of references or the property node.
    As soon as I try and wire a colour box into the Plot>Plot Colour control, I get error 1055 out of the property node.
    I was wondering if it was an error between the keyboard and the chair, but now I am thinking it is someting more sinister.
    The Error box pops up and can't be dismissed remaining the focus until I run TASKKILL on LabVIEW and terminate it.
    Any ideas on how to achieve my goal would be appreciated.
    (LabVIEW 8.6)
    Solved!
    Go to Solution.

    Hi Sheela,
    It's 1 plot per graph, up to 4 graphs displayed on different tabs.
    Here are some screenshots
    Attachments:
    graph_display.JPG ‏135 KB
    set_Plot_colour.JPG ‏79 KB

  • How do you save dynamic data type, from the DAQ assistant, for use in Excel or matlab?

    Currently, I have the following basic VI setup to save Data from my PCI6221 Data Aquisition Card.  The problem I'm having is I keep getting the last iteration of the while loop in the measurement file and that's pretty much it.  When I try to index the data leaving the loop it gives me a 2D array of Data which cannot be input into the "Write to Measurement File" VI.  How would I save this to a useful Data/time step format?  I was wondering of a way to continuously collect the Data and then save it in a large measurement file that I would manipulate in Matlab/excel?  Am I using the wrong type of loop for this application?  I also noticed my Dynamic Data array consists of data, time, timestep and then a vector of the data taken.  Is it possible to just get a vector of the time change per sample alongside the data?    Sorry for the barrage of questions but any help would be greatly appreciated, and thanks in advance!
    -Bryan
    Attachments:
    basic DAQ.vi ‏120 KB

    There is a VI in the Express > Signal Manipulation palette called "From DDT" that lets you convert from the Dynamic Data Type to other data types that are more compatible with operations like File I/O....for instance, you could convert your DDT into a 2D array and use the Write To Spreadsheet File.vi.  Just a thought...
    -D
    Darren Nattinger, CLA
    LabVIEW Artisan and Nugget Penman

  • How can we create a data source on structures

    Hi,
       How can we create a data source on structures.
    Regs,
    abdul

    Abdul,
        Welcome to SDN!
        We can't create Datasource using Strcutres. We need to have base tables.
        For Function Module Extractors, we will create strctures. We will use these strctures as Extract Structures. But, we will get the data from Base tables only not from Strcutures.
    Strctures won't contain data.
    all the best.
    Regards,
    Nagesh Ganisetti.

  • How to create the Data Type for the receiver end?

    Hello Expertise
    I wanted to Create a Data type for  Receiver end in PI.
    Sender end is ECC.
    Receiver end is SRM
    Here's the Data type for Sender end  as
    Can anyone help to create the Data type for Receiver end i.e SRM.
    Thanks in advance.
    Regards
    karan

    Hi Karan,
    Please don't call Sir, we are just trying to help each other.
    Please go through below scenario's and check your configuration.
    ABAP Client Proxy to ABAP Server Proxy Scenario - Process Integration - SCN Wiki
    http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/e0ac1a33-debf-2c10-45bf-fb19f6e15649?overridelayout=true
    http://wiki.scn.sap.com/wiki/display/XI/Step-by-step+FTP+to+ABAP+Proxy
    regards,
    Harish

  • Scripting Crash- "Create from Data Type" on Typedef Enum

    I just encountered a crash that I can duplicate in both LabVIEW 2013 and 2012 (student).
    Attached is a project that contains the code I used on 2012. Run the target VI.
    (I can get the project I had in 2013, if needed, sometime next week)
    Basic steps:
    Create a type def enum
    Place it on a VI
    Use scripting to get ahold of the Control Terminal and get the data type
    "Create from Data Type"

    Haha, I saved your code and ran it while I still had another project open... didn't really think that one through. Thank you, Auto-save.
    So it looks like the crash happens at the Create node. I can get rid of the crash by removing the Type Def link from the enum.
    I'm not at all an expert in scripting and have only used it a few times. Could a workaround be to get a reference to all of the Controls on the FP and copy the Control with the same Label "Enum" (instead of loading the terminal and creaing a new terminal)? Maybe creating a typedef by data type is what's causing the crash, but copying an already existing control will work.

  • How to add dynamic data type as one of the terminals of a Custom VI

    Hello,
    Can anybody tell me if it's possible and how to add a dynamic data type as one of the terminals of a sub-VI? I would like to have a terminal that I can connect signal from DAQmx to my sub-VI.  Thanks.

    Here is one of the coolest things about LV, and one of its major advantages over languages like VB - it has automatic memory management and it compiles whenever you make a change. This allows you to be very free in the way you handle data and change your code. In this case, you should note the small gray dot that appears when you wire the dynamic data into the Array of Waveforms input. This gray dot means that LV coerces the source data type (DDT, in this case) to the target data type (Array of waveforms). If it wouldn't match, you would get a broken wire, the VI couldn't run, and if you hover over the wire or press the broken run button you would get an exact description of the error. Cool, eh?
    This can also be seen in other things. For example, you can change an array's data type or number of dimensions by simply doing it. This will automatically be reflected anywhere the array is called in the program, and if anything won't match, the VI will be broken. If you change the # of dimensions of an array, any array function which that array is wired to will adapt. This allows you to be very safe in the way you write code, because you have LV watching all that annoying stuff for you. You don't have to worry about misspelling a variable here (for the most part).
    One important point about coercion - it does take processor power. This will usually only be evident in large arrays or loops, but it is an important point. Another thing is that coercing numeric types can cause you to lose data - coercing a DBL to a U16, for example, will cause you to lose all the fractional data.
    To learn more about LabVIEW, I suggest you try searching this site and google for LabVIEW tutorials. Here and here are a couple you can start with. You can also contact your local NI office and join one of their courses.
    In addition, I suggest you read the LabVIEW style guide and the LabVIEW user manual (Help>>Search the LabVIEW Bookshelf).
    Try to take over the world!

  • Attaching a Cluster of 2 elements data type to dynamic data type wire.

    Hey Folks,
    How do I attach a cluster of 2 elements data type of wire with a Dynamic data type wire?
    Or a Build XY Graph to a curve fitting2.
    Thanks for the help.
    Ty

    Hi Ty,
    Try to use the "Express-VI Curve Fitting" which is at: Functions-> Signal Analysis -> Curve Fit.
    You have to put this VI before the "Build XY Graph".
    Otherwise, u can convert the siganls types by using the "Convert from Dynamic Data"
    which is at : Functions-> Signal Mamipulation -> Convert from Dynamic Data.
    Hope it Helps....
    The Bush-Man

  • How to create dynamic data tables with ADF 10g

    Hi,
    Can anyone provide sample code for creating dynamic data table in adf where column & row will be added dynamically according to the data coming from the Array List of data.
    I appreciate your help here.

    I think you've posted to the wrong forum. This one is for WebLogic Portal questions.
    Try the ADF/DVT forum:
    http://myforums.oracle.com/jive3/forum.jspa?forumID=1565

  • Creating runtime data types

    Hi
    I need to dynamically create input fields with specified lengths(so that user cannot enter values beyond this length).
    I do it like this.
    IWDAttributeInfo attributeInfo =
        nodeName
        .getNodeInfo()
        .addAttribute(attributeName,
           "ddic:com.sap.dictionary.string");
    IWDInpuField inputField =
       (IWDInpuField)viewHandle
                      .createElement
                      (IWDInputField.class,null);
    int length = getLengthFromSomeMethod();
    inputField.bindValue(attributeInfo);
    inputField.setLength(length);
    The input field added is of specified length, but still the user is able to enter value beyond this length. This i guess is due to the fact that attribute bound to the field is of type "ddic:com.sap.dictionary.string".
    Can i create data types at runtime so that i might add attributes with this data type to a node at run time?
    Is there any other way to solve this problem?

    kaushal,
    Try this:
    attributeInfo.getModifiableSimpleType()
      .setMaxLength(length);
    "Length" of InputField declares (average) width of control in characters.
    VS

  • Creating RosettaNet data types in XI 2.0: 'xml:lang' attribute

    Has anybody successfully created a RosettaNet interface in XI 2.0?
    I am working with the PIP 3A2 messages, but some of the elements have an attribute named 'xml:lang', which is a standardized attribute from the W3C's XML namespace.  The attribute name is declared as 'xml:lang' because it's still a DTD-based PIP.  Normally, in schema, this is handled by declaring an import of the xml.xsd file provided by W3C and defining the namespace alias 'xml' to point to it in the RosettaNet schema.  The xml.xsd provided by W3C boils down to the following declaration, to support 'xml:lang' as an attribute...
    <xs:schema targetNamespace="http://www.w3.org/XML/1998/namespace" xmlns:xs="http://www.w3.org/2001/XMLSchema" xml:lang="en">
    <xs:attribute name="lang" type="xs:language">
    </xs:attribute>
    </xs:schema>
    I'm trying to create this interface in the XI 2.0 data type editor, but...
    1. I can't create attributes as standalone data types in alternate namespaces (to simulate the declarations in W3C's xml.xsd).
    2. I can't link a standalone attribute declaration from another namespace to an attribute in the editor.
    3. The editor prohibits use of a colon in the attribute name (as it should), so I can't declare the attribute name to be 'xml:lang'.
    4. I can't figure out how to control the addition of a new namespace alias to 'xml'.  The editor wants to use default names like 'p0' when I bring in types from other namespaces.
    Can anyone suggest where I should look for an answer?
    --Dan King
    Capgemini

    Hi Dan,
    You can design and Test Rosettanet PIPS Messages in XI-3.0 only.
    Regards
    Prasad
    SAP Netwaver RIG-XI
    SAP Labs LLC, USA

  • Create Characteristics, Data Type - Currency

    Hi All,
    I am trying to create characteristics in transaction CT04 for our PO release strategy.
    Data type is Currency. After giving all required details when I press enter the value range becomes NNNNNNNNNNNNN.NN. So I am unable to select value in release strategy classification tab.
    Does anybody have any idea that why values are getting converted to  NNNNNNNNNNNNN.NN.
    Is any configuration missing?
    Is the problem with template?
    Regards
    sapmm1234

    I have done the following settings:
    Charateristrics PO_Value
    Valid from Today Date
    Decription Total Net Order Value
    Status Released
    Data Type Currency
    Number of Class 15
    Decimal Places 2
    Currency QAR
    Template I ahve not selected anything but defaults it is taking NNNNNNNNNNNNN.NN
    Even If I delete this when I press enter It is taking NNNNNNNNNNNNN.NN
    Multiple values & Interval Values allowed
    Additional Data:
    Table CEKKO
    Field GNETW
    Not Ready for Input Checked
    Unformatted Entry Checked
    Propose Template is not checked
    Values
    <= 2500
    > 2500
    <= 10000
    > 10000
    After giving this value when I press enter all values becomes
    <= NNNNNNNNNNNNN.NN QAR
    > NNNNNNNNNNNNN.NN QAR
    <= NNNNNNNNNNNNN.NN QAR
    >= NNNNNNNNNNNNN.NN QAR
    So I could not select any value in RElease strategy --> Classification tab
    Any Idea why Value are getting converted into this format.
    Regards
    sapmm1234

  • Creating own data types

    Hi,
    How can i create my own data types????
    Thanks,
    Mohit.

    Hi,
    Through TYPES statement you can create your own datatypes. And through Type-pools you can create global data.
    Re: type pools
    Reward if useful!

  • How to convert a dynamic data type to array of strings

        I want to perform a serial communication between two
    computers that I´ll call them A and B. The computer A (transmitter)
    will send a signal (sinusoidal) to computer B (receiver). I´m using a
    VISA Serial Communications Set (VISA Configure Serial Port.vi, VISA
    Write.vi, VISA Read.vi and VISA Close.vi).  VISA Write accepts
    only string data type and VISA Read reads only string data type, but
    the signal that I generated (on transmitter) is dynamic data and I need
    to perform this conversion to run my program sucessfully. How can I
    perform this conversion?!

    Hi Rafael,
    You can configure the From DDT Express VI to convert your dynamic data to any number of different types.  By default, the Express VI will convert to a 1D array of numerics...however, you can configure it (either when you first drop it, or by double-clicking it) to convert to a 2D array of numerics...additionally, you can configure it to convert based on channel data being in columns or rows.  I have attached another screenshot that shows converting the dynamic data into a 2D numeric array. 
    I hope this helps.
    -D
    Darren Nattinger, CLA
    LabVIEW Artisan and Nugget Penman
    Attachments:
    FromDDT2D.jpg ‏164 KB

Maybe you are looking for

  • How do I save a photoshop jpg as a "PictureViewer" jpg document?

    How do I save a photoshop jpg image as a universal "PictureViewer" jpg document?

  • How to find out where a Compound clip is being used

    I've created a dummy Compund Clip just to test FCPX doesnt allow me to delete - it says its being used I cant remember where I used it How do I found out where it's being used? Thanks Omar

  • Is it possible to change ur password from lock screen?

    My iPod stopped charging after while of use, so I stopped using it, but I found a way to charge it, but I forgot the password on it. Is there any way I can reset the password from the lock screen?

  • Changing field length in infotype 105

    Good morning We wish to use both IT105 subtype 0010 and IT105 subtype 9000 to handle external email accounts. Subtype 9000 has field name USRID with length 30 xhars. Subtype 0010 has field name USRID_LONG with length 240 chars. 1. Can I and if so, ho

  • ASM restore

    11g ASM RAC, whole data raw disk group lost as SA mount raw disks to anther file system, rebuild +data raw disk group. rebuild spfile, restore controlfile. do rman restore database RMAN> restore database; Starting restore at 02-OCT-08 using channel O