Upload Files into SAP Office Folder in Background

Hi All ,
Has anyone tried uploading file(s) of any type say *.XLS , *.PDF to SAP office folder (Outbox) in the background . I am using the function module  'SO_DOCUMENT_REPOSITORY' with methods "SAVE" , "ATTCREATEFROMPC" and "SEND" . It works fine in foreground without any errors . But when tried to schedule in background , the job stops at the method call "ATTCREATEFROMPC" and gives a message  "Database error for <INSERT INTO KPRO> " . It looks like the uderlyiong function module checks for an active GUI and fails during background .
Any thoughts or other solutions would be appreciated ....
Thanks

Hi,
I think ATTCREATEFROMPC method is for loading the file from frontend PC. It is bound to fail if you run it in background since there is no SAPGUI running it and it can't know the location.
You will need to use some other method to be able to read the files from the APP server, and have your documents on the APP server if you want to run your code in the background.
cheers,
Ajay

Similar Messages

  • Uploading File into SAP Transaction using BSP

    Hi Everybody,
    I would like to know how to save the file into SAP Transaction thro BSP. I have one requirement,For example,the captured file from the web should be attached into the Equipment master (Transaction Code IE02).Its possible via SAP GUI.But i would like to know how it can be done from BSP.The same example applicable to sales order also..
    Also i wondering where these files get stored.
    Anybody could help me out of this issue please?...
    Naga Bokkisam

    You can do that using BDS..But you need to find the Business object to store it under Equipment Master or Sales order.
    Here is the example where i stored the document under Warranty process, ie sub set of Equipment master:
    Here BUS2222 is business object for Warranty Process:
      CALL FUNCTION 'SCMS_XSTRING_TO_BINARY'
        EXPORTING
          BUFFER                = STR_FILE_CONTENT
        TABLES
          BINARY_TAB            = I_FILE_CONTENT.
      CALL FUNCTION 'BDS_BUSINESSDOCUMENT_CREA_TAB'
        EXPORTING
          CLASSNAME             = 'BUS2222' "classname_select
          CLASSTYPE             = 'BO'" classtype_select
        CLIENT                = SY-MANDT
          OBJECT_KEY            = OBJECT_KEY
        BINARY_FLAG           = 'X'
        TABLES
          SIGNATURE             = I_SIGNATURE
          COMPONENTS            = I_COMPONENTS
        CONTENT               = I_FILE_CONTENT
    EXCEPTIONS
       NOTHING_FOUND         = 1
       PARAMETER_ERROR       = 2
       NOT_ALLOWED           = 3
       ERROR_KPRO            = 4
       INTERNAL_ERROR        = 5
       NOT_AUTHORIZED        = 6
       OTHERS                = 7     .
    Let me know if you need any detail..
    <i>*Reward each useful answer</i>
    Raja T

  • Warning while uploading file into SAP - SAP GUI Security

    Hello Experts,
    When ever I am uploading any file to SAP from desktop, system asks me:
    "Do you want to grant access to this file - Yes or No"
    Also there is check box "Remember my decision"
    Refer screenshot
    Please note: This warning is given to me only. My other colleagues does not get this warning. How can I remove this
    Moreover, it is showing as "SAP GUI Security"
    Meena

    Hi Meena,
    It is just a warning message and so you can ignore it. Also, be informed that nothing is skeptical here. Things are working as it should work.
    You other colleagues must have clicked Remember my decision so now it is not asking them. You can click on remember my decision and then can click on yes. From next time on it wont ask. And even if it asks you just follow the same process.
    Hope this helps!
    Regards,
    Sanket Sachde

  • How to upload a Flat file into sap database if the file is in Appl'n Server

    Hello Sap Experts , Can you tel me
    " How to upload a Flat file into sap database if the file is in Application Server.
    what is Path for that ?
    Plz Tel Me its Urgent
    Thanks for all

    Hi,
    ABAP code for uploading a TAB delimited file into an internal table. See code below for structures.
    *& Report  ZUPLOADTAB                                                  *
    *& Example of Uploading tab delimited file                             *
    REPORT  zuploadtab                    .
    PARAMETERS: p_infile  LIKE rlgrap-filename
                            OBLIGATORY DEFAULT  '/usr/sap/'..
    DATA: ld_file LIKE rlgrap-filename.
    *Internal tabe to store upload data
    TYPES: BEGIN OF t_record,
        name1 like pa0002-VORNA,
        name2 like pa0002-name2,
        age   type i,
        END OF t_record.
    DATA: it_record TYPE STANDARD TABLE OF t_record INITIAL SIZE 0,
          wa_record TYPE t_record.
    *Text version of data table
    TYPES: begin of t_uploadtxt,
      name1(10) type c,
      name2(15) type c,
      age(5)  type c,
    end of t_uploadtxt.
    DATA: wa_uploadtxt TYPE t_uploadtxt.
    *String value to data in initially.
    DATA: wa_string(255) type c.
    constants: con_tab TYPE x VALUE '09'.
    *If you have Unicode check active in program attributes then you will
    *need to declare constants as follows:
    *class cl_abap_char_utilities definition load.
    *constants:
    *    con_tab  type c value cl_abap_char_utilities=>HORIZONTAL_TAB.
    *START-OF-SELECTION
    START-OF-SELECTION.
    ld_file = p_infile.
    OPEN DATASET ld_file FOR INPUT IN TEXT MODE ENCODING DEFAULT.
    IF sy-subrc NE 0.
    ELSE.
      DO.
        CLEAR: wa_string, wa_uploadtxt.
        READ DATASET ld_file INTO wa_string.
        IF sy-subrc NE 0.
          EXIT.
        ELSE.
          SPLIT wa_string AT con_tab INTO wa_uploadtxt-name1
                                          wa_uploadtxt-name2
                                          wa_uploadtxt-age.
          MOVE-CORRESPONDING wa_uploadtxt TO wa_upload.
          APPEND wa_upload TO it_record.
        ENDIF.
      ENDDO.
      CLOSE DATASET ld_file.
    ENDIF.
    *END-OF-SELECTION
    END-OF-SELECTION.
    *!! Text data is now contained within the internal table IT_RECORD
    * Display report data for illustration purposes
      loop at it_record into wa_record.
        write:/     sy-vline,
               (10) wa_record-name1, sy-vline,
               (10) wa_record-name2, sy-vline,
               (10) wa_record-age, sy-vline.
      endloop.

  • T-code to upload mutliple files into SAP directories ?

    Hi,
    Is there any other transaction to upload multiple files into SAP directories ( ALL11) other than CG3Z ? Any other procedures at the operating system level ? Please advise.
    Regards
    Shiva

    I dont think so. But you can :
    -- Ask your developer to create a BDC for this transaction to upload multiple files.
    -- Use LSMW to record this transaction to upload multiple files.
    Regards,
    Jazz

  • How do I upload XML files into sap table?

    Dear all,
    I found some methods that upload xml into SAP,
    but there doesn’t work under 4.6c.
    Can someone tell me how to upload XML files into
    sap under 4.6c?
    THX!

    hi,
    You can convert XML to abap using transformations. Simple transformations is a proprietary SAP programming language that describes the transformation of ABAP data to XML (serialization) and from XML to ABAP data (deserialization).
    goto SE80->workbench->edit object(or other objects)->in object selection chose more tab and then choose the transformation radio button and write a name and click create new.
    Here you enter your transformation like
    <xsl:transform version="1.0"
      xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
      xmlns:sap="http://www.sap.com/sapxsl"
    >
    <xsl:strip-space elements="*"/>
    <xsl:template match="/">
      <xsl:copy-of select="."/>
    </xsl:template>
    </xsl:transform>
    You can use this transfomation in your program using call transformation. You can find more info on call transformation in help.
    Hope this helps.
    Regards,
    Richa

  • I uploaded a AI CS5 file into a Cloud Folder with Plug-ins. But its empty in Adobe Ideas.

    I uploaded an AI CS5 file into a Cloud Folder with Plug-ins. But its empty in Adobe Ideas. I'd like to work on it with the touch version. Any ideas?

    The link should have worked, I just clicked on it and went to the correct forum. Anyway, in the top left you should see a breadcrumb trail like Adobe Forums > Adobe Creative Cloud > Discussions. Click on Adobe Forums and click on the drop-down labeled Select Forum. Type 'i' to reach the i choices and select Ideas.

  • Upload nugget file into SAP (WD ABAP)

    Hi all,
    I had created a WD ABAP program and take backup of the program as a nugget file.Now I am confuse how to upload that file to create an aplication.
    Can anone suggest me how to upload this into SAP.
    Thanks
    Sanket sethi

    hi
    plz go through this
    http://help.sap.com/saphelp_nw04s/helpdata/en/b3/be7941601b1d09e10000000a155106/frameset.htm
    regards
    Prashant

  • Uploading the file into sap ( fields are seprerated by ' | '.

    Hi All,
    Plz let me know how to upload the file into sap in which the fields are separated by the symbol ' | '
    sample file format
    Material|Oracle_Item_type
    (89034)|PFG
    001069-000-97|BTF/BTS
    001070-000-97|SRV PTS
    001074-000-00|SRV PTS
    001086-000-97|SRV PTS
    001143-000-97|SRV PTS
    001176-000-97|SRV PTS
    001197-000-97|SRV PTS

    data: gt_txtar TYPE truxs_t_text_data.
    CALL FUNCTION 'SAP_CONVERT_TO_TEX_FORMAT'
              EXPORTING
                i_field_seperator    = ' | '
              TABLES
                i_tab_sap_data       = itab
              CHANGING
                i_tab_converted_data = gt_txtar.
    CONCATENATE '/usr/sap/tmp/file.txt' INTO lv_dwnfile.
    OPEN DATASET lv_dwnfile FOR OUTPUT IN TEXT MODE ENCODING UTF-8 .
    loop at gt_txtar.
    TRANSFER gt_txtar TO lv_dwnfile.
    endloop.
    CLOSE DATASET lv_dwnfile .
    Regards
    Sathar
    Edited by: Sathar RA on Sep 1, 2008 9:47 AM

  • Upload file to a particular folder in UCM

    I want to upload file to a particular folder location in UCM.
    When I am uploading it is going to the default location though i programmatically have set the folder path
    I am using Adf application in Jdev 11.1.1.3
    As i am new to UCM i do not have idea of whether to define the location at ucm level or in our program
    Below is my code like this
    public void checkInContent(TransferFile file){
    UploadContentVORowImpl row=(UploadContentVORowImpl)this.getUploadContentVO1().getCurrentRow();
    IdcClient client= UCMRepositoryOperations.getIdcClient();
    DataBinder binder= client.createBinder();
    binder.putLocal ("IdcService", "CHECKIN_UNIVERSAL");
    binder.addFile("primaryFile", file);
    String fileType=file.getContentType().substring(0,file.getContentType().indexOf("/"));
    int contentId= new SequenceImpl("UCM_CONTENT_ID_SEQUENCE",getDBTransaction()).getSequenceNumber().intValue();
    binder.putLocal("dDocID", contentId+"");
    binder.putLocal("dDocName", file.getFileName());
    binder.putLocal("dDocTitle", file.getFileName());
    binder.putLocal("dDocType","DigitalMedia");
    SimpleDateFormat sdf=new SimpleDateFormat("dd-MM-yyyy HH:mm:ss");
    binder.putLocal("dInDate",sdf.format(row.getFromDate().dateValue()));
    binder.putLocal("dOutDate",sdf.format(row.getToDate().dateValue()));
    binder.putLocal("xScope",row.getScope());
    if(row.getStateId()!=null){
    binder.putLocal("xState", row.getStateId().toString());
    if(row.getDistrictId()!=null){
    binder.putLocal("xDistrict",row.getDistrictId().toString());
    binder.putLocal("dLocation", "/Contribution Folders/sahaj/content/loginPageNews");
    binder.putLocal("dAuthor", "Test");
    binder.putLocal("dSecurityGroup", "public");
    binder.putLocal("blDateFormat", "dd-MM-yyyy HH:mm:ss");
    ServiceResponse resp=null;
    String response=null;
    try {
    resp = client.sendRequest(UCMRepositoryOperations.getContext(), binder);
    } catch (IdcClientException e) {
    ucmAMLogger.severe(e);
    try {
    response=resp.getResponseAsString();
    resp.close();
    } catch (IOException e) {
    ucmAMLogger.severe(response);
    ucmAMLogger.info(response);
    }

    The xContributionFolder should be an ID, not a file path.
    To determine the correct ID, this PL/SQL function may be useful :
    function f_get_folder_id ( p_folder_path in VARCHAR2)
    return NUMBER
    is
    v_parent_folder_id NUMBER := 429910249369000002 ; -- ID of 'Contribution Folders/Root' collection
    v_folder_name VARCHAR2(255);
    v_folder_path VARCHAR2(32000);
    pos_next_separator NUMBER;
    CURSOR c_get_folder_id ( p_parent_folder_id in number, p_folder_name in varchar2 )
    is
    SELECT dcollectionid
    FROM collections
    WHERE dcollectionname = p_folder_name
    AND dparentcollectionid = p_parent_folder_id;
    begin
    v_folder_path := p_folder_path ;
    -- strip first '/'
    if ( substr(v_folder_path,1,1) = C_FOLDER_SEPARATOR ) then v_folder_path := substr(v_folder_path,2); end if;
    pos_next_separator := instr(v_folder_path,C_FOLDER_SEPARATOR) ;
    while ( pos_next_separator > 0 )
    loop
    v_folder_name := substr(v_folder_path,1, pos_next_separator - 1);
    v_folder_path := substr(v_folder_path,pos_next_separator+ 1);
    open c_get_folder_id ( p_parent_folder_id => v_parent_folder_id , p_folder_name => v_folder_name );
    fetch c_get_folder_id into v_parent_folder_id;
    close c_get_folder_id ;
    pos_next_separator := instr(v_folder_path,C_FOLDER_SEPARATOR) ;
    end loop;
    v_folder_name := v_folder_path;
    open c_get_folder_id ( p_parent_folder_id => v_parent_folder_id , p_folder_name => v_folder_name );
    fetch c_get_folder_id into v_parent_folder_id;
    close c_get_folder_id ;
    dbms_output.put_line('Found :' ||v_folder_name||' id '||v_parent_folder_id);
    return v_parent_folder_id;
    end f_get_folder_id;

  • Error while uploading file into KM

    Hi Experts,
    I m getting error while uploading file into KM. Its throwing an error message like " Syngenta-POC.doc" does not exist, or file is empty; you cannot upload empty files"
    please assists me.

    Shantanu,
    Please check the files which you are upload is empty or unknown format. If everything seems valid then try to check for the corresponding SAP Note in service.sap.com
    Ram

  • Import very large csv files into SAP

    Hi
    We're not using PI, but have middleware called Trading Networks. Our design is fixed (not my decision) to not upload files into Application Server and import it from there. Our design dictates that we must write RFCs and Trading Networks will call the RFC per interface with very large file sent as table of strings. This takes 14 minutes to import into SAP plain Z-table from where we'll integrate. As a test we uploaded the file to Application Server and integrated into Z-table from there. This took 4 minutes. However our architect is not impressed that we'll stretch available Application Server to it's limits.
    I want to propose that the large file be split in e.g. 4 parts at Trading Networks level and call 4 threads of the RFC which could reduce integration time to e.g. 3 minutes 30 seconds. Is there someone that has suggestions in this regard especially about a proposed, working, elegant solution for integrating large files with our current environment? This will form the foundation of our project.
    Thank you and best regards,
    Adrian

    Zip compression can be tried. The RFC will receive zip stream which will be decompressed using CL_ABAP_ZIP.

  • How to Import file into sap directory.

    Hi all,
    I need to import a .XML file into SAP-BW directory from my local pc.
    By tcod AL11 I can only display all the directories, but I cannot import/upload this file.
    How I Can create my own directory e.g /usr/sap/tmp123
    Help me please.
    thanks.
    Kaustubh.

    Hi Kaustubh,
    Use the FM ARCHIVFILE_CLIENT_TO_SERVER.
    Give Filename + path for both the source and destination and your file will get transferred to the specified directory in AL11.
    But I am not sure about creating your own directory in AL11.
    Reward if helpful.
    Regards
    Hemant Khemani

  • Upload file to windows share folder running on unix

    Hi, I am having requirement to upload the files into windows share folder, It works fine If I run the application on windows, but we moved the application to UNIX, so right now the client has to upload the files to windows shareholder , server is running on the UNIX,
    as I am using the simple File file = new File(//share/shareholder),
    so the problem is once we move to UNIX, how can I handle ., any example will really helpful.
    Thanks
    Srikanth

    k, when I run the UNIX, I am getting below error, It works fine If I run in windows, but when I run in Unix getting error, as all are inside the network.
    jcifs.smb.SmbException: Failed to connect to server
    java.net.UnknownHostException: shareServer
    at jcifs.UniAddress.getByName(UniAddress.java:297)
    at jcifs.UniAddress.getByName(UniAddress.java:201)
    at jcifs.smb.SmbFile.getAddress(SmbFile.java:792)
    at jcifs.smb.SmbFile.connect(SmbFile.java:820)
    at jcifs.smb.SmbFile.connect0(SmbFile.java:797)
    at jcifs.smb.SmbFile.open0(SmbFile.java:852)
    at jcifs.smb.SmbFile.open(SmbFile.java:881)
    at jcifs.smb.SmbFileOutputStream.<init>(SmbFileOutputStream.java:139)
    at jcifs.smb.SmbFileOutputStream.<init>(SmbFileOutputStream.java:97)
    at jcifs.smb.SmbFileOutputStream.<init>(SmbFileOutputStream.java:67)
    at jcifs.util.FileTest.main(FileTest.java:37)
    at jcifs.smb.SmbFile.connect0(SmbFile.java:799)
    at jcifs.smb.SmbFile.open0(SmbFile.java:852)
    at jcifs.smb.SmbFile.open(SmbFile.java:881)
    at jcifs.smb.SmbFileOutputStream.<init>(SmbFileOutputStream.java:139)
    at jcifs.smb.SmbFileOutputStream.<init>(SmbFileOutputStream.java:97)
    at jcifs.smb.SmbFileOutputStream.<init>(SmbFileOutputStream.java:67)
    at jcifs.util.FileTest.main(FileTest.java:37)

  • Import a biar file into a specific folder in CMS through java sdk

    Hi,
    How to import a biar file into a specific folder in CMS through java sdk?
    Can anyone help.
    Regards,
    Kavitha S

    Hi Kavitha,
    Have a look at the sample available at
    http://scn.sap.com/docs/DOC-6006, for importing a biar file using java sdks.
    As far as I am aware of, you would not be able to import the contents of a biar file to a specific folder.
    Why would you want to use a biar file to import contents to a different folder?
    Organize>Move functionality from CMC/Infoview/BILaunchpad can work for this.
    -Prithvi

Maybe you are looking for