JAVA CODE  NOT CREATING IDOC

Hi all
I m facing problem to upload data through idoc.the scenario is like we receive electric meter reading in flat file format. And to upload that data JAVA code is written which will create an IDOC FILE this authorization is only give to 2-3 person in organization and to basis guy also as user changed it’s password in SAP and in JAVA the java code is not going to create the IDOC file and data is not going to upload. after changing user password in sap system ,user not able to upload the data.
ISU_MR_UPLOAD01 is the idoc file generated. So is there any authorization issue, password issue how to see and view IDOC IN SAP, can any one help me out into this.
The error with java throws is as;
1ST ERROR IN TRACE FILE
ERROR file opened at 20061109 133610 India Standard, SAP-REL 640,0,59 RFC-VER 3  MT-SL
T:2736 ======> User TR has no RFC authorization for function group SYST .
T:2736 <* RfcReceive [1] : returns 3:RFC_SYS_EXCEPTION
2ND ERROR ON COMMAND PROMT
C:\j2sdk1.4.2_07>cd bin
C:\j2sdk1.4.2_07\bin>java sandsupload
Creating IDoc...Exception in thread "main" com.sap.mw.idoc.IDoc$Exception: (2) I
DOC_ERROR_METADATA_UNAVAILABLE: The meta data for the IDoc type "ISU_MR_UPLOAD01
" is unavailable.
        at com.sap.mw.idoc.jco.JCoIDoc$JCoDocument.<init>(JCoIDoc.java:233)
        at com.sap.mw.idoc.jco.JCoIDoc$JCoDocument.<init>(JCoIDoc.java:187)
        at com.sap.mw.idoc.jco.JCoIDoc.createDocument(JCoIDoc.java:10521)
        at sandsupload.main(sandsupload.java:35)
