Moving data into internal table without header line

Hello experts.
i have two internal tables . itab1 without headerline and itab2 with headerline. itab1 has 10 fields and itab2 has 2 fields.
BEGIN OF itab,
        lifnr LIKE lfa1-lifnr,
        ktokk LIKE lfa1-ktokk,
        name1 LIKE lfa1-name1,
        sortl LIKE lfa1-sortl,
        pstlz LIKE lfa1-pstlz,
        ort01 LIKE lfa1-ort01,
        land1 LIKE lfa1-land1,
       j_1ipanno LIKE j_1imovend,
end of itab.
DATA: itab1 TYPE STANDARD TABLE OF itab.
data: begin of itab2 occurs 0,                             
      lifnr like j_1imovend-lifnr,
      j_1ipanno like j_1imovend-j_1ipanno,
  end of itab2.
now i want to move the data from itab2-j_1ipanno into itab1-j_1ipanno. so pls tell me how to do that. lifnr in both the tables are the same.
thanks for all the replies.

Hi Shiva,
In with out header line,
You declare header line & body separately like
data: IT_MARA type standard table of MARA,
WA_MARA like line of IT_MARA.
Advantages:
1. Clear differentiation of header line over body
2. It is must in the ABAP Objects to have separate header line & body
3. Use ful in Nested Internal tables
Disadvantages:
1. Long syntax
for example: Loop at IT_MARA into WA_MARA.
In with header line
Data ITAB like MARA occurs 0 with header line.
Advantages:
1. Simple to use & declare over without header line.
Also,
With Header line:
codedata : itab like <dbtable> occurs 0 with header line.
Data: begin of itab occurs 0,
f1 type f1,
f2 type f2,
end of itab.[/code]
Without Header line.
codeTypes: begin of ty_tab,
f1 type f1,
f2 type f2,
end of ty_tab.
Data: itab type table of ty_tab, " Internal Table
wa type ty_tab. " Work Area[/code]
at any point of time use internal table without header line,it will be good performance as well OO ABAP will allow only internal table without header line.
Just use one simple example :
create one simple program with header line,use get run time field.
create one simple program without header line,use get run time field.
see the results ,here time will be micro seconds,so take 1000 records to internal table and do calculate the time.
While adding or retrieving records to / from internal table we have to keep the record temporarily.
The area where this record is kept is called as work area for the internal table. The area must have the same structure as that of internal table. An internal table consists of a body and an optional header line.
Header line is a implicit work area for the internal table. It depends on how the internal table is declared that the itab will have the header line or not.
e.g.
data: begin of itab occurs 10,
ab type c,
cd type i,
end of itab. " this table will have the header line.
data: wa_itab like itab. " explicit work area for itab
data: itab1 like itab occurs 10. " table is without header line.
The header line is a field string with the same structure as a row of the body, but it can only hold a single row.
It is a buffer used to hold each record before it is added or each record as it is retrieved from the internal table. It is the default work area for the internal table.
kindly reward if found helpful.
cheers,
Hema.

