Data access from Application Server - Seeking Opinion

I am working on a fairly large scale ERP application that is written in Java both on the front end, and middle tier ( using a JBoss application server ).
All of the database access happens in my app server, and when I wanted to get peoples opinions on the best way to extract and pass data to and from the database from the app server, and of course to and from the client.
I am using JDBC to make database calls and extra data from the database. This is of course pretty trivial. And I first started writing POJO that represent tables in my database. I then wrote a faily length method that uses reflection to call the setting methods and pass in the objects returned from the database result set. This of course becomes tricky when you start to join multiple tables together. And often you only need a small subset of columns in a table and don't require an object with all the columns from the table ( some set, and some as null objects ).
So then I decided I was use a combination of ArrayList objects and HashMap's to store the data. If a result set returned multiple rows, it would return an ArrayList of HashMap objects. Each hash map would contain the data for that row, and the hash map keys are the column names.
This seems to work pretty well and resolves the problem of joining multiple tables together and keeping track of which columns get stored in which objects.
Does anyone have a different solution or idea as to how to handle this? And thoughts or ideas would be greatly appreciated.

bryano wrote:
Let me pose a quick Hibernate question as well.Let me recommend that you not be so thin-skinned about responses.
>
If you had a table that had 40 columns in it and say 1000 rows. And you needed to run a query that returned all 1000 rows, but you only needed two out of the
40 columns. Would it be better to extract those two columns into the HashMap / ArrayList collection I mentioned in my original post? Or would using something like Hibernate and a class that mapped all of the columns in the table be okay?Why not just map the columns you needed in Hibernate? Who said you had to map all 40 and have them be null?
My concern is on efficiency,
and I was wondering if building 1000 objects that each have 40 members that only 2 are populated is the most efficient way of extracting the data.Doesn't sound very efficient.
I will admit, my knowledge of Hibernate is limited at best so I may be missing a component of Hibernate that would allow you to only extract the columns you required, but you are still working with an object that has 38 null value objects for the columns you didn't require.I don't believe you're required to map every column in a table.
%