the part of java code
try {
            //create a JCo client pool
            JCO.addClientPool( "MyPool",    //pool name
                               3,           //maximum pool connections
                               "333",       //SAP client
                               " TR",    //user ID
                               " XYZ",  //password
                               "EN",        //language
                               " 1.1.1.1   ", //app server host name
                               "00" );   //system number
            //create an IDoc repository
            IDoc.Repository idocRep = JCoIDoc.createRepository("MyIDocRepository", "MyPool");
            //create a new and empty MATMAS02 document
            System.out.print("Creating IDoc...");
     Line where it shows error
            IDoc.Document doc = JCoIDoc.createDocument(idocRep, "ISU_MR_UPLOAD01");
            //get the root segment from the document
            //The root segment does not contain any fields or data. It is only
            //used as the standard parent segment and won't be transmitted when
            //the document is sent to an SAP system.
            IDoc.Segment segment = doc.getRootSegment();
            //create and add a new and empty child segment of type E1MARAM
            //and fill the segment data

Hi Gaurav,
Same exception on the same line has been reported and marked as solved here :
IDOC_ERROR_METADATA_UNAVAILABLE:
Btw, I think this forum is not visited often by JCO and ABAP connectivity experts, so maybe you could get a faster response to your problems while posting in "Java Programming" or maybe in some forum under the category ABAP Development.
HTH
Peter

Similar Messages

  • ADF Calendar : java code to create activity

    Dear All,
    I need to create an activity in the calendar from java code and not from the create popup.
    actually i need to create a new activity when i drag a activity from a table to the calendar but the oracle demo is too complicated !!
    Can anyone advice how ?
    Thanks

    Hi,
    Always mention your JDev version.
    Are you talking about the component demo ? Calendar Drop Target Demo ?
    Which part of it you are finding it complicated? Have you downloaded the source and went through the code?
    -Arun

  • Java code to create a new .txt file in FTP server  --- Help

    Hi,
    I wrote a standalone java app which creates a .txt file in my local machine and transfers it to FTP server. But my requirement now is to create a new .txt file with the same content in FTP server itself instead of creating locally with basic java code.
    I'm aware of transfering file from local machine to the FTP server using STOR command of FTP. But i never tried creating a new file & writing content into that in FTP server.
    So, if any one did this before please help me out with source code or any idea ???
    Thank you.
    Vj.

    simply_vijay wrote:
    thanks for your reply. yes i've seen the Apache Commons NET API , but there is no method or class to create a new file in FTP server. I'm really worried how to solve this problem ???Sure there is.
    There's a method where you can write data to a file on the server using an OutputStream, right? Well, instead of writing to a FileOutputStream, write to that OutputStream instead. Remember to close the OutputStream and call the method which says you're finished with the command (I forget what it's called).

  • Need JAVA code to create OIM ITresource-connection values are in a csv file

    Hi,
    Could any one plz help me with the java code used / tested before to create OIM IT resource dynamically, for the reference. IT resource parameter (connection) values in a .csv file, where in I've multiple environments.
    Thanks,
    Ramesh
    Edited by: user13267745 on Aug 19, 2010 12:37 AM

    Hi Gregg,
    You can create one transformation from the DataStore to itself.  In the "Technical" rules group, set 0RECORDMODE = 'X' (before image) or 'R' (reverse).  Therefore, when you execute its corresponding DTP, all existing records shouldl be set to zero.
    Then, as a second step, you can execute the DTP which is related to the transformation between the DataStore and the DataSource, thus loading the new records.
    I hope this helps you.
    Regards,
    Maximiliano

  • How to redirect in java code not the jsp or any other

    hello
    can any one help me how to redirect in java pages the code must be in java function not in jsp or any thing else
    thanks in advance

    Function? Don't you rather mean method?
    Anyway, in JSF you can send a redirect using ExternalContext#redirect(). If your JSF environment is on top of JSP/Servlet, then under the hood it basically invokes HttpServletResponse#sendRedirect() and FacesContext#responseComplete().

  • Transaction code to create IDOCs without Processing them. Just to create.

    Hi All,
    Would like to know if there are any tcodes to just create Idoc.
    I need Idoc# created and not processed.
    Whenever i create it using WE19, idoc# is generated only after processing.Would like to know if its possible to just create IDoc i.e Idoc with Idoc# generated. But not processed.
    I would like to process it separately later.
    Appreciate ur help.
    Thanks
    Dhilipan

    Hello Gowri,
    Thanks a lot for throwing some light..
    Checked with the Partner profile, it was set to trigger immediately. When i change it to trigger by background program.
    and thn try creating idoc in WE19, it just creates it without processing.
    Thanks a lot for the support.
    Dhilipan

  • Select from  Berkeley DB through java code not working

    Hi,
    I have developed an application using Jdeveloper 11g where in the Database Navigator I have created a new connection say Conn1 ,selected Generic Jdbc as the connection type and org.sqlite.Jdbc as the Driver Class.The JDBC URL is for example jdbc:sqlite:C:\Temp\ABC\abc.db .I have created a table say zipcodes. Now,I developed an ADF Fusion Web App in Jdev and selected View Obj in the model part.In the subsequent steps I selected the Berkley DB Connection as Conn1 and thus created the App Module and View Object.I then created a java class in the model part with code as
    package abc;
    import java.sql.Connection;
    import java.sql.DriverManager;
    import java.sql.ResultSet;
    import java.sql.SQLException;
    import java.sql.Statement;
    import java.util.Properties;
    public class MainClass {
    public static void main(String[] args)
    try {
    String driver = "org.apache.derby.jdbc.EmbeddedDriver";
    Class.forName(driver).newInstance();
    Connection conn = null;
    conn = DriverManager.getConnection("jdbc:derby:C:\Temp\ABC\abc.db");
    Statement s = conn.createStatement();
    ResultSet rs = s.executeQuery("SELECT city, state, zipcode FROM zipcodes");
    while(rs.next()) {
    System.out.println("City : "+ rs.getString(1));
    System.out.println("State : "+ rs.getString(2));
    System.out.println();
    rs.close();
    s.close();
    conn.close();
    } catch(Exception e) {
    System.out.println("Exception: "+ e);
    e.printStackTrace();
    I imported db.jar, dbexample.jar, sqlite.jar ,derby.jar. and in the view part selected a jsf page and drag and dropped an attribute from the view control...Now when I run the application the error is that: Application module not connected to a database...
    What can be the possible problem?????How do I resolve it
    Thank you.

    Hello,
    What is the OS platform and version of Berkeley DB being used?
    abc.db is the Berkeley DB database right?
    Thanks,
    Sandra

  • ABAP/Java Code to create ID configuration

    Hi Experts ,
    It is our project requirement that we need to create the mass ID Configs like ( Receiver determination / Interface determination) from the code (ABAP/JAVA)...
    I have seen on the SAP docs that there is some web services available to do that .
    Has anybody has this sort of exposure ...
    Kind regards
    Goutam

    Hi,
    For ID objects, I did not see any article yet.
    But for IR objects or SLD objects, the answer is Yes.
    Please check following blog:
    XI - Reverse Engineering #1 – Software Component
    /people/felix.jeyareuben/blog/2007/03/20/xi--reverse-engineering-1-150-software-component
    XI – Reverse Engineering #2 – Dependencies in SWC & adding a namespace
    /people/felix.jeyareuben/blog/2007/03/22/xi-150-reverse-engineering-2-150-dependencies-in-swc-amp-adding-a-namespace
    What you can do is to check the author of the blog to see if this is possible.
    Regards.
    Liang

  • Java code not working in Jsp page....

    I like to say to myself "there is no magic" when I come to a perplexing situation, today is one of those times.
    The following code when executed from the java class retrieves all the specified objects from the database and displays the requested attributes without issue:
    try {
    DBBody dbb = new DBBody();
    Entity[] allbods = dbb.retrieveAll(true);
    for(int k=0;k < allbods.length;k++) {
    Body body = (Body)allbods[k];
    System.out.println("From the dbase index position: " + k +" : " + "\n" + "Id: " + body.getId() + "\n" + "Type: " + body.getType() + "\n" + "Load: " + body.getLoad() + "\n XML:" + body.toXml() + "\n");
    dbb.close();
    } catch (Exception adb) {
    adb.printStackTrace();
    : the **exact same** code as displayed above when run in a Jsp only lists the values for the "body.getId()" and "body.getType()" methods...for a reason I can't discern, "body.getLoad()" and "body.toXml()" return empty strings in the Jsp. Everything else returns as when the code is run from the class. Both "getLoad()" and "toXml()" return strings but behind the scenes use StringBuffer objects that are converted to Strings...getId() returns an int and "getType()" returns a String also, but for whatever reason (to repeat) only those two attributes come through IN THE JSP, in the class ALL attributes are retrieved without a problem...so, what is wrong with Jsp? Java? I get no error message what so ever, just empty strings for the two specified method returns...what am I overlooking. I am running the embedded Jsp engine of the Jetty Http Server that I've incorporated into my application, which uses the latest Jsp version.
    Any help on this issue would be greatly appreciated.

    If you dont want to paste your code, then you will
    certainly not get any responses from the so called
    Java Engineers rest is left to you. We can get dukes
    elsewhere instead.
    SwarajSwaraj, I apologize if I was taken to be abrassive with my last comment, I myself am a java engineer so I have no animosity, as for your request to copy the entire code it is no longer needed I have solved the problem and the solution follows just incase anyone else runs into similar issues. It indeed had nothing to do with StringBuffer working improperly but rather it was how I was getting my dbase connection.
    As many of you who have developed applications with jdbc support to popular dbase vendors may already know, a connection must be established to the database by specifying various parameters, namely the name of the jdbc connection driver classes for the desired vendor (eg. "com.microsoft.jdbc.sqlserver.SQLServerDriver" for MS Sql Server instances) and the driver specific db connection url. Of course the driver classes must be available on the class path so that they can be accessed. Without these parameters the connection will not be initialized..well it turns out my "bug" was caused by my inadvertently ommitting the connection parameters in my Jsp, you might wonder "but you said it executed fine in the jsp except for the missing "getBody()" and "toXml()" results..how could it even execute at all if you didn't establish a connection?"
    The answer is I designed the application to use a default connection driver class (the jdbc odbc bridge driver) and a default connection url (one that is tied to my testing instance of MsSqlServer2000) it turns out that the jdbc odbc bridge is very light weight...it lacks support for certain very useful MsSql datatypes namely "ntext", I use the "ntext" type for fields that can grow to any size (stylesheet code,xml code...etc.) but the bridge driver doesn't support "ntext" BUT rather than throw an exception error like proper error handling would require it silently eats the request (very very bad) ...this exacerbated the problem I had significantly (had it thrown an error I would have known immediately that the connection was using the wrong driver and url and fixed it sooner) as it is ...I was led down blind allies thinking my code was faulty, (which it wasn't strictly speaking ..I was just missing some extra code to account for the possibility that the bridge driver is instantiated by accident) so after adding the following code above the Jsp code shown previously:
    //Configure a connection to a Microsoft Sql Database.
    DBConfig.setVendorId(DBConfig.MSSQL_VID);
    DBConfig.setDBHostId("xiassql");
    DBConfig.setDBHostPort("1433");
    DBConfig.setDBUrl(DBConfig.buildDBUrl());
    :The code worked perfectly. The "DBConfig" class does exactly that..allowing me to pass in connection attributes including the type of vendor "DBConfig.MSSQL_VID", (I have built in support for 5 popular vendors so far), the dbase host name "xiassql" and the port "1433" , then we build the url using the specified attributes and the connection is complete. After adding the code above the Jsp returned all the retrieved values perfectly. So, when testing applications that enable backend dbase connections if you get seemingly identical code behaving differently from class to Jsp, suspect an issue relating to your connection url and classes (assuming you have multiple support and a default value as I do in my app.) also any changes in the execution context from class to Jsp can cause similar errors (like not declaring the same classes at the top of the Jsp file , or less likely using an outdated Jsp engine!)
    Regards,
    PS I will take off the Duke Dollars on this question since I answered it myself!

  • Signed Java Code not acting as signed after 7.0 21 update

    I have scoured the web and tried numerous things and nothing works. First, I am not a Java guru but I have done my homework here and all seems like it is signed correctly and should be working. The app was developed by someone else but we have the code and it was working fine up until the latest Java release. Now it throws an error that eludes to it being unsigned. We have a GoDaddy certificate that we use to sign the code using signjar in the build.xml (we are using Netbeans).
    There are two projects. One that access serial ports to talk to a Scale (RXTXMyComm) and another that does the data calculations, etc. (CWML). The RXTXSerial Dlls are also included in a jar called rxtxSerial.native.jar.
    First, we compile and build the RXTX project with the following build.xml (parital to show how it is signed):
    `
    <project name="RXTXCommMY" default="default" basedir=".">
    <description>Builds, tests, and runs the project RXTXCommMY.</description>
    <import file="nbproject/build-impl.xml"/>
    <target name="-post-jar">
    <jar destfile="dist/rxtxSerial.native.jar">
    <fileset dir="lib/win32" includes="rxtxSerial.32.dll" />
    <fileset dir="lib/win64" includes="rxtxSerial.64.dll" />
    </jar>
    <signjar jar="dist/rxtxSerial.native.jar" storetype="pkcs12" storepass="MYPASS" alias="cwml's godaddy.com, inc. id" keystore="../CERTNAME.p12" signedjar="dist/rxtxSerial.native.signed.jar" />
    <delete file="dist/rxtxSerial.native.jar" />
    <signjar jar="${dist.jar}" storetype="pkcs12" storepass="MYPASS" alias="cwml's godaddy.com, inc. id" keystore="../CERTNAME.p12" signedjar="dist/RXTXCommMY.signed.jar" />
    <delete file="${dist.jar}" />
    </target>
    </project>
    `
    These jars are then included in the CWML project and it is built as follows:
    `
    <target name="-post-jar">
    <tstamp>
    <format property="build.timestamp" pattern="yyyyMd_HmsS" />
    </tstamp>
    <filter token="build.timestamp" value="${build.timestamp}" />
    <basename property="jarFilename" file="${dist.jar}" suffix=".jar" />
    <signjar jar="${dist.jar}" storetype="pkcs12" storepass="MYPASS" alias="CWML's godaddy.com, inc. id" keystore="../CERTNAME.p12" signedjar="dist/${jarFilename}_v${build.timestamp}.jar" />
    <delete file="${dist.jar}" />
    <copy file="index.html" todir="dist" filtering="true" />
    <copy file="cwml.jnlp" todir="dist" filtering="true" />
    </target>
    `
    The jnlp looks as follows:
    `
    <?xml version="1.0" encoding="UTF-8"?>
    <jnlp>
    <information>
    <title>Scale Applet</title>
    <vendor>Scale Applet</vendor>
    </information>
    <security>
    <all-permissions />
    </security>
    <resources>
    <j2se version="1.7+" />
    <jar href="CWML_v2013427_153155832.jar" main="true" />
    <jar href="lib/RXTXCommMY.signed.jar?v=2013427_153155832" />
    <nativelib href="lib/rxtxSerial.native.signed.jar?v=2013427_153155832" />
    </resources>
    <applet-desc name="ScaleApplet" main-class="cwml.ScaleApplet" width="200" height="40">
    </applet-desc>
    </jnlp>
    `
    I did run it through the Janela verifier and it is fine.
    It runs and works in Netbeans and it worked fine prior to update 21. I have also discovered if I remove the <security> tags from the jnlp it works in IE with Java 7.0 21 but it will not work in Chrome. When I run Java console in Chrome I get the following:
    `
    java.lang.ExceptionInInitializerError thrown while loading gnu.io.RXTXCommDriver
    Exception in thread "Thread-15" java.lang.ExceptionInInitializerError
         at cmwl.ioport.PortHelper.getAvailablePorts(PortHelper.java:49)
         at cmwl.ioport.PortHelper.connectSerialPorts(PortHelper.java:64)
         at cmwl.ioport.PortHelper.run(PortHelper.java:42)
    Caused by: java.security.AccessControlException: access denied ("java.util.PropertyPermission" "sun.arch.data.model" "read")
         at java.security.AccessControlContext.checkPermission(Unknown Source)
         at java.security.AccessController.checkPermission(Unknown Source)
         at java.lang.SecurityManager.checkPermission(Unknown Source)
         at sun.plugin2.applet.AWTAppletSecurityManager.checkPermission(Unknown Source)
         at java.lang.SecurityManager.checkPropertyAccess(Unknown Source)
         at java.lang.System.getProperty(Unknown Source)
         at gnu.io.CommPortIdentifier.<clinit>(CommPortIdentifier.java:123)
         ... 3 more
    `
    I ran a much more detailed trace and it showed the Certs being verified for all three jars. I am at a loss as this is causing us big problems. Line 123 that is being called is:
    `
    System.loadLibrary( "rxtxSerial." + System.getProperty("sun.arch.data.model") );
    `
    I have also tried adding Trusted-Library:True to the manifest and all it does is then give me a "Sandbox" error.
    Any help at all will be greatly appreciated. As I said I am not a Java guy at all and only inherited this application.

    Also, even though it bricked when I updated to 7.0.6, it says that it is running ios 7.0.4. I installed ips 7.0.6 ipsw fi
    e, not sure how I could restore specifically to that ios if even possible.

  • How to increase heap size in java code, not using "java -Xms64m "

    Im writing a java programme for loading the german dictionary. my dictionary is very huge(around 300000+ words).
    while loading the dictioanry im getting error "OutOfMemoryError" .
    I found one solution to increase the heap size, but i want to increase the heap size in java programmer itself, not outside jar file. so i could not use "-Xms64m" option of jvm.
    Can anyone tell me how can i do this

    sunlover1984 wrote:
    Im writing a java programme for loading the german dictionary. my dictionary is very huge(around 300000+ words).
    while loading the dictioanry im getting error "OutOfMemoryError" .
    I found one solution to increase the heap size, but i want to increase the heap size in java programmer itself, not outside jar file. so i could not use "-Xms64m" option of jvm.
    Can anyone tell me how can i do thisThat option is a startup option for the JVM. That means if your jar is already loaded then you are already too late to try and call it.

  • Unable to create a folder through java code on weblogic server 10GR3

    Hi,
    I have java code which creates a folder and writes an XML file in to it.
    File saveDirectory = new File(storePath);
    if(!saveDirectory.exists()){
    System.out.println("directory doesnt exists");
    boolean isDirectoryCreated = saveDirectory.mkdir();
    System.out.println("directory doesnt exist creating status :"+isDirectoryCreated);
    This code works fine on my local weblogic server.Whereas the one installed on Unix box is not.
    saveDirectory.mkdir() is unable to create a directory at the given path.
    I feel there is some permission problems.
    Please let me know what can be done.
    Thanks,

    I have my Linux/Unix Admin either add me to a group that can do this or create one that can and add me to it.
    If you command prompt can you manually do it now?
    Best Regards
    mseberg

  • F9N7- IDOC FINSTA not created

    Hi,
    We are using IHC for inter company cash within group. Normally an IHC process chain runs overnight and we have no issue. However, today we manually ran F9N7, as overnight job did not pick up some payment orders and did not create bank statement.
    On running F9N7 we were able to create bank statement(I see entry in table BKKM1) however system did not create  IDOC type  FINSTA.
    How do we create idoc type FINSTA for both sending and receiving companies(bank statements) as i am unable to rerun F9N7 as bank statement is already created.
    Kindly advise
    Umang

    Have you resolved the issue?

  • User Exit that will allow the SAP program to create DN, but not create IDO

    Hi all,
    The requirement is when we select 1 PO in VL10g transaction and click the u201CBackgroundu201D button, the user exit will allow the SAP program to create Delivery Number, but not create IDOC for the Delivery Number to send it to warehouse system.  Also the created Delivery Number must be in changeable mode in ECC system .I need to find any exit to make the DN table field LIKP-VLSTK not to be u201CBu201D (distributed).  The B will make DN not changeable in ECC system which is hard coded value in standard program. so the DN should be changeable.
    Please suggest me the User Exit name which serves my purpose.
    Thanks in advance
    Latha.

    Welcome to SCN!
    Here is some code that will allow you to find exits and BADIS on your own:
    [Code To Find BAdi|https://wiki.sdn.sap.com/wiki/display/ABAP/CodeToFind+BAdi]
    Rob

  • How to kill a system process from java code.

    Hi,
    i need to kill or remove windows system process like cmd.exe from java code.
    like removing it from end process in task mgr.
    i tried below code but its not removed.
    is there a better way we can do this.
    killing a system process from java code will create any issues?
       public static void main(String[] args) throws Exception {
       String[] cmd = { "cmd.exe" };
       Process p = Runtime.getRuntime().exec(cmd);
       p.destroy();
    any suggestions or ideas are really appreciated.
    thanks.

    Hi  jtahlborn, mohan
    yes the process is created from my java code. 
    in my code iam creating a process like below and if it is running for a long i need to kill it from java.
    For that " Runtime.getRuntime().exec("taskkill /F /PID " +  7408); " is working fine.
    7408 is my process id in taskmgr created from java and iam manually passing the PID it to kill it.
    But i need to get the PID from java code.
    Thanks for your suggestions.
    Sample Code:
    public static void main(String args[])
            try {
              Process process = Runtime.getRuntime().exec(new String[]{"cmd.exe","/c","start"});        
              Field f = process.getClass().getDeclaredField( "handle");
              f.setAccessible( true);         
              long procHandle = f.getLong( process);
              System.out.println( "prochandle: " + procHandle );
              //Runtime.getRuntime().exec("taskkill /F /PID " +  procHandle);
            } catch( Exception e) {
              e.printStackTrace();

Maybe you are looking for

  • Item Conversion Template Issue for Oracle Migration - Copy functionality

    Hi, I am working on Migration project which is from Radius ERP to Oracle 11.5.10.2. Currently working on Item Conversion. This Item conversion having the fileds like (ORGANIZATION_ID,SEGMENT1,DESCRIPTION,ITEM_TYPE,COST_OF_SALES_ACCOUNT,SALES_ACCOUNT,

  • How pass ext characters to a stored proc by odbc when enable sqlserver syntax is on??

    how pass french characters or extended characters to a stored procedure by odbc error: ORA-01756: quoted string not properly terminated une chaine entre apostrophhes ne se termine pas correctement oracle Retrieving extended characters thru ODBC PL/SQ

  • PPV report or functional Specification

    Dear Friends, I tried but did not find any standard Purchase Price variance report. My client's report requirement is : PO, Mateial, Std Price, Std Cost , Actual Price, Actual Qty, Actual Cost, Batch, Vendor.............. All information I collected

  • Is the Zen Touch Mac Compatib

    My Cousin has an iMac and i'm visiting him and I was wondering if I could transfer tunes from his computer to my Zen Touch. Also, is the zen touch like the ipod where it will only support syncing with one computer. Where it makes you delete everythin

  • Apple Mobile Device Support Error in iTunes 8.2.0.23 FIX

    Okay, after I installed the 8.2.0.23 version of iTunes and tried to plug in my iPhone, I got a message stating essentially that the version of Apple Mobile Device Support is wrong, and to uninstall AMDS and iTunes and reinstall them. Of course, after