How to delimited text file data being downloaded in Application server

Hi All,
How to delimited or having a tab between each fields in the data being downloaded to  Application server. Please provide an example of code or how i should make changes to my below coding. Thanks.
eg. the out file in application server.
Field1#Field2#Field3
what I currently get was as below:-
Field1Field2Field3
My coding:
FORM download_outfile.
  DATA : xfer(400).
  IF rb_locl EQ 'X'.
    DESCRIBE TABLE itab LINES sy-tfill.
    IF sy-tfill GT 0.
      CALL FUNCTION 'WS_DOWNLOAD'
           EXPORTING
                filename            = p_file
                filetype            = 'DAT'
           TABLES
                data_tab            = itab
           EXCEPTIONS
                file_open_error     = 1
                file_write_error    = 2
                invalid_filesize    = 3
                invalid_table_width = 4
                invalid_type        = 5
                no_batch            = 6
                unknown_error       = 7
                OTHERS              = 8.
      IF sy-subrc EQ 0.
        WRITE : / 'download done’.
      ELSE.
        WRITE : / '4)Error occured'.
      ENDIF.
    ENDIF.
  ELSE.
    OPEN DATASET p_file FOR OUTPUT IN TEXT MODE.
    DATA : l_subrc LIKE sy-subrc.
    LOOP AT itab.
      MOVE itab TO xfer.
      TRANSFER xfer TO p_file.
      IF sy-subrc NE 0.
        l_subrc = sy-subrc.
      ENDIF.
    ENDLOOP.
    IF l_subrc EQ 0.
      WRITE :/ 'download done’.
    ELSE.
      WRITE :/ 'error occurred’.
    ENDIF.
    CLOSE DATASET p_file.
  ENDIF.
ENDFORM

Hi,
Please check this sample codes.
OPEN DATASET P_DOWN FOR OUTPUT IN TEXT MODE. " P_DOWN is the file to download
  IF SY-SUBRC = 0.
    CLEAR V_STRING.
*-- Download to the file
    LOOP AT IT_DOWN.
      CONCATENATE IT_DOWN-DISTTYPE
                  IT_DOWN-O_CITY
                  IT_DOWN-O_REGIO
                  IT_DOWN-O_PSTLZ
                  IT_DOWN-O_CTRY
                  IT_DOWN-D_CITY
                  IT_DOWN-D_REGIO
                  IT_DOWN-D_PSTLZ
                  IT_DOWN-D_CTRY
                  IT_DOWN-DISTANCE
             INTO V_STRING
             SEPARATED BY '09'.    " here 09 is the tab delimeter
      TRANSFER V_STRING TO P_DOWN.
      CLEAR V_STRING.
    ENDLOOP. 
Regards,
Ferry Lianto