Similar Messages

  • Error in data load from application server

    Well, this problem again!
    In datasource for dataload by flatfile, tab Extraction i selected Load Text-Type File From Application Server.
    In tab Proposal:
    Converter: Separated with Separator (for Example, CSV).
    No. of Data Records: 9198
    Data load sucefull.
    I add 1 record:
    Converter: Separated with Separator (for Example, CSV).
    No. of Data Records: 9199
    So appear a  message error "Cannot convert character sets for one or more characters".
    I look in line 9199 in file and not have any special character. I use AL11 and debug to see this line.
    When i load file from local workstation, this error not occur.
    What's happen?

    Hi Rodrigo,
    What type of logical file path have yopu created in the application server for loading this file.
    Is it a UNIX file path or an ASCII file path.
    Did you check how the file looks in the application server AL11?
    Prathish

  • Data transfer from application server to sap system in binary mode

    hi friends,
    can any one help me out in
    how to read,open the dataset (syntax) while transfering the file from application server in binary mode ?
    how to move the file to differrent location in the same server?
    regards,
    mohan
    Message was edited by:
            mohan kumard

    HI,
    Syntax for reading the file
    OPEN DATASET file FOR INPUT IN BINARY MODE
    if sy-subrc = 0.
    DO.
          READ DATASET file INTO wa_record.
    ENDDO.
    CLOSE DATASET file.
    endif.
    syntax for writing file.
    OPEN DATASET  file FOR OUTPUT  IN  BINARY MODE .
    if sy-subrc = 0.
    transfer wa_record to file.
    CLOSE DATASET file.
    endif.
    You can also transfer file from application server to presentation server using transaction CG3Y by specifying source path(app ser),destination path(presentation ser) and tranfer format (BIN).
    To copy the file from one location to other location in application server
    use the FM 'ARCHIVFILE_SERVER_TO_SERVER'
    reward points if needful..

  • Authorization Object for data downloading from application server

    Hi friends ,
       My program downloads and uploads data from the application server .
    My requirement is  ,
    Authorization checks should be performed on the Server directories to ensure that the user has access to read and write to the directory. It should check the s_dataset authorisation object for this.. If a user does not have the s_dataset authorisation object no upload or download should be allowed.
    Can you please tell me how to deal with this ? how do we check the above condition ??
    Many thanks ,
    Hemant

    hi,
    This is not a single step process.
    First of all you have to create a field for authorization for server directories from su20 and then create authorization object from su21.then define a role from pfcg with this authorization object and assign this role to user profile from su01 with values defined.
    Then you have to call this authorization object in your program at selection screen.

  • How to bring the data from application server to presentation server

    hi,
    i have one problem,i have written the program which will open the files in the application server when we run the program in the background(sm37),the same data from application server i want to bring into presentation server in the format of (.csv),how to bring the data from application to presentation server can any body help me on this  topic.folowing is the code .
    *& Report  ZPFA_HIER_LOAD
    REPORT  ZFPA_HIER_LOAD.
    *---- Declaration of Oracle connectioN
    DATA con_name LIKE dbcon-con_name VALUE 'COMSHARE'.
    DATA: MFL1(9),MFL2(5),MFL3(9),MFL4(2),MFL5(8) TYPE c.
    DATA : mfilename type string.
    data: begin of matab1 occurs 0,
          MFL1(9) TYPE C,
          MFL2(5) TYPE C,
          MFL3(9) TYPE C,
          MFL4(2) TYPE C,
          MFL5(8) TYPE C  ,
         end of matab1 .
    data: setid(8) type c.
    data: begin of source occurs 0,
          setid(8) type c,
          end of source.
    *PARAMETERS : p_pfile LIKE filename-FILEEXTERN.
    *PARAMETERS : m_bsenty(8). " type c obligatory.
    *mfilename = P_PFILE.
    EXEC SQL.
      SET CONNECTION :con_name
    ENDEXEC.
    EXEC SQL.
      CONNECT TO :con_name
    ENDEXEC.
    EXEC SQL PERFORMING get_source.
      SELECT set_id FROM UNIT_SET INTO
      :setid
      ORDER BY SET_ID
    ENDEXEC.
    start-of-selection.
    LOOP AT SOURCE.
      REFRESH matab1. CLEAR matab1.
      EXEC SQL PERFORMING evaluate.
    SELECT TO_CHAR(MEM_ID),TRIM(TO_CHAR(MEM_PID)) FROM UNIT_TREE INTO :MFL1,
    :MFL5
    where set_id = :SOURCE-SETID ORDER BY MEM_ID
      ENDEXEC.
      if SOURCE-SETID = '80000000'.
       mfilename = '/tmp/aesorg'.
      elseif SOURCE-SETID = '80000006'.
       mfilename = '/tmp/Consolidation_Manager'.
      elseif SOURCE-SETID = '80000010'.
       mfilename = '/tmp/10org'.
      elseif SOURCE-SETID = '80000012'.
       mfilename = '/tmp/20org'.
      elseif SOURCE-SETID = '80000018'.
       mfilename = '/tmp/30org'.
      elseif SOURCE-SETID = '80000025'.
       mfilename = '/tmp/40org'.
      Endif.
      mfilename = '/usr/test.dat'.
    ************************This was i tried***********************
      open dataset mfilename for output in text mode encoding default." IN
    *TEXT MODE ENCODING DEFAULT.
    if sy-subrc <> 0.
    exit.
    endif.
    close dataset mfilename.
    CALL FUNCTION 'GUI_DOWNLOAD'
       EXPORTING
         FILENAME         = MFILENAME
         FILETYPE         = 'ASC'
       TABLES
         data_tab         = matab1
       EXCEPTIONS
         file_write_error = 1
         invalid_type     = 2
         no_authority     = 3
         unknown_error    = 4
         OTHERS           = 10.
    loop at matab1 .
    transfer matab1 to mfilename.
    endloop.
      clear matab1.
    ENDLOOP.
    loop at matab1 .
    transfer matab1 to mfilename.
    endloop.
    close dataset mfilename.
         MFL5 = '0'.
       CLEAR MFL5.
    FORM evaluate.
      if MFL5 = -1.
        MFL5 = ''.
      ENDIF.
      concatenate MFL1 ','   into MFL1.
      concatenate MFL1 ','   into MFL3.
      matab1-MFL1 = MFL1.
      matab1-MFL2 = 'ZBUE,'.
      matab1-MFL3 = MFL3.
      matab1-MFL4 = ' ,'.
      matab1-MFL5 = MFL5.
      append matab1 .
      CLEAR MFL1.
      CLEAR MFL2.
      CLEAR MFL3.
      CLEAR MFL4.
      CLEAR MFL5.
    ENDFORM.
                     "evaluate
    *&      Form  GET_SOURCE
          text
    FORM GET_SOURCE.
      source-setid = setid.
      append source.
      clear source.
    ENDFORM.                    "GET_SOURCE

    Hi Rammohan,
    You cannot use OPEN DATASET to transfer data from application server to presentation server.
    You can do the following :
    <b>Do 1st point in BACKGROUND</b>
    1. Read the data file from application server into an internal table using OPEN DATASET
    <b>Do 2nd point in Foreground</b>
    2. Once you get the data into an internal table, then use FM GUI_DOWNLOAD to download it on presentation server
    You cannot use the above 2 point together in Background because its not possible. Hence you need program it partially in background and partially in foreground.
    Best regards,
    Prashant

  • Use of Open and close data set in to pick up files from application server

    Hi,
    As per my earlier posts i m making a programm which will pick excel sheet from application server and make auto PR by bapi and this all process will be handle by background processing (SM36, SM37). My concer is all proces are working fine but my files are not been picked by application server , when run on my own machine everything is working fine.I never used OPENDATA SET command before , so i have no idea how it will be used , can anyone provide me details with my set of codes where it should be used ....
    sou_dir_name = 'Y:\Sucess\'.
    tar_dir_name = 'Y:\destination\'.
    Open dataset sou_dir_name for input in text mode encoding default.
    if sy-subrc eq 0.
       do.
           read dataset sou_dir_name into file_table.
       if sy-subrc ne 0.
         exit.  " end of file.
    enddo.
    endif.
    CALL FUNCTION 'TMP_GUI_DIRECTORY_LIST_FILES'
      EXPORTING
        DIRECTORY  = sou_dir_name
        FILTER     = '.'
      IMPORTING
        FILE_COUNT = file_count
        DIR_COUNT  = dir_count
      TABLES
        FILE_TABLE = file_table
        DIR_TABLE  = dir_table
      EXCEPTIONS
        CNTL_ERROR = 1
        OTHERS     = 2.
    IF SY-SUBRC <> 0.
    ENDIF.
    loop at file_table into wa_file_table.
    clear  :  strr , str1 , str2 , str3 .
      strr = wa_file_table-PATHNAME .
      concatenate sou_dir_name strr into str1 .
      concatenate tar_dir_name strr into str2 . " success
      concatenate tar_dir_name1 strr into str3 .         " failed
    FILE = STR1 .
    *start-of-selection.
    *&  Function For Retrieve Data From Excel
    CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE'
      EXPORTING
        filename                      = FILE
        i_begin_col                   = col_start
        i_begin_row                   = row_start
        i_end_col                     = col_end
        i_end_row                     = row_end
      tables
        intern                        = excel_bdcdata
    EXCEPTIONS
       INCONSISTENT_PARAMETERS       = 1
       UPLOAD_OLE                    = 2
       OTHERS                        = 3.
      IF sy-subrc NE 0.
    WRITE : / 'File Error'.
    EXIT.
    ENDIF.
      loop at excel_bdcdata.
        translate excel_bdcdata to upper case .
        move excel_bdcdata-col to it_index.
        assign component it_index of  structure  wa_file to <fs> .
        move excel_bdcdata-value to <fs>.
        at end of row.
          append wa_file to it_file .
            clear wa_file.
          endat.
      endloop.

    Parsing XML data:
    http://help.sap.com/saphelp_nw04/helpdata/en/86/8280ba12d511d5991b00508b6b8b11/frameset.htm
    or alternatively check out ABAP online help for "CALL TRANSFORMATION".
    For creating the material master look at BAPI_STANDARDMATERIAL_CREATE.
    Thomas

  • Delete data from application server

    Hi All.
    I have created file in application by using OPEN DATA SET, I need to delete from application server after some validation ,  how to delete?
    Please guide me.
    Thanks in Advance.

    Hi,
    DATA FNAME(60) VALUE 'file'.
    OPEN DATASET FNAME FOR OUTPUT.
    OPEN DATASET FNAME FOR INPUT.
    IF SY-SUBRC = 0.
      WRITE / 'File found'.
    ELSE.
      WRITE / 'File not found'.
    ENDIF.
    DELETE DATASET FNAME.
    OPEN DATASET FNAME FOR INPUT.
    IF SY-SUBRC = 0.
      WRITE / 'File found'.
    ELSE.
      WRITE / 'File not found'.
    ENDIF.
    The output appears as follows:
    File found
    File not found
    Use cane Also Use Function Modue: EPS_DELETE_FILE
    Regards,
    Gurpreet

  • How to upload data from application server

    Hi,
    please help me out in uploading the data from application server which is a tab delemited file into an internal table.
    Thanks
    kumar

    hi,
    Use this sample code as an example.
    table declaration
    tables: mara.
    *data declaration
    data: begin of it_lfa1 occurs 0,
    vendor like lfa1-lifnr,
    land1 like lfa1-land1,
    name1 like lfa1-name1,
    ort01 like lfa1-ort01,
    end of it_lfa1.
    selection screen
    selection-screen: begin of block b1 with frame.
    parameters: p_file type rlgrap-filename obligatory.
    selection-screen: end of block b1.
    at selection screen
    at selection-screen on value-request for p_file.
    *& start-of-selection
    start-of-selection.
    perform transfer_file using p_file.
    perform write.
    *& Form transfer_file
    text
    -->P_P_FILE text
    form transfer_file using p_p_file.
    data: l_message(30) type c.
    ***opening dataset for reading
    open dataset p_p_file for input in text mode encoding default message
    l_message.
    if sy-subrc ne 0.
    message i001(zerr2) with p_p_file.
    endif.
    *******transferring data from file to app server.
    do.
    read dataset p_p_file into it_lfa1.
    if sy-subrc = 0.
    append it_lfa1.
    clear it_lfa1.
    else.
    exit.
    endif.
    enddo.
    *******closing dataset
    close dataset p_p_file.
    endform. " transfer_file
    *& Form write
    text
    --> p1 text
    <-- p2 text
    form write .
    loop at it_lfa1.
    write:/ it_lfa1-vendor,
    it_lfa1-land1,
    it_lfa1-name1,
    it_lfa1-ort01.
    endloop.
    endform. " write
    Thanks
    Aneesh.

  • How to get data from application server

    hi experts,
    when i load data from application server(.csv file) to ODS, data all goes one column.
    in infopackage exterdata tabstrip  i have given the below values.
    escape sign is "
    data separator is ,
    separator for thousands is ,
    my sample data:
    "1010000";"A410";"03.2008";"113.5704531"
    "1010000";"A410";"04.2008";"93.1146410"
    any ideas..
    Siri

    Hi Siri,
    You should look in the T.Code :RSCUSTV1
    BW:Settings for Flat File
    Thousand separator 
    Dec. point separator 
    Field separator         
    Field delimiter 
    Then you can use the Same Characterstics while creating the Flat file & also passing the same in Info Package
    This will resolve your issue
    Regards
    Hari

  • Uploading the data from Application server to Database

    Hi,
    I am trying to upload tab delimited file from application server into database.
    I have upload the file from presentation to application server by CGZ3
    and i am able to see file in app server with #s and it appers in application server as
    10140#A#E#120#abcd#
    10146#M#P#300#a.b#
    10152#M#P#200#dat123.com##
    140#A#P#300#blicksat123.com#
    10140#A#E#260#cust1at123.com##
    And my notepad records looks like
    10140     A     E     120     abcd
    10146     M     P     300     a.b
    10152     M     P     200     dat123.com     
    140     A     P     300      blicksat123.com
    10140     A     E      260     cust1at123.com
    I am using open data set and read dataset to read the file as shown below
    DATA:
        l_htab      TYPE c,                " Horizontal tab
        l_line(100) TYPE c.                " Content in the file
      l_htab = cl_abap_char_utilities=>horizontal_tab.
    Open dataset
      OPEN DATASET pp_afname FOR INPUT IN TEXT MODE ENCODING DEFAULT.
      IF sy-subrc EQ 0.
        DO.
    Read dataset
          READ DATASET pp_afname INTO l_line.
          IF sy-subrc EQ 0.
            SPLIT l_line AT l_htab
                       INTO fs_file-carrid
                            fs_file-autoind
                            fs_file-commtype
                            fs_file-resptime
                            fs_file-smtpaddr.
            APPEND fs_file TO pt_afile.
          ELSE.
            EXIT.
          ENDIF.                           " IF SY-SUBRC EQ 0.
        ENDDO.                             " DO.
        CLOSE DATASET pp_afname.
      ELSE.
        MESSAGE 'Problem in opening the App.Server file' TYPE con_msgtyp_i.
      ENDIF.                               " IF sy-subrc EQ 0.
    Load the data to the database
      PERFORM load_data_to_database USING t_afile.
    When i am trying to upload it is taking me to dump and the errpr analysis is like
    "The program attempted to interpret the value "26 0 " as a number, but
    since the value contravenes the rules for correct number formats,
    this was not possible."
    Any suggestions on this
    Regards
    VEnk@

    Hi,
    Thats the line feed character. After reading  the application server file, use this
    data: lv_feed type c value CL_ABAP_CHAR_UTILITIES=>CR_LF.
    loop at itab.
    replace all occurrences of lv_feed in itab-field with space.
    modify itab.
    endloop.
    Vikranth

  • Download  350MB of data from Application Server to Presentation server

    i want to Download  350MB(Around 2.5Million record of Table BSEG) of data from Application Server to Presentation server..
    i have tried with the transaction CG3Y and program using open dataset,read dataset,close dataset,ws_download...but went in vain,,,ended with TIMEOUT ERROR..will OPEN DATASET 'path' FOR OUTPUT FILTER 'Compress'  be helpful
    ..please help me ..its urgent..

    you can do the FTP with Unix commands..
    initially connect to the application server  by using command
    FTP <app server ip>,then it willl ask for username and password... after successful connection you  can use the following commnads to transfer file
    lcd <destination path name>(set the dest path)
    cd <source path>(set the sorce path),
    get <filename to be transfererd>( do the transfer)....
    You can do same with ABAP code also, for this you need to use some function modules like..
    FTP_CONNECT ( to establish the connection)
    FTP_COMMAND ( to execute the commands like cd, lcd get,put)
    finally FTP_DISCONNECT to close the open connection...
    for further details refer standard program RSFTP002,RSFTP003....
       reward points if helpful...

  • TRANSFER OF DATA FROM APPLICATION SERVER TO REPORT

    I have a file on application serverin T-code AL11(sap directories).I want to bring the data from this file to my report.
    Please explain me procedure with example.
    I approached below method:
    I approached with OPEN DATASET,But i got short dump.
    syntax:
    open dataset c_dset(file in app.svr.) for output in text mode
    encoding default.
    transfer c_dset to i_transfer(itab).
    close dataset.
    short dump:
    unable to open file "".
    Kindly solve my problem.

    Hi Saritha,
    If I am not wrong u r trying to read the data from the file which is on  the apps server rite?
    Use open data set with input for reading the file from application server ..........  output is to write the file onto the application server
    check the below sample code.......
    DATA:
    len TYPE i,
    text(30) type c,
    dir(30) TYPE c VALUE '/tmp/test.txt'.
    DATA: begin of data OCCURS 0,
    matnr type matnr,
    werks type werks_d,
    end of data.
    START-OF-SELECTION.
    CLEAR: text.
    OPEN DATASET dir FOR INPUT IN TEXT MODE.
    DO.
    READ DATASET dir INTO text.
    IF SY-SUBRC 0.
    EXIT.
    ENDIF.
    close dataset.

  • Error while loading data from application server

    Hi all,
    Am facing a problem while loading data from application server.
    The error i get is ....
    *" The argument ' Rental/Lease ' cannot be interpreted as a number while assigning character to application structure*.
    'Rental/Lease' is a value for a character infoobject length 30. I checked for the sequence of fields in data source and the sequnce of values am receiving in application server and the sequence match.
    when i copy these values into a CSV onto a desktop and load,load is successful.
    Please let me know your views.
    Thanks&Regards,
    Praveen

    It looks like the system is trying to convert Rental/Lease to a number format.   Is the info object type CHAR or NUMC or ???  I would look there.
    Also, make  sure / is in RSKC.
    Brian

  • Dump while downloading data from Application Server File in 4.6 system

    Hi,
    When we are trying to upload data from Application Server to internal table using dataset statements, it is resulting in a dump. System we are using is 4.6c.
    When we faced similar kind of issue in ECC version, we have used the statement, Ignoring Conversion Errors.
    Please let me know how to handle this situation in 4.6 System.
    Thanks for your inputs.
    Regards,
    Phani

    Hi All,
    I am sorry. My question was wrong. It should be while uploading data from internal table to application server, if there are any special characters, it is going to dump.
    I will let you know the dump details and code at the earliesst.
    Sorry and Thanks again for your prompt response.
    Regards,
    Phani.

  • Urgent - Append data to internal table from Application server

    Hi All,
    I encountered the problem while read the input file from Application server...then append it to internal table. I manage to read the input file from presentation and append the data to internal table.
    Below are my coding which cause me not able the append data from Application server. Please kindly help me to solving/correct my coding. Thanks in advance .
    PARAMETERS : p_inpfl LIKE rlgrap-filename.  "Material Input File
    SELECTION-SCREEN BEGIN OF LINE.
    Application Server
    SELECTION-SCREEN COMMENT 1(19) text-002 FOR FIELD rb_ux.
    SELECTION-SCREEN POSITION 33.
    PARAMETERS: rb_ux RADIOBUTTON GROUP g1.
    Presentation Server
    SELECTION-SCREEN COMMENT 40(21) text-003 FOR FIELD rb_pc.
    SELECTION-SCREEN POSITION 65.
    PARAMETERS: rb_pc RADIOBUTTON GROUP g1 DEFAULT 'X'.
    SELECTION-SCREEN END OF LINE.
    SELECTION-SCREEN  SKIP.
    SELECTION-SCREEN END OF BLOCK b01.
    FORM f_Input_file.
      CLEAR: v_f_exists.
      CHECK NOT p_inpfl IS INITIAL.  "input file exist
      IF NOT rb_pc IS INITIAL.  " Pc check
        PERFORM f_read_tab_delimited_file TABLES i_input
                               USING    c_09
                                        p_inpfl
                                        rb_ux
                               CHANGING v_ifile_str_with_tab
                                        v_f_exists
                                        v_ifile_record_count
                                        v_message.
        IF v_f_exists EQ '1' .
      UPLOAD FILE could not be read
          MESSAGE e546 .
        ENDIF .
        IF v_ifile_record_count EQ 0 .
      Zero records in upload file
          MESSAGE e547 .
        ENDIF.
      ELSE.
        OPEN DATASET p_inpfl FOR INPUT IN TEXT MODE.
        DO.
          READ DATASET p_inpfl INTO i_input.
          IF sy-subrc EQ 0.
            APPEND i_input.
          ELSE.
            EXIT.
          ENDIF.
        ENDDO.
        CLOSE DATASET p_inpfl.
      ENDIF.

    Hi,
    Refere the following code for the poulating internal from the application server.
    PARAMETERS :  pr_sfile TYPE  filename-fileintern,
    Here give the logical file name from the application serevr.
    data :        w_param_1 LIKE  filename-fileintern,
                   x_file(500),
                   w_move_file LIKE  epsf-epsfilnam,
                   w_from_dir  LIKE epsf-epsdirnam,
                   w_path LIKE rlgrap-filename,
                  input_line(1000),
                  w_path LIKE rlgrap-filename,
                  w_file LIKE rlgrap-filename,
                  w_dir LIKE  rlgrap-filename,
                  w_dir1 LIKE epsf-epsdirnam,
                  w_file1 LIKE  epsf-epsfilnam,
    **************Start of the code***************
      MOVE '*' TO w_param_1.
      PERFORM get_file_name USING pr_sfile w_param_1.
        LOOP AT it_file WHERE name CP w_file1.
          CLEAR : x_file, w_path,
                  w_move_file, w_from_dir.
          REFRESH : it_input,
                    it_input_err.
       IF w_flag IS INITIAL.
          CONCATENATE w_dir it_file-name INTO x_file.
          CONDENSE  x_file.
    TO Move file from sever for backup storing the file name and path
          w_path = x_file.
          CALL FUNCTION 'TRINT_SPLIT_FILE_AND_PATH'
            EXPORTING
              full_name     = x_file
            IMPORTING
              stripped_name = w_move_file
              file_path     = w_from_dir
            EXCEPTIONS
              x_error       = 1
              OTHERS        = 2.
          IF sy-subrc <> 0.
            MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                    WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
          ENDIF.
    ********here it_input will be the structure of the file present on the application server
          PERFORM read_file TABLES it_input
                            USING  x_file.
          CLEAR it_input_err.
          REFRESH it_input.
        ENDLOOP.
    *******************end of the code****************
    *&      Form  read_file
          text
         -->P_X_FILE  text
    FORM read_file  TABLES it_tab
                    USING  x_file.
      OPEN DATASET x_file FOR INPUT IN TEXT MODE ENCODING DEFAULT.
      IF sy-subrc NE 0.
        WRITE : / text-006.
      ELSE.
        DO.
          READ DATASET x_file INTO input_line.
          IF sy-subrc = 0.
            CLEAR: it_input, count.
            DO.
              ADD 1 TO count.
              ASSIGN COMPONENT count OF STRUCTURE it_tab TO <fs>.
              IF sy-subrc = 0.
                SPLIT input_line AT separator INTO <fs> input_line.
              ELSE.
                EXIT.
              ENDIF.
            ENDDO.
            APPEND it_tab.
          ELSE.
            EXIT.
          ENDIF.
        ENDDO.
      ENDIF.
      CLOSE DATASET x_file.
    *&      Form  get_file_name
          text
         -->P_P_SFILE  text
         -->P_W_PARAM_1  text
    FORM get_file_name USING    p_sfile
                                w_param_1.
                               CHANGING x_file.
      CALL FUNCTION 'FILE_GET_NAME'
        EXPORTING
          client           = sy-mandt
          logical_filename = p_sfile
          parameter_1      = w_param_1
        IMPORTING
          file_name        = x_file
        EXCEPTIONS
          file_not_found   = 1
          OTHERS           = 2.
      IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
      w_path = x_file.
      CALL FUNCTION 'TRINT_SPLIT_FILE_AND_PATH'
        EXPORTING
          full_name     = w_path
        IMPORTING
          stripped_name = w_file
          file_path     = w_dir
        EXCEPTIONS
          x_error       = 1
          OTHERS        = 2.
      IF sy-subrc <> 0.
        MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      ENDIF.
      w_dir1 = w_dir.
      w_file1 = w_file.
      CALL FUNCTION 'EPS_GET_DIRECTORY_LISTING'
        EXPORTING
          dir_name               = w_dir1
          file_mask              = w_file1
        TABLES
          dir_list               = it_file
        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 <> 0.
        WRITE : / text-006.
      ENDIF.
    Hope this will help you.

