How to Read records from structure to internal table

HI,
Can any body know how to read the records from structure to internal table at runtime.
please give me sample program if possible.
thanks in advance
KP

if your internal table is having the same structure as the structure you are reading the values from then you can directly assign like..
internatable table work area or header line = structure.
or else if they are different assign field by field like
internal table-field1 = structure-field1.
internal table-field2 = structure-field2.
award points if it helps.

Similar Messages

  • How to read data from idoc to internal table?

    Hi
    How to get data from idoc segments to internal table?

    Hi
    Check this ex
    The following coding sample, shows how you may read a MATMAS IDoc and extract the data for the MARA and MARC segments to some internal variables and tables.
    DATA: xmara LIKE mara.
    DATA: tmarc LIKE marc
                OCCURS 0
                WITH HEADER LINE.
    LOOP AT edidd.
       CASE edidd-segnam.
         WHEN 'E1MARAM'.
              MOVE edidd-sdata TO xmara.
         WHEN 'E1MARCM'.
           MOVE edidd-sdata TO tmarc.
              APPEND tmarc.
       ENDCASE.
    ENDLOOP.
    now do something with xmara and tmarc.
    hope this helps you...
    Reward points if useful..
    Regards
    Sreenivas

  • How to read records from Relationship table using ABAP API's

    Hi All,
    I need to retrieve the records from Relationship table. In Java API's I came to know there is an option to retrieve this. I could not find anything in ABAP API's. Is there any option in ABAP API's to do this.
    Please Suggest.
    Thank You,
    Gajendra.

    Hi Gajendra,
    You can mainly read records from MDM (in a DDIC structure) using ABAP API's using the following function modules/methods:
    1. RETRIEVE: This is used to generically retrieve records from tables. Attributes and Values can also be retrieved.
    2. RETRIEVE SIMPLE: Retrieve records from MDM in a simple way.( simple data types).
    3. RETRIEVE CHECKOUT: Retrieves all checked out ID's.
    4. RETRIEVE ATTRIBUTES: Retrieves attribute(s) from a Taxanomy table.
    You will find all these methods in the following interface
    Interface : IF_MDM_CORE_SERVICES
    Hope it helps.
    *Please reward points if found useful.
    Thanks and Regards
    Nitin Jain

  • How to read data from structure RSTXT

    Hi Everyone..
       I have some problem with read data from structure RSTXT.
    I am using transaction code vl02n -> for delivery select <b>Item</b> in item
    overview tab -> Go to -> Item -> text.
    I want display "<b>RSTXT-TXLINE</b>" field in <b>ALV</b> report how it can be possible?
    If anyone knows about it plz reply me with example.
    Thanks in Advance.

    Hi,
    Use FM READ_TEXT
    ( Once on the text, plz display it in plain page mode :
    then > Go To> header : Here you'll get the FM parameters : ID, Object, Name, ... )
    Sample code :
      DATA: BEGIN OF TTLINE OCCURS 0.
              INCLUDE STRUCTURE TLINE.
      DATA: END OF TTLINE.
      CALL FUNCTION 'READ_TEXT'
           EXPORTING
                CLIENT                  = SY-MANDT
                ID                      = L_ID
                LANGUAGE                = L_LANGUE
                NAME                    = L_BL
                OBJECT                  = 'VBBK'
           TABLES
                LINES                   = TTLINE
           EXCEPTIONS
                ID                      = 1
                LANGUAGE                = 2
                NAME                    = 3
                NOT_FOUND               = 4
                OBJECT                  = 5
                REFERENCE_CHECK         = 6
                WRONG_ACCESS_TO_ARCHIVE = 7
                OTHERS                  = 8.
    Regards,
    Erwan

  • How to transfer data from a dynamic internal table

    Hi All
    I want to transfer data from a dynamic internal table<dyn_table>
    to a non dynamic internal table itab which should have the same structure as <dyn_table>.
    How can this be done?
    Regards,
    Harshit Rungta

    As stated earlier this can be done only through field symbols...
    You cannot create an non dynamic internal table with ANY structure...using DATA statement
    If the strucutre is defined well and good...you can create an non-dynamic internal table...
    If you do not know the structure then the internal table has to be dynamic...and to be generated using field symbols
    DATA: lv_ref TYPE REF TO data.
    FIELD-SYMBOLS: <fs_dyn_table> TYPE STANDARD TABLE.
    * You create a dynamic internal table...
    CREATE DATA lv_ref LIKE (your_dynamic_internal_table).
    ASSIGN lv_ref->* TO <fs_dyn_table>.
    Now...do the transfer.
    <fs_dyn_table> = "your_dynamic_internal_Table
    Hope it helps!

  • How to bring data from 3 different internal table to one

    hii all,
              i have 3 internal table ls_mat,which has around 20 fields,it_stpo,which has 3 fields,and it_mast,i need to bring all these 3 table data in one tabel...how do i do...plzz help...

    Hi ,
    Does this internal table have any fields in common in all the three.
    If yes , then loop ls_mat
    Declare a type will all the fields and create a structure and internal table with that type (for ex lx_final and lt_final respectively)
    Loop at ls_mat into lx_mat.
    1.copy all the fields of lx_mat to respective lx_final.
    2.read table it_stpo into lx_stpo with key field = lx_mat-field.
    3.Copy all fields of lx_stpo to respective lx_final.
    4. read table it_mast into lx_mast with key field = lx_mat-field.
    5. copy all fields of lx_mast to respective lx_final.
    6. now append lx_final to lt_final.
    Endloop.
    now you can get all values inside lt_final.
    Regards,
    sivaganesh

  • In SRM How to upload data from Excel to Internal Table

    Hello Experts,
    As seen the Function Module 'ALSM_EXCEL_TO_INTERNAL_TABLE' does not exists in SRM.
    Is there any alternative to upload the data direct from excel to Internal table using any other FM. As seach did't get any relevant FM.
    Please advice..
    Thanks..

    did u try this
    TEXT_CONVERT_XLS_TO_SAP
    in this manner
    CALL FUNCTION 'TEXT_CONVERT_XLS_TO_SAP'
        EXPORTING
          i_line_header              = 'X'
          i_tab_raw_data             = lt_raw
          i_filename                 = p_path
        TABLES
          i_tab_converted_data       = gt_output
        EXCEPTIONS
          conversion_failed          = 1
          OTHERS                     = 2.
    this FM works on DOI
    so
    SAP document about DOI:
    http://help.sap.com/saphelp_nw2004s/helpdata/EN/e9/0be775408e11d1893b0000e8323c4f/frameset.htm
    SAP Demo Program about DOI: SAPRDEMOEXCELINTEGRATION.
    the fm you mentioned works on OLE
    so you could refer,
    SAP document about OLE:
    http://help.sap.com/saphelp_46c/helpdata/EN/59/ae3c98488f11d189490000e829fbbd/frameset.htm
    Also you can refer this post
    Download of SRM Contracts in Excel - Unit of Measurement Missing
    Let me know if this works ..
    Regards
    Manthan.
    Edited by: Manthan_R on Feb 23, 2010 12:18 PM

  • Reading data from XML to Internal table

    Hi Experts,
    I got a requirement to read the data fom xml to internal table.is it possible to store deep internel table data into flat internal tables?my internel table contains 4 internel table and these 4 internel table contains 2 internel tables each...can any one help me o this...
    points will be rewarded...
    Regards,
    Rakhi

    Hi Rakhi,
    * Structure to Get the Client Details as in XML format
      DATA: BEGIN OF client,
              BEGIN OF Personal_Details,
                kunnr like kna1-kunnr,
                name1 like kna1-name1,
                adrnr like kna1-adrnr,
              END OF Personal_Details,
              BEGIN OF Address,
                street like adrc-street,
                city1  like adrc-city1,
              END OF Address,
              BEGIN OF Communication,
                fax_number like adrc-fax_number,
                tel_number like adrc-tel_number,
              END OF Communication,
            END OF client.
      DATA: it_client TYPE TABLE OF client WITH HEADER LINES,
            result LIKE client.
      DATA: xml_string TYPE string.
    *  Get the Client Details into the structure to be made as an XML string
      TRY.
    *  Convert the Structure to XML string
          CALL TRANSFORMATION  ('ID')
            SOURCE para = it_client
            RESULT XML xml_string.
    *  Convert the XML string to structure - result
          CALL TRANSFORMATION  ('ID')
            SOURCE XML xml_string
            RESULT para = result.
      CATCH cx_st_error.
      ENDTRY.
    best regards,
    Thangesh

  • How To Read Field Values Form Dynamic Internal Table

    Hi,
    I Created a dynamic internal table using.
    FIELD-SYMBOLS: <gt_table> TYPE STANDARD TABLE,
                   <wa_gt_table>,
                   <l_fvalue> TYPE ANY.
    This Interanl table is working well, and all values are populated to an ALV.
    Now I try to set a link
    for that I am using below code
          READ TABLE <gt_table> ASSIGNING <l_fvalue> index rs_selfield-tabindex.
          IF sy-subrc EQ 0.
            insplot = <l_fvalue>-prueflos.
    Now it is showing a syntax error :
    the data object <l_fvalue> has no structure and there for no component called prueflos
    Regards
    Nausal

    Hi,
    Refere following code
    Local Field Symbol
      FIELD-SYMBOLS: <lf_any> TYPE ANY.                     "Changed data
      LOOP AT <gf_dyna_table> ASSIGNING <gf_dyna>.
        DO.
          ASSIGN COMPONENT sy-index OF STRUCTURE <gf_dyna> TO <lf_any>.
          IF sy-subrc NE 0.
            EXIT.
          ENDIF.
          IF ls_attach-line IS INITIAL.
            ls_attach-line = <lf_any>.
          ELSE.
            CONCATENATE ls_attach-line <lf_any> INTO ls_attach-line
                                                SEPARATED BY lc_tab.
          ENDIF.
        ENDDO.
        CONCATENATE lc_cret ls_attach-line  INTO ls_attach-line.
      Append Changed Data to attachement table
        APPEND ls_attach TO gt_attach.
      Clear
        CLEAR : ls_attach.
      ENDLOOP.
    Regards,
    Prashant

  • How to pass data from list to internal table

    Sir,
    Please tell me how to pass data from list display to internal table. Some fields in the list display are input fields .These are added at run time and these added values should be stored in the internal table

    Follow this code sample:
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
       EXPORTING
        I_CALLBACK_PROGRAM                = W_REPID
        I_CALLBACK_PF_STATUS_SET          = 'PF_STATUS'
        I_CALLBACK_USER_COMMAND           = 'USER_COMMAND'
    FORM USER_COMMAND USING P_UCOMM TYPE SY-UCOMM
                            P_SELFLD TYPE SLIS_SELFIELD.
    case p_ucomm.
    when '<Some user Action>'.
      Data ref1 type ref to cl_gui_alv_grid.
    CALL FUNCTION 'GET_GLOBALS_FROM_SLVC_FULLSCR'
    IMPORTING
    E_GRID = ref1.
    call method ref1->check_changed_data
    * Your internal table will have the data
    endcase.
    ENDFORM.
    Regards,
    Ravi

  • Read statement from 2 different internal table.

    Hello,
    I am new to ABAP and try to work out these statements. Please can someone help me in correcting the code.
    Requirement is
    1. I have Sales Header Table
    2. Sales Item Table.
    Both the above table has Doc_number as the key filed and both has CREATEDON date . While reading the Data from SALES ITem table i have copy the CREATEON Date from SAles Header Table.
    For the above requirment i have used the following code which is going for unending loop.
    Tables: /BIC/ASALHDR0100,/BIC/ASALORD0100.
    DATA: CHDATE like /BIC/ASALHDR0100 occurs 0 with header line,
          WA_CHDATE type /BIC/ASALHDR0100,
          CiDATE like /BIC/ASALORD0100 occurs 0 with header line,
          WA_CiDATE type /BIC/ASALORd0100.
          SELECT * from /BIC/ASALORD0100 into table CIDATE.
          select * from /BIC/ASALHDR0100 into CHDATE for all entries in CIDATE where DOC_NUMBER = CIDATE-DOC_NUMBER.
    Append CHDATE.
          endselect.
    loop at CHDATE INTO WA_CHDATE.
        LOOP at CIDATE into WA_CIDATE.
        if WA_CHDATE-DOC_NUMBER = WA_CIDATE-DOC_NUMBER.
    Read table CHDATE into WA_CHDATE with KEY doc_number = WA_CIDATE-doc_number .
              write: WA_CHDATE-DOC_NUMBER,
                      WA_chdate-createdon,
                     WA_CIDATE-DOC_NUMBER.
                     ENDIF.
                     ENDLOOP.
              endloop.
    Thanks
    Edited by: Rob Burbank on Jul 26, 2010 9:34 AM

    HI,
    try thsi code.
    TABLES: /bic/asalhdr0100,/bic/asalord0100.
    DATA: chdate LIKE /bic/asalhdr0100 OCCURS 0 WITH HEADER LINE,
    wa_chdate TYPE /bic/asalhdr0100,
    cidate LIKE /bic/asalord0100 OCCURS 0 WITH HEADER LINE,
    wa_cidate TYPE /bic/asalord0100.
    SELECT * FROM /bic/asalord0100 INTO TABLE cidate.
    SELECT * FROM /bic/asalhdr0100 INTO TABLE chdate FOR ALL ENTRIES IN cidate WHERE doc_number = cidate-doc_number.
    LOOP AT chdate INTO wa_chdate.
      LOOP AT cidate INTO wa_cidate.
        IF wa_chdate-doc_number = wa_cidate-doc_number.
          READ TABLE chdate INTO wa_chdate WITH KEY doc_number = wa_cidate-doc_number .
          WRITE: wa_chdate-doc_number,
          wa_chdate-createdon,
          wa_cidate-doc_number.
        ENDIF.
      ENDLOOP.
    ENDLOOP.
    Regards,
    Pravin

  • Oracle DB: How to read data from a corrupted database table.

    Hi All,
    Wanted to know if there is a way I could read data from a corrupted Oracle database table?
    Are there any tools that I can use? Or does Oracle provides any mechanism to do that?
    Any pointers in this regard would be helpful.
    Thanks in Advance.

    user10600611 wrote:
    Table shows inconsistent data.You are going to have to be more specific. Inconsistent in what sense? A correct data model should not allow for inconsistencies to crop up.
    However, you may be able to use one of the many FLASHBACK features of Oracle to look at the table at a prior point in time before the corruption.
    HTH!

  • How to read records from Database view

    Hi folks,
    well...let me know, y im getting error as : V_T52EL is not defined in the ABAP dictionary as Table , Projection view or Database view.
    But actually here this View Type is : Maitenance View.
      SELECT  KOART
        from   V_T52EL
        where ENDDA  GE SY-DATUM AND
                 SYMKO  EQ T030-BWMOD.
    plz let me know..guys.
    Regards,
    Kumar

    Hello,
    Maitenace View reocird can be viewed only through Tcode SM30
    Vasanth

  • How to read data from field symbol containing Table

    I defined a field symbols for reading output of a BRF plus rule however since fielk symbol is of type any
    I cannot read its contents
    Any inputs are highly appreciated
    Please see attachment explaining problem

    Thanks a lot for your help
    However It did not work for me as it started giving error incompatible types
    Here is my code
    constants:lv_function_id type if_fdt_types=>id value '3440B5B078B21EE3BC9EB53C42F84A45'.
    data:lv_timestamp type timestamp,
          lt_name_value type abap_parmbind_tab,
          ls_name_value type abap_parmbind,
          lr_data type ref to data,
          lv_counter type i value 0,
          lr_target type ref to data,
          lx_fdt type ref to cx_fdt,
          lo_trace type ref to if_fdt_trace,
          lo_lean_trace type ref to if_fdt_lean_trace,
          la_z_string type if_fdt_types=>element_text,
          lv_role_name  type grac_role_name,
          lv_result type string.
    field-symbols <la_any> type any.
    field-symbols <role_name> type grac_s_od_role_detail.
    field-symbols <system> type string.
       types:
        begin of ys_access ,
                  role_name type  string,
                  system_name   type string,
                end of ys_access .
      types:
        yt_access type table of ys_access .
    field-symbols: <access_item> type table,
                    <ls_req_access> type ys_access.
    data con_name type if_fdt_types=>element_text.
    data ls_any type ys_access.
    * All method calls within one processing cycle calling the same function must use the same timestamp.
    * For subsequent calls of the same function, we recommend to use the same timestamp for all calls.
    * This is to improve the system performance.
    * If you are using structures or tables without DDIC binding, you have to declare the respective types
    * by yourself. Insert the according data type at the respective source code line.
    * GET TIME STAMP FIELD lv_timestamp.
    * Process a function and record trace data, passing context data objects via a name/value table.
    * Prepare function processing:
    ls_name_value-name = 'Z_STRING'.
    la_z_string = 'P1'.
    get reference of la_z_string into lr_data.
    ls_name_value-value = lr_data.
    insert ls_name_value into table lt_name_value.
    * Create the data to store the result value after processing the function
    * You can skip the following call, if you already have
    * a variable for the result. Please replace also the parameter
    * EA_RESULT in the method call CL_FDT_FUNCTION_PROCESS=>PROCESS
    * with the desired variable.
      cl_fdt_function_process=>get_data_object_reference( exporting iv_function_id      = lv_function_id
                                                                    iv_data_object      = '_V_RESULT'
                                                                    iv_timestamp        = lv_timestamp
                                                                    iv_trace_generation = abap_true
                                                          importing er_data             = lr_data ).
      assign lr_data->* to <la_any>.
      try.
          cl_fdt_function_process=>process( exporting iv_function_id = lv_function_id
                                                      iv_timestamp   = lv_timestamp
                                                      iv_trace_mode  = if_fdt_constants=>gc_trace_mode_lean
                                                     "iv_trace_mode  = if_fdt_constants=>gc_trace_mode_lean_required
                                            importing ea_result      = <la_any>
                                                      eo_trace       = lo_trace
                                            changing  ct_name_value  = lt_name_value ).
          lo_lean_trace ?= lo_trace.
          lo_lean_trace->save( ).
          catch cx_fdt into lx_fdt.
    * You can check CX_FDT->MT_MESSAGE for error handling.
      endtry.
    * Get context values after processing:
      cl_fdt_function_process=>get_context_value( exporting  iv_function_id = lv_function_id
                                                             iv_trace_generation = abap_true
                                                             iv_timestamp   = lv_timestamp:
                                                             iv_data_object = '3440B5B078B21EE3BC9EFF599C110ADD' "Z_STRING
                                                   importing ev_data             = lv_result ). " Suggested variable: la_z_string
      create data lr_target type grac_s_od_role_detail.
    *  assign <la_any> to <role_name>.
      assign lr_target->* to <la_any>.
       loop at lt_name_value into ls_name_value.
        if ls_name_value-name cs 'RESULT'.
          assign ls_name_value-value  to <la_any>.
            ls_any = ls_name_value-value  .
        endif.
        endloop.
        access_item = <la_any>.
    * assign ( )<la_any> to <access_item>.
    * assign component 1 of structure <la_any> to <rolename>.
    *   assign <la_any> to <ls_req_access>.
    * lr_target = <la_any>.
    * assign lr_target->* to <role_name>.
    * lv_role_name = <role_name>.
      lv_result = lv_result.

  • How to update Records from Internal table to u2018Zu2019 table?

    Hi Friends,
    How to update Records from Internal table to u2018Zu2019 table.
    I have records in Internal table , that records want to update on u2018Zmarau2019 Table.
    ( my internal table & u2018 Zu2019 table structures are same.)
    Thanking you.
    Regards,
    Subash

    Hi,
    loop at internal table.
    modify <Z- table > from values < internal table Workarea>.
    if sy-subrc = 0.
      COMMIT work.
    else.
      ROLLBACK waork.
    endif.
    endloop.
    or
    UPDATE <Z- table > from table < internal table Workarea>.
    if sy-subrc = 0.
      COMMIT work.
    else.
      ROLLBACK waork.
    endif.
    Prabhudas

Maybe you are looking for

  • Radeon HD 8750m switchable graphics driver BY HP is not working on Windows 8.1

    Hello all, I have  laptop Envy 6-1200el. It's a good machin but I have always been annoyed by video drivers trouble. When I bought my PC last year it worked good when we had Windows 8, but the video drivers didn't work properly already there. The dri

  • Updated to Quick Time 7 Pro but Can't view trailers

    I updated to Quick Time 7 Pro and every thing looks ok when Quick Time is opened. But when I try to view movie trailers on this website it continues to tell me that I need to download Quick Time. Help.

  • Terminating JVM

    Hi, Im not sure if what I am thinking can be done, please bear with me... I have two Java program A and B (I would rather not change the source for B as its a proven app), program A instantiates B through using Runtime.exec(). However program B also

  • How to know active sessions logged in by same database users

    This is 10g. I need to query list of DB users who have logged in using the same database user accounts. How can I achieve this? This is on 10g and 9i

  • Control key details

    Dear All, Please explain me the different control key meanings?? and in which scenarios all should be used?? PM01 Plant maintenance - internal PM02 Plant maintenance - external PM03 Plant maintenance - external (services) PM05 Plant maintenance - int