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.

Similar Messages

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

  • 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

  • Data Vs Types  and  Type Vs  Like

    hi frds can you send main diffrences between
    Data Vs Types   and     Type Vs  Like.
    some what briefly explanation..........  i am in confusion in this

    Hi Madhu,
    Data is used to create data object ( means memory will be allocated)
    Types is used to create structures
    Type is used to refer to Predefined data types ( like n,i,f,d,t,p,x....)
    Like is used to refer the local variables.
    All ABAP programs can define their own data types. Within a program, procedures can also define local types.
    You define local data types in a program using the
    TYPES .
    TYPES: spfli_type TYPE spfli,
           surname(20) TYPE c,
           BEGIN OF address,
                 name       TYPE surname,
                 street(30) TYPE c,
                 city       TYPE spfli_type-cityfrom,
           END OF address,
           town TYPE address-city.
    This example shows the definition of two structure types in a program - SPFLI_TYPE and ADDRESS. The structure of the data type SPFLI_TYPE is taken from the database table SPFLI in the ABAP Dictionary. The components of SPFLI_TYPE are the same as the columns of SPFLI. The individual data types of the components are the ABAP equivalents of the data types of the columns of the database table. The structure type ADDRESS is newly defined. The component ADDRESS-NAME takes the data type of the previously-defined type SURNAME, the component ADDRESS-STREET is newly-defined, ADDRESS-CITY takes the data type of column CITYFROM of the structure type SPFLI_TYPE.
    TYPES: BEGIN OF struct1,
             col1 TYPE i,
             BEGIN OF struct2,
               col1 TYPE i,
               col2 TYPE i,
             END OF struct2,
           END OF struct1.
    TYPES mytype TYPE struct1-struct2-col2.
    The example shows how you can construct a nested structure type STRUCT1 with a complex component STRUCT2 by nesting TYPES BEGIN OF ... TYPES END OF blocks, and how you can address the inner components.
    local types in program
    referring to predefined ABAP types:
    TYPES: surname(20)  TYPE c,
           street(30)   TYPE c,
           zip_code(10) TYPE n,
           city(30)     TYPE c,
           phone(20)    TYPE n,
           date         LIKE sy-datum.
    local structure in program
    referring to the above types
    TYPES: BEGIN of address,
             name TYPE surname,
             code TYPE zip_code,
             town TYPE city,
             str  TYPE street,
           END OF address.
    local nested structure in program
    referring to the above types
    TYPES: BEGIN of phone_list,
             adr TYPE address,
             tel TYPE phone,
           END OF phone_list.
    This example shows how to create complex data types from simple type definitions. After a set of simple data types are created with ABAP predefined types, a structured type ADDRESS is defined using the data types defined earlier. Finally, a nested structure type, PHONE_LIST, is created, whose first component has the type ADDRESS.
    Table types
    Local tables in a program are called internal tables. To construct a new internal table type, use the syntax:
    TYPES  can be any known data type. Specifying the key is optional. Internal tables can thus be generic. For more information, refer to Internal Tables.
    DATA
    The Statements TYPES and DATA
    Each ABAP program define its own data types using the statement.
    TYPES dtype TYPE type ...
    and declare its own variables or instance attributes of classes using the statement
    DATA var {TYPE type} ...
    Within the program or a class, you can also define local data types and variables within procedures. Local variables in procedures obscure identically-named variables in the main program or class.
    When creating data types and data objects, there are a number of naming convention that also apply for other local program definitions, such as procedures. These are described in detail in the keyword documentation.
    The Additions TYPE and LIKE
    The additions TYPE type and LIKE dobj are used in various ABAP statements. The additions can have various meanings, depending on the syntax and context.
    ·        Definition of local types in a program
    ·        Declaration of data objects
    ·        Dynamic creation of data objects
    ·        Specification of the type of formal parameters in subroutines
    ·        Specification of the type of formal parameters in methods
    ·        Specification of the type of field symbols
    Constructing New Data Types
    The TYPE addition allows you to construct new data types in the TYPES, DATA; CONSTANTS; and STATICSstatements. In the TYPES statement, these are local data types in the program. In the other statements, they are attributes of new data objects, meaning that the newly defined data types are not free-standing. Rather, they are linked to database objects.This means that you can refer to them using the LIKEaddition, but not using TYPE.
    To construct new data types, the addition TYPE can be used with the following type constructors:
    ·        Construction of reference types
    REF TO type|dobj
    ·        Construction of structured data types
    BEGIN OF struc_type.
    END OF struc_type.
    ·        Construction of table types
    tabkind OF linetype
    These data types only exist during the runtime of the ABAP program.
    Referring to Known Data Types or Data Objects
    Using the additions TYPE or LIKE in the TYPESstatement, local data types in a program can be referred to known data types or data objects. This is mainly the case with user-defined elementary data types. If you declare variables using the additions TYPE type or LIKE dobj with statement DATA, the data type of var is already fully defined before the declaration is made.
    The known types or data that are referred to must be visible at the point where the data type or variable is declared.
    A known data type can be any of the following:
    ·        A predefined ABAP type to which you refer using the TYPE addition
    ·        An existing local data type in the program to which you refer using the TYPE addition
    ·        The data type of a local data object in the program to which you refer using the LIKE addition
    ·        A data type in the ABAP Dictionary to which you refer using the TYPE addition. To ensure compatibility with earlier releases, it is still possible to use the LIKE addition to refer to database tables and flat structures in the ABAP Dictionary. However, you should use the TYPE addition in new programs.
    The LIKE addition takes its technical attributes from a visible data object. As a rule, you can use LIKE to refer to any object that has been declared using DATA or a similar statement, and is visible in the current context.  The data object only has to have been declared. It is irrelevant whether the data object already exists in memory when you make the LIKE reference.
    ·        In principle, the local data objects in the same program are visible. As with local data types, there is a difference between local data objects in procedures and global data objects. Data objects defined in a procedure obscure other objects with the same name that are declared in the global declarations of the program.
    ·        You can also refer to the data objects of other visible ABAP programs. These might be, for example, the visible attributes of global classes in class pools. If a global class cl_lobal has a public instance attribute or static attribute attr, you can refer to it as follows in any ABAP program:
    DATA dref TYPE REF TO cl_global.
    DATA:  f1 LIKE cl_global=>attr,
           f2 LIKE dref->attr.
    You can access the technical properties of an instance attribute using the class name and a reference variable without first having to create an object. The properties of the attributes of a class are not instance-specific and belong to the static properties of the class.
    TYPES: BEGIN OF struct,
             number_1 TYPE i,
             number_2 TYPE p DECIMALS 2,
           END OF struct.
    DATA:  wa_struct TYPE struct,
           number    LIKE wa_struct-number_2,
           date      LIKE sy-datum,
           time      TYPE t,
           text      TYPE string,
           company   TYPE s_carr_id.
    This example declares variables with reference to the internal type STRUCT in the program, a component of an existing data object wa_struct, the predefined data object SY-DATUM, the predefined ABAP type t and STRING, and the data element S_CARR_ID from the ABAP Dictionary.
    Referring to Generic Data Types
    If you refer to one of the generic predefined ABAP types of fixed length (c, n, p, x) in the TYPES or DATA statement, you must specify the undefined technical attributes.
    TYPES|DATA var[(length)] TYPE type ...
    TYPES|DATA var TYPE type ...
    DATA: text1,
          text2 LENGTH 2,
          text3 TYPE c LENGTH 3,
          pack TYPE p DECIMALS 2 VALUE '1.225'.
    This example creates three character variables with field lengths of one, two, and three bytes respectively, and a packed number variable with field length 8 bytes and two decimal places. If the attribute Fixed point arithmetic is set, the value of pack is 1.23.
    This example shows how to declare elementary data objects with reference to predefined ABAP types.
    PROGRAM demo_elementary_data_objects.
    DATA text1  TYPE c LENGTH 20.
    DATA text2  TYPE string.
    DATA number TYPE i.
    text1 = 'The number'.
    number = 100.
    text2 = 'is an integer.'.
    WRITE: text1, number, text2.
    This program produces the following output on the screen:
    The number              100 is an integer.
    In this example, the data objects text1, text2 and number are declared with the DATA statement. The technical attributes are determined by referring to the predefined ABAP types c, string, and I. Values from unnamed literals are assigned to the data objects. The contents of the named data objects are displayed on the list.
    Specifying a Start Value
    When you declare an elementary fixed-length variable, the DATAstatement automatically fills it with the type-specific initial value as listed in the table in the Predefined ABAP Types section.
    However, you can also specify a starting value of a fixed-length elementary variable (also within a structure declaration) using the VALUE addition in the DATAstatement:
    DATA var ... VALUE val|{IS INITIAL}.
    Specifying start values:
    DATA: counter TYPE p VALUE 1,
          date    TYPE d VALUE '19980601',
          flag    TYPE n VALUE IS INITIAL.
    After this data declaration, the character string flag contains its type specific
    Initial value ‘0’.
    Difference Between TYPE & LIKE
    Difference between TYPE & LIKE

  • 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

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

  • Dynamic Data: Character Type Declaration

    Hello Experts,
    I would like to get your feedback regarding declaration of a character type field with dynamic length?
    For example, I would like to declare data like: char(size) type c, where size is dynamic.
    How can I do this? Thanks in advance.
    Regards,
    Jerome

    Hi,
    DATA r_elemdescr TYPE REF TO cl_abap_elemdescr.
    r_elemdescr ?= cl_abap_elemdescr=>describe_by_name( 'DATA_ELEMENT_HERE' ).
    DATA r_field TYPE REF TO data.
    FIELD-SYMBOLS <field> TYPE ANY.
    CREATE DATA r_field TYPE HANDLE r_elemdescr.
    ASSIGN r_field->* TO <field>.
    <field> = .....
    now <field> is your dynamic field value
    Regards,
    Ravi

  • EJB-QL and date/time types

    Hi,
    as far as I understand, EJB-QL does not support date/time values.
    Does anybody know how to work around this limitation?
    Using long values containing milliseconds is not an alternative, because the database stores
    date/time values.
    I need to compare these date/time values to input parameters in finder methods.
    Suggestions?
    Bye the way, is there any reason for this limitation in EJB-QL, or did they simply forget to include
    date/time types to the spec?
    Greetings
    Christian

    Greetings,
    Hi,
    as far as I understand, EJB-QL does not support
    date/time values. Actually, it does - EJB QL supports all types supported by a bean's abstract schema (IOW: available types for CMP/CMR fields). However, therein also lies the crutch - EJB QL is for querying beans, not the resource to which they map (EJB QL's similarity to SQL is purely for convenience; an Entity Bean, it should be remembered, may represent entities in any persistent store, not just RDBMSes). Therefore, you should be thinking in terms of Java types, not SQL ones... The specification, however, does place "restrictions" (ie. minimally required [vendor] support), on their use which should be limited to long millisecond values (by which a Date object performs an equals comparison... ;).
    Does anybody know how to work around this limitation?Depends on what you're attempting. If you're using a Date as an argument to a finder, eg:
    findByDateInRange( java.util.Date start, java.util.Date end )then this shouldn't pose a problem where your EJB QL would look like:
    SELECT OBJECT(a) FROM MyBeanSchema AS a WHERE a.myDate BETWEEN ?1 AND ?2Presuming the bean MyBean contains a CMP field of type java.util.Date called 'myDate'. If, however, you must use a literal date then you will have to use a long literal unless your vendor supports otherwise. However, it might be worth noting that EJB QL must still be mapped to the underlying resource QL (eg. SQL), and so a more intelligble value (one that meets the resource's format requirements ;), could be used in the actual rQL statement.
    Using long values containing milliseconds is not an
    alternative, because the database stores
    date/time values.I'm guessing you mean here something like "04/23/2002" and "13:13:35", etc. This, however, is not how the database actually stores the data - input/output formats such as these are supported for the convenience of us 'nuerically-challenged' humans (similar to internet hostnames vs. TCP/IP addresses ;) - nor do Java Date/Calendar/Timestamp types store them this way.
    I need to compare these date/time values to input
    parameters in finder methods.
    Suggestions?Ah, yes. Well then... refer back to the above. :)
    Bye the way, is there any reason for this limitation
    in EJB-QL, or did they simply forget to include
    date/time types to the spec?The EJB QL does not explicitly support any specific types beyond those "supported by an EJB's abstract schema", which is pretty much any Java type that can represent a compatible resource type. The reason for the noted "restriction" on date/time types, however, is (likely) due to the way the associated Java classes (not to mention the back-end resource), handle/represent these data internally and this gives the vendor an easily achievable minimal level of compliance for supporting these types.
    I hope this helps.
    ChristianRegards,
    Tony "Vee Schade" Cook

  • External Data source not appearing in Data source type

    Hello,
    I use SQL Server 2012 BI Edition and use Data tools to create reports. I have a 3rd party Data source. While creating a new shared data source, I cannot get it to appear under the Data Source Type. Only the current built in types are available. For test
    purposes, I tried editing the RSReportServer.config and added a duplicate entry and it was shown in the dropdown. What should I do? 
    When this 3rd party data source is installed, under Tools --> Connect to Database, I am able to get that datatype and connect to my data source. I tried uninstalling and this option goes away. 
    Regards
    Vivek.

    Hi Vivek,
    Based on my research, the error always occurs when you load custom extensions in SQL Server 2012 Data Tools or use Report Builder 2.0 to run an SSRS 2008 or SSRS 2008 R2 report that uses a custom data processing extension in server mode. According to your
    description, it seems that you are not in those two scenarios. So I think this issue can be caused by that the Custom Data Process Extension is not deployed correctly in SQL Server Reporting Services.
    The following document about Implementing a Data Processing Extension in Reporting Services is for your reference:
    http://www.codeproject.com/Articles/22946/Implementing-a-Data-Processing-Extension
    Besides, please note that Report Builder is currently not extensible, and can't load custom data extensions or custom query designers. We can refer to the method posted by Robert to work around this issue:
    https://go4answers.webhost4life.com/Example/custom-data-sources-report-builder-30-15682.aspx
    Hope this helps.
    Thanks,
    Katherine Xiong
    Katherine Xiong
    TechNet Community Support

  • Can i see the column DATA(BLOB type) in PM_OBJECTS of DCM schema

    we installed DCM managed clustering .it is Database repository type.
    i am trying to see the column DATA(BLOB type) in PM_OBJECTS of DCM schema .
    I wrote a program in java to read blob data type and write it into a temporary file.
    when i open temporary files all the data in junk format.
    can i see the real data of thatcolumn.Is it possible?
    first of all for what purpose DCM shema will be used?

    Hi,
    There is no option to show the comments on the diagram.
    We plan to add such feature in the next version.
    Ivan

  • Report for pulling out data of Pricing Ref. Material

    Hi All,
    I want to know the transaction or report which can pull out the data of pricing ref. material used for any material in Sales Org .2 view. I mean to say that, if there are 100 materials created and 50 of them have a pricing material field populated by some xyz material then how can I pull out those 50 material numbers for which the pricing ref. material is populated along with the pricing ref. material number?
    Await your quick response.
    Hrishikesh

    Hi
    These are  the standard reports for the material related.
    Material Analysis-Incoming orders - MC(E
    Material Analysis- Invoiced Sales - MC+Q
    Material Returns-Analysis - MC+M
    But i think you need to go for LIS , by creating a user defined report where in you need to take the character sics as pricing reference material (MATNR) as one of them
    Regards
    Srinath

  • Power View in SharePoint Server - The data extension type for a data source is not valid

    Hi All,
    All of a sudden I am getting following error when trying to create Power View report using shared report data source (no error testing the connection):
    "The current action cannot be completed. The data extension type for a data source
    'http://dev/Shared Ducuments/Sales.rsds' is not valid for this operation"
    I already have a data source (I had created it after creating my site collection a week ago) and when I use this source to create Power View report then there is no error but I am getting above error when I create another similar data source and use it to create
    a Power View report.
    Please help me to resolve the error.
    Thanks

    I am going nuts! I had selected 'Analysis Services' instead of 'Microsoft BI Semantic Model for Power View'

Maybe you are looking for