Return a flat file from an RFC

Hi,
I have created a function module that at the moment returns 4 tables. I want to create a flat file based on these tables and return that file from the function instead of the tables. I can create a flat file using the function GUI_DOWNLOAD.
Is there a way to return a flat file from the function?
Regards,
Mark

No, but you can return all four tables in single flat table.   First you would need to create a structure in SE11,  it would have one field, of type string.  In your function module interface, you would have a tables parameter like the structure that you just created.  No in the code of the function module, instead of writing your data of each internal table to the corresponding tables parameter to update the one table with the flat structure. 
Make Sense?
Regards,
Rich Heilman

Similar Messages

  • Flat file to Asynch RFC: R3 not getting updated

    hi all,
             I have a flat file to asynch RFC scenario.I can see the file getting deleted and the chequered flag in MONI.In adapter monitoring i can see the message being processed for the RFC.But it has to update an R3 table which is not getting done.
    Can anybody give ideas where the problem lies...in earlier blogs someone had suggested to check sm58 but dnt know what to give the inputs for this...
    help highly appreciated and points will be awarded
    regards,'
    Nisheeta

    Hi Nisheeta,
    1)I hope your Receiver RFC adpater is working fine (In adapter monitoring it should be green)
    2) As you mentioned that your RFC is working correctly with the given inputs (which in this case you are passing thru file, right?). Just check oncemore.
    3) Call transaction SM58 . This tool lists only those transactonal RFCs that could not be carried out successfully or that had to be planned as batch jobs. The list includes the LUW ID and an error message. Error messages displayed in SM58 are taken from the <b>target system</b>. To display the text of the message, double-click on the message.
    so u have to check in sap29...
    Regards
    Suraj
    PS: <b>Guyz stop asking for points, let her problem get solved first... Thanks</b>

  • Delete  flat file from the local drive after downloading in the program

    how to <b>delete flat file from the local drive after downloading in the program</b>
    I am using gui_upload to upload flat file data in internal table. and after that i dont want that flat file in the disk. i want to delete it.

    Once the file has been uploaded into the internal table call the<b> FILE_DELETE </b>method of the class  <b>CL_GUI_FRONTEND_SERVICES</b>.
    DATA: v_rc TYPE i.
    CALL METHOD cl_gui_frontend_services=>file_delete
    EXPORTING
    filename = 'C:\TEMP\MATERIAL.TXT'
    CHANGING
    rc = v_rc
    EXCEPTIONS
    file_delete_failed = 1
    cntl_error = 2
    error_no_gui = 3
    file_not_found = 4
    access_denied = 5
    unknown_error = 6
    OTHERS = 7.
    IF sy-subrc <> 0.
    MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
    WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
    ENDIF.
    Regards
    Kathirvel

  • Load Flat File from App Server

    HI, all.
    I want load flat file from appliation server. I created CSV file and loaded it on app. server with FM ARCHIVEFILE_CLIENT_TO_SERVER. After I created datasource and tried load data in the infocube. In this procedure I encountered with two problem
    1. When I look file in AL11, I doesn't see cyrillic symbols, instead this symbols I see #.
    2. When I try load data with data source, I get exception RS_EXCEPTION 000 "File don't open"
    Anybody can help me resolve this problem?
    wbr, Fanil.

    Hi, kodanda pani KV.
    2. File is was closed.
    1. Can me you clearly explain what you meen?
    wbr, Fanil

  • Problem Reading Flat File from Application server

    Hi All,
    I want to upload a Flat File which is having a Line Length of 3000.
    While uploading it to Application server , only upto 555 length it is getting uploaded .
    i am using the code :
    DATA: BEGIN OF TB_DATA OCCURS 0,
            LINE(3000),
          END OF TB_DATA.
    *----Uploading the flat file from the Local drive using FM "UPLOAD".
    OPEN DATASET TB_FILENAM-DATA FOR OUTPUT IN TEXT MODE." ENCODING DEFAULT.
    IF SY-SUBRC NE 0.
      WRITE:/ 'Unable to open file:', TB_FILENAM-DATA.
    ELSE.
      LOOP AT TB_DATA.
        TRANSFER TB_DATA TO TB_FILENAM-DATA.
      ENDLOOP.
    ENDIF.
    CLOSE DATASET TB_FILENAM-DATA.
    What could be the problem?
    Could it be due to any Configuration Problem?
    Waiting for your replies.
    Thanks and Regards.
    Suki

    Your code looks OK, but you may have touble displaying the full width. Try:
    WRITE: /001 TB_FILENAM-DATA+555.
    (And don't forget to append your ITAB after each read.)
    Rob

  • To read flat file from a unix server

    We need to read a flat file from a Unix server, where our Database is located.
    The location gets created correctly.
    But while we are trying to import files from the location in Design Center , we get an error that "directory does not exists", although the directory has all the permissions.
    Can someone please suggest how should we create the location so as it can read the files.
    Please Reply ASAP......

    We have started Design Center on a local machine(Windows Machine) with uaer as repository owner of the server,
    In the design center we can not sample the file till we import it,
    can you please tell how to sampe the file without importing it.
    Also a location pointing to server location gets easily created on the design center and the file module points to that location only, but when we try to import the file through that location, it says directory does not exists, although oracle user has all the read write permissions on the directory......
    Please help!

  • How can I get data in flat file from Pool table and cluster table ?

    Hi,
    I am working in one Achiving project. My requirement is to get data into flat file from Cluster table and pool table.
    Is there any tool avilable to download data into flat file from pool table and cluster table ?
    if table name given in the selection screen then data will be downloaded into flat file.
    waiting for quick response.
    Best Regards,
    Bansidhar

    Data cannot be retrived directly form the cluster table
    as the Cluster results are stored in Cluster Key say for example PCLkey
    and form that Key we need to fetch the data
    these clustes are not the part of PNP or PNPCE tables
    for ur info kindly check

  • Extracting a flat file from oracle table

    I have moved the knowledge module KIM ISO SQL to FileAppend from the Metadata to my project folder.
    But when I create an interface mapping the oracle table and a flat file on a different unix server, in the drop down menu , it shows only KIM SQL TO SQL and KIM Control Append.It does not show up the SQL to FileAppend knowledge module option.
    What should I do to extract a flat file from oracle table?
    Thanks
    Hima
    Overstock.com

    All IKM in the Drop Down Menu are dependent of the target technology.
    A question, at this interface, is your target table a file ?

  • Moving of flat file from the application server after upload.

    Hi All,
    I am uploading data from a flat file placed on the application server by a BDC program.
    After the BDC has created the session i want to transfer the flat file from that folder to another folder on the application server by changing the name of the flatfile.
    Can any one suggest the best way of doing this particular scenario?
    Thanks in advance.
    Regards
    Satish Nair.

    Here is a sample program.
    report zrich_0001.
    data: d1 type localfile value '/usr/sap/TST/SYS/Data1.txt',
          d2 type localfile value '/usr/sap/TST/SYS/Data2.txt'.
    data: begin of itab occurs 0,
          rec(20) type c,
          end of itab.
    data: wa(20) type c.
    start-of-selection.
      open dataset d1 for input in text mode.
      if sy-subrc = 0.
        do.
          read dataset d1 into wa.
          if sy-subrc <> 0.
            exit.
          endif.
          itab-rec = wa.
          append itab.
        enddo.
      endif.
      close dataset d1.
      open dataset d2 for output in text mode.
      loop at itab.
        transfer itab to d2.
      endloop.
      close dataset d2.
      delete dataset d1.
    Regards,
    Rich Heilman

  • Logical path for getting a Flat file from application server

    Hi All,
    We have loaded some .csv files to application server, what is the logical path we have to mention in the infopackage scheduler screen? please guide me how to give the path for getting a flat file from application server.
    Thanks,
    Sairam.

    Hi Sairam,
    I hope you know which location you have saved in the Application server.
    Now if you go to the Infopackage and click on the "External Data" tab, there you will see Radio Buttons for
    1) Client Workstation
    2) Application Server
    Choose the second radio button, then in the Field "Name of the File" you will be able to use the F4 help and browse AL11 transaction through this option. You can then choose the File.
    Hope this helps
    Regards,
    Praveen.

  • Unable to load the flat file  from client  work station

    Hi,
    I am trying load a flat file (.CSV file)from my desktop (Client work station) and getting the following error.
    An upload from the client workstation in the background is not possible
    Message no. RSM860
    Diagnosis
    You cannot load data from the client workstation in the background.
    Procedure
    Transfer your data to the application server and load it from there.
    I have recd a .XLS file and then I have converted to .CSV file , which I saved in my desktop and trying to load the same.
    Please help me how to go about this?...
    Thanks in advance.
    Christy.

    Hi All,
    Again, I have tried to load the flat file from clint work station with direct loading..I have got the following errors..
    Errors : 1
    Record                                                  990: Contents '50,000' from Field /BIC/ZPLQTY_B Not Convertible in Type QUAN -> Long Tex
    like this i recd so many errors.
    ERROR : 2
    Error in an arithmetic operation in record 259     
    Please help me how to load the flat file successfully.
    If I hv to save the flat file in Appl server..how to do that..Please provide step by step instruction..
    Thanks
    Christy

  • How to receive flat file from XI to R/3 system?

    Hello guys,
    The XI will receive XML files from other source. I have to pick that XML file  and convert it in flat file so that i can receive it in R/3 with required BAPI. Guys plz tell me necessary steps need to follow to do the whole process. I dont know much about XI and from lots of tutorials i am getting confused. I have to work with both XI and SAP R/3. What to do. Plz advise me.
    Thanks in advance.
    With regards,
    Rosaline.

    Dear Abhishek,
    Thanks for your help.
    1) convert the XML content of the file into flat structure (using UDF or JAVA mapping)....map the output of the JAVA mapping to the the BAPI structure....so now you would have falt file (content) in the BAPI.
    2) create a flat file using PI and place it in some folder....now the BAPI program should pick this flat file from the folder and process accordingly....this will not require a JAVA mapping and can be done by FCC parameters of the File channel.
    These are 2 diff way or steps? Plz provide any help link.
    With regards,
    Rosaline.

  • Load some flat files from ftp location

    HI,
    I have requirement, i want to load the some flat files from ftp location. but problem is in that ftp location i have multiple files.i want to load flat files starts with file name with numeric. otherwise i have apart from these start with numeric files .
    i have remain 2 flat files with constant name. i need to load flat files starts with file name with numeric or i need to leave these 2 constant files then need to load remain start with numeric files. how to achive this in ssis for each loop container.

    See these two examples:
    http://microsoft-ssis.blogspot.com/2012/01/custom-ssis-component-foreach-ftp-file.html
    http://microsoft-ssis.blogspot.com/2011/08/foreach-ftp-file-enumerator.html
    Please mark the post as answered if it answers your question | My SSIS Blog:
    http://microsoft-ssis.blogspot.com |
    Twitter

  • FM to tansfer data in flat file from presentation to application server

    Hi Experts,
    Please tell the FM to tansfer data in flat file from presentation server to application server or vice versa in ECC 6.0.
    Thanks.

    Hi,
    This is how you can achieve it:
    1. You read the flat file from presentation layer and store the file content in internal table gt_inrec
      CALL FUNCTION 'GUI_UPLOAD'
        EXPORTING
          filename                = gw_filename
          filetype                = 'ASC'
        IMPORTING
          filelength              = gw_length
          header                  = gw_header
        TABLES
          data_tab                = gt_inrec
        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.
    2. Create a new file at the application server:
      OPEN DATASET p_ofile FOR OUTPUT IN
      TEXT MODE ENCODING DEFAULT.
    3. Transfer the content from the internal table into the file at the application server:
        LOOP AT gt_inrec.
          TRANSFER gt_inrec-record TO p_ofile.
        ENDLOOP.
    Hope it helps,
    Lim....

  • Issue with uploading flat file from App Server

    Hi,
    Im loading a flat file to an ODS.
    When I try to load in from my Local Workstation, it works fine.
    All data is loaded green.
    However, when I try to load the file after i copied it to my App Server, it cannot load.
    The error is get is:
    Error 2 while splitting CSV data: see long text
    Message no. RSDS_ACCESS011
    Diagnosis
    Error 2 occurred while splitting the CSV data string.
    1 = Could not find a closing escape character
    2 = Invalid escape character
    3 = Conversion error
    4 = OTHERS
    The thing is that it worked fine (exact same file no changes) when I loaded from my Desktop.
    Appreciate any help or input.
    Rgds,
    Gary.

    Gary,
    You can load it from the App server. Just check the file name whther you are giving it correctly and also check the readio button from App Server.
    Go to AL11 (Tcode) and cross check whther your file is there. See in which directory your file is there. Mention the same path in the extraction tab in IP.
    Thanks...
    Shambhu

Maybe you are looking for