Data: stru_tab type ref to data? what data refers to?

Dear friends,
                     Relatively iam new to WDA. can u please explain me below statement.
data: stru_tab type ref to data.

Actually there are not really any Web Dynpro sepecific data types.  The ones mentioned are simply data dictionary data types that are defined for use with WD, but can be used in any ABAP applications.  You should start your research with just ABAP data types.  Look in the ABAPDOCU transaction or search the keyword documentation for DATA. There is lots of documentation on the ABAP native data types.
Here is a little bit of it:
Predefined ABAP Types
The table below shows the predefined ABAP types. Additional attributes can be found under value ranges and initial values.
Type Length Standard length Description
b 1 Byte   1 byte integer (internal)
c 1 to 65,535 characters 1 character Text field
cursor as i as i Database cursor
d 8 characters   Date field
f 8 bytes   Floating point number
i 4 bytes   4 byte integer
n 1 to 65,535 characters 1 character Numeric text
p 1 to 16 bytes 8 bytes Packed number
string variable   Text string
s 2 bytes   2 byte integer (internal)
t 6 characters   Time field
x 1 to 65,535 bytes 1 byte Byte field
xstring variable   Byte string
These types are predefined in every ABAP program.
All predefined ABAP types in this table are elementary.
Apart from the types b and s, the predefined ABAP types can also be used to define your own data types and data objects and for typing. The types b and s cannot be specified directly in ABAP statements. Self-defined data types and data objects in ABAP programs are of the data type b and s if they are defined with reference to data elements to the ABAP Dictionary which are of the external data types INT1 or INT2.
The predefined data types string and xstring describe data objects of variable length (dynamic data objects). While the length of data objects in all other elementary data types is determined for its whole lifetime, the length of text and byte strings varies according to their content (the maximum size of a string is determined by profile parameter ztta/max_memreq_MB, see Maximum size of dynamic data objects).
The program-globally predefined data type cursor is currently synonymous with the predefined ABAP type i. This is required for the declaration of a cursor variable for database cursor handling.
All predefined ABAP types for which a length interval is specified in second column in the table are generic, which means that the length is not part of the type description. For the type p, the fractional portion is indefinite as well as the length.
The entries in the standard length column specify the length that is used for the corresponding generic data type when declaring data objects, if no explicit length is specified in the relevant statement.
In Unicode systems, the length must either be specified in characters and bytes. In non-Unicode systems, the length of a character is one byte, but in Unicode systems the length of a character depends on which Unicode character representation is used.
Generic ABAP Types
The following table shows the predefined generic ABAP types. A generic data type is an incomplete type specification that includes several complete type specifications. The generic types can be used for the typing of field symbols and formal parameters. The only generic type that can be used for typing of data references is the predefined type data. The predefined generic type for object references is object. When a data object is assigned to generically typed field symbols using the statement ASSIGN, or to a formal parameter in procedure calls, the system checks whether its concrete data type is a of the generic type, or is compatible with it.
Type Description
any Any data type (suitable for any type)
any table Internal table of any table type
c Text field of generic length
clike Character-type (c, d, n, t, string and character-type flat structures); in non- Unicode programs also x, xstring and any flat structures
csequence Text-type (c, string)
data Any data type
hashed table Hashed table
index table Index table
n numeric text of generic length
numeric Numeric (b, i, p, f, s)
object Any object type (root class of the inheritance hierarchy)
p Packed number of generic length and generic number of decimal places
simple Elementary data type including structured types with exclusively character-type flat components
sorted table Sorted table
Standard table Standard table
table Standard table
x Byte field of generic length
xsequence byte-type (x, xstring)
The genric types clike, csequence, numeric,simple, and xsequence are available as of release 6.10.
Notes
The generic type any currently has the same effect in typing as the generic type data. When declaring references, any cannot yest be specified after REF TO. Generic data references (REF TO data) or generic object references (REF TO object) are possible. The generic type object can currently only be specified after REF TO.
Except for the built-in generic types illustrated in the table above, there are at the moment no self-defined generic types in ABAP with only one exception: A table type defined with TYPES - TABLE OF or defined in the ABAP Dictionary without completely specifying the table key, is also generic.
Predefined Types in the ABAP Dictionary
The following table lists the predefined types in the ABAP Dictionary. These types cannot be used directly in ABAP programs, and are therefore known as external data types. Instead, they are used in the ABAP Dictionary for the definition of data types to which ABAP programs can refer. The predefined data types of the ABAP Dictionary must also be taken into account in Open SQL statements and when working with screens: Open SQL statements work with database tables defined in the ABAP Dictionary whose colums have external data types. Screen fields are also declared in the Screen Painter with reference to external data types.
Type Permitted Places m Meaning ABAP Type
ACCP 6 Accounting period n(6)
CHAR 1-255 Character string c(m)
CLNT 3 Client c(3)
CUKY 5 Currency key c(5)
CURR 1-31 Currency field p((m+1)/2)
DATS 8 Date d
DEC 1-31 Calculation/amount field p((m+1)/2)
FLTP 16 Floating point number f(8)
INT1 3 1 byte integer b
INT2 5 2 byte integer s
INT4 10 4 byte integer i
LANG 1 Language c(1)
LCHR 256-... Long character string c(m)
LRAW 256-... Long byte string x(m)
NUMC 1-255 numerischer Text n(m)
PREC 2 Accuracy of a quantity field s
QUAN 1-31 Quantity field p((m+1)/2)
RAW 1-255 Byte sequence x(m)
RAWSTRING 256-... Byte sequence xstring
SSTRING 1-255 Character string string
STRING 256-... Character string string
TIMS 6 Time t
UNIT 2-3 Unit key c(m)
For types LCHR and LRAW, the maximum number of places in a transparent database table is the value of the preceding INT2 field.
The types RAWSTRING and STRING have a variable length. A maximum length for these types can be specified, but has no upper limit.
The type SSTRING is available as of release 6.10 and it has a variable length. Its maximum length must be specified and is limited to 255. The advantage of this type compared with CHAR, is that it is assigned to the ABAP type string.
The table below shows the data types of the ABAP Dictionary that are based on the predefined types in the above table, and that can be addressed in an ABAP program. The elementary components of these data types are converted to predefined ABAP data types according to the final column in the above table, whereby the number of places m of each type is converted to lengths.
Data types in the ABAP Dictionary Data types in ABAP
Data element Elementary data type, Reference type
Structure, Database table, View Structured data type
Table type Table type
Note
As of release 6.20, a component of structures or database tables that has the type LANG can be identified as a text language. The text language is used for the conversion of character-type components of the structure when importing data from data clusters and for RFC between MDMP systems and Unicode systems.

