(De-)Serializing ref to data (using transitions?)

Hi all,
I'd like to use a simple transformation to serialize and deserialize a table, that contains a data reference. The table is defined like this:
types:
  begin of my_row,
    field type char10,
    value type ref to data,
  end of my row,
  my_table type sorted table of my_row with unique key field.
Reference cannot be used directly, so <tt:copy ..> does not work. I tried <tt:assign ...>, but it leads into a syntax error.
Is there any comfortable way, to solve that problem? I mean I could use the ABAP RTTI and build an XML-file by myself, but that is a lot of more work to do .....
As always, any help is appreciated.
Nick

Hey Kamil,
You can use a field symbol to move the data like this:
data: dyn_struc type ref to data.
stat_struc type A.
field-symbols <fs> type data.
create data dyn_struc type A.
assign dyn_struc->* to <fs>.
stat_struc = <fs>.
Of course, this will only work if dyn_struc was actually created with type A. Otherwise, the last line will cause a runtime error.
Best regards,
Erik

Similar Messages

  • Using XFA javascript to refer to Data Connection data

    Is it possible to use XFA Javascript to refer to Data Connection data, without referring first to a field which is bound to a Data Connection.
    The aim of this is to track changes of certain fields by comparing a fields "newText" to the Data Connection's field.
    Also, is it possible to have Acrobat save data back to the data connection (ie. change the data connection data to reflect changes in the current form)

    Additionally, does anyone know of any documentation (preferably free) detailing the use of XFA Javascript in LiveCycle.

  • Can I use LabVIEW to load data directly into system memory? The serial card I'm using isn't supported by NI nor does VISA recognize it. I'm using a Win32 function to read the data from the card and now I want it to go directly to system memory.

    Can I use LabVIEW to load data directly into system memory from a VI? The serial card I'm using isn't supported by NI nor does VISA recognize it. I'm using a Call Library function to read the data from the card and now I want it to go directly to system memory.
    The data is being received at 1Mbps.
    Thanks

    Two questions:
    One, if it's a serial card, then presumably it gives you more serial ports, like COM3, COM4, etc. If so, VISA would see the COM ports, and not the card directly. The drivers for the card should make it so that you see the extra serial ports from the OS. If you don't see the extra COM ports from VISA, then it sounds like the drivers for the card are not installed properly. Do the extra COM ports show up in Device Manager?
    Two, you said that you're using a Call Library function to get the data and you want to put it into system memory. Errr.... you just read the data and you have it in memory by definition. Are you saying you need a way to parse the data so it shows up on a graph or something?

  • How to get the context data using java script in interactive forms

    Hi All,
    How to get the context data using java script in interactive forms by adobe,  am using web dynpro java
    thanks.

    Hi venkat,
    Please Refer this link.
      Populating one Drop-Down list from the selection of another Drop-down list
    Thanks,
    Raju.

  • How to determine type and access of REF TO DATA

    Hello experts,
    I have a structure with two fields, one string as name/ID and the second one REF TO DATA as placeholder for any value, so DATA can take for example another string or a numeric value or whatever. Ok, now I want to handle this DATA based on it's type, which is unknown at that point. So I first DESCRIBE the field (its type). If for example this type results in a string, I want to move this string data from REF TO DATA into a local string value. Then I want to reformat the string value and save it again to the REF TO DATA field.
    So, in short, I have these tasks:
    1. determine type of REF TO DATA
    2a. if it's a string, then move the val. of the string into a local string variable
    2b. or alternatively do something else, if it's not a string value
    3. do something with the local string, then save it back to the REF TO DATA field
    Any ideas?
    Thank in advance for your help!
    Kind regards, Matthias

    Hi Matthias
    I think you missed a little and very important detail here:
      ASSIGN ls_rec-value TO <fs>.
    That's not what we want, instead you need to use:
      ASSIGN ls_rec-value->* TO <fs>.
    That's why you are obtaining this type 'l' which is refering to a TYPE REF TO DATA itself. Doing it the right way your final type would be 'C' which corresponds with a character data type.
    Best Regards

  • Download multiple table data using RTTI

    Hi,
    Using RTTI, I am trying to download database table data dynamically. I have code that works fine for one table at a time. If I need to download data from multiple tables in one go. How can I  do this using RTTI?
    Thanks in advance,
    VG
    My code is...
    DATA: go_struct TYPE REF TO cl_abap_structdescr,
                go_table TYPE REF TO cl_abap_tabledescr,
                gi_data type ref to data.
          FIELD-SYMBOLS: <gi_data> TYPE STANDARD TABLE.
    * Dynamically getting the line type of the specified table
          go_struct ?= cl_abap_typedescr=>describe_by_name( v_tabname ) .
          TRY.
              CALL METHOD cl_abap_tabledescr=>create
                EXPORTING
                  p_line_type  = go_struct
                  p_table_kind = 'S'
                RECEIVING
                  p_result     = go_table.
            CATCH cx_sy_table_creation .
    *MESSAGE e000 WITH text-004.
          ENDTRY.
    * creating internal table of table type just created
          CREATE DATA gi_data TYPE HANDLE go_table.
    * Assigning the internal table to field symbol
          ASSIGN gi_data->* TO <gi_data>.
    ** get the data into the internal table from db table
          SELECT * INTO TABLE <gi_data> FROM (v_tabname).
    download....
    CALL FUNCTION 'GUI_DOWNLOAD'
        EXPORTING
    *      filename                = 'C:\test.txt'
          filename                = p_file1
          write_field_separator   = 'X'
        TABLES
            data_tab               = <gi_data>
        EXCEPTIONS
          file_write_error        = 1
          no_batch                = 2
          gui_refuse_filetransfer = 3
          invalid_type            = 4
          no_authority            = 5
          unknown_error           = 6
          header_not_allowed      = 7
          separator_not_allowed   = 8
          filesize_not_allowed    = 9
          header_too_long         = 10
          dp_error_create         = 11
          dp_error_send           = 12
          dp_error_write          = 13
          unknown_dp_error        = 14
          access_denied           = 15
          dp_out_of_memory        = 16
          disk_full               = 17
          dp_timeout              = 18
          file_not_found          = 19
          dataprovider_exception  = 20
          control_flush_error     = 21
          OTHERS                  = 22.
      IF sy-subrc = 0.
        MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      ENDIF.
    Edited by: Thomas Zloch on Nov 5, 2010 9:42 AM - please use code tags

    Hi,
    DATA: go_struct TYPE REF TO cl_abap_structdescr,
    go_table TYPE REF TO cl_abap_tabledescr,
    gi_data type ref to data.
    FIELD-SYMBOLS: <gi_data> TYPE STANDARD TABLE.
    LOOP AT GT_TAB_LIST INTO GS_TAB_LIST.
    * Dynamically getting the line type of the specified table
    go_struct ?= cl_abap_typedescr=>describe_by_name( GS_TAB_LIST-tabname ) .
    TRY.
    CALL METHOD cl_abap_tabledescr=>create
    EXPORTING
    p_line_type = go_struct
    p_table_kind = 'S'
    RECEIVING
    p_result = go_table.
    CATCH cx_sy_table_creation .
    *MESSAGE e000 WITH text-004.
    ENDTRY.
    * creating internal table of table type just created
    CREATE DATA gi_data TYPE HANDLE go_table.
    * Assigning the internal table to field symbol
    ASSIGN gi_data->* TO <gi_data>.
    ** get the data into the internal table from db table
    SELECT * INTO TABLE <gi_data> FROM ( GS_TAB_LIST-tabname ).
    download....
    CALL FUNCTION 'GUI_DOWNLOAD'
    EXPORTING
    * filename = 'C:\test.txt'
    filename = p_file1
    write_field_separator = 'X'
    TABLES
    data_tab = <gi_data>
    EXCEPTIONS
    file_write_error = 1
    no_batch = 2
    gui_refuse_filetransfer = 3
    invalid_type = 4
    no_authority = 5
    unknown_error = 6
    header_not_allowed = 7
    separator_not_allowed = 8
    filesize_not_allowed = 9
    header_too_long = 10
    dp_error_create = 11
    dp_error_send = 12
    dp_error_write = 13
    unknown_dp_error = 14
    access_denied = 15
    dp_out_of_memory = 16
    disk_full = 17
    dp_timeout = 18
    file_not_found = 19
    dataprovider_exception = 20
    control_flush_error = 21
    OTHERS = 22.
    IF sy-subrc = 0.
    MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
    WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
    ENDIF.
    endloop.

  • How to load data to transitive attribute

    hi All,
    can any one guide me how to load data to transitive attribute. explain with scenarios
    Thanks,
    Amy

    Hi,
    The transitive attribute is an attribute of attribute.
    If a characteristic was included in an InfoCube as a navigation attribute, it can be used for navigating in queries. This characteristic can itself have further navigation attributes, called transitive attributes. These attributes are not automatically available for navigation in the query. As described in this procedure, they must be switched on.
    Transitive Attributes without reloading infocube
    http://help.sap.com/saphelp_nw04/helpdata/en/6f/c7553bb1c0b562e10000000a11402f/frameset.htm
    Hope this helps.
    Thanks,
    JituK

  • Problems with data using cellular network since upgrading to iOS8

    I have an iPhone 5 and recently upgraded to iOS8. Since doing so, I am no longer able to use FaceTime and many other services (eg Snapchat, Apps Store, etc) when relying on the cellular network. I have not changed cellular carriers and it all worked fine with iOS7. What can I do?

    Hi reader1961,
    Welcome to the Apple Support Communities!
    I understand that issues with cellular data on your iPhone can be very frustrating. In this situation there are several troubleshooting steps that I would recommend to help you resolve the issue. Please refer to and use the attached article for troubleshooting steps and guidance. 
    iPhone cellular data connection issues
    Have a great day,
    Joe

  • Hyperion get ref cursor data

    Hi,
    Is there any way to execute stored procedure via hyperion using ODBC and get back ref cursor data.
    I tried to call a stored procedure that have a ref cursor out parameter but it gives me error.
    My stored procedure code is below.
    wrong number or types of arguments to in call to 'HYP_CURSOR'
    create or replace package hyp_ref_cusrsor is
    type t_cusror is ref cursor;
    end;
    create or replace procedure hyp_cursor(ret1 out hyp_ref_cusrsor.t_cusror) is
    begin
    open  ret1 for select * from hyp_tmp1 m;
    end;
    Hyperion version is 9.3.1
    Oracle version is 10.0.2
    Regards

    George wrote:
    Is there a limit to the volume of data a ref cursor can return via an Oracle Database Procedure call? No.
    {thread:id=886365}
    Re: OPEN cursor for large query
    A ref cursor is a pointer to a compiled SQL statement, it has no rows so there is no limit to the number of rows that you can use it to fetch, just like there is no limit to the number of rows a select can return.
    I am using a ref cursor to return data and testing using toad, it hangs the session. My Business Object report also hangs because of the large data volume 750,000 rows returned via a ref cursor. This is very confusing, it it hangs how do you know it returns 750,000 rows?

  • I am having problems to run logic pro 9, there is an error display that says I need to set bonjour and that this app serial number has been used by another red user,  could anybody guide me?

    I am having problems to run logic pro 9, there is an error display that says I need to set bonjour and that this app serial number has been used by another red user,  could anybody guide me? actually, my computer can't start  since three days ago, could it be the same problem?

    Logic is the APPlication (program, app) that you are having the problem with.
    Logic Pro can take advantage of other computers on your local (home or work) network to help it do "heavy lifting" data chores by using Bonjour and a feature called Nodes.   It seems that Logic is attempting to find and connect to another machine on your network.
    Do you have Logic installed on another computer there?  That may be the source of the confilict.
    You might want to post this question in the Logic Pro Community.
    Be sure to indicate the version of Logic Pro that you are using.  I'm sure the folks there can help you out.

  • Submit data using Jquery/Javascript during button click

    submit data using Jquery/Javascript during button click

    Hi,
    From your description, my understanding is that you want to restrict edit form with jQuery/JS.
    If you want to restrict the default edit form with jQuery/JS, you could refer to these steps below:
    Enter your editform.aspx.
    Add below code under <asp:Content ContentPlaceHolderId="PlaceHolderMain" runat="server">.
    Save this file.
    <script src="https://code.jquery.com/jquery-1.11.1.min.js" type="text/javascript"></script>
    <script type="text/javascript">
    function PreSaveAction(){
    if($("select[id$='DropDownChoice']").val()==""){
    alert("please choose a value!");
    return false;
    return true;
    </script>
    The screenshot below is my result(it will not save data after clicking OK in the message alert):
    If you customize your list with InfoPath, you could check the checkbox “Cannot be blank” under Validation section or add a rule for your validation as the screenshot below:
    In addition, you could check your code with pressing F12 to debug your code.
    Best Regards,
    Vincent Han
    TechNet Community Support
    Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact
    [email protected]

  • REF TO DATA to Structure

    Hi Folks!
    I got a little problem with moving data.
    I'm using ref to data for a general data definition. Unfortunately after I create the data using a certain type, let's say 'A', I cant move the data of the created data to a structure of type 'A'. (It can also be type 'B'; that depends on the user input; thats why I am using ref to data).
    Is there a way to move the data from the cre3ated structure to the static type structure?
    I'm looking forward to reading from you
    Best Regards!

    Hey Kamil,
    You can use a field symbol to move the data like this:
    data: dyn_struc type ref to data.
    stat_struc type A.
    field-symbols <fs> type data.
    create data dyn_struc type A.
    assign dyn_struc->* to <fs>.
    stat_struc = <fs>.
    Of course, this will only work if dyn_struc was actually created with type A. Otherwise, the last line will cause a runtime error.
    Best regards,
    Erik

  • How can I get Virtual Machine NIC traffic usage data using SCOM 2012 R2 ?

    Hello Guys,
    How can I get Hyper-V 2012 r2 Virtual Machine NIC traffic usage data using SCOM 2012 R2 ?
    Thanks
    NM-BG

    Hi,
    Please refer to the following links:
    Hyper-V Management Pack Extensions 2012 / 2012 R2
    https://hypervmpe2012.codeplex.com/
    System Center Management Pack for Windows Server 2012 R2 Hyper-V
    http://www.microsoft.com/en-us/download/details.aspx?id=40798
    We
    are trying to better understand customer views on social support experience, so your participation in this
    interview project would be greatly appreciated if you have time.
    Thanks for helping make community forums a great place.

  • 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 track repeting record data using BAM in biztalk

    Hi All,
      am new bam, How can How to track repeting record data using BAM in biztalk,please find the below input record
    <ns0:Employee xmlns:ns0="http://BizTalk_.Employee.Schemas.emp_In">
      <Emp>
        <id>122</id>
        <sal>222222222</sal>
        <name>.srinu</name>
        <dept>java</dept>
      </Emp>
       <Emp>
        <id>666</id>
        <sal>44444444</sal>
        <name>.srinu</name>
        <dept>java</dept>
      </Emp>
       <Emp>
        <id>333</id>
        <sal>7777</sal>
        <name>.biztalk</name>
        <dept>C#</dept>
      </Emp>
    </ns0:Invoice>
    am tried using TPE but its showing all the 3 rows as NULL  in bam primary import database.
    So please let know how can i achieve above issue.
    Regards,
    srinivas

    Hi Srinivas,
    Using TPE you cannot process repeating records. It doesn’t allow you to loop through your InvoiceDetails (repeating record), hence it shows null in tracked record. This
    is one of the limitations when you use TPE.
    This can be done using BAM API. If you use Orchestration or by writing a custom pipeline component you can use BAM API where you have the flexibility to loop through the
    repeating record and insert each InvoiceDetails node as a record in your BAM activity. BAM API is the only option to track repeating items inside a message as separate activity instances.
    Refer this MSDN article for more info:http://msdn.microsoft.com/en-us/library/aa559527.aspx
    If this answers your question please mark it accordingly. If this post is helpful, please vote as helpful by clicking the upward arrow mark next to my reply.

Maybe you are looking for