Similar Messages

  • Copying the data into internal table without internal table

    Hello experts.
    i have two internal tables . itab1 without headerline and itab2 with headerline. itab1 has 10 fields and itab2 has 2 fields.
    BEGIN OF itab,
    lifnr LIKE lfa1-lifnr,
    ktokk LIKE lfa1-ktokk,
    name1 LIKE lfa1-name1,
    sortl LIKE lfa1-sortl,
    pstlz LIKE lfa1-pstlz,
    ort01 LIKE lfa1-ort01,
    land1 LIKE lfa1-land1,
    j_1ipanno LIKE j_1imovend-panno,
    end of itab.
    DATA: itab1 TYPE STANDARD TABLE OF itab.
    data: begin of itab2 occurs 0,
    lifnr like j_1imovend-lifnr,
    j_1ipanno like j_1imovend-j_1ipanno,
    end of itab2.
    now i want to move the data from itab2-j_1ipanno into itab1-j_1ipanno.
    Both the tables ie itab1 and itab2 has lifnr data in them .
    so in itab2 j_1ipanno has pan number for the lifnr( vendors) so i need to populate this pannumbers in itab1 also by comparing
    the lifnrs in two tables. where ever the lifnr of itab2 is equal to itab1-lifnr then this pannumber should be placed there. 
    so pls tell me how to do that. lifnr in both the tables are the same.
    thanks for all the replies.

    Hi Shiva,
                Try this one..
    data: begin of itab.
       lifnr LIKE lfa1-lifnr,
        ktokk LIKE lfa1-ktokk,
    name1 LIKE lfa1-name1,
    sortl LIKE lfa1-sortl,
    pstlz LIKE lfa1-pstlz,
    ort01 LIKE lfa1-ort01,
    land1 LIKE lfa1-land1,
    j_1ipanno LIKE j_1imovend-panno,
    end of itab.
    data: wa like line of itab1.
    data: begin of itab occurs 0,
            lifnr like j_1imovend-lifnr,
            j_1ipanno like j_1imovend-j_1ipanno,
    end of itab2.
    data: wa1 like line of itab2.
    loop at itab1 into wa.
    itab2-lifnr = wa-lifnr.
    itab2-j_1ipanno = wa-j_1ipanno
    append itab2.
    endloop.
    Reward points if helpful.
    Kiran Kumar.G.A
            Have a Nice Day..

  • How to create an internal table with header line in smartforms

    Hello Guys,
    I need to append the data in my internal table in smartforms by the problem is an error occurred "a table without header line  and therefore no component called tdline"
    i already declared the data under types declaration tab
    types : begin of ts_tline,
             TDFORMAT type tdformat,
             tdline type tdline,
            end of ts_tline.
    types : it_tline type table of ts_tline.
    and declare these in global data
    WA_TLINE type TS_TLINE
    XT_TLINE type IT_TLINE
    my syntax in program lines :
      LOOP AT  gy_lines INTO WA_PROJ.
        SPLIT wa_proj AT  cl_abap_char_utilities=>cr_lf
           INTO table IT_SPLIT.
        LOOP AT IT_SPLIT.
          MOVE it_split-commentext TO xt_TLINE-tdline.
    an error occured at this part ****
         append xt_TLINE.
        ENDLOOP.
      ENDLOOP.
    what is wrong with my code..it cannot append data to xt_tline.
    Please help.Will reward points
    Thanks in advance
    aVaDuDz

    check this link
    this will help u......
    http://www.****************/Tutorials/Smartforms/SFMain.htm
    reward IF..........
    regards
    Anbu

  • Moving data from internal table to Dynamic internal table

    Hello All,
      I am facing a problem i moving the data from a internal table data to Dyn. internal table.
    My code is as follows
    *******Declartion**************************************
    DATA: IT_FIELDCAT TYPE LVC_T_FCAT,
          IS_FIELDCAT LIKE LINE OF IT_FIELDCAT.
    DATA: IT_OUTTAB TYPE STANDARD TABLE OF ZVTEST.
    DATA: WA_OUTTAB TYPE  ZVTEST.
    DATA: LV_LINE LIKE SY-TABIX,
           COUNT TYPE I.
    FIELD-SYMBOLS: <NEW_TABLE> TYPE REF TO DATA.
    FIELD-SYMBOLS: <L_TABLE> TYPE ANY TABLE,
                   <L_LINE> TYPE ANY.
    FIELD-SYMBOLS: <L_FIELD> TYPE ANY.
    FIELD-SYMBOLS: <FS_DATA> TYPE REF TO DATA,
                   <FS_1> TYPE ANY TABLE,
                   <FS_2>,
                   <FS_3>.
    DATA: NEW_LINE TYPE REF TO DATA.
    DATA: LT_DATA TYPE REF TO DATA.
      ASSIGN LT_DATA TO <FS_DATA>.
    Create a new Table
      CALL METHOD CL_ALV_TABLE_CREATE=>CREATE_DYNAMIC_TABLE
      EXPORTING
            IT_FIELDCATALOG = IT_FIELDCAT
      IMPORTING
            EP_TABLE = <FS_DATA>
      EXCEPTIONS
          GENERATE_SUBPOOL_DIR_FULL = 1
          OTHERS                    = 2.
      IF SY-SUBRC = 0.
        ASSIGN <FS_DATA>->* TO <FS_1>.
        CREATE DATA NEW_LINE LIKE LINE OF <FS_1>.
    A field-symbol to access that work area
        ASSIGN NEW_LINE->*  TO <FS_2>.
      LOOP AT IT_OUTTAB INTO WA_OUTTAB.
        MOVE-CORRESPONDING WA_OUTTAB TO <FS_1>.
      ENDLoop.
    But when I am using MOVE-CORRESPONDING WA_OUTTAB TO <FS_1>.
    I am getting the error like
    "<FS_1>" is not a structure or internal table with header line.          
    Please check the code and tell where I am making the mistake.
    Regards,
    Vasanth

    Hello Rich ,
    My is code is as below..
    Declaration:
    DATA: IT_FIELDCAT TYPE LVC_T_FCAT,
          IS_FIELDCAT LIKE LINE OF IT_FIELDCAT.
    DATA: BEGIN OF IT_OUTTAB OCCURS 0,
            PSPID     LIKE PROJ-PSPID, "Projektdefinition
            POSID     LIKE PRPS-POSID, "PSP-Element
            POST1     LIKE PRPS-POST1, "Kurzbeschreibung
            STTXT_INT LIKE CNJ_STAT-STTXT_INT, "Systemstatus
            STTXT_EXT LIKE CNJ_STAT-STTXT_EXT, "Anwenderstatus
          END OF IT_OUTTAB.
    DATA: WA_OUTTAB LIKE IT_OUTTAB.
    DATA: LV_LINES LIKE SY-TABIX,
           COUNT TYPE I.
    FIELD-SYMBOLS:  type any.
    DATA: NEW_LINE TYPE REF TO DATA.
    DATA: LT_DATA TYPE REF TO DATA.
      G_R_DISP_VARIANT-REPORT = SY-REPID.
      G_R_DISP_VARIANT-VARIANT = PA_VAR.
      CALL FUNCTION 'REUSE_ALV_VARIANT_SELECT'
           EXPORTING
                I_DIALOG            = 'N'
                I_USER_SPECIFIC     = 'A'
                I_DEFAULT           = 'X'
                IT_DEFAULT_FIELDCAT = G_T_FIELDCAT
                I_LAYOUT            = G_R_LAYOUT
           IMPORTING
                ET_FIELDCAT         = G_T_FIELDCAT
               et_sort             = l_tab_sort
               et_filter           = l_tab_filter
               ES_LAYOUT           = G_R_LAYOUT
           CHANGING
                CS_VARIANT          = G_R_DISP_VARIANT
           EXCEPTIONS
                ERROR_MESSAGE       = 4
                OTHERS              = 4.
      LOOP AT G_T_FIELDCAT INTO G_R_FIELDCAT WHERE NO_OUT IS INITIAL
                                               AND TECH IS INITIAL.
        MOVE-CORRESPONDING G_R_FIELDCAT TO IS_FIELDCAT.
        IS_FIELDCAT-FIELDNAME = G_R_FIELDCAT-FIELDNAME.
        IS_FIELDCAT-INTTYPE   = G_R_FIELDCAT-INTTYPE.
        IS_FIELDCAT-OUTPUTLEN = G_R_FIELDCAT-OUTPUTLEN.
        IS_FIELDCAT-REF_FIELD = G_R_FIELDCAT-FIELDNAME.
        IS_FIELDCAT-REF_TABLE = G_R_FIELDCAT-REF_TABNAME.
        APPEND IS_FIELDCAT TO IT_FIELDCAT.
      ENDLOOP.
      DATA: WA_LISTE LIKE P_T_LISTE.
      CLEAR:IT_OUTTAB.
      REFRESH: IT_OUTTAB.
      LOOP AT P_T_LISTE INTO WA_LISTE.
        WA_OUTTAB-PSPID = WA_LISTE-PSPID .
        WA_OUTTAB-POSID = WA_LISTE-POSID.
        WA_OUTTAB-POST1 = WA_LISTE-POST1.
        WA_OUTTAB-STTXT_INT = WA_LISTE-STTXT_INT.
        WA_OUTTAB-STTXT_EXT = WA_LISTE-STTXT_EXT.
        APPEND WA_OUTTAB TO IT_OUTTAB.
      ENDLOOP.
    **dynamic table creation for data
      ASSIGN LT_DATA TO .
    Create a new Table
      CALL METHOD CL_ALV_TABLE_CREATE=>CREATE_DYNAMIC_TABLE
      EXPORTING
            IT_FIELDCATALOG = IT_FIELDCAT
      IMPORTING
            EP_TABLE = .
    A field-symbol to access that work area
        ASSIGN NEW_LINE->*  TO  = WA_OUTTAB-PSPID.
         ASSIGN COMPONENT 'POSID' OF STRUCTURE WA_OUTTAB TO <FS_3>.
          ASSIGN COMPONENT 'POSID' OF STRUCTURE  = WA_OUTTAB-POSID.
         ASSIGN COMPONENT 'POST1' OF STRUCTURE WA_OUTTAB TO <FS_3>.
          ASSIGN COMPONENT 'POST1' OF STRUCTURE .
         <FS_5> = <FS_3>.
           = WA_OUTTAB-POST1.
         ASSIGN COMPONENT 'STTXT_INT' OF STRUCTURE WA_OUTTAB TO <FS_3>.
          ASSIGN COMPONENT 'STTXT_INT' OF STRUCTURE  TO P_FILE.
        ENDLOOP.
      ELSE.
        MESSAGE E041(S9) WITH P_FILE.
      ENDIF.
      CLOSE DATASET P_FILE.
    Here my problem is ´´, I am not able to use move corresponding statement.
    So I am not getting the exact values to the fields of the dynamic table...
    Please check it and give me a solution,
    Regards,
    Vasanth

  • BADI cant use an internal table with header line

    hi,
         In BADI, we cant use an internal table with header line, and I am calling a function module which requires internal table as import parameter, now, the table I am passing is without a header line, So how to solve this problem ?

    You can use a type and then create an internal table of that type.
    types :
    begin of t_<example>
    *field list
    end of t_<example>
    data :
    gt_<table> type standard table of t_<example>
    pass this to the FM

  • Char data into internal table.

    Hi all,
    I will get data from the FTP (.TXT file) through FTP_SERVER_TO_R3.
    in chardata with separater Tab delimited.
    here i took one field symbol and assigning the data into internal table.
    till here every thing is ok.
    My problem is one data type is 13 char, if that field is more than 13 char in the file
    it is giving DUMP. (DUMP is OVERFLOW Field 999976767878.22)
    TYPES : BEGIN OF X_STRING,
                       LINE(150) TYPE STRING,
                  END OF X_STRING.
    data : IT_STRING TYPE STANDARD TABLE OF X_STRING,
              WA_STRING TYPE X_STRING.
                          FIELD-SYMBOLS : <fs> TYPE ANY.
                        LOOP AT chardata INTO wa_chardata.
                          REFRESH it_string.
                          SPLIT wa_chardataline AT cl_abap_char_utilities=>horizontal_tab INTO TABLE it_string.
                          LOOP AT it_string INTO wa_string FROM 1 TO 29.
                            ASSIGN COMPONENT sy-tabix OF STRUCTURE wa_data TO <fs>.
                            <fs> = wa_string-field1.
                            UNASSIGN <fs>.
                          ENDLOOP.
                          APPEND wa_data TO it_data.
                          CLEAR wa_data.
                        ENDLOOP.
    Please give me solution to over come this.
    Regards,
    Sri

    In Statement ASSIGN COMPONENT sy-tabix OF STRUCTURE wa_data TO <fs>.
    insted of using SY-TABIX  use the actual field name of the structre wa_data .
    Use a RTTS Method to get all the fields of the structre WA_DATA and then loop at all the fields and then manuplate teh that which has been splitted...!
    Hope it helps it will not cause any over flow..and ...( Try to condence the The splitted dat use condence addition while moveing the data to wa_data it will avoide the leading and trailing spaces.... )
    Edited by: Anup Deshmukh on Jun 17, 2010 8:31 AM

  • Extract the classification data into internal table

    Hi all,
    I having requirement to extract classification data for material number.
    1) Provide the selection option for material number (MATNR).
    2) Based on the material number, then extract all that data into internal table as below layout. My problem is how to retrieve the following data from different table based on the MATNR (material number).
    Please provide the sample code for select the following data. Thanks.
    Classification table
    OBJEK  (from AUSP table)
    MAFID (from AUSP table)
    KLART (from AUSP table)
    CLASS  (from KLAH table)
    ATWRT (from AUSP table)
    MSEHI  (from CABN table)
    OBTAB (check if class type=002, set it as “MARA”)
    STDCL (from KSSK table)

    Hi,
    if I understand, you´re trying to get information from the classification system for the material. You can use the following code:
    DATA: clases LIKE TABLE OF sclass WITH HEADER LINE,
          datos LIKE TABLE OF clobjdat WITH HEADER LINE.
    CALL FUNCTION 'CLAF_CLASSIFICATION_OF_OBJECTS'
         EXPORTING
              class              = 'DESK'               "clase a buscar
              classtype          = '001'                "tipo de la clase
              features           = 'X'
              language           = sy-langu
              object             = 'PM00A000C055'       "Material
              objecttable        = 'MARA'
              key_date           = sy-datum
              initial_charact    = 'X'
              change_service_clf = 'X'
         TABLES
              t_class            = clases
              t_objectdata       = datos
         EXCEPTIONS
              no_classification  = 1
              no_classtypes      = 2
              invalid_class_type = 3
              OTHERS             = 4.
    loop at datos.
    endloop.

  • Upload excel data into Internal table

    Hi,
    I'm trying to upload excel data into internal table, well the excel file layout will be different on each run of the report.
    Excel file will have 60 columns and 500 record limit. I can upload the excel data using 'ALSM_EXCEL_TO_INTERNAL_TABLE' and 'KCD_EXCEL_OLE_TO_INT_CONVERT' but the output table is generates 60 lines for each record i.e.., 60 * 500 = 30,000 which could cause performance.
    I try with the FM 'TEXT_CONVERT_XLS_TO_SAP', but this will only work if the file structure is static. It didn't work for dynamic file layout. Even GUI_UPLOAD doesn't work to upload excel file, it will work if I convert the file to Tab delimited file.
    Please advise if you know any alternate procedure to upload excel data into internal table.
    Thanks,
    Kumar.

    Moderator message - Cross post locked
    Rob

  • Problem in collecting Spool data into internal table

    Hi ,
    i need to download  spool request data into internal table,
    after collecting i need to loop it and delete some records,
    for this i am using  Fm  RSPO_RETURN_ABAP_SPOOLJOB
    but getting some extra spaces and lines,unable to get right format.
    please help me in this issue to prepare internal table like normal internal table with spool id.
    Regards
    sarath

    Hi ,
    Thanks for the reply,
    My requirement is like i need to collect all the records from the spool to Internal table and
    after that based on one field in the internal table i have to separate error records by deleting sucess records from that internal table(from spool),
    for that i have to loop the internal table and need to count the error records, after that download to excel and mail functionalities
    required for that .
    so please help me in this.
    Regards
    sarath

  • Getting error of Defining an internal table with header line, SELECT-OPTIO

    Hi all,
    i have a coding for my smart form,In this coding i have define an structure which being used,but when i execute it it give me
    error of Defining an internal table with header line, SELECT-OPTIONS, and RANGES is not allowed within a structure.Even tough you can see that in  my coding im not using SELECT-OPTION or RANGES,but can't understand why it gives me this error.
    Following are the code:
      DATA: BEGIN OF traptab OCCURS 50.
            INCLUDE STRUCTURE mseg.
      DATA: vgart LIKE mkpf-vgart,
            blart LIKE mkpf-blart,
            blaum LIKE mkpf-blaum,
            bldat LIKE mkpf-bldat,
            budat LIKE mkpf-budat,
            cpudt LIKE mkpf-cpudt,
            cputm LIKE mkpf-cputm,
            aedat LIKE mkpf-aedat,
            usnam LIKE mkpf-usnam,
            tcode LIKE mkpf-tcode,
            xblnr LIKE mkpf-xblnr,
            bktxt LIKE mkpf-bktxt,
            frath LIKE mkpf-frath,
            frbnr LIKE mkpf-frbnr,
            wever LIKE mkpf-wever,
          END OF traptab. 
    Thanks & Regards,
    sappk25

    thanks

  • Dynamicly creating an internal table with header line

    Hi experts,
    I am trying to do a read on an internal table using field symbols of type any table. To be able to read more than one row at once, I'd like to read it into another internal table (instead of just one line and instead of looping through them one by one).
    So far the following line rendered an error that the target internal table doesn't have a header line
    read table <fs_v_tab> WITH KEY (<fs_comp>) = <fs_param>-low INTO <fs_v_tab>.
    (also attempted using "<fs_v_tab>->*" & "<fs_v_tab>[]" to be silly)
    Based on the following article, I was wondering if it were possible to dynamicly create an internal table with header line.
    [http://help-abap.blogspot.com/2008/09/dynamic-internal-table-creation.html|http://help-abap.blogspot.com/2008/09/dynamic-internal-table-creation.html]
    Any help or tips on how to dynamicly filter an internal table field-symbol is greatly appreciated!

    Just read the online help:
    This statement reads a row from internal table itab.
    Or more exact:
    This statement reads one row from internal table itab.
    Therefore you can not read multiple lines into another table. The header line is needed to put the result in. And this is not what you intended, the result will be in the header line, not in the table itself.
    If the row to be read is not uniquely specified, the first suitable row is read. In the case of index tables, this row has the lowest table index of all matching rows.
    At least you have to do what you dont wanna do: looping.

  • Dynamic Creation of Internal table WITH HEADER LINE

    Dear,
    Please show me the way of creating Internal table WITH HEADER LINE dynamically..
    Thanks,
    Nirav

    <font color='blue'>Hi Parekh,
    Have a look at the sample program for Dynamic internal table
    This program has been developed to update any table data in the dictionary. We give table name and File name as Input fields.
    <pre>
    REPORT znpmmm0201.
    *Types
    TYPES:
          BEGIN OF ty_file,
            data(4096) TYPE c,
          END OF ty_file.
    *Type-pools
    TYPE-POOLS:
          truxs.
    *Work areas
    DATA:
          wa_file      TYPE ty_file.
    *Internal tables
    DATA:
          it_file      TYPE STANDARD TABLE OF ty_file,
          it_data      TYPE truxs_t_text_data.
    DATA:
          gv_dref TYPE REF TO data,
          file_name TYPE string.
    *FIELD-SYMBOLS
    FIELD-SYMBOLS:
                   <gf_itab> TYPE STANDARD TABLE,
                   <wa>      TYPE ANY.
    *& Selection-screen
    PARAMETERS:
          p_table TYPE rsrd1-tbma_val,
          p_file  TYPE ibipparms-path.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.
      PERFORM f4_for_p_file CHANGING file_name .
    *& START-OF-SELECTION
    START-OF-SELECTION.
      CREATE DATA gv_dref TYPE TABLE OF (p_table).
      ASSIGN gv_dref->* TO <gf_itab>.
      PERFORM upload_data USING file_name.
      MODIFY (p_table) FROM TABLE <gf_itab>.
    *&      Form  UPLOAD_DATA
    FORM upload_data USING file.
      CALL FUNCTION 'GUI_UPLOAD'
        EXPORTING
          filename                = file
          filetype                = 'ASC'
        TABLES
          data_tab                = it_file.
      APPEND LINES OF it_file TO it_data.
      CLASS cl_abap_char_utilities DEFINITION LOAD.
      DATA: l_field_seperator.
      l_field_seperator = cl_abap_char_utilities=>horizontal_tab.
      REPLACE ALL OCCURRENCES OF '|' IN TABLE it_data WITH l_field_seperator.
      CALL FUNCTION 'TEXT_CONVERT_TEX_TO_SAP'
        EXPORTING
          i_field_seperator    = l_field_seperator
          i_tab_raw_data       = it_data
        TABLES
          i_tab_converted_data = <gf_itab>.
    ENDFORM.                    " UPLOAD_DATA
    *&      Form  F4_FOR_p_file
    FORM f4_for_p_file CHANGING file.
      DATA:
            l_field_name LIKE  dynpread-fieldname VALUE 'P_FILE'.
      CALL FUNCTION 'F4_FILENAME'
        EXPORTING
          program_name  = syst-cprog
          dynpro_number = syst-dynnr
          field_name    = l_field_name
        IMPORTING
          file_name     = p_file.
      file = p_file.
    ENDFORM.                    " F4_FOR_p_file </pre>
    Thanks,
    Venkat.O</font>

  • How to load text data into internal table

    I have a text file to load txt data into internal table. So how to read text data with validation and to load all text data into the internal table?
    Say this is the text file:
    IO_NAME, IO_TYPE, IO_SHTXT, IO_LONGTEXT, DATATYPE, DATA LENGTH
    ZIO_TEST1, CHA,      IO TEST1,      IO TEST 1,        CHAR,         20
    ZIO_TEST2, CHA,      IO TEST2,      IO TEST 2,        CHAR,         20
    Regards,
    Mau

    Hi,
    U can use GUI_UPLOAD for this...
    Declare an internal table like
    data: begin of itab occurs 0,
    string(1200),
    end of itab.
    check the sample code:
    cange as you need
    DATA: DATEI_PC TYPE STRING VALUE 'C:\MATNR.TXT'.
    DATA: BEGIN OF ITAB occurs 0,
    TXT(1024),
    END OF ITAB.
    CALL METHOD CL_GUI_FRONTEND_SERVICES=>GUI_UPLOAD
    EXPORTING
    FILENAME = DATEI_PC
    FILETYPE = 'ASC'
    CHANGING
    DATA_TAB = ITAB[]
    EXCEPTIONS
    FILE_OPEN_ERROR = 1
    FILE_READ_ERROR = 2
    NO_BATCH = 3
    GUI_REFUSE_FILETRANSFER = 4
    INVALID_TYPE = 5
    NO_AUTHORITY = 6
    UNKNOWN_ERROR = 7
    BAD_DATA_FORMAT = 8
    HEADER_NOT_ALLOWED = 9
    SEPARATOR_NOT_ALLOWED = 10
    HEADER_TOO_LONG = 11
    UNKNOWN_DP_ERROR = 12
    ACCESS_DENIED = 13
    DP_OUT_OF_MEMORY = 14
    DISK_FULL = 15
    DP_TIMEOUT = 16
    NOT_SUPPORTED_BY_GUI = 17
    ERROR_NO_GUI = 18
    OTHERS = 19.
    IF SY-SUBRC NE 0. WRITE: / 'Error in Uploading'. STOP. ENDIF.
    WRITE: / 'UPLOAD:'.
    LOOP AT ITAB. WRITE: / ITAB-TXT. ENDLOOP.

  • Uploading  Excel sheet  data into internal table

    Hi All,
    I want to upload Excel file data into internal table. My problem is that my excel file  having more than one sheets. I want to upload  the data of particula Excel sheet..
    Please suggest me how can I upload particulat Excel sheet data .
    Thanks and regards
    Praveen

    check this link
    Uploading multiple excel sheets
    You can check Satish's answer in the above link
    Re: uploading data from excel sheets through BDC's into sap system
    <b>Award points if found helpful</b>

  • Loading Text data into internal table

    I have a text file to load txt data into internal table. So how to read text data with validation and to load all text data into the internal table?
    Say this is the text file:
    IO_NAME, IO_TYPE, IO_SHTXT, IO_LONGTEXT, DATATYPE, DATA LENGTH
    ZIO_TEST1, CHA, IO TEST1, IO TEST 1, CHAR, 20
    ZIO_TEST2, CHA, IO TEST2, IO TEST 2, CHAR, 20
    Regards,
    Mau

    hi Mau,
    look this code, maybe it's help u.
    <b>REPORT  ZTXTTOTABLE.</b>
    DATA: p_file   TYPE string value 'C:\teste.txt',
          BEGIN OF TI_table OCCURS 0,
            COD(5) TYPE C,
            NAME(40),
          END OF TI_table,
          a(2).
    PARAMETERS: sel_file(128) TYPE c
                default 'C:\teste.txt' OBLIGATORY LOWER CASE.
    p_file = sel_file.
    CALL FUNCTION 'GUI_UPLOAD'
      EXPORTING
        filename = p_file
      TABLES
        data_tab = ti_table[].
    format color COL_TOTAL INTENSIFIED ON.
    loop at ti_table.
      write: / sy-vline, ti_table-cod, at 10 sy-vline, ti_table-name,
             at 60 sy-vline.
    endloop.
    write: / sy-uline(60).
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR sel_file.
      CALL FUNCTION 'WS_FILENAME_GET'
        EXPORTING
          def_filename     = ''
          def_path         = 'C:\'
          mask             = ',Documentos de texto (*.txt), *.txt.'
          mode             = ''
        IMPORTING
          filename         = p_file
        EXCEPTIONS
          inv_winsys       = 1
          no_batch         = 2
          selection_cancel = 3
          selection_error  = 4
          OTHERS           = 5.
      find '.txt' IN p_file.
      if sy-subrc <> 0.
        concatenate p_file '.txt' into sel_file.
      else.
        sel_file = p_file.
      endif.
    top-of-page.
      format color COL_HEADING INTENSIFIED ON.
      uline (60).
      write: / sy-vline, 'COD', at 10 sy-vline, 'NAME', at 60 sy-vline.
      write: / sy-uline(60).
    good luck!
    Regards
    Allan Cristian

Maybe you are looking for