Read DMS document into internal table

Hi,
I have a requirement to read DMS document in binary format into internal table.
and i want to print the data in internal table through SAP spool.
Please let me know how to handle this requirement.
Thanks
Srini

Hi,
Check scms pakage, FG - SCMS_CONV for conversions..
Regards
Surjit

Similar Messages

  • Question about reading csv file into internal table

    Some one (thanks those nice guys!) in this forum have suggested me to use FM KCD_CSV_FILE_TO_INTERN_CONVERT to read csv file into internal table. However, it can be used to read a local file only.
    I would like to ask how can I read a CSV file into internal table from files in application server?
    I can't simply use SPLIT as there may be comma in the content. e.g.
    "abc","aaa,ab",10,"bbc"
    My expected output:
    abc
    aaa,ab
    10
    bbb
    Thanks again for your help.

    Hi Gundam,
    Try this code. I have made a custom parser to read the details in the record and split them accordingly. I have also tested them with your provided test cases and it work fine.
    OPEN DATASET dsn FOR input IN TEXT MODE ENCODING DEFAULT.
    DO.
    READ DATASET dsn INTO record.
      PERFORM parser USING record.
    ENDDO.
    *DATA str(32) VALUE '"abc",10,"aaa,ab","bbc"'.
    *DATA str(32) VALUE '"abc","aaa,ab",10,"bbc"'.
    *DATA str(32) VALUE '"a,bc","aaaab",10,"bbc"'.
    *DATA str(32) VALUE '"abc","aaa,ab",10,"b,bc"'.
    *DATA str(32) VALUE '"abc","aaaab",10,"bbc"'.
    FORM parser USING str.
    DATA field(12).
    DATA field1(12).
    DATA field2(12).
    DATA field3(12).
    DATA field4(12).
    DATA cnt TYPE i.
    DATA len TYPE i.
    DATA temp TYPE i.
    DATA start TYPE i.
    DATA quote TYPE i.
    DATA rec_cnt TYPE i.
    len = strlen( str ).
    cnt = 0.
    temp = 0.
    rec_cnt = 0.
    DO.
    *  Start at the beginning
      IF start EQ 0.
        "string just ENDED start new one.
        start = 1.
        quote = 0.
        CLEAR field.
      ENDIF.
      IF str+cnt(1) EQ '"'.  "Check for qoutes
        "CHECK IF quotes is already set
        IF quote = 1.
          "Already quotes set
          "Start new field
          start = 0.
          quote = 0.
          CONCATENATE field '"' INTO field.
          IF field IS NOT INITIAL.
            rec_cnt = rec_cnt + 1.
            CONDENSE field.
            IF rec_cnt EQ 1.
              field1 = field.
            ELSEIF rec_cnt EQ 2.
              field2 = field.
            ELSEIF rec_cnt EQ 3.
              field3 = field.
            ELSEIF rec_cnt EQ 4.
              field4 = field.
            ENDIF.
          ENDIF.
    *      WRITE field.
        ELSE.
          "This is the start of quotes
          quote = 1.
        ENDIF.
      ENDIF.
      IF str+cnt(1) EQ ','. "Check end of field
        IF quote EQ 0. "This is not inside quote end of field
          start = 0.
          quote = 0.
          CONDENSE field.
    *      WRITE field.
          IF field IS NOT INITIAL.
            rec_cnt = rec_cnt + 1.
            IF rec_cnt EQ 1.
              field1 = field.
            ELSEIF rec_cnt EQ 2.
              field2 = field.
            ELSEIF rec_cnt EQ 3.
              field3 = field.
            ELSEIF rec_cnt EQ 4.
              field4 = field.
            ENDIF.
          ENDIF.
        ENDIF.
      ENDIF.
      CONCATENATE field str+cnt(1) INTO field.
      cnt = cnt + 1.
      IF cnt GE len.
        EXIT.
      ENDIF.
    ENDDO.
    WRITE: field1, field2, field3, field4.
    ENDFORM.
    Regards,
    Wenceslaus.

  • Reading file content into internal table

    Hi All,
    I'm facing problem reading pdf file content into an internal table. I need to read this file from communication server (neither presentation nor application server). I have tried gui_upload , it is working fine but it does not work in batch jobs. Open dataset in binary mode is also not helping much. Could anyone help ?
    Thanks a lot

    "open dataset <filepath> for input in binary mode" should work.... what does it say when you try this?
    Thanks
    Muktar

  • Read Type-pools into internal table

    Hi all,
    I want the type-pools content to be put into the internal table and find the Lines of Code in it.
    Can anybody suggest how it is possible?
    Regards,
    K.Tharani.

    hi
    type pool will contain a list of related datas decalred in it ,
    and we can use those datas declared
    TYPE-POOLS abap.
      DATA: litab_catalog TYPE  abap_fieldcat_alv OCCURS 0,
              s_catalog TYPE  abap_fieldcat_alv.
      DATA: LITAB_EVENT   TYPE slis_t_event,
            S_EVENT   TYPE slis_alv_event.
    CATALOG Creation.
      s_catalog-col_pos   = 1.
      s_catalog-tabname   = 'GITAB_ERROR'.       "'T_ERROR'.
      s_catalog-fieldname = 'RECNO'.
      s_catalog-outputlen = 15.
      s_catalog-seltext_l  = 'Record Number'.
      s_catalog-ddictxt = 'L'.
      APPEND s_catalog TO litab_catalog.
    i think u can move ur type pools value into a Internal table,
    and then u can use
    describe table internal table  lines work area.

  • Error while reading excel file from application server into internal table.

    Hi experts,
    My requirement is to read an excel file from application server into internal table.
    Hence I have created an excel file fm_test_excel.xls in desktop and uploaded to app server using CG3Z tcode (as BIN file type).
    Now in my program I have used :
    OPEN DATASET v_filename FOR INPUT IN text mode encoding default.
    DO.
    READ DATASET v_filename INTO wa_tab.
    The statement OPEN DATASET works fine but I get a dump (conversion code page error) at READ DATASET statement.
    Error details:
    A character set conversion is not possible.
    At the conversion of a text from codepage '4110' to codepage '4103':
    - a character was found that cannot be displayed in one of the two
    codepages;
    - or it was detected that this conversion is not supported
    The running ABAP program 'Y_READ_FILE' had to be terminated as the conversion
    would have produced incorrect data.
    The number of characters that could not be displayed (and therefore not
    be converted), is 445. If this number is 0, the second error case, as
    mentioned above, has occurred.
    An exception occurred that is explained in detail below.
    The exception, which is assigned to class 'CX_SY_CONVERSION_CODEPAGE', was not
    caught and
    therefore caused a runtime error.
    The reason for the exception is:
    Characters are always displayed in only a certain codepage. Many
    codepages only define a limited set of characters. If a text from a
    codepage should be converted into another codepage, and if this text
    contains characters that are not defined in one of the two codepages, a
    conversion error occurs.
    Moreover, a conversion error can occur if one of the needed codepages
    '4110' or '4103' is not known to the system.
    If the conversion error occurred at read or write of  screen, the file
    name was '/usr/sap/read_files/fm_test_excel.xls'. (further information about
    the file: "X 549 16896rw-rw----201105170908082011051707480320110517074803")
    Also let me know whether this is the proper way of reading excel file from app server, if not please suggest an alternative .
    Regards,
    Karthik

    Hi,
    Try to use OPEN DATASET v_filename FOR INPUT IN BINARY mode encoding default. instead of OPEN DATASET v_filename FOR INPUT IN text mode encoding default.
    As I think you are uploading the file in BIN format to Application server and trying to open text file.
    Regards,
    Umang Mehta

  • How to read data from an internal table into a real table?

    Hello experts,
    I'm relatively new to ABAP and I'm trying to figure out how to read data from an internal table into a table that I created.  I'm trying to use the RRW3_GET_QUERY_VIEW_DATA function module to read data from a multiprovider.  I'm trying to read data from the e_cell_data and e_axis_data tables into a table that I've already created.  Please see code below.
    TABLES MULTITAB.
    DATA:
      query_name TYPE RSZCOMPID,
      s_cubename TYPE RSINFOPROV,
      t_cell_data TYPE RRWS_T_CELL,
      t_axis_data TYPE RRWS_THX_AXIS_DATA,
      t_axis_info TYPE RRWS_THX_AXIS_INFO,
      wa_t_cell_data like line of t_cell_data,
      wa_t_axis_data like line of t_axis_data,
      w_corp_tab like line of t_cell_data.
    s_cubename = 'CORP_MPO1'.
    query_name = 'Z_corp_test'.
        CALL FUNCTION 'RRW3_GET_QUERY_VIEW_DATA'
           EXPORTING
             i_infoprovider           = s_cubename
             i_query                  = query_name
            i_t_parameter            = query_string_tab
           IMPORTING
             e_cell_data              = t_cell_data
             e_axis_data              = t_axis_data
             e_axis_info              = t_axis_info.
    If anyone has any information to help me, I would greatly appreciate it.  Thanks.

    Hi,
    <li>Once you call the function module RRW3_GET_QUERY_VIEW_DATA, lets say data is available in the corresponding tables e_cell_data e_axis_data which you have mentioned.
    <li>Modify your internal table defined for other purpose, with data from e_cell_data e_axis_data like below.
    LOOP AT t_cell_data INTO wa_t_cell_data.
      "Get the required data from t_cell_data.
      MOVE-CORRESPONDING wa_t_cell_data TO it_ur_tab.
      "Modify your internal table wih data
      MODIFY it_ur_tab TRANSPORTING <field1> <field2> <field3>.
    ENDLOOP.
    LOOP AT t_axis_data INTO wa_t_axis_data.
      "Get the required data from t_cell_data.
      MOVE-CORRESPONDING wa_t_axis_data TO it_ur_tab.
      "Modify your internal table wih data
      MODIFY it_ur_tab TRANSPORTING <field1> <field2> <field3>.
    ENDLOOP.
    Thanks
    Venkat.O

  • Read info about files in specific folder into internal table

    Hi Experts
    I need to have last modified date and filename information read into an internal table. I need to read in the information of all files in a specific (UNIX) folder (I do not know the name of the single files).
    I really hope someone can help.
    Thanks a lot
    Kind regards,
    Torben

    Hi Guys
    Thanks a lot for you input.
    I managed to get my program to works as follows:
    REPORT  ZDELETE_ARCHIVING_FILES.
    *Step 1: Get the list of files in the directory into internal table :
    DATA: DLIST    LIKE EPSFILI OCCURS 0 WITH HEADER LINE,
          DPATH    LIKE EPSF-EPSDIRNAM,
          MDATE    LIKE SY-DATUM,
          MTIME    LIKE SY-UZEIT.
    DATA: BEGIN OF FATTR OCCURS 0,
              FILE_NAME  LIKE EPSF-EPSFILNAM,
              FILE_SIZE  LIKE EPSF-EPSFILSIZ,
              FILE_OWNER LIKE EPSF-EPSFILOWN,
              FILE_MODE  LIKE EPSF-EPSFILMOD,
              FILE_TYPE  LIKE EPSF-EPSFILTYP,
              FILE_MTIME(12),
          END OF FATTR.
    DATA: P_PATH(50) TYPE C.
    CONCATENATE '/ARCHIVE/' sy-sysid '/archive' INTO P_PATH.
    *        WRITE: / P_PATH.
    DPATH = P_PATH.
    *Get files in folder - read into internal table DLIST
    *if filenames are longer than 40 characters
    *then use FM SUBST_GET_FILE_LIST.
    CALL FUNCTION 'EPS_GET_DIRECTORY_LISTING'
         EXPORTING
              DIR_NAME               = DPATH
         TABLES
              DIR_LIST               = DLIST
         EXCEPTIONS
              INVALID_EPS_SUBDIR     = 1
              SAPGPARAM_FAILED       = 2
              BUILD_DIRECTORY_FAILED = 3
              NO_AUTHORIZATION       = 4
              READ_DIRECTORY_FAILED  = 5
              TOO_MANY_READ_ERRORS   = 6
              EMPTY_DIRECTORY_LIST   = 7
              OTHERS                 = 8.
    IF SY-SUBRC EQ 0.
    *Step 2: Read the file attributes into an internal table
    *Read info about the files (attributes) into the internal table FATTR
    *as we need info about the last time it was changed (MTIME)
      LOOP AT DLIST.
        CALL FUNCTION 'EPS_GET_FILE_ATTRIBUTES'
             EXPORTING
                  FILE_NAME              = DLIST-NAME
                  DIR_NAME               = DPATH
             IMPORTING
                  FILE_SIZE              = FATTR-FILE_SIZE
                  FILE_OWNER             = FATTR-FILE_OWNER
                  FILE_MODE              = FATTR-FILE_MODE
                  FILE_TYPE              = FATTR-FILE_TYPE
                  FILE_MTIME             = FATTR-FILE_MTIME
             EXCEPTIONS
                  READ_DIRECTORY_FAILED  = 1
                  READ_ATTRIBUTES_FAILED = 2
                  OTHERS                 = 3.
        IF SY-SUBRC EQ 0.
          FATTR-FILE_NAME = DLIST-NAME.
          APPEND FATTR.
        ENDIF.
      ENDLOOP.
      SORT FATTR BY FILE_NAME.
      DATA: time(10), date LIKE sy-datum.
      DATA: months TYPE i.
      DATA: e_file TYPE string.
      LOOP AT FATTR.
      CLEAR: time, months, e_file.
        IF FATTR-FILE_NAME(10) = 'archive_BW'.
    *Convert the unix time into readable time
          PERFORM p6_to_date_time_tz(rstr0400) USING FATTR-FILE_MTIME
                                                     time
                                                     date.
    *Calculate the number of months between date (MTIME) and current day
    *ex 31.03.2009 - 01.04.2009 = 1 month
    *ex 01.02.2009 - 01.04.2009 = 2 month
        CALL FUNCTION 'MONTHS_BETWEEN_TWO_DATES'
          EXPORTING
            i_datum_von = date
            i_datum_bis = sy-datum
          IMPORTING
            e_monate = months.
            CONCATENATE DPATH '/' FATTR-FILE_NAME INTO e_file.
    *        WRITE: / FATTR-FILE_NAME,
    *                 FATTR-FILE_SIZE,
    *                 date,
    *                 time,
    *                 sy-datum,
    *                 months,
    *                 e_file.
    *Step 3: Delete files where months > 1
          IF months > 1.
            OPEN dataset e_file for output in text mode encoding default.
            DELETE dataset e_file.
            CLOSE dataset e_file.
          ENDIF. "months > 1
        ENDIF.
      ENDLOOP.
    ENDIF.

  • Read Application server file and upload into internal table

    Another help needed guys,
    My file in the application server is of format
    Name       Marks 1    Marks  2       Marks 3............
    A                10             15               20
    The only thing separating the columns is space.
    Actually this file was downloaded from an internal table into the app server.
    Now I want to load it back into the internal table.
    How do I load this into internal table so that each column goes in separate internal table field.
    Currently am using cl_abap_char_utilities=>HORIZONTAL_TAB but I can get only the first column name in my field1 of the internal table.
    How should I applroach this?
    Points will be awarded for useful answers.
    Regards
    Ankit

    Hi ankit,
    i think u have uploaded the tab delimited file in the application sever.
    then suppose see if u r file is in the format of name#marks1#marks2#marks3.
    then in the program u do like this..
    first declare one internal table with one filed.
    data:
      c_hextab(1)      TYPE x VALUE '09'.
    data:
      begin of t_data occurs 0,
          line(256) type c,
      endof t_data.
    and declare one more intternal table
    data:
    begin of  t_itab occurs 0,
      name(15)    type c,
      marks1(4)   type c,
      marks2(4)   type c,
      marks3(4)   type c,
    endof t_itab.
    then
    open the file with
    OPEN DATASET p_file FOR INPUT IN TEXT MODE.
    then  between do and endo do like this..
    DO.
    clear t_data.
    READ DATASET p_file INTO t_data.
    if sy-subrc ne 0.
      exit.
    else.
    split t_data at c_hextab
          into t_itab-name
                t_itab-marks1
    t_itab-marks2
    t_itab-marks3.
    append t_itab.
    endif.
    enddo.
    i think it will be helpful to u
    Please let me know wht type of file has been uploaded into application server.(tab deleimted, comma separated or something else).
    Regards,
    Sunil Kumar Mutyala.

  • Read local folder, return filenames into internal table

    Assume I have 3 files in c:\abc folder:
    a1.xls
    a2.xls
    a6.xls
    Is there a fm or code sample to pass in folder name (ie c:\abc) and returns a1.xls, a2.xls and a6.xls into internal table?

    Use Class CL_GUI_FRONTEND_SERVICES Method DIRECTORY_LIST_FILES to get list of file in a folder . FILE_TABLE will give the table with list of files
    data: begin of itab ,
            file(26) type c,
          end of itab.
    data: tab type table of itab.
    data : cnt type i.
    CALL METHOD CL_GUI_FRONTEND_SERVICES=>DIRECTORY_LIST_FILES
      EXPORTING
        DIRECTORY                   = 'C:\temp'
    *    FILTER                      = '*.*'
    *    FILES_ONLY                  =
    *    DIRECTORIES_ONLY            =
      CHANGING
        FILE_TABLE                  = tab
        COUNT                       = cnt
    *  EXCEPTIONS
    *    CNTL_ERROR                  = 1
    *    DIRECTORY_LIST_FILES_FAILED = 2
    *    WRONG_PARAMETER             = 3
    *    ERROR_NO_GUI                = 4
    *    NOT_SUPPORTED_BY_GUI        = 5
    *    others                      = 6
    IF SY-SUBRC <> 0.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.

  • Read DMS document in binary format

    Hi,
    I have a requirement to read DMS document in binary format into internal table.
    and i want to print the data in internal table through SAP spool.
    Please let me know how to handle this requirement.
    Thanks
    Srini

    Hi,
    Check scms pakage, FG - SCMS_CONV for conversions..
    Regards
    Surjit

  • Issue with uploading XML file from application server into internal table

    i Need to fetch the XML file from the application server and place into internal table and i am getting error message while using the functional module   SMUM_XML_PARSE and the error message is "line   1 col   1-unexpected symbol; expected '<', '</', entity reference, character data, CDATA section, processing instruction or comment" and could you please let me know how to resolve this issue?  
        TYPES: BEGIN OF T_XML,
                 raw(2000) TYPE C,
               END OF T_XML.
    DATA:GW_XML_TAB TYPE  T_XML.
    DATA:  GI_XML_TAB TYPE TABLE OF T_XML INITIAL SIZE 0.
    DATA:GI_STR TYPE STRING.
    data:  GV_XML_STRING TYPE XSTRING.
    DATA: GI_XML_DATA TYPE  TABLE OF SMUM_XMLTB INITIAL SIZE 0.
    data:GI_RETURN TYPE STANDARD TABLE OF BAPIRET2.
        OPEN DATASET LV_FILE1 FOR INPUT IN TEXT MODE ENCODING DEFAULT.
        IF SY-SUBRC NE 0.
          MESSAGE 'File does not exist' TYPE 'E'.
        ELSE.
          DO.
    * Transfer the contents from the file to the work area of the internal table
            READ DATASET LV_FILE1 INTO GW_XML_TAB.
            IF SY-SUBRC EQ 0.
              CONDENSE GW_XML_TAB.
    *       Append the contents of the work area to the internal table
              APPEND GW_XML_TAB TO GI_XML_TAB.
            ELSE.
              EXIT.
            ENDIF.
          ENDDO.
        ENDIF.
    * Close the file after reading the data
        CLOSE DATASET LV_FILE1.
        IF NOT GI_XML_TAB IS INITIAL.
          CONCATENATE LINES OF GI_XML_TAB INTO GI_STR SEPARATED BY SPACE.
        ENDIF.
    * The function module is used to convert string to xstring
        CALL FUNCTION 'SCMS_STRING_TO_XSTRING'
          EXPORTING
            TEXT   = GI_STR
          IMPORTING
            BUFFER = GV_XML_STRING
          EXCEPTIONS
            FAILED = 1
            OTHERS = 2.
        IF SY-SUBRC <> 0.
          MESSAGE 'Error in the XML file' TYPE 'E'.
        ENDIF.
      ENDIF.
      IF GV_SUBRC = 0.
    * Convert XML to internal table
        CALL FUNCTION 'SMUM_XML_PARSE'
          EXPORTING
            XML_INPUT = GV_XML_STRING
          TABLES
            XML_TABLE = GI_XML_DATA
            RETURN    = GI_RETURN.
      ENDIF.
      READ TABLE GI_RETURN TRANSPORTING NO FIELDS WITH KEY TYPE = 'E'.
      IF SY-SUBRC EQ 0.
        MESSAGE 'Error converting the input XML file' TYPE 'E'.
      ELSE.
        DELETE GI_XML_DATA WHERE TYPE <> 'V'.
        REFRESH GI_RETURN.
      ENDIF.

    Could you please tel me  why the first 8 lines were removed, till <Soap:Body and also added the line <?xml version="1.0" encoding="UTF-8"?> in the beggining .
    Becuase there will be lot of  XML files will be coming from the Vendor daily and that should be uploaded in the application server and should update in the SAP tables based on the data in the XML file.
    what information i need to give to vendor that do not add the first 8 lines in the XML file and add the line in the beggining <?xml version="1.0" encoding="UTF-8"?>   ??????
    Is there any other way we can do with out removing the lines?

  • How to get data of tabulated text file into internal table

    hi all,
    i want to get data from tabulated text file(notepad) into internal table. i searched in SCN and got lot of post regarding  how to convert excel file into internal table but i didnt get posts regarding text file.
    thanks
    SAchin

    try:
    DATA: BEGIN OF tabulator,
            x(1) TYPE x VALUE '09',
          END OF tabulator.
      READ DATASET file INTO wa.
    split wa at tabulator into table itab.
    A.

  • Read from file to Internal Table With Extra Record

    Hi,
    I'm trying to read file from application server into internal table. Then loop thru the internal table and display.
    My text file only have 2 rows of records. However, when display the internal table, it show the 2 records plus an extra line with 0. May I know where did I do wrong?
    PARAMETERS: p_infile  LIKE rlgrap-filename OBLIGATORY DEFAULT  '/usr/sap/'..
    DATA: ld_file LIKE rlgrap-filename.
    *Internal tabe to store upload data
    TYPES: BEGIN OF t_record,
        name1 like pa0002-VORNA,
        name2 like pa0002-name2,
        age   type i,
        END OF t_record.
    DATA: it_record TYPE STANDARD TABLE OF t_record INITIAL SIZE 0,
          wa_record TYPE t_record.
    *Text version of data table
    TYPES: begin of t_uploadtxt,
      name1(10) type c,
      name2(15) type c,
      age(5)  type c,
    end of t_uploadtxt.
    DATA: wa_uploadtxt TYPE t_uploadtxt,
          wa_upload TYPE t_uploadtxt.
    *String value to data in initially.
    DATA: wa_string(255) type c.
    START-OF-SELECTION.
    ld_file = p_infile.
    OPEN DATASET ld_file FOR INPUT IN TEXT MODE ENCODING DEFAULT.
    IF sy-subrc NE 0.
    ELSE.
      DO.
        CLEAR: wa_string, wa_uploadtxt.
        READ DATASET ld_file INTO wa_string.
        IF sy-subrc NE 0.
          EXIT.
        ELSE.
          SPLIT wa_string AT SPACE INTO wa_uploadtxt-name1 wa_uploadtxt-name2 wa_uploadtxt-age.
          MOVE-CORRESPONDING wa_uploadtxt TO wa_upload.
          APPEND wa_upload to it_record.
        ENDIF.
      ENDDO.
      CLOSE DATASET ld_file.
    ENDIF.
    END-OF-SELECTION.
    loop at it_record INTO wa_record.
      write / wa_record-name1.
      write / wa_record-name2.
      write / wa_record-age.
    Endloop.

    Hi,
    Am attaching the file I used. There's no empty line after the second record.
    After execute, it is showing:
    Joe     Adams     20
         0
    John     Smith     40
         0
    May I know why there's 0, where did i do wrong?
    Thank you.

  • Function module to get data into internal table from Excel file sheets

    Hi,
    I have to upload customers from excel file.
    we are donloading customer data excel file sheets.
    Customer data in 1 sheet, tax data the other sheet of same excel file, Customer master-Credit data in other sheet of same excel file.
    so i have 3-4 sheet in one excel file.
    now my requirement is to get the data from excel file into internal table.
    is there any function module.
    Thanks & Regards

    I am sending you the idea with an example how you can upload data from an EXCEL file into an internal table. I am not sure if you can take data from different sheet in the same EXCEL file. I think that this is not possible (try it )
    Upload the data into an internal table, like the way that I am describing in the above:
      DATA: L_MAX_COL_NB TYPE I.
      DATA: l_file_name LIKE RLGRAP-FILENAME.
    Just to be sure that is the correct type for the FM.
      l_file_name = P_FILE_NAME.
      L_MAX_COL_NB = 58.  "Maximum nb of colums that the FM can read.
      CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE'
           EXPORTING
                FILENAME                = l_file_name
                I_BEGIN_COL             = 1
                I_BEGIN_ROW             = 2
                I_END_COL               = L_MAX_COL_NB
                I_END_ROW               = 9999
           TABLES
                INTERN                  = PT_EXCEL
           EXCEPTIONS
                INCONSISTENT_PARAMETERS = 1
                UPLOAD_OLE              = 2
                OTHERS                  = 3.
      IF SY-SUBRC <> 0.
      ENDIF.
    Now you should upload the data into your own itab. The Function Module will return to you all the an itab
    from all fields and columns. Define the structure of the uploading file into SE11 - Data Dictionary. Then read the fieldcatalog of this structure. In the code that I am sending to you, I am insearting an empty line into the internal table and then I am assigning this line into a corresponding field-symbol. Then I am able to change the working area - so and the line of the itab. Propably you could you the statement APPEND INITIAL LINE TO (your_table_name) ASSIGNING <your_field_symbol>, but the example was written in an old SAP version.
      FIELD-SYMBOLS:
                     <F_REC> LIKE WA_UPLOAD_FILE,      "working are of the uploading file
                     <F_FIELD> TYPE ANY.
      DATA: COLUMN_INT TYPE I,
            C_FIELDNAME(30) TYPE C.
      PERFORM GET_FIELDCATOLG TABLES FIELDCAT
                               USING 'ZECO_CHARALAMBOUS_FILE'.
      LOOP AT PT_EXCEL.
        AT NEW ROW.
          ASSIGN WA_UPLOAD_FILE TO <F_REC>.
        ENDAT.
        COLUMN_INT = PT_EXCEL-COL.
        READ TABLE FIELDCAT INTO WA_FIELDCAT INDEX COLUMN_INT.
        CONCATENATE '<F_REC>-' WA_FIELDCAT-FIELDNAME INTO C_FIELDNAME.
        ASSIGN (C_FIELDNAME) TO <F_FIELD>.
        <F_FIELD> = PT_EXCEL-VALUE.
        AT END OF ROW.
          APPEND WA_UPLOAD_FILE TO GT_UPLOAD_FILE.
          CLEAR WA_UPLOAD_FILE.
        ENDAT.
      ENDLOOP.
    With Regards
    George
    Edited by: giorgos michaelaris on Mar 4, 2010 3:44 PM

  • Insert into internal table

    Hi Experts,
    I am new comer to ABAP, have some very important task to be done, need help from all of you. I have a program which displays the results(inform about the infocubes). I want to insert the output of this prgm into an internal table, I am looking lot into the documentation, but so far not much help and i am not able to execute it. And one more task, I want to join this internal table and one database table and get the result, my question is , Is it possible to join this internal table and database table based on some common field.
      Any help will be of grt help
    Thanks,
    Hem.

    Hi,
    For joining internal table with database table,you need to write the logic as below.
    This is the pseudo code.
    select * from database into table itab2 where condition.
    loop at itab1 into wa1.
       move-corresponding wa1 to wa3.
       loop at itab2 into wa2 where field = wa1-field.
        move-corresponding wa2 to wa3.
       endloop.
       append wa3 to itab3.
    endloop.
    1. select the required data from database table into internal table.
    2. loop the first internal table which you already have.
    3. Based on the key fields in these two internal tables[database],place the condition in READ or LOOP statement for the second internal table inside the loop of the first internal table.
    4. If there are more records in second internal table for a single record in first internal table,then use LOOP the second internal table within the first internal table.Otherwise, read the second internal table within the first internal table.
    5.Then move the corresponding fields from both the internal tables inside the loop to third internal table.Append the record to the third internal table.
    Hope it helps.
    Regards,
    J.Jayanthi

Maybe you are looking for

  • Dynamic header

    Hello, I have to create a report that actually consists of two type of report. Each report type I have created from different set of tables, and therefore I have two repeating frames, (one for each report type). In the margin I created two different

  • A little qusetion?

    If I have 2 disc in ide 1, 2 drives in ide 2, and one disc in ide 3 on a (MSI K7N2 DELTA ILSR). Could I then use both the serial-ata slots on my motherboard without losing some of the otger drives? I want to know that before i buy a new hd=)

  • Quantity Issue- Milestone Billing

    i am doing milestone billing, where the scenario is , i hav to bill the amount in 3 stages. 30-30-40. Here i am using the billing type F1 earlier when i was creating a invoice for the first time by default the system was taking total vaule of the inv

  • What am I doing wrong not not understand​ing??!

    Still having strange outlook issuesHi guys this is my first post on this message board! glad to be a part of these forums as I am on crackberry as well and have posted this. Ive been having astrange issue that I can't seem to get any info about. This

  • Yard Management ( capacity of destination storage bin )

    Hi Experts, In sap yard management how to find capacity of destination storage bin , is there any field to check? Regards Anji