Similar Messages

  • Data: lv_value1 type ref to cl_bsp_messages()

    i have a small doubt, I am confusing a lot
    1)Data: lv_value1 type ref to cl_bsp_messages
    In this case what should i call lv_value1 is instance/reference/object ?
    2) In do_finish_input() we have Global_messages import parameter which refers cl_bsp_messages as well
    In this case what should i call Global_messages is instance/reference/object ?
    3)In do_validate_input i wrote some of following code for my requirement
    data: lv_value2 type ref to cl_bsp_wd_message_service
    lv_value2 =  me->view_manager->get_message_service()
    the rv_result  of get_message_service is  cl_bsp_wd_message_service
    my question is  ,
    In this case what should i call lv_value2 is instance/reference/object ?
    4) data: lv_value3 type ref to CL_CRM_BOL_DQUERY_SERVICE.
    lv_value3 = CL_CRM_BOL_DQUERY_SERVICE=>get_instance()
    In this case what should i call lv_value3 is instance/reference/object ?

    hi ,
    1) Data: lv_value1 type ref to cl_bsp_messages
    up to here you create an instance for this class cl_bsl_meassage
    when you write create object then memory is allocated for this instance then it is called object.
    for example if you have class to add two values , and we create two objects name as obj1 and obj2
    so there we can multiple input vales at a time means using objec1 you can pass input values as 1 1 and result 2
    using obj2 you can pass another 2 input values as 2 2 then result is 4,  how it will be done
    when create an object it allocates separate memory for that object . using data statement you can just assign this object replies to this class.
    2.In do_finish_outpu() the returing parameter type ref to cl_bsp_messages so that , using that attribute you can access all the methods and attributes of that class.
    3 ) it is an object it holds the returning values of that methods , if you want get data from this object , you have some methods in that class
    4 ) here also it is an object , using that method we are getting total instance of that class in to object lv_value3.

  • How to define a TYPE REF TO data into my local variable/structure?

    Hello,
    I am trying to implementing a BADI, in its signature part,
    c_accit TYPE REF TO data.
    My pseudo code goes like,
    DATA: l_itm_details TYPE REF TO data.
    l_itm_details = c_accit.
    l_itm_details-koart = 'D' =====> here am getting error!
    * Do processing
    ENDIF.
    Here am getting error that, l_itm_details is not a structure! Pls. let me know how to fix it?
    Thank you

    Hello,
    c_accit TYPE REF TO data.
    C_ACCIT is a "data reference" parameter. In order to access its components you have to "de-reference" it!
    FIELD-SYMBOLS: <l_itm_details> TYPE ANY,
    <l_value> TYPE ANY.
    ASSIGN c_accit->* TO <l_itm_details>."De-reference the data reference
    ASSIGN COMPONENT 'KOART' OF STRUCTURE <l_itm_details> TO <l_value>.
    If you know the structure of the data reference variable you can define your field-symbol <l_itm_details> of that type directly, else you can define a generic type as mentioned in the code snippet.
    BR,
    Suhas

  • Passing value from field symbol / variable type ref to data to variable

    hey ,
    DATA: NODE_FLIGHTS TYPE REF TO IF_WD_CONTEXT_NODE.
      DATA: RT_CARRID TYPE REF TO DATA.
      FIELD-SYMBOLS: <FS_CARRID> TYPE TABLE
    .* Retrieve the data from the select option
      RT_CARRID = WD_THIS->M_HANDLER->GET_RANGE_TABLE_OF_SEL_FIELD( I_ID = 'S_WEIGHT).
    Assign it to a field symbol
      ASSIGN RT_CARRID->* TO <FS_CARRID>.
    how can i pass RT_CARRID or <FS_CARRID> to a varible with type vbap-netgrw ( net weight ) ?
    thanks
    ASA

    >
    ASA MOKED wrote:
    > hey ,
    >
    >
    > DATA: NODE_FLIGHTS TYPE REF TO IF_WD_CONTEXT_NODE.
    >   DATA: RT_CARRID TYPE REF TO DATA.
    >   FIELD-SYMBOLS: <FS_CARRID> TYPE TABLE

    > .* Retrieve the data from the select option
    >   RT_CARRID = WD_THIS->M_HANDLER->GET_RANGE_TABLE_OF_SEL_FIELD( I_ID = 'S_WEIGHT).
    > * Assign it to a field symbol
    >   ASSIGN RT_CARRID->* TO <FS_CARRID>.
    create a work area of type <FS_CARRID>.
    field-symbol: <fs_wa> type line of <FS_CARRID>.
    loop at <FS_CARRID> into <fs_wa>.
    lv_netgr = <fs_wa>-netgr.

  • Add line to type ref to data field - type table

    HI All,
    I have field that is defined as type ref to data ,and the type of it is table with data inside of it lr_data.
    I have the also the table type of lr_data and I want to add additional line to the type ref to data field.
    How can i do that ?
    For example
    TYPES: BEGIN OF bank_list,
             country_key type string,
             bank_key    type string ,
             bank_name   type string,
             bank_city  type string    ,
           END OF bank_list.
    data lt_bank type table of bank_list.
    data lr_data data  ref to data.
    Now lr_datae is  type lt_bank " in _Runtine
    and contain 4 entries .
    I get the lr_data with 4 entries and I want to add new entry to the table.
    How can I do that?
    Thanks,
    Joy
    Edited by: Joy Stpr on Feb 8, 2012 10:05 PM

    Hello Joy,
    You can check this code snippet to get an idea on how to proceed with your requirement:
    CLASS lcl_add_data DEFINITION.
      PUBLIC SECTION.
        CLASS-METHODS add_data CHANGING ch_data TYPE REF TO data
                               EXCEPTIONS err_invalid_type.
    ENDCLASS.                    "lcl_add_data DEFINITION
    *       CLASS lcl_add_data IMPLEMENTATION
    CLASS lcl_add_data IMPLEMENTATION.
      METHOD add_data.
        DATA: lo_tabdescr   TYPE REF TO cl_abap_tabledescr,
              lo_strucdescr TYPE REF TO cl_abap_structdescr,
              ls_component  TYPE abap_compdescr.
        FIELD-SYMBOLS: <lt_data>      TYPE STANDARD TABLE,
                       <ls_data>      TYPE any,
                       <lv_fieldval>  TYPE any.
        IF ch_data IS BOUND.
    *     Get the runtime type object
          lo_tabdescr  ?= cl_abap_typedescr=>describe_by_data_ref( ch_data ).
    *     Check  if supplied param is table
          IF lo_tabdescr->type_kind NE cl_abap_typedescr=>typekind_table.
            RAISE err_invalid_type.
          ENDIF.
        ELSE.
          RETURN.
        ENDIF.
        ASSIGN ch_data->* TO <lt_data>. "Dereferencing the data reference
    *   Get the line type of table
        lo_strucdescr ?= lo_tabdescr->get_table_line_type( ).
        DO 2 TIMES.
    *     Add initial line to the table
          APPEND INITIAL LINE TO <lt_data> ASSIGNING <ls_data>.
          CLEAR <ls_data>.
    *     Loop on the fields of the structure & populate them
          LOOP AT lo_strucdescr->components INTO ls_component.
            ASSIGN COMPONENT ls_component-name OF STRUCTURE <ls_data> TO <lv_fieldval>.
            CASE ls_component-name.
              WHen 'COUNTRY_KEY'.
                <lv_fieldval> = `My Country`.
              WHEN 'BANK_KEY'.
                <lv_fieldval> = `123`.
              WHEN 'BANK_NAME'.
                <lv_fieldval> = `My Bank`.
              WHEN 'BANK_CITY'.
                <lv_fieldval> = `My City`.
            ENDCASE.
          ENDLOOP.
        ENDDO.
      ENDMETHOD.                    "add_data
    ENDCLASS.                    "lcl_add_data IMPLEMENTATION
    TYPES:
    BEGIN OF bank_list,
      country_key TYPE string,
      bank_key    TYPE string,
      bank_name   TYPE string,
      bank_city   TYPE string,
    END OF bank_list.
    DATA: lt_bank TYPE STANDARD TABLE OF bank_list,
          lr_data TYPE REF TO data.
    START-OF-SELECTION.
      GET REFERENCE OF lt_bank INTO lr_data. "Get reference
    * Add the data to the data reference
      lcl_add_data=>add_data( CHANGING    ch_data = lr_data
                              EXCEPTIONS  err_invalid_type = 1 ).
    BR,
    Suhas

  • Type ref to

    data : r type in_table-name.
    data : r type ref to in_table-name. 
    what is the difference b/w them

    Hi
    type ref to used mostly for declaring classes.
    You can not declare
    DATA: l_grid type cl_gui_alv_grid.
    you need to give it as
    DATA: l_grid type ref to cl_gui_alv_grid.
    Regards
    Navneet

  • Me and type ref

    hi all,
    i read the book written by dr horst keller and sascha kruger "abap objects" with confusion on the below script. really hope can get the help.
    1) confused 1, why creator has no create object and only create reference variable? why no need to create instance of client class?
    2) confused 2. why only me? me means everything(attribute/method) of client class? why not define as me->name just like in confused 4?
    3) why creator no create object also can creator->name?
    report self_reference.
    class client definition.
    public section.
    data name(10) type c value 'master' read-only.
    methods create_server.
    endclass.
    class server definition.
    public section.
    methods acknowledge importing creator type ref to client.  "confused 1
    private section.
    data name(10) type c value 'servant'.
    endclass.
    class client implementation.
    method create_server.
    data server_ref type ref to server.
    create object server_ref.
    call method server_ref->acknowledge exporting creator = me. "confused 2
    endmethod.
    endclass.
    class server implementation.
    method acknowledge.
    data name type string.
    name = creator->name.                   "confused 3
    write: me->name, 'created by', name.  "confused 4
    endmethod.
    endclass.
    data client_ref type ref to client.
    start-of-selection.
    create object client_ref.
    call method client_ref->create_server
    the output is "servant created by master".

    hi,
       i will explain your confusion along with your example...
    report self_reference.
    class client definition.
    public section.
    data name(10) type c value 'master' read-only.
    methods create_server.
    endclass.
    class server definition.
    public section.
    methods acknowledge importing creator type ref to client. "confused 1
    private section.
    data name(10) type c value 'servant'.
    endclass.
    class client implementation.
    method create_server.
    data server_ref type ref to server.
    create object server_ref.
    call method server_ref->acknowledge exporting creator = me. "confused 2
    endmethod.
    endclass.
    class server implementation.
    method acknowledge.
    data name type string.
    name = creator->name. "confused 3
    write: me->name, 'created by', name. "confused 4
    endmethod.
    endclass.
    data client_ref type ref to client.
    start-of-selection.
    create object client_ref.
    call method client_ref->create_server
    the output is "servant created by master".
    confusion 1:
    Normaly while creating an object we have to create a reference variable to class and then create the instance of the class with 'Create Objec' statement, but in this example we are passing a parameter creator of type client is sent to acknowledge method of server class. Here the parameter  creator is sent as an reference variable which means that the object is already created and just an reference to that variable is sent to the method acknowledge.
    confusion 2:
    here 'me' is a self reference variable of a class. It does not mean an attribute or methods of a class, it denotes the object of the class itself in which it is referenced. Normally the 'me' is used for self reference inside the class methods for refering to attributes or methods of the same class.
    eg: me->attrib1 or call method me->method1
    confusion 3:
    An ABAP class has two parts namely a defenition part and an implementaion part. The defenition part of the class contains all the attributes and declaration of the methods, whereas the implementation part contains the actual implementation of methods i.e., defenition of methods. In simple words, the defenition part of the class contains the methods name and what are the parameters like exporting, importing, changing,exceptions, etc., whereas the implementation part contains actual functionality of the method.
    As i have already stated that the parameter passed to the method are passed as reference variable, there is no need for creating object seperately and just an reference to already exisiting object is passed as parameter.
    so we can obtain the value of the attribute 'name' by means of the reference variable creator which gives the value of the client object.
    confusion 4:
    'me' is a self reference variable which is nothing but a reference to the same class, so me->name refers to the attribute name of the server class.

  • Type ref to a table

    Hi Experts,
    I have an FM returning a variable which is :
      abc type ref to data.
    This actually returns a table at runtime.
    However since its declaration is such, I capture the reference in another variable
      xyz type ref to data.
    Now I need to know whether the xyz table has one row or more.
    How can I do that?
    Thanks and Regards,
    Ravi Bhatnagar

    Try something like this. Assign the data ref to a field symbol, then use the LINES operator to find out the number of lines.
    DATA: lo_ref TYPE REF TO data.
    DATA: lv_lines TYPE i.
    FIELD-SYMBOLS: <fs_tab> TYPE table.
    ASSIGN lo_ref->* TO <fs_tab>.
    lv_lines = LINES( <fs_tab> ).
    Regards,
    Rich Heilman

  • HT5409 I asked if AVCHD files can be played on Mac and the support site says to simply click on the icon and quick time will play it. A big lie. Just say it won't support the file type and tell us what apps to get.

    I asked if AVCHD files can be played on Mac and the support site says to simply click on the icon and quick time will play it. A big lie. Just say it won't support the file type and tell us what apps to get. anybody?

    I also had issues opening AVCHD files on case-sensitive filesystems.
    You can try these steps to solve the issue:
    Right click on the AVCHD file and select 'Show Package Contents'
    Right click on the BDMV file and select 'Show Package Contents'
    Rename index.bdm to INDEX.BDM (it seems that all files in the BDMV folder should be in UPPERCASE for Quicktime to open the AVCHD file).
    Go back twice and try again to double-click on the AVCHD file (Quicktime should open a window showing the multiple clips, as expected).

  • I am trying to open up my iTunes from my Mac. It says "You can't open the application iTunes because it is not supported on this type of Mac." What do I do?

    I am trying to open up my iTunes from my iMac. It says "You can't open the application iTunes because it is not supported on this type of Mac." What do I do? I've already force closed all other apps.

    Well, obviously the problem isn't with the other apps, it's with the type of Mac you have. What type of Mac do you have?

  • I upgrade to ios7 today and now when I try to speak out a messae in messages or use siri niether works siri says it cannot take request right now, and messages just clocks and never types out the message, what happened?

    I upgrade to ios7 today and now when I try to speak out a messae in messages or use siri niether works siri says it cannot take request right now, and messages just clocks and never types out the message, what happened? Has anyone else had this issue today?

    What you are experiencing is 100% related to Malware.
    Sometimes a problem with Firefox may be a result of malware installed on your computer, that you may not be aware of.
    You can try these free programs to scan for malware, which work with your existing antivirus software:
    * [http://www.microsoft.com/security/scanner/default.aspx Microsoft Safety Scanner]
    * [http://www.malwarebytes.org/products/malwarebytes_free/ MalwareBytes' Anti-Malware]
    * [http://support.kaspersky.com/faq/?qid=208283363 TDSSKiller - AntiRootkit Utility]
    * [http://www.surfright.nl/en/hitmanpro/ Hitman Pro]
    * [http://www.eset.com/us/online-scanner/ ESET Online Scanner]
    [http://windows.microsoft.com/MSE Microsoft Security Essentials] is a good permanent antivirus for Windows 7/Vista/XP if you don't already have one.
    Further information can be found in the [[Troubleshoot Firefox issues caused by malware]] article.
    Did this fix your problems? Please report back to us!

  • When i connect my ipad2 to my tv using the hdmi cord for video mirroring, nothing happens! I've tried it on two new and different types of tv's, what gives?

    When I connect my Ipad2 to my tv using the HDMI cord for video mirroring, nothing happens! I've tried it with new and different types of tv's, what gives?

    Do you have the correct input set on the TV, like HDMI 1, HDMI 2, etc?

  • My Mac has hardware problem. It keeps speaking out whatever I type or input. What can I do?

    My Mac has hardware problem.It keeps speaking out whatever I type or input. What can I do?

    No it doesn't!
    Turn off VoiceOver in System Preferences/Universal Access.

  • Somehow my MacBook (vintage) is now showing a black text box that continues to type and also speak what I am doing.  There is also a blk border text box that follow me in the page itself.  How do I get this turned off?

    Somehow my MacBook (vintage) is now showing a black text box that continues to type and also speak what I am doing.  There is also a blk border text box that follow me in the page itself.  How do I get this turned off?

    What version of Mac OS X? Do you have the original (or any) system disk?

  • TS1398 i can't connect to my wifi eveni if type the right password, what shall i do?

    I can't connect to my wifi even though i type the right password. what shall i do?

    Try a reset..Hold the power and home button at the same time for 10 seconds and release it when the apple logo is shown on screen..then try to connect to wifi..hope this helps..

Maybe you are looking for

  • RRI & Interactive reports in R/3

    Hi all, Can please explain about this :  Is RRI jump target  same like  Interactive reports in R/3 . Ranga

  • I keep receiving an error message when I try to send an adobe document through Outlook email.

    I keep receiving an error message when I try to send an adobe document through Outlook email. The message is : Either there is not default mail client or the current mail client cannot fulfill the message request. Please run Microsoft Outlook and set

  • Workspace 11.1.1.3 and HFM cannot open apps

    Hi, I have an issue where i cannot open any apps in workspace 11.1.1.3. I checked and all services for workspace and HFM are running with IIS as well. I can open the app in the client, but on the Web, i cannot. I did a reconfiguration and that also d

  • FB70 Printing Multi A/R Invoices

    My understanding of issuing A/R invoices is as follows: 1. FB70 u2013 enter customer invoice 2. FB12 u2013 request correspondence 3. F.64 u2013 print correspondence The problem for that is if, for example, 20 invoices are entered in FB70, then we hav

  • Confirmation Print Out ?

    Hi SRM Gurus, We have SRM 5.0. We would like to take the print out of confirmation. Is it possible? Could you please list the steps to be done? Thanks in advance, Ramkumar