Similar Messages

  • How to load text file data to Oracle Database table?

    By using Oracle Forms, how to load text file data to Oracle Database table?

    Metalink note 33247.1 explains how to use text_io as suggested by Robin to read the file into a Multi-Row block. However, that article was written for forms 4.5 and uses CREATE_RECORD in a loop. There was another article, 91513.1 describing the more elegant method of 'querying' the file into the block by transactional triggers. Unfortunately this more recent article has disappeared without trace and Oracle deny its existence. I know it existed as I have a printed copy in front of me, and very useful it is too.

  • FM to select the file path for download into application server

    Hello,
    I need a FM to select the file path for download into application server. It is a F4 help .
    Its functionality should be simmilar to the one used for presentation server i.e. as fol
    CALL METHOD cl_gui_frontend_services=>file_save_dialog

    Hello,
    What about F4_DXFILENAME_TOPRECURSION? You can check other FMs of the group DX_FILE.
    BR,
    Suhas
    PS: I think these FMs are not released by SAP, so need to be cautious while using these

  • How to store multiple files from SAp in to Application server?

    Hi Guys,
                 Can anybody tell me how to store multiple files from SAP into Application server.in my application i have to get the data from SAP tables BSEG , BKPF , BSAK and BSIK that to daily i have to do.
                Any Logic  or Code for how to do is welcomed.
                        plz help me urgently.
    Thanks,
    Gopi

    Hi,
      directories creates basis. If you have task to store data in application server you already should have information into which folder you have to do it. If you don't have this information because it is just for example training for next task then you can use your personal folder into which you have access. To get list of all available folders please look at attached code and form get_directories (you get the list of folders you see in transaction AL11). But don't forget: If you are using open dataset you have to have rights to access application folder!
    Here you are code which I use to upload text files from local disc into application folder
    Regards,
      Karol
    *& Report  FILE_PC_TO_SAP
    REPORT  FILE_PC_TO_SAP.
    DATA: BEGIN OF searchpoints OCCURS 100,
            DIRNAME(200)     TYPE c, " name of directory.
            sp_name(100)     TYPE c," name of entry. (may end with *)
          END OF searchpoints.
    DATA: BEGIN OF isearchpoints OCCURS 10,
            dirname(75) TYPE c,            " name of directory.
            aliass(75)  TYPE c,            " alias for directory.
            svrname(75) TYPE c,            " svr where directory is availabl
            sp_name(75) TYPE c,            " name of entry. (may end with *)
            sp_cs(10)   TYPE c,            " ContainsString pattern for name
          END OF isearchpoints.
    data: l_file type filetable.
    data: l_rc   type i.
    data: itab   type TABLE OF string.
    data: g_tmp_file_path type rlgrap-filename.
    data: wa_itab type string.
    data: h_destin(100) type c.
    data: dat      type string.
    INITIALIZATION.
    perform get_directories.
    START-OF-SELECTION.
    parameters: in_file type string OBLIGATORY LOWER CASE.
    parameters: destin(100) type c OBLIGATORY LOWER CASE.
    CALL FUNCTION 'GUI_UPLOAD'
      EXPORTING
       FILENAME                      = in_file
       "FILETYPE                      = 'BIN'
       FILETYPE                      = 'ASC'
       HAS_FIELD_SEPARATOR           = ' '
       HEADER_LENGTH                 = 0
       READ_BY_LINE                  = 'X'
       DAT_MODE                      = ' '
      TABLES
        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
       OTHERS                        = 17.
    IF sy-SUBRC <> 0.
      write: / 'Error during loading input file!'.
    ENDIF.
    if h_destin is INITIAL.
      h_destin = in_file.
    endif.
    CONCATENATE destin h_destin into dat SEPARATED BY '/'.
    *TRANSLATE dat TO UPPER CASE.
    OPEN DATASET dat FOR OUTPUT IN TEXT MODE ENCODING DEFAULT.
    IF sy-SUBRC = 0.
      loop at itab into wa_itab.
         TRANSFER: wa_itab TO dat.
      endloop.
      CLOSE DATASET dat.
      write: / 'File uploaded!'.
    ELSE.
      write: / 'Not possible to open dataset'.
    ENDIF.
    at selection-screen on value-request for in_file.
      perform select_input_file_name.
      loop at l_file into g_tmp_file_path.
        move g_tmp_file_path to in_file.
        h_destin = ''.
        SPLIT g_tmp_file_path at '\' into table itab.
        loop at itab into g_tmp_file_path.
          h_destin = g_tmp_file_path.
        endloop.
      endloop.
    at selection-screen on value-request for destin.
      DATA: lt_dfies    TYPE TABLE OF dfies.
      DATA: lwa_dfies   TYPE dfies.
      CALL FUNCTION 'DDIF_FIELDINFO_GET'
        EXPORTING
          tabname    = '/BI0/PCO_AREA'
          lfieldname = 'CO_AREA'
        IMPORTING
          dfies_wa   = lwa_dfies.
      lwa_dfies-tabname = 'searchpoints'.
      lwa_dfies-REPTEXT   = 'Destination directory'.
      lwa_dfies-LENG      = 100.
      lwa_dfies-INTLEN    = 100.
      lwa_dfies-OUTPUTLEN = 100.
      lwa_dfies-fieldname = 'SP_NAME'.
      APPEND lwa_dfies TO lt_dfies.
      CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
        EXPORTING
          RETFIELD = 'SP_NAME'
          DYNPPROG = SY-REPID
          DYNPNR = SY-DYNNR
          DYNPROFIELD = 'destin'
          VALUE_ORG = 'S'
        TABLES
          VALUE_TAB = searchpoints
          FIELD_TAB = lt_dfies
        EXCEPTIONS
          PARAMETER_ERROR = 1
          NO_VALUES_FOUND = 2
          OTHERS = 3.
    *&      Form  select_input_file_name
    *       text
    form select_input_file_name.
    *  call function 'F4_FILENAME'
    *       exporting
    *            program_name  = sy-repid
    *            dynpro_number = sy-dynnr
    *            field_name    = 'PATH'
    *       importing
    *            file_name     = g_tmp_file_path.
      CALL METHOD CL_GUI_FRONTEND_SERVICES=>FILE_OPEN_DIALOG
      EXPORTING
      WINDOW_TITLE = 'Please choose a file'
      "default_extension = '*.TXT'
      "default_filename = 'C:\*.txt'
      initial_directory = 'C:\'
      file_filter = '*.*'
      CHANGING
      FILE_TABLE = l_file
      RC = l_RC
      EXCEPTIONS
      FILE_OPEN_DIALOG_FAILED = 1
      CNTL_ERROR = 2
      ERROR_NO_GUI = 3
      NOT_SUPPORTED_BY_GUI = 4
      OTHERS = 5.
      IF SY-SUBRC <> 0.
        MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
        WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    endform.                    "select_input_file_name
    *&      Form  WRITE_DB_HOME
    *       Write DB home directory
    *       no parameters
    FORM write_db_home.
      CASE sy-dbsys(3).
        WHEN 'ORA'.
          CALL 'C_SAPGPARAM' ID 'NAME'  FIELD 'DIR_ORAHOME'
                             ID 'VALUE' FIELD searchpoints-dirname.
    *--- C5056155 Start of ALV -------------------------------*
    *      PERFORM flip_flop(rsora000) USING cflag.
    *      WRITE: / 'DIR_ORAHOME',       30 searchpoints-dirname.
          MOVE: 'DIR_ORAHOME'        TO searchpoints-sp_name.
          APPEND searchpoints.
    *--- C5056155 End   of ALV -------------------------------*
        WHEN 'ADA'.
          CALL 'C_GETENV' ID 'NAME'  FIELD 'DBROOT'
                          ID 'VALUE' FIELD searchpoints-dirname.
    *--- C5056155 Start of ALV -------------------------------*
    *      PERFORM flip_flop(rsora000) USING cflag.
    *      WRITE: / 'DIR_ADA_DBROOT',    30 searchpoints-dirname.
          MOVE: 'DIR_ADA_DBROOT'     TO searchpoints-sp_name.
          APPEND searchpoints.
    *--- C5056155 End   of ALV -------------------------------*
        WHEN 'INF'.
          CALL 'C_GETENV' ID 'NAME'  FIELD 'INFORMIXDIR'
                          ID 'VALUE' FIELD searchpoints-dirname.
    *--- C5056155 Start of ALV -------------------------------*
    *      PERFORM flip_flop(rsora000) USING cflag.
    *      WRITE: / 'DIR_INF_INFORMIXDIR', 30 searchpoints-dirname.
          MOVE: 'DIR_INF_INFORMIXDIR' TO searchpoints-sp_name.
          APPEND searchpoints..
    *--- C5056155 End   of ALV -------------------------------*
        WHEN 'DB6'.
          CALL 'C_GETENV' ID 'NAME'  FIELD 'INSTHOME'
                          ID 'VALUE' FIELD searchpoints-dirname.
          IF sy-subrc = 0.
    *--- C5056155 Start of ALV -------------------------------*
    *        PERFORM flip_flop(rsora000) USING cflag.
    *        WRITE: / 'DIR_DB2_HOME',    30 searchpoints-dirname.
            MOVE: 'DIR_DB2_HOME'       TO searchpoints-sp_name.
            APPEND searchpoints.
    *--- C5056155 End   of ALV -------------------------------*
          ELSE.
            EXIT.
          ENDIF.
        WHEN OTHERS.
          EXIT.
      ENDCASE.
    ENDFORM.                    " WRITE_DB_HOME
    FORM get_directories.
    * get the name and aliases of ALL userdefined directories
      SELECT * FROM user_dir INTO isearchpoints
        WHERE svrname = sy-uname.
        MOVE isearchpoints-dirname to searchpoints-dirname.
        MOVE isearchpoints-aliass  to searchpoints-sp_name.
        APPEND searchpoints.
      ENDSELECT.
      SELECT * FROM user_dir INTO isearchpoints
        WHERE svrname = 'all'.
        MOVE isearchpoints-dirname to searchpoints-dirname.
        MOVE isearchpoints-aliass  to searchpoints-sp_name.
        APPEND searchpoints.
      ENDSELECT.
    * Get DB home
      IF sy-dbsys(3) = 'ADA'.
        PERFORM write_db_home.
      ENDIF.
    * get name of directory with the error files
      CALL 'C_SAPGPARAM' ID 'NAME'  FIELD 'DIR_ATRA'
                         ID 'VALUE' FIELD searchpoints-dirname.
      MOVE: 'DIR_ATRA'           TO searchpoints-sp_name.
      APPEND searchpoints.
    * get name of directory with the error files
      CALL 'C_SAPGPARAM' ID 'NAME'  FIELD 'DIR_BINARY'
                         ID 'VALUE' FIELD searchpoints-dirname.
      MOVE: 'DIR_BINARY'         TO searchpoints-sp_name.
      APPEND searchpoints.
    * get name of directory $DIR_CCMS
      CALL 'C_SAPGPARAM' ID 'NAME'  FIELD 'DIR_CCMS'
                         ID 'VALUE' FIELD searchpoints-dirname.
      MOVE: 'DIR_CCMS'           TO searchpoints-sp_name.
      APPEND searchpoints.
    * get name of directory with the error files
      CALL 'C_SAPGPARAM' ID 'NAME'  FIELD 'DIR_CT_LOGGING'
                         ID 'VALUE' FIELD searchpoints-dirname.
      MOVE: 'DIR_CT_LOGGING'     TO searchpoints-sp_name.
      APPEND searchpoints.
    * get name of directory with the error files
      CALL 'C_SAPGPARAM' ID 'NAME'  FIELD 'DIR_CT_RUN'
                         ID 'VALUE' FIELD searchpoints-dirname.
      MOVE: 'DIR_CT_RUN'         TO searchpoints-sp_name.
      APPEND searchpoints.
    * get name of directory with the error files
      CALL 'C_SAPGPARAM' ID 'NAME'  FIELD 'DIR_DATA'
                         ID 'VALUE' FIELD searchpoints-dirname.
      MOVE: 'DIR_DATA'           TO searchpoints-sp_name.
      APPEND searchpoints.
    * Get DB home
      IF sy-dbsys(3) = 'DB6'.
        PERFORM write_db_home.
      ENDIF.
    * get name of directory with the error files
      CALL 'C_SAPGPARAM' ID 'NAME'  FIELD 'DIR_DBMS'
                         ID 'VALUE' FIELD searchpoints-dirname.
      MOVE: 'DIR_DBMS'           TO searchpoints-sp_name.
      APPEND searchpoints.
    * get name of directory with the error files
      CALL 'C_SAPGPARAM' ID 'NAME'  FIELD 'DIR_EXECUTABLE'
                         ID 'VALUE' FIELD searchpoints-dirname.
      MOVE: 'DIR_EXECUTABLE'     TO searchpoints-sp_name.
      APPEND searchpoints.
    * get name of directory with the error files
      CALL 'C_SAPGPARAM' ID 'NAME'  FIELD 'DIR_EXE_ROOT'
                         ID 'VALUE' FIELD searchpoints-dirname.
      MOVE: 'DIR_EXE_ROOT'       TO searchpoints-sp_name.
      APPEND searchpoints.
    *get name of directory with the error files
      CALL 'C_SAPGPARAM' ID 'NAME'  FIELD 'DIR_GEN'
                         ID 'VALUE' FIELD searchpoints-dirname.
      MOVE: 'DIR_GEN'            TO searchpoints-sp_name.
      APPEND searchpoints.
    * get name of directory with the error files
      CALL 'C_SAPGPARAM' ID 'NAME'  FIELD 'DIR_GEN_ROOT'
                         ID 'VALUE' FIELD searchpoints-dirname.
      MOVE: 'DIR_GEN_ROOT'       TO searchpoints-sp_name.
      APPEND searchpoints.
    * get name of directory with the error files
      CALL 'C_SAPGPARAM' ID 'NAME'  FIELD 'DIR_GLOBAL'
                         ID 'VALUE' FIELD searchpoints-dirname.
      MOVE: 'DIR_GLOBAL'         TO searchpoints-sp_name.
      APPEND searchpoints.
      CALL 'C_SAPGPARAM' ID 'NAME'  FIELD 'DIR_GRAPH_EXE'
                         ID 'VALUE' FIELD searchpoints-dirname.
      MOVE: 'DIR_GRAPH_EXE'      TO searchpoints-sp_name.
      APPEND searchpoints.
    * get name of directory with the error files
      CALL 'C_SAPGPARAM' ID 'NAME'  FIELD 'DIR_GRAPH_LIB'
                         ID 'VALUE' FIELD searchpoints-dirname.
      MOVE: 'DIR_GRAPH_LIB'      TO searchpoints-sp_name.
      APPEND searchpoints.
    * get name of directory with the error files
      CALL 'C_SAPGPARAM' ID 'NAME'  FIELD 'DIR_HOME'
                         ID 'VALUE' FIELD searchpoints-dirname.
      MOVE: 'DIR_HOME'           TO searchpoints-sp_name.
      APPEND searchpoints.
    * Get DB home
      IF sy-dbsys(3) = 'INF'.
        PERFORM write_db_home.
      ENDIF.
    * get name of directory with the error files
      CALL 'C_SAPGPARAM' ID 'NAME'  FIELD 'DIR_INSTALL'
                         ID 'VALUE' FIELD searchpoints-dirname.
      MOVE: 'DIR_INSTALL'        TO searchpoints-sp_name.
      APPEND searchpoints.
    * get name of directory with the error files
      CALL 'C_SAPGPARAM' ID 'NAME'  FIELD 'DIR_INSTANCE'
                         ID 'VALUE' FIELD searchpoints-dirname.
      MOVE: 'DIR_INSTANCE'       TO searchpoints-sp_name.
      APPEND searchpoints.
    * get name of directory with the error files
      CALL 'C_SAPGPARAM' ID 'NAME'  FIELD 'DIR_LIBRARY'
                         ID 'VALUE' FIELD searchpoints-dirname.
      MOVE: 'DIR_LIBRARY'        TO searchpoints-sp_name.
      APPEND searchpoints.
    * get name of directory with the error files
      CALL 'C_SAPGPARAM' ID 'NAME'  FIELD 'DIR_LOGGING'
                         ID 'VALUE' FIELD searchpoints-dirname.
      MOVE: 'DIR_LOGGING'        TO searchpoints-sp_name.
      APPEND searchpoints.
    * get name of directory with the files written by the memory inspector
      CALL 'C_SAPGPARAM' ID 'NAME'  FIELD 'DIR_MEMORY_INSPECTOR'
                         ID 'VALUE' FIELD searchpoints-dirname.
      MOVE: 'DIR_MEMORY_INSPECTOR' TO searchpoints-sp_name.
      APPEND searchpoints.
    * Get DB home
      IF sy-dbsys(3) = 'ORA'.
        PERFORM write_db_home.
      ENDIF.
    *get name of directory with the error files
      CALL 'C_SAPGPARAM' ID 'NAME'  FIELD 'DIR_PAGING'
                         ID 'VALUE' FIELD searchpoints-dirname.
      MOVE: 'DIR_PAGING'         TO searchpoints-sp_name.
      APPEND searchpoints.
    *get name of directory with the error files
      CALL 'C_SAPGPARAM' ID 'NAME'  FIELD 'DIR_PUT'
                         ID 'VALUE' FIELD searchpoints-dirname.
      MOVE: 'DIR_PUT'            TO searchpoints-sp_name.
      APPEND searchpoints.
    * get name of directory with the error files
      CALL 'C_SAPGPARAM' ID 'NAME'  FIELD 'DIR_PERF'
                         ID 'VALUE' FIELD searchpoints-dirname.
      MOVE: 'DIR_PERF'           TO searchpoints-sp_name.
      APPEND searchpoints.
      CALL 'C_SAPGPARAM' ID 'NAME'  FIELD 'DIR_PROFILE'
                         ID 'VALUE' FIELD searchpoints-dirname.
      MOVE: 'DIR_PROFILE'        TO searchpoints-sp_name.
      APPEND searchpoints.
    * get name of directory with the error files
      CALL 'C_SAPGPARAM' ID 'NAME'  FIELD 'DIR_PROTOKOLLS'
                         ID 'VALUE' FIELD searchpoints-dirname.
      MOVE: 'DIR_PROTOKOLLS'     TO searchpoints-sp_name.
      APPEND searchpoints.
    * get name of directory with the error files
      CALL 'C_SAPGPARAM' ID 'NAME'  FIELD 'DIR_REORG'
                         ID 'VALUE' FIELD searchpoints-dirname.
      MOVE: 'DIR_REORG'          TO searchpoints-sp_name.
      APPEND searchpoints.
    * get name of directory with the error files
      CALL 'C_SAPGPARAM' ID 'NAME'  FIELD 'DIR_ROLL'
                         ID 'VALUE' FIELD searchpoints-dirname.
      MOVE: 'DIR_ROLL'           TO searchpoints-sp_name.
      APPEND searchpoints.
    * get name of directory with the error files
      CALL 'C_SAPGPARAM' ID 'NAME'  FIELD 'DIR_RSYN'
                         ID 'VALUE' FIELD searchpoints-dirname.
      MOVE: 'DIR_RSYN'           TO searchpoints-sp_name.
      APPEND searchpoints.
    * calculate directory for saphostagent (no sapparam available...)
      IF ( sy-opsys(3) = 'WIN' ) OR ( sy-opsys(3) = 'Win' ).
        DATA: windir_path(64),  programfiles_path(64).
    *   hoping that ProgramFiles is set in service user environment
        CALL 'C_GETENV' ID 'NAME'  FIELD 'ProgramFiles'
                        ID 'VALUE' FIELD programfiles_path.
        IF programfiles_path IS INITIAL.
    *     %ProgramFiles% not available. guess from windir
          CALL 'C_GETENV' ID 'NAME'  FIELD 'windir'
                          ID 'VALUE' FIELD windir_path.
    *     e.g. S:\WINDOWS ==> S:\Program Files
          CONCATENATE windir_path(3) 'Program Files' INTO programfiles_path.
        ENDIF.
        CONCATENATE programfiles_path '\SAP\hostctrl'
                                                 INTO searchpoints-dirname.
      ELSE.
    *   on UNIX, the path is hard coded
        searchpoints-dirname = '/usr/sap/hostctrl'.
      ENDIF.
      MOVE: 'DIR_SAPHOSTAGENT' TO searchpoints-sp_name.
      APPEND searchpoints.
    * get name of directory with the error files
      CALL 'C_SAPGPARAM' ID 'NAME'  FIELD 'DIR_SAPUSERS'
                         ID 'VALUE' FIELD searchpoints-dirname.
      IF searchpoints-dirname = '.'.
        IF sy-opsys = 'Windows NT'.
          searchpoints-dirname = '.\'.
        ELSE.
          searchpoints-dirname = './'.
        ENDIF.
      ENDIF.
      MOVE: 'DIR_SAPUSERS'       TO searchpoints-sp_name.
      APPEND searchpoints.
    * get name of directory with the error files
      CALL 'C_SAPGPARAM' ID 'NAME'  FIELD 'DIR_SETUPS'
                         ID 'VALUE' FIELD searchpoints-dirname.
      MOVE: 'DIR_SETUPS'         TO searchpoints-sp_name.
      APPEND searchpoints.
    * get name of directory with the error files
      CALL 'C_SAPGPARAM' ID 'NAME'  FIELD 'DIR_SORTTMP'
                         ID 'VALUE' FIELD searchpoints-dirname.
      MOVE: 'DIR_SORTTMP'        TO searchpoints-sp_name.
      APPEND searchpoints.
    *get name of directory with the error files
      CALL 'C_SAPGPARAM' ID 'NAME'  FIELD 'DIR_SOURCE'
                         ID 'VALUE' FIELD searchpoints-dirname.
      MOVE: 'DIR_SOURCE'         TO searchpoints-sp_name.
      APPEND searchpoints.
    * get name of directory with the error files
      CALL 'C_SAPGPARAM' ID 'NAME'  FIELD 'DIR_TEMP'
                         ID 'VALUE' FIELD searchpoints-dirname.
      MOVE: 'DIR_TEMP'           TO searchpoints-sp_name.
      APPEND searchpoints.
    * get name of directory with the error files
      CALL 'C_SAPGPARAM' ID 'NAME'  FIELD 'DIR_TRANS'
                         ID 'VALUE' FIELD searchpoints-dirname.
      MOVE: 'DIR_TRANS'          TO searchpoints-sp_name.
      APPEND searchpoints.
      CALL 'C_SAPGPARAM' ID 'NAME'  FIELD 'DIR_TRFILES'
                         ID 'VALUE' FIELD searchpoints-dirname.
      MOVE: 'DIR_TRFILES'        TO searchpoints-sp_name.
      APPEND searchpoints.
    * get name of directory with the error files
      CALL 'C_SAPGPARAM' ID 'NAME'  FIELD 'DIR_TRSUB'
                         ID 'VALUE' FIELD searchpoints-dirname.
      MOVE: 'DIR_TRSUB'          TO searchpoints-sp_name.
      APPEND searchpoints.
    *  get the name of the current server.
      CALL 'C_SAPGPARAM' ID 'NAME' FIELD 'rdisp/myname'
                         ID 'VALUE' FIELD searchpoints-dirname.
      data: h_ind type i.
      LOOP AT searchpoints.
        h_ind = sy-tabix.
        IF searchpoints-sp_name IS INITIAL.
          DELETE searchpoints INDEX h_ind.
        ENDIF.
      ENDLOOP.
    ENDFORM.

  • How to store text field data from web dynpro application in pcd ?

    Hi Forum,
    I am new to web Dynpro.
    I want to store user specific data (a text field value) from a wd application in PCD and access it every time the user runs the application.How can I achieve this?
    Thanks,
    Mickey.

    Hi
    I created the "read" and "update" methods in my application service. How can I call them? I created and implemented the methods just like here: https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/340fc0ea-0c01-0010-74bf-965b11031e77
    Operations:
    - readMyEntityService:
    - updateMyEntityService
    Implementation:
    retValue = getMyEntityService().read(key);
    getMyEntityService().update(dS0);
    In Web Dynpro there is this update method with the code above (in my original post).
    How can I call the update-method????????
    Kind regards
    Bettina

  • How to open a  file that resides on either application server or webserver

    Hi all,
    i need to open a pdf file when pressing a button in a form this file might exist on application server or a webserver.please i need the answer to this question as soon as possible

    i did all the previous steps that u mentioned but the file didn't open
    and i recieved the following line on the browser's page
    The requested URL /forms/ktl/dalia.pdf was not found on this server.
    please note that the folder that i'm making an alias for is the bin .does that represent a problem ?

  • Downloading  pipe delimited text file on to desktop  with data in internal

    hi all,
    how  to download pipe delimited text file on to desktop  with data in internal
    table with an example plz.

    hi,
    u can use the FM GUI_DOWNLOAD.
    here is the sample code.
    *Internal table to hold the employee details
    DATA: it_details TYPE STANDARD TABLE OF x_details,
          wa_details TYPE x_details.
    *Internal table for file
    DATA: BEGIN OF  it_details_txt OCCURS 0,
            line(700),
          END OF  it_details_txt.
    *Employee details for the file
      CLEAR wa_details.
      LOOP AT it_details INTO wa_details.
        CLEAR it_details_txt.
        CONCATENATE
            wa_details-var1
            wa_details-var2
            wa_details-var3
            wa_details-var4
          INTO it_details_txt-line SEPARATED BY '|'.
        APPEND it_details_txt.
        CLEAR wa_details.
      ENDLOOP.
    *Download file in .TXT format to local desktop
      CALL FUNCTION 'GUI_DOWNLOAD'
        EXPORTING
          filename                = 'data.txt'
          filetype                = 'ASC'
        TABLES
          data_tab                = it_details_txt
        EXCEPTIONS
          file_open_error         = 1
          file_write_error        = 2
          invalid_filesize        = 3
          invalid_type            = 4
          no_batch                = 5
          unknown_error           = 6
          invalid_table_width     = 7
          gui_refuse_filetransfer = 8
          customer_error          = 9
          no_authority            = 10
          OTHERS                  = 11.
      IF sy-subrc = 0.
        MESSAGE 'Data downloaded successfully' TYPE 'S'.
      ENDIF.

  • How to get summary columns in delimited text file

    How to get summary columns in delimited text file
    I am trying to generate a delimited text file output with delimited_hdr = no.The report is a Group above report with summary columns at the bottom.In the text file the headers are not getting repeated & thats ok.The problem is the summary data is getting repeated for each row of data.Is there a way where i will get all the data & summary data will get displayed only once.I have to import the delimited text file in excel spreadsheet.

    Sorry there were a typos :
    When I used desformat=DELIMITEDDATA with desttype=FILE, I get error "unknown printer driver DELIMITEDDATA". When you look for help, DELIMITED is not even listed as one of the values for DESTFORMAT. But if you scroll down and look for DELIMITER it says , this works only in conjuction with DESTFORMAT=DELIMITED !!!!!!??!! This is in 9i.
    Has this thing worked for anybody ? Can anyone please tell if they were able to suppress the sumary columns or the parent columns of a master-detail data for that matter ?

  • Application Server Download - Tab Delimited Text File

    Hi,
    I am trying to create a tab delimited text file in application server. Is there any option should i use with the Open Dataset / Transfer statements? My requirement is to download the file (Text - Tab Delimited) into Excel for further analysis. Can you please suggest me a suitable solution for this?
    Thanks,
    Kannan.

    Hi,
    You can use transactions CG3Y and CG3Z. Its very simple.
    Refer sample code:
    constants: c_split TYPE c VALUE cl_abap_char_utilities=>horizontal_tab,
    c_path TYPE VALUE char100 '/local/data/interface/A28/DM/OUT'.
    *& Form f1001_browse_appl_file
    Pick up the file path for the file in the application server
    FORM f1001_browse_appl_file .
    DATA: lcl_directory TYPE char128.
    lcl_directory = p_direct.
    CALL FUNCTION '/SAPDMC/LSM_F4_SERVER_FILE'
    EXPORTING
    directory = lcl_directory
    filemask = c_mask
    IMPORTING
    serverfile = p_f2
    EXCEPTIONS
    canceled_by_user = 1
    OTHERS = 2.
    IF sy-subrc 0.
    MESSAGE s000 WITH text-039.
    EXIT.
    ENDIF.
    ENDFORM. " f1001_browse_appl_file
    *& Form f1004_app_file
    upload the file from the application server
    FORM f1004_app_file .
    REFRESH: i_input.
    OPEN DATASET p_f2 IN TEXT MODE ENCODING DEFAULT FOR INPUT.
    IF sy-subrc EQ 0.
    DO.
    READ DATASET p_f2 INTO wa_input_rec.
    IF sy-subrc 0.
    MESSAGE s000 WITH text-030.
    EXIT.
    ENDIF.
    o
    + Split The CSV record into Work Area
    PERFORM f0025_record_split.
    o
    + Populate internal table.
    APPEND wa_input TO i_input.
    CLEAR wa_input.
    ENDDO.
    ENDIF.
    ENDFORM. " f1004_app_file
    *& Form f0025_record_split
    Move the assembly layer file into the work area
    FORM f0025_record_split .
    CLEAR wa_input.
    SPLIT wa_input_rec AT c_split INTO
    wa_input-legacykey
    wa_input-profile_role
    wa_input-read_date.
    ENDFORM. " f0025_record_split
    DO your manipulation with the data records here.
    Popualte data into final internal table and write it back to application server at the desired path.
    *& Form f0020_write_application
    Write error log to application Server
    FORM f0020_write_application .
    IF p_f1 IS NOT INITIAL.
    CONCATENATE p_direct p_obj sy-datum text-037 INTO p_f2.
    ELSEIF p_f2 IS NOT INITIAL.
    REPLACE text-036 IN p_f2 WITH text-037.
    ENDIF.
    OPEN DATASET p_f2 FOR OUTPUT IN TEXT MODE ENCODING DEFAULT.
    IF sy-subrc 0.
    EXIT.
    ENDIF.
    LOOP AT i_error INTO wa_error.
    TRANSFER wa_error TO p_f2.
    IF sy-subrc 0.
    EXIT.
    ENDIF.
    CLEAR wa_error.
    ENDLOOP.
    CLOSE DATASET p_f2.
    ENDFORM. " f0020_write_application
    HTH,
    Regards,
    Dhruv Shah

  • How to create a tab-delimited text file?

    Hi,
    I need to create a tab-delimited text file at presentation server getting content from an internal table. My file should also have a header - also tab-delimited. Data for a header is stored in some work area.
    Any ideas how to add tab-delimiter into a text file? Or should I go for a HEX file and use
    CONSTANTS: c_tab TYPE x VALUE '09'.
    and separate my data with this constant instead?
    Any thoughts whould be appreciated.
    TIA
    Ivaylo Mutafchiev

    Hi Ivaylo,
    Refer sample code:
        IF i_final_head[] IS NOT INITIAL.
          CALL FUNCTION 'GUI_DOWNLOAD'
            EXPORTING
              filename                = lcl_filename
              filetype                = 'ASC'
              write_field_separator   = 'X'
            TABLES
              data_tab                = i_final_head
            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
              OTHERS                  = 17.
          IF sy-subrc <> 0.
            MESSAGE s000 WITH text-031.
            EXIT.
          ENDIF.
        ENDIF.
    Reward points if this helps.
    Manish
    Message was edited by: Manish Kumar

  • How to use Automator to batch convert xls/xlsx files into tab OR pipe delimited text file.

    If you have answer, please provide specific and detailed steps.
    Situation 1:
    Start:
    150+ files in .xls OR .xlsx format
    data contains many characters EXCEPT "Tab"
    Process:
    Use Automator to:
    Select Files from Finder window
    Convert selected files from xls/xlsx to TAB-DELIMITED file format
    End:
    150+ files in .txt format
    files have identical names to those from "Start:"
    data is TAB-DELIMITED
    Situation 2:
    Start:
    150+ files in .xls OR .xlsx format
    data contains many characters EXCEPT | (pipe, vertical bar)
    Process:
    Use Automator to:
    Select Files from Finder window
    Convert selected files from xls/xlsx to |-delimited file format
    End:
    150+ files in .txt format
    files have identical names to those from "Start:"
    data is "|"-delimited

    If your post is addressed to my response then the answer is you have to write your own or search on-line to see if something exists to do what you want.
    As you note there is no pre-built script for this.
    regards
    Message was edited by: Frank Caggiano - Are you certain there isn;t something in Excel to export as a tab delimited file?
    This link Convert An Excel Spreadsheet To A Tab Delimited Text File seems to indicate that the function is in Excel already.

  • In Firefox 4 how can I cause the date on downloaded files to be the current date? (Some are and some are not. In FF3 the dates were ALWAYS the current ones.)

    In Firefox 4 how can I cause the date on downloaded files to be the current date? (Some are and some are not. In FF3 the dates were ALWAYS the current ones.)
    == This happened ==
    Every time Firefox opened
    == I upgraded to Firefox 4 (beta)

    Firefox 3.6.* and earlier set the downloaded file's modification time to the current time. In Firefox 4.0 the behavior has been changed, if a server returns a timestamp telling when the file was last modified (Last-Modified header), it is used instead.
    You can revert to the previous behaviour by using the [https://addons.mozilla.org/en-US/firefox/addon/93121/ Download Timestamp] add-on.

  • How do I save a Number file to an delimited text file

    I was trying to import all my conatct that I created from Number to iList, I kept on failing, after I did some reaserch, and found out I need to save to an delimited text file. Can anybody help me? Or if anyone can direct me from import an Number file into iList, it would be wonderful, please help.
    Thank again

    You have a couple of options to convert the data to a tab-delimited file. The easist may be to copy the table from Numbers & paste it into a Pages word processing document. From there you can export it as a plain text file which you can then import.
    Jerry,
    IList Data is a database app that may be a solution for those moving from AppleWorks. It's more than Bento & less than FileMaker.

  • How to get tab delimited text file when Stored Procedure executes ?

    Hello Everyone,
    I have a stored procedure which returns 1 result set as an output.
    I want the output as a Tab Delimited Text file.
    I know that I can use SSIS and get the same output but I am not allowed to use SSIS in this case.
    Is there any other ways ?
    I will be really appreciate If someone can answer with, How many different ways I can get Tab delimited text file ?
    Thanks in advance
    Henary

    you can do that by using SQLCMD
    http://blog.sqlauthority.com/2013/03/05/sql-server-exporting-query-results-to-csv-using-sqlcmd/
    you can also use BCP 
    EXEC master..xp_cmdshell 'bcp "select * from tempdb.dbo.orders" queryout "c:\output.txt" -c -T'
    EXEC master..xp_cmdshell 'bcp "exec usertest.dbo.proctest" queryout "c:\output.txt" -c -T'
    --Prashanth

  • Efficent method to sort data from tab delimited text file

    I am currently writing a program to sort through data that was acquired and display it on a graph and some other indicators.  The file is a tab delimited text file with possibly 100,000s of data points.  the current method that I have tried using was that if I wanted all of the data from Oct, I would parse out the month from the timestamp, compare that to the desired month, and add it to the array if it is the same.  Other possible options of sorting are yearly and daily, possibly even hourly.
    The method does work, however it does take some time (up to a minute on a P4 3.6 GHz with 2 gb ram), and most of the other computers are not nearly as fast or with as much memory.  Is there a more efficent method to sorting the data??
    I attached my sorting vi as well as a sample data file.
    thanks for the advice.  It is saved in LV8.0.1
    Kenny
    Kenny
    Attachments:
    data sort.zip ‏84 KB
    oven1.txt ‏21 KB

    First of all, "sorting" has usually a different meaning (Sorting and numeric array ascending or descending, a string array aphabetically, etc.). Your data already seems sorted by date and time, you just want to pick a subset having certain characteristics.
    The main problem that is slowing you down is your constant growing of large arrays. This causes constant memory reallocations.
    Since your data is already sorted by date and time, all you need is to place your data in a sutable data structure, find the start and end point of your selection, then use "array subset" for example.
    Your code also seems to have a lot of unecessary complexity. See for example your "test for sort data" (see image below).
    the four cases only differ by filename --> only the file name belongs into the case and the file operation outside the inner case. Even better, just use autoindexing.
    that shift register does not do anything, because it always contains the same data. Using "index array" with index wired to [i] is equivalent to an autoindexing tunnel.
    You have a case structure to select which files to read, skipped files give you an empty array. Do you really need to do all these operations on an empty array. Why not place all code inside the TRUE case??
    Below is an image of one possible code alternative that addresses some of these points.
    Message Edited by altenbach on 10-26-2006 09:32 AM
    LabVIEW Champion . Do more with less code and in less time .
    Attachments:
    testForSortData.png ‏33 KB

Maybe you are looking for

  • AVI to DVD

    Issue: No tool seems to convert the Tina avi-file in the right way. My goal is to soon cool down and burn that avi to a DVD and watch it smoothly on the telly. Yes, the Philips DVP5500S-player deals with MPEG2, MPEG1 and MPEG4. The footage is done in

  • Performance (Linux or Solaris)

    Hi folks, We have been asked by many clients which performs better / faster (Linux vs Solaris). The environment is: Intel Xeon Server Hardware Local Disk (SAS) - RAID 5 Single Server install Single Location VirtualBox as Hypervisor I am asking for yo

  • Mix landscape and portrait in one report

    Is it possible to have a container report have a mix of subreports that are portrait and some landscape?   Is it possible to embedd the printer portrait/landscape control characters on each subreport so it prints properly?   ...or something to print

  • Troubleshooting Maximum No. of Order Proposals Exceeded

    Hi PP Gurus, Can any of you tell me the best way to troubleshoot the above problem after an MRP run?  When I run MRP in the background - MDBT I occasionally get an error in the log saying "Maximum no. of order proposals per deadline exceeded" for one

  • I cannot open Iphoto on my macbook pro

    I cannot open Iphoto on my macbook pro what do I do?