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..

Similar Messages

  • Data Transfer from Flat file To SAP system,

    Hi SAP Guru's,
    My query is :
    How to update Material master data by using idoc type MATMAS05 . The data is present in flat file at application server.
    I am  new to idoc area.Please provide me the sample program that how to update material master data by using standard idoc type.
    I am clear with the point that we have to read flat file from application server to internal table.
    But i got stucked at this point that how to update data from internal table data , by using standard idoc type MATMAS 05.
    I am in real need.Please provide me with the answer of this query.
    I will really appreciate your <<removed by moderator>> reply.
    Thanks
    Simran
    Edited by: Simran_SAP on Aug 25, 2010 10:46 AM
    Edited by: kishan P on Aug 25, 2010 4:36 PM

    Hi Vinod,
    Thanks for reply..
    I am new to idoc area.and my requirement is to generate the idoc after reading data from a flat file. The file is passed to the application server
    by a middleware . The SAP interface program reads the file from the application server and then starts processing the data. Please help me how to create the inbound IDoc and which FM needs to be used.
    Please provide a sample Program .
    This will really help..
    Waiting fr ur early response.
    Thanks
    Simran

  • Fetching of multiple files from Application Server into SAP Program

    Hi All,
    I have a issue related <b>Fetching of multiple files from Application Server into SAP Program</b>.
    Actual issue is as below.
    In the <b>selection screen</b> of <b>my program</b> i will give <b>Application Server Path</b> as :
    <b>/PW/DATA/SAP/D1S/PP/DOWN/eppi0720*</b>
    Then the based on above input it should pick up all the files that are matching <b>eppi0720*</b> criteria.
    Suppose if i am having <b>5</b> files with above scenario, i have to fetch all those <b>5</b> files at a time and place in my SAP Program.
    All those 5 file's data should come into SAP at a time.
    Can anybody tell me how can we solve above issue.
    If any body has come across same issue please provide me with solution.
    Thanks in advance.
    Thanks & Regards,
    Rayeez.

    If you want to get around the authorization check, you can do something like this.
    report zrich_0001 .
    parameters: p_path type epsf-epsdirnam
                      default '/usr/sap/TST/SYS/global'.
    parameters: p_file type epsf-epsfilnam default 'CO*'.
    start-of-selection.
    perform get_file_list.
    *       FORM get_file_list                                            *
    form get_file_list.
      types: name_of_dir(1024)        type c,
             name_of_file(260)        type c,
             name_of_path(1285)       type c.
      data: begin of file_list occurs 100,
              dirname     type name_of_dir,  " name of directory. (possibly
                                             " truncated.)
              name        type name_of_file, " name of entry. (possibly
                                             " truncated.)
              type(10)    type c,            " type of entry.
              len(8)      type p,            " length in bytes.
              owner(8)    type c,            " owner of the entry.
            mtime(6)    type p, " last modification date, seconds since 1970
              mode(9)     type c, " like "rwx-r-x--x": protection mode.
              useable(1)  type c,
              subrc(4)    type c,
              errno(3)    type c,
              errmsg(40)  type c,
              mod_date    type d,
              mod_time(8) type c,            " hh:mm:ss
              seen(1)     type c,
              changed(1)  type c,
            end of file_list.
      data: begin of file,
              dirname     type name_of_dir,  " name of directory. (possibly
                                             " truncated.)
              name        type name_of_file, " name of entry. (possibly
                                             " truncated.)
              type(10)    type c,            " type of entry.
              len(8)      type p,            " length in bytes.
              owner(8)    type c,            " owner of the entry.
            mtime(6)    type p, " last modification date, seconds since 1970
              mode(9)     type c, " like "rwx-r-x--x": protection mode.
              useable(1)  type c,
              subrc(4)    type c,
              errno(3)    type c,
              errmsg(40)  type c,
              mod_date    type d,
              mod_time(8) type c,            " hh:mm:ss
              seen(1)     type c,
              changed(1)  type c,
            end of file.
      call 'C_DIR_READ_FINISH'             " just to be sure
           id 'ERRNO'  field file_list-errno
           id 'ERRMSG' field file_list-errmsg.
      call 'C_DIR_READ_START' id 'DIR'    field p_path
                              id 'FILE'   field p_file
                              id 'ERRNO'  field file-errno
                              id 'ERRMSG' field file-errmsg.
      if sy-subrc <> 0.
        sy-subrc = 4.
        exit.
      endif.
    * Read the file list and add to internal table.
      do.
        clear file.
        call 'C_DIR_READ_NEXT'
          id 'TYPE'   field file-type
          id 'NAME'   field file-name
          id 'LEN'    field file-len
          id 'OWNER'  field file-owner
          id 'MTIME'  field file-mtime
          id 'MODE'   field file-mode
          id 'ERRNO'  field file-errno
          id 'ERRMSG' field file-errmsg.
        if sy-subrc =  1.
          exit.
        endif.
        append file to file_list.
      enddo.
    * Write out the file list
      loop at file_list.
        write:/ file_list-name.
      endloop.
    endform.
    Regards,
    Rich Heilman

  • How to copy a file from application server to local system

    Guys,
    Need to copy a file from application server to local system.Is there an FM for the same.
    Tried searching for it but couldn't find anything useful.
    Code snippets will be highly appreciated.
    Warm Regards,
    P.
    Moderator message: very frequently asked and answered question, obviously you did not search thoroughly, all points removed.
    Edited by: Thomas Zloch on Dec 3, 2010 4:48 PM

    hi,
    You can use the transactions CG3Y or through program u can do like this..
    DATA: BEGIN OF IT_FILE OCCURS 0,
                    LINE TYPE STRING,
               END OF IT_FILE.
    OPEN DATASET <file_name>  FOR INPUT IN TEXT MODE ENCODING DEFAULT.
            IF SY-SUBRC IS INITIAL.
              DO.
                READ DATASET<file_name> INTO IT_FILE-LINE.
                IF SY-SUBRC = 0.
                  APPEND IT_FILE.
                  CLEAR IT_FILE.
                ELSE.
                  EXIT.
                ENDIF.
              ENDDO.
            ENDIF.
    CLOSE DATASET <file_name>.
    Download it to local system using  FM - GUI_DOWNLOAD

  • 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

  • SSO from non sap application server to SAP systems

    Mysapsso2 cookie has been generated after we are login into the portal https://FQDN/irj/portal for all the backend systems in client browser. Since it is working fine. After login into the portal , while clicking the URL iview of external JBoss application sever in portal home page and it is shows the new windows pop up login page. After login into this external JBoss application server, we have configured work item for SAP ITS WEBGUI login page of the backend system inside this JBoss appliaction. Here we need to pass the mysapsso2 cookie information in SAP WEBGUI, so that login page is bypassed using SSO. Kindly do give some suggestion for fixing this issue. Kind Regards, R Rajavelu

    Try to use it Appsintegrator to access the non sap application from SAP Application

  • 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.
    %

  • Data Transfer to Application server in Background

    Hi,
    I tried running a report in background.If I choose "print immediately" option, the required file is written to the application server.But on scheduling the date and time of the job(the print immediate option is not checked), the file is not written to the server.
    Please let me know what could be the problem and how to solve it.
    Thanks and Regards,
    Chaarulatha.

    Hi don't understand the question:
    "print immediately" just means that a print order is created for the spool list created.
    This is completelöy independent of the writing of a file. Files are written using open dataset and transfer statements.
    Is it this what you want?
    Regards,
    Clemens

  • Dump in data transfer to application server

    Hi all,
    We are using the FM AUTHORITY_CHECK_DATASET before the command OPEN Dataset to transfer a file to the application server.
    The sy-subrc for the FM comes out to be 0, but the sy-subrc  for the open dataset command = 8 (on Checking in the debug mode).
    The code snippet is as follows
      v_path1 = v_bkpf.
      CALL FUNCTION 'AUTHORITY_CHECK_DATASET'
           EXPORTING
                program          = 'ZZRFFI058_GL_ACCOUNT_MAPPING'
                activity         = 'WRITE'
                filename         = v_path1
           EXCEPTIONS
                no_authority     = 1
                activity_unknown = 2
                OTHERS           = 3.
      IF sy-subrc <> 0.
        MESSAGE e195(zzfn) WITH
              'No authorisation to write file on application server'
               v_path1.
       WRITE:/ 'File:', v_path1, ' not created'.
        STOP.
      ENDIF.
      OPEN DATASET v_bkpf FOR OUTPUT.                           "DEL ACC012
      TRANSFER i_bkpf_w TO v_bkpf LENGTH v_len.
    So we have a dump at the TRANSFER command.
    Not sure how the FM is successful and OPEN DATASET fails   
    Pls post your ideas.
    Thanks ,
    Stock.

    hi please make sure that the strcuture which ur passing into the application server is entirely in character format
    for example:
    <b>
    data: begin of itab occurs 0,
    field1 like mara-matnr,
    field2 like mara-menge,
    end of itab.
    loop at itab.
    transfer itab to app_file.
    endloop.
    </b>
    This will for a dump as the structure isnt in character format. all the fields should be of types C, N, D, T, STRING
    <b>
    in this case declare another itab with character fields of same field length
    begin of itab1.
    field1(18),
    field2(17),
    end of itab1.
    loop at itab.
    itab1-field1 = itab-field1.
    itab1-field2 = itab-field2.
    transfer itab1 to app_file
    endloop.
    award points if found helpful</b>

  • Data transfer to application server

    Hi,
    By using TRANSFER statement we can transfer the data record to the application server.
    my question here is .. Can we  transfer set of records as a whole (at once) to application server...?
    if yes.. please let me know the procedure.
    Thanks in advance..
    Ramana

    Hi Janaki,
    I understand your question that way that you want to avoid multiple TRANSFER commands but transfer all data together.
    This is possible by first concatenating all records to a string and then transfer it. For table structured with all CHAR components  it may look like this:
    DATA:
      lv_all  TYPE STRING.
    FIELD-SYMBOLS:
      <field> TYPE ANY,
      <rec>   TYPE ANY.
    LOOP AT itab ASSIGNING <rec>.
      DO.
        ASSIGN COMPONENT sy-index OF STRUCTURE <rec> to <field>.
        IF SY-SUBRC <> 0.
        EXIT.u201DDO
        ENDIF.
    * insert a TAB character between compoinents
        CONCATENATE
          <field>
          cl_abap_char_utilities=>horizontal_tab
          TO lv_all.
      ENDDO.
      AT LAST.
        TRANSFER lv_all TO <your file open for output or append>.
      ENDAT.
    * insert a linefeed character after each line of internal table
      CONCATENATE
        lv_all
        cl_abap_char_utilities=>linefeed
        TO lv_all.
    ENDLOOP.
    If you do not want the tab character at the end of each record, you may remove it.
    Regards,
    Clemens

  • Data transfer error(application server)

    Hi Gurus,
    While uploading data into application server, I have an issue. I am having the data in internal table but I am unable to send all the data into application server.
    (open dataset file for output )
    TRANSFER l_h_tbl_file  TO fu_wk_get_file.
    Data in internal table:
    f1 f2 f3 f4 f5
    1  2   -  4  5 
    after update to application server:
    f1 f2 f3 f4 f5
    1  2   -  -  - 
    I am getting 2 fields only. if any blank filed(f3) exist between those fields remaining fields also getting blank.
    How can proceed further?
    Regards,
    Dhanu

    Try this..instead of moving field by field into the file 1st convert all he fields to a character stream..and then move that steam to file. Ex:
    loop at internal table into l_h_tbl_file.
    concatenate l_h_tbl_file-f1 l_h_tbl_file-f2 l_h_tbl_file-f3
    l_h_tbl_file-f4 l_h_tbl_file-f5 into g_string.
    TRANSFER g_string TO fu_wk_get_file.
    endloop.

  • 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.

  • Error during data transfer from Lotus Notes to SAP via JCO - Urgent Help Required

    Dear SAP Expert:
    I need your help! Recently getting error during data transfer to SAP. I need your suggestion!
    I am transferring Lotus Notes data to SAP via JCO, recently getting the below error msg, could you pls tell me what could be the reason?
    Please suggest me how to fix that kind of issue.
    "com.sap.mw.jco.JCO$Exception: (104) RFC_ERROR_SYSTEM_FAILURE: Error in ABAP/4 statement when processing an internal table. table.
    at com.sap.mw.jco.rfc.MiddlewareRFC$Client.nativeExecute(Native Method)
    at com.sap.mw.jco.rfc.MiddlewareRFC$Client.execute(MiddlewareRFC.java:1244)
    at com.sap.mw.jco.JCO$Client.execute(JCO.java:3842)
    at com.sap.mw.jco.JCO$Client.execute(JCO.java:3287)
    at SAPAdapter.execute(Unknown Source)
    at JavaAgent.fillBapiAndWriteBackToNotes(Unknown Source)
    at JavaAgent.NotesMain(Unknown Source)
    at lotus.domino.AgentBase.runNotes(Unknown Source)
    at lotus.domino.NotesThread.run(NotesThread.java:249)
    Thanks in advance! Your help would be highly appreciated! Thanks again!

    error is clear, check your abap code.

  • PDF file transfer from File server into SAP

    Hi,
    I need to get the PDF file which exists in the File server into SAP using XI in any format so that I can convert into required form in SAP but the file exists in PDF format in File server or any method other than XI .Is it possible to do it through XI if so please explain me the procedure.
    Answers will be appreciated with points.
    Thanks,
    Ramesh.

    Hi Ramesh,
        In addition to above reply, also go through these blogs whcuh also talk about ADF Conversion:
    <a href="/people/william.li/blog/2006/03/17/how-to-get-started-using-conversion-agent-from-itemfield:///people/william.li/blog/2006/03/17/how-to-get-started-using-conversion-agent-from-itemfield
    <a href="/people/sap.user72/blog/2005/07/27/xi-generate-pdf-file-out-of-file-adapter:///people/sap.user72/blog/2005/07/27/xi-generate-pdf-file-out-of-file-adapter
    Regards,
    Subhasha Ranjan

  • Data transfer from sql server 7.0 to oracle 8i

    iam having problems BIG TIME problems in transferring data from sql server7 to ora8i.
    Can someone plz tell me the steps,procedure to do this or how ican connect to sql server7 and copy all the tables vews etc to ora8i. thanks

    Hi,
    Version 1.2.5.0.0 will be available for free download from this site within the next two weeks.
    I will migrate both schema and data for a SQL Server 7.0 database.
    Please mail [email protected] with your request.
    Regards
    John

Maybe you are looking for

  • Want to break down a date into 4 lines in one field

    Hi all, In report 10g , when a date value mask is like 'DY. MON. DD,YYYY' in a field, it will be display whole date 'Mon. Apr.14,2008' in one line but in the report i want it shows like below in one field (break in every word, four lines) because the

  • How to optimize execution time of lot commands

    hello, in my plugin i do a lot of textinsert cmds, delete cmds, attribute setting cmds. now i wonder why this process is very slow. how can i execute many commands as fast as possible? disable a command/undo stack? how? thanks, juergen

  • Extract Filter v Refine Edge CS5

    I hear a lot of people talking blithely about how superior Refine Edge is to the previous Extract Filter. If you look at the two sample files called "Auto Align 1" and "Auto Align 2" in the tutorials folder a couple of versions back you'll find 2 chi

  • Problem copying cusor, please check code.

    The function below is supposed to accept a database and a read cursor, and create a write cursor pointing to the the same record. It is supposed to work for databases with duplicate keys allowed (a requirement - although the combination of key and da

  • I am having problem with iMessage after updating my 5s to iOS 8.0.2

    I am having problem with iMessage after updating my 5s to iOS 8.0.2. I cannot send any text by iMessage anymore. My friend tries to text me and it did not go through