Not able to checkout Files using Java Code and SAP BAPI  from DMSServer

Hi
Able to download / checkout the files using T-Code SE37 (BAPI_DOCUMENT_CHECKOUTVIEW2).
But when same RFC is executed from Java, it alsways says -
Message ::::::::Document LGL/10000000003/000/00 does not exist
My inputs in Java Code is as below -
import java.io.*;
import java.util.*;
import com.sap.mw.jco.*;
//CREATED ON - 10-APRIL-2010.
public class BapiDocCheckOutview {
     public static void main(String args[]){
          try{
               if(mConnection!=null){
JCO.Repository repository=new JCO.Repository("AraSoft",mConnection);
JCO.setMiddlewareProperty("jco.middleware.allow_start_of_programs", "SAPFTPA");
JCO.Function function=repository.getFunctionTemplate("BAPI_DOCUMENT_CHECKOUTVIEW2").getFunction();
                    //End of get function.
                 System.out.println("Before execution1");
                 if(function !=null){
               JCO.Field DOCUMENTTYPE = function.getImportParameterList().getField("DOCUMENTTYPE");
                DOCUMENTTYPE.setValue("LGL");
                JCO.Field DOCUMENTNUMBER = function.getImportParameterList().getField("DOCUMENTNUMBER");
                DOCUMENTNUMBER.setValue("10000000003");
                JCO.Field DOCUMENTPART = function.getImportParameterList().getField("DOCUMENTPART");
                DOCUMENTPART.setValue("000");
                JCO.Field DOCUMENTVERSION = function.getImportParameterList().getField("DOCUMENTVERSION");
                DOCUMENTVERSION.setValue("00");
                JCO.Field GETSTRUCTURE = function.getImportParameterList().getField("GETSTRUCTURE");
                GETSTRUCTURE.setValue("1");
JCO.Field GETCOMPONENTS = function.getImportParameterList().getField("GETCOMPONENTS");
             GETCOMPONENTS.setValue("X");
JCO.Field ORIGINALPATH = function.getImportParameterList().getField("ORIGINALPATH");
              ORIGINALPATH.setValue("C:
TEMP
DMS_");
JCO.Field GETHEADER = function.getImportParameterList().getField("GETHEADER");
                      GETHEADER.setValue("X");
JCO.Field PF_FTP_DEST=function.getImportParameterList().getField("PF_FTP_DEST");
          PF_FTP_DEST.setValue("SAPFTPA");
//JCO.Field PF_HTTP_DEST=function.getImportParameterList().getField("PF_HTTP_DEST");
     //PF_HTTP_DEST.setValue("SAPHTTPA");
                      System.out.println("Here Setting Values Inside Structure ::DOCUMENTFILE");
JCO.Structure DOCUMENTFILE=function.getImportParameterList().getStructure("DOCUMENTFILE");
DOCUMENTFILE.setValue("1","ORIGINALTYPE");
DOCUMENTFILE.setValue("WWI","WSAPPLICATION");
DOCUMENTFILE.setValue("ZHCL_CS","STORAGECATEGORY");
DOCUMENTFILE.setValue("E0DF7893E2BD5DF19C07001517B4A299","APPLICATION_ID");
DOCUMENTFILE.setValue("E0DF7893E2BD5FF19C07001517B4A299","FILE_ID");
DOCUMENTFILE.setValue("X","CHECKEDIN");
DOCUMENTFILE.setValue("X","ACTIVE_VERSION");
                        //DOCUMENTFILE.setValue("LGL","DOCUMENTTYPE");
                        //DOCUMENTFILE.setValue("10000000003","DOCUMENTNUMBER");
                        //DOCUMENTFILE.setValue("000","DOCUMENTPART");
                        //DOCUMENTFILE.setValue("00","DOCUMENTVERSION");
                      //JCO.Field GETCOMPONENTS = function.getImportParameterList().getField("GETCOMPONENTS");
                      //GETCOMPONENTS.setValue("X");
                      //JCO.Field GETHEADER = function.getImportParameterList().getField("GETHEADER");
                      //GETHEADER.setValue("X");
                    mConnection.execute(function);
If anyone have an Idea on what I have missed out...
Please do advice me.
Thanks
Prashant

Hi
To update in the initial requirement, I have added (prefixed, zeroes) in Document No., doing that, now the  application is able to find the document, but not able to transfer the same from DMS Server to my local Machine, always giving the following error -
Type ::::::::E
Message ::::::::File d:\dms\z_IPI_PRASHANT01.doc cannot be created
Please let me know, if some services needed to checked in SAP System or some more information to be provided in RFC.
Thanks
Prashant
Dear Experts
Any advice on this. Still not able to download the documents from DMS Server.
I have also added few more code in my Java program -
     private int use_sapgui;
     public void setSapGui(int use_sapgui){
          use_sapgui = 2;
PLease help !!
Regards
Edited by: Prashantroy on Sep 26, 2011 12:49 PM
Hi,
Further to my earlier Mail, while checking the Trace suing SM59 in ECC System I got  the following Error -
Trace file opened at 20111010 142232 India Standard Time, SAP-REL 701,0,134
======> cannot open SAPGUI
ABAP Programm: SAPLSYSE (Transaction: )
User: IPI_PRASHANT (Client: 220)
Destination: SAPFTP (handle: 3, , )
SERVER> RFC Server Session (handle: 1, 43220900, {5D1DF3E0-ACBD-F11F-8EA0-00A0D1
SERVER> Caller host:
SERVER> Caller transaction code:  (Caller Program: java)
SERVER> Called function module: RFC_START_PROGRAM
Error RFCIO_ERROR_SYSERROR in abrfcpic.c : 1742
FUNCTION: 'exec_sapgui'
cannot open SAPGUI
PROG =sapftp erpdev sapgw00 43232164 IDX=4
Can someone help me in getting this sorted out.
Thanks N Regards
Edited by: Prashantroy on Oct 10, 2011 2:32 PM

Similar Messages

  • How do I produce an excel file using java code

    How do i produce an excel file using java code.
    If it is possible would ne one have ne source code as an example.
    I have tried looking up information on outputing the information to a *.csv file but unfortunality i have had no luck in finding any information. To be exact ne source code.
    Thanks
    Lee

    That's what I use and I'd be the first to admit that it's very messy. But it works. Go use Google and see what else you can find.

  • How to create a table in the file using java code.?

    HI,
    I should export the data from the view objects to a word document. I have done that but I should
    display the data in the form of a table.
    Kindly come up with the necessary information on how to create a table in the file using java.
    Thanks,
    Phani

    Hi, Thank you for responding to my query.
    The below are the details of my code.
    DCBindingContainer dcBindings =
    (DCBindingContainer)BindingContext.getCurrent().getCurrentBindingsEntry();
    DCIteratorBinding StudentDetailsContent =
    (DCIteratorBinding)dcBindings.get("StudentView1Iterator");
    OutputStreamWriter w = new OutputStreamWriter(outputStream, "UTF-8");
    Row currentRow =
    StudentDetailsContent.getRowSetIterator().first();
    Object a[]= currentRow.getAttributeValues();
    int i;
    for(i=0 ;i<=a.length;i++){
    w.write(a.toString());
    w.write(" ");
    w.flush();
    I am usning this coding to achieve the task of exporting data to file.
    I need to display this information in the table that is where I need help from you people.
    Thanks,

  • Read an excel file using java code

    Hi,
    I want to create an excel file on the client machine based on the personal details entered on the web page. And I want to save the file on the client machine in the form of CSV. Then I want to read the contents of the spreadsheet using Java Code from the using servlets. Can I read the contents of the file directly from the client machine or do i need to save the file on the server and then read the contents of it. Please help me solve this.

    Hi,
    I want to create an excel file on the client machine
    based on the personal details entered on the web
    page. And I want to save the file on the client
    machine in the form of CSV. Then I want to read the
    contents of the spreadsheet using Java Code from the
    using servlets. Can I read the contents of the file
    directly from the client machine or do i need to save
    the file on the server and then read the contents of
    it. Please help me solve this.As stated I am rather certain that is impossible.
    Servers don't access the file systems of client machines.

  • How to read data from the excel file using java code.

    Hi to all,
    I am using below code to getting the data from the excel file but I can't get the corresponding data from the specific file. can anyone give me the correct code to do that... I will waiting for your usefull reply......
    advance thanks....
    import java.io.*;
    import java.sql.*;
        public class sample{
                 public static void main(String[] args){
                      Connection connection = null;
                          try{
                               Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
                               Connection con = DriverManager.getConnection( "jdbc:odbc:Mydsn","","" );
                               Statement st = con.createStatement();
                               ResultSet rs = st.executeQuery( "Select * from [Sheet1$]" );
                               System.out.println("sample:"+rs);
                                  ResultSetMetaData rsmd = rs.getMetaData();
                                  System.out.println("samplersd:"+rsmd);
                               int numberOfColumns = rsmd.getColumnCount();
                                  System.out.println("numberOfColumns:"+numberOfColumns);
                                   while (rs.next()) {
                                            System.out.println("sample1:"+rs);
                                            for (int i = 1; i <= numberOfColumns; i++) {
                                                 if (i > 1) System.out.print(", ");
                                                 String columnValue = rs.getString(i);
                                                 System.out.print(columnValue);
                                            System.out.println("");
                                       st.close();
                                       con.close();
                                      } catch(Exception ex) {
                                           System.err.print("Exception: ");
                                           System.err.println(ex.getMessage());
                        }

    1: What is the name of the excel sheet?
    2: What is printed in this program? null ? anything?
    error?Excel file name is "sample.xls" I set excel file connectivity in my JDBC driver(DSN). Here in my program I am not giving that excel file name. I am giving only that excel sheet name. that is followed
    ResultSet rs = st.executeQuery( "Select * from [Sheet1$]" );The output of this program is given bellow.
    sample:sun.jdbc.odbc.JdbcOdbcResultSet@1b67f74
    samplersd:sun.jdbc.odbc.JdbcOdbcResultSetMetaData@530daa
    numberOfColumns:2

  • Open new window using java code and not in script

    i need some method like sendredirect or forward . where i can make some codes so as to open a new window.
    actually i am calling a jsp from one jsp file where a lot of dynamic parameters are sent. and in the second jsp i call a servlet which works to download a file to the client side. i want the file should open in new window not in the browser from where it is initiated.
    else can any one say the mime type where i can open file(a xls file) in xls window and not in browser which is not needed as user needs to press the back button(present in browser)

    Hi,
    in your code
    the following code, which is used to set the file name that is to be downloded
    response.setHeader("Content-Disposition", "*inline*; filename=somename.xls" );
    to be replaced by
    response.setHeader("Content-Disposition", "*attachment*; filename=somename.xls" );
    it will work fine try it.
    Edited by: Bhaskar.krishna on Jan 17, 2008 12:56 AM

  • Updating an existing xml file using java code

    hi friends,
    I have simple problem, I have an existing xml file and I want to update some of the values in the file.
    can any one send me the java code for that.
    bye.
    -harish

    org.w3c.dom.Document d = parseXmlFile("D:/www/Detailcache/detail.xml", false);
    public static Document parseXmlFile(String filename, boolean validating) {
    try {
    // Create a builder factory
    DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
    factory.setValidating(validating);
    // Create the builder and parse the file
    Document doc = factory.newDocumentBuilder().parse(new File(filename));
    return doc;
    } catch (Exception e) {
    System.out.println("ERROR-->");e.printStackTrace();
    return null;
    look at .. for more related examples
    http://javaalmanac.com/egs/javax.xml.parsers/BasicDom.html?l=rel

  • Not able to send file Using FTP in SSIS 2005

    I am using SSIS 2005
    I am trying to send file to ftp server using FTP task in SSIS but i am getting following error.
    Error Message-:An error occurred in the requested FTP operation.
    Detailed Description-:550 /FileName.txt: Access is denied.
    RemotefilePath is /
    I need a advice.
    Thanks in advance.

    I got this error recently from the FTP task in SSIS:
         Unable to send files using "FTP".
    I had everything correct, by the book.  I was trying to send a file, but I got the same error when trying to receive a file. 
    I already verified that I could send the file via command line FTP, so the FTP was not "secure FTP" (which wouldda required FileZilla or WinSCP or something similar) and my credentials were fine. 
    But I still got the above error.  Heck, I was beginning to thing that the FTP task in SQL Server 2008 was broken and just couldn't send files.
    Well, this issue is now resolved.  The problem was in the
    destination folder.  I was assuming that the root folder for my FTP account held the files. 
    So I entered the destination folder as this:   
    /data_in/
    But... the FTP task sees the root folder as one up from that. 
    So I had to use my account name in the path... meaning I had to change the destination folder to this:    
        /myaccountname/data_in/
        (where "myaccountname" was my login to the FTP site.)
    I hope this post helps someone else.
    Donna

  • Help in using JAVA code in SAP XI

    Hi,
    I have some java and jar files, I want to use those files through SAP XI.
    Scenario:
    we need to do encryption of some data field which is coming as input to XI, Now here we have a readymade code for encryption in JAVA that we have to use. Now we have imported all the JAVA and jar files in the XI. and written a small code in XI editor which is calling some function of JAVA file. But we are getting error that system is not able to resolve the function name.
    I think we need to define class path somewhere in XI.
    Please help me to resolve this issue.
    Thanks.

    Hi Vin,
    Here's all you should need to do:
    1) Import the jar files into the IR as an Imported Archive.
    2) You can then reference this from Message Maps (and XSLT maps). To do this in a Message Map:
    a) Create a user-defined function.
    b) Make sure to include the class in the import section. com.company.xi.MyClass for example.
    The Imported Archive and the Message Map (or XSLT map) need to be in the same software component. If they're not, you'll need to setup dependencies in the SLD between the software components.
    Thanks,
    Jesse

  • How to delete a perticular node from xml file using java code

    Hii All,
    Now i am trying to delete a perticular node from xml file.Like...
    XML file:
    <Licence>
    <SERVER>
    <was id="1">1</was>
    <was id="2">2</was>
    </SERVER>
    </LICENCE>
    I am working in messaging service using JABBER framework with whiteboard facility.
    Here Some commands i have created to add,modify,delete nodes from xml file.They Are
    1.If u want to add a new node then.
    create Licence.SERVER <ss id="3">ddd</ss> lic.xml
    (here u want to add a new node called "ss" under Licence.SERVER.
    And lic.xml is tyhe xml file name where it was saved.
    2.If u want to delete a node(Suppose <was id="1">),then the command should be
    delete Licence.SERVER.was:id='"1" lic.xml
    A problem arises that here it find two was attributes.And it delete the last was attribute,not the requested node.
    PLEASE HELP ME IN SOLVING THIS CODE..
    ------------------------------------

    Looks like you clicked on "Post" before you pasted in the code you were talking about.

  • HTTP :  404 Not found - Not able to download file using custom table

    Hi ,
    I have created the custom procedure to download the file as follows :-
    create or replace PROCEDURE "DOWNLOAD_MY_FILE" (p_file in number) as
         v_mime varchar2(255);
         v_length number;
         v_file_name varchar2(2000);
         Lob_loc BLOB;
    BEGIN
         select mime_type, blob_content, file_name,dbms_lob.getlength(blob_content)
              into v_mime,lob_loc,v_file_name,v_length
              from consultant_feedback_header
              where file_id = p_file;
    owa_util.mime_header( nvl(v_mime,'application/octet'), FALSE );
    htp.p('Content-length: ' || v_length);
    -- htp.p('Content-Disposition: attachment; filename="' || v_file_name || '"');
              owa_util.http_header_close;
              wpg_docload.download_file( Lob_loc );
    end download_my_file;
    I have followed the following steps :-
    1) Log in into SQL COMMAND as SYS
    2) alter session current_schema=FLOWS_XXXXXX;
    3) compile the procedure with my pl/sql procedure :
    CREATE OR REPLACE FUNCTION
    wwv_flow_epg_include_mod_local(
    PROCEDURE_NAME IN VARCHAR2)
    RETURN BOOLEAN
    IS
    BEGIN
    IF UPPER(procedure_name) IN (
    ' DOWNLOAD_MY_FILE') THEN
    RETURN TRUE;
    ELSE
    RETURN FALSE;
    END IF;
    END wwv_flow_epg_include_mod_local;
    I don´t know what am I do wrong?
    Regards
    Naveen

    Check whether you are using a path on the Application Server.
    OPEN DATASET cannot process files on presentation server. I guess, the path you are using is present on your PC or some other server that is not the SAP application server.

  • Problem in writing into the excel file using java code

    Hai ,
    I will be getting the data as a string and i am writing into the excel file. the problem is .if it has numeric values even now i will writing as a string data ,at this time i am getting the message in the excel file as "Number in the cell is formatted as text".
    I need to remove this thru my code..but i can write only as a string .
    To write in a excel file ,i used HSSFWorkbook.

    just check out
    http://www.andykhan.com/

  • I am not able to send email using JAVA API to outer email

    If I am trying to send email from my company account to yahoo I am getting following errors:
    javax.mail.SendFailedException: Invalid Addresses;
    nested exception is:
    com.sun.mail.smtp.SMTPAddressFailedException: 550 5.7.1 Unable to relay
    for [email protected]
    at com.sun.mail.smtp.SMTPTransport.rcptTo(SMTPTransport.java:1196)
    at com.sun.mail.smtp.SMTPTransport.sendMessage(SMTPTransport.java:584)
    at javax.mail.Transport.send0(Transport.java:169)
    at javax.mail.Transport.send(Transport.java:98)
    at MailSend.main(MailSend.java:116)
    Caused by: com.sun.mail.smtp.SMTPAddressFailedException: 550 5.7.1 Unable to rel
    ay for [email protected]
    at com.sun.mail.smtp.SMTPTransport.rcptTo(SMTPTransport.java:1047)
    ... 4 more
    com.sun.mail.smtp.SMTPAddressFailedException: 550 5.7.1 Unable to relay for mkba
    [email protected]
    at com.sun.mail.smtp.SMTPTransport.rcptTo(SMTPTransport.java:1047)
    at com.sun.mail.smtp.SMTPTransport.sendMessage(SMTPTransport.java:584)
    at javax.mail.Transport.send0(Transport.java:169)
    at javax.mail.Transport.send(Transport.java:98)
    at MailSend.main(MailSend.java:116)
    Please let me know the reason for the same.

    Unable to relay - This happened because your Company network don't permit relay. Do talk to the network administrator and check with way safe you can send.
    I got the same problem, now im using through gmail.

  • Converting html data to MsWord file using java code

    hi,
    Can any one suggest me how to convert html to ms word ?.
    I found many tools when i searched thru google but i need API to do
    this.
    Thanks in advance.
    regards,
    chakri

    http://jakarta.apache.org/poi/
    http://groups.yahoo.com/group/jacob-project/

  • How to compare two huge xml files(50MB+) using Java Code

    I want to compare two huge xml files using java code and need to find the difference of those xml files
    is there any API for that

    You should find third party API

Maybe you are looking for

  • I can't delete any folders in cc.

    I checked the list view and then choose the folder to send to archives, but there is no archive folder choice to send it to. As I understand it I must send my files to the archives to delete them.

  • The requested URL was not found, or cannot be served at this time.

    Hi, While processing the Reports request, the Reports CGI gives the following error - The requested URL was not found, or cannot be served at this time. The error is shown only when the URL exceeds more than 1500 - 2000 something. If i remove some of

  • WD Excel-Export with Blanks

    Hello, im exporting a contextnode to an excel sheet using the ALV component. The problem is that in one field of the context, values with more than one blank between characters occur. For example "abc  def". After export to excel the blanks are reduc

  • Send Storage Bins to external system (change pointer, change document, ...)

    Hello, I need to send to my external system the storage bin modifications, namely, insert and delete information. I haven't found any User Exits ou BADIs to the LS01 transaction. I'm trying to do this using change pointers, but it doesn't seems to ex

  • IMac Shuts Down after 5 Minutes, No Matter What

    Hi Guys, I have a serious problem. Last night, after about a week of not using my computer, I turned it on, jumped in the shower, came out, and it was off (not sleeping, just completely off). So turned it on again, it loaded up, I opened up Safari, t