Maybe you are looking for

  • How do I set up my e-mail so that it doesn't delete it from Outlook?

    When I read and delete my e-mail on my iPad, it also deletes it from my Outlook account.  How do I set it so tha it does not delete it from Outlook?

  • IPhoto crashes while trying to print

    iMac 2.66GHz Intel core 2 duo 8GB 1067 MHz DDR3 Ram Maverick 10-9 iPhoto 9-5-1 Brand new HP Photosmart 5520 from Apple Store There is no way to get past select photo, select print from menu and iPhoto crashes. All software up to date. No problem prin

  • Query returns null pointer as result

    Hi, I have a problem retrieving objects with Query. Wenn I lookup an object with the following method: Query q = pm.newQuery(classObj); q.declareParameters("String param"); q.setFilter(fieldName + " == param"); ans = (Collection)q.execute(searchValue

  • Apple configurater won't restore backup since updating to version 1.2

    Since updating Apple Configurator to version 1.2, I am unable to restore from a backup. I have supervised iPad 2s. Set one up the way we want and backup. Connect another supervised iPad 2 and try to restore. Fails everytime. If I restore from a backu

  • Does not copy new text

    If I try to copy some text from somewhere and paste it, it does not paste. instead, the previous item that i copied appears. This is so so so annoying. I never expected Apple iOS would be this glitchy. Where is the PERFECTIONISM and the SIMPLICITY? E