Problem while calling subroutines in ECC 6.0 version

Hi, here is some problem can you please try to solve.....
    I have created three forms TOP_OF_PAGE,DOC_DISPLAY,END_OF_LIST and i have called them by passing to wa_events-form. Up to this every thing is fine, the problem is i am working witth ECC 6.0  so while doing Extended program check through SLIN it is giving some waring like
"FORM DO_DISPLAY_AT_USER_COMMAND not called directly
(check dynamic PERFORMs!!) " for all the three forms which i have created...Please help me out to over come this warning... For ur reference i am giving some code as mentioned below.......
LOOP AT i_events into wa_events.
    CASE wa_events-name.
      WHEN slis_ev_top_of_page.
        wa_events-form = 'TOP_OF_PAGE'.
      WHEN slis_ev_end_of_list.
        wa_events-form = 'END_OF_LIST'.
      WHEN slis_ev_user_command.
        wa_events-form = 'DOC_DISPLAY_AT_USER_COMMAND'.
    ENDCASE.
    MODIFY i_events from wa_events.
  ENDLOOP.
ENDFORM.                               " INIT_ALV_EVENTS
*&      Form  DOC_DISPLAY
FORM doc_display_at_user_command USING p_ucomm    LIKE syst-ucomm
                                 p_selfield TYPE slis_selfield.
  CASE p_ucomm.
    WHEN '&IC1'.
      CLEAR i_out.
      READ TABLE i_out into wa1_out INDEX p_selfield-tabindex.
      IF sy-subrc EQ 0 .
        IF wa1_out-belnr EQ space.
          MESSAGE e016(kb).
        ELSE.
          SET PARAMETER ID 'BLN' FIELD wa1_out-belnr.
          SET PARAMETER ID 'BUK' FIELD wa1_out-bukrs.
          SET PARAMETER ID 'GJR' FIELD wa1_out-gjahr.
          CALL TRANSACTION 'FB03' AND SKIP FIRST SCREEN.
        ENDIF.
      ENDIF.
  ENDCASE.
ENDFORM.                    "DOC_DISPLAY_AT_USER_COMMAND
      FORM TOP_OF_PAGE                                              *
FORM top_of_page.
  PERFORM std_header in program zstandrt
                       USING sy-cprog sy-title 'L' '1' ' ' 'confidential' 'restricted'.
ENDFORM.                    "TOP_OF_PAGE
      FORM END_OF_LIST                                              *
FORM end_of_list.
Begin of V04 comment  >***********************************
IF W_BDC_SESSION EQ 'X'.
  SKIP 2.
  IF P_NOUPD EQ 'X'.
    FORMAT COLOR COL_POSITIVE.
    WRITE :/20 ' Created BDC session : '(O02) , P_GROUP.
    WRITE :/25 ' Execute Using tcode SM35 ....'(O03).
  ELSE.
    FORMAT COLOR COL_NEGATIVE.
    WRITE :/20 ' Created BDC session For Error Transactions'(O04) ,
                 P_GROUP.
    WRITE :/25 ' Execute Using tcode SM35 ....'(O03).
  ENDIF.
  FORMAT COLOR COL_NORMAL.
ENDIF.
SKIP 2.
End of V04 comment   >************************************
  WRITE :/50 ' *** END OF REPORT *** '(o01).
  PERFORM print_selections.
ENDFORM.                    "END_OF_LIST
Thanks & Regards.
Laxman.P
B'lore.

Hi
Are you getting the output or not?
You can just ignore this warning in EPC
as this FORM USER_COMMAND  is always called indirectly only
But check the Output and see?
<b>Reward points for useful Answers</b>
Regards
Anji

Similar Messages

  • HT201210 Facing a problem while setting MAC 6.1. My version is 5.1. The activation does not complete.

    Facing a problem while setting MAC 6.1. My version is 5.1. The activation does not complete.

    Hacked or jailbroken iPhone will have this problem.
    BTW, it's IOS 6.0.1 not MAC.

  • Problem while Calling a CGI pgm From Java with code sample

    Hey guys,
    I am calling a CGI program from java servlet, while calling cgi program I am passing encoded(Base64) content via post process,
    My problem is the encoded data is not posted as expected, the encoded data is corrupting. But when I send encoded data in a text file, cgi program is perfectly decoding and working fine.
    Here I am doing Base64 encoding as per requirement, I cannot avoid this encoding.
    My doubt is about OutputStreamWriter constructor argument , In OutputStream Constructor I am passing one argument is OutputStream object and another argument is encoding type. I tried with ASCII, US-ASCII & UTF-8 .
    My code is as follows, please help me to resolve this issue.
    URL url = new URL("CGI server path");
    URLConnection urlConnection = url.openConnection();
    urlConnection.setDoOutput(true);
    OutputStream os = urlConnection.getOutputStream();
    BufferedOutputStream buffer = new BufferedOutputStream(os);
    OutputStreamWriter  writer = new
                                                   OutputStreamWriter(buffer, "US-ASCII");
    writer.write(encodedPDF-Content);
    writer.write("\r\n");
    writer.flush();
    writer.close();
    here encodedPDF-Content is String and it's size is 9565 bytes

    Whenever you read something in java into string (with Reader implementation) it expects source to contain text in encoding you specified. It then decodes it and makes 16 bit unicode string from it. Whenever you store string using Writers it does reverse operation with specified encoding (may be different than this which you used to read source) and stores text as a sequence of bytes made of 16 bit unicode string. So, passing text back and forth between programs with the help of files or I/O you can make mistake at both reading and writing encoding. Check for it.
    Now, when C programm or other application reads file it may take another assumptions about encoding or may even completly ignore it and read source as a binary file. Then, if you have a source text as a file and have to pass it to other application never do it using Reader/Writer. User raw InputStream/OutputStream instead what will preserve all information unchanged.
    here encodedPDF-Content is String and it's size is 9565 byteHow id you get this info? String.length() gets you how many chars is in it, it will be half the number of bytes. If you see your input file beeing 9565 bytes long, see my above statements.

  • Problem while calling the FM FP_JOB_OPEN

    Hi All,
    I have a scenario where i need to attach multiple Forms(Adobe) to a work flow container.
    While calling the FM 'FP_JOB_OPEN', i am passing the required parameters as below
    wl_outputparams-nodialog = 'X'.
    wl_outputparams-connection = 'ADS'.
    wl_outputparams-dest = 'LP01'.
    wl_outputparams-getpdf  = 'X'.
    the problem is that i get a Print preview pop-up even though i pass Nodialog = 'X', and more over after calling the actual Form function module the resultant parameter 'fpformoutput-pdf' is only filling up only after i process the print preview dialog and see the preview. other wise the field 'fpformoutput-pdf' is blank.
    as i need to do this work in back ground(for work flow background step) i do not want the print preview pop-up window.
    can some one help me in this regard.
    PS. For multiple forms i tried calling the form functions modules in between every FP_JOB_OPEN n FP_JOB_CLOSE
    as well as a single FP_JOB_OPEN and calling the multiple form function modules and FP_JOB_CLOSE.
    thanks in anticipation .
    Srinivas

    @koolspy      
    Yes, i did specify the settings in the o/p options.
    in addition to this, after debugging i could able to see some issue when calling form name via  FM 'FP_FUNCTION_MODULE_NAME', in this FM it is appending '_IN' to the generated FM name and trying to check for existence check, obviously there wont be any FM as it is appending '_IN' to the generated FM.
    but when calling the generate FM after FP_JOB_OPEN it is throwing sy-subrc = 1, which is Usage error.
    Why is it behaving weirdly, is there any thing i am missing while calling the Form?
    please help as this is on high priority
    thanks
    srinivas

  • Locking Problem while calling BAPI

    Hi ,
    I am calling a BAPI in my wd appln . if there is some problem while executing the bapi like posting period not open then i am displaying the error of the BAPI . but after that i see in the locked tables through SM12 some tables gets locked .
    so when i call the BAPI again it gives me error like the following tables are locked by the user... so is there any way by which i can release the locks hold by the bapi if problems occurs.
    Regards
    Yash

    Hi Yash,
    Try the command ROLLBACK WORK if the error occurs.
    This will remove all locks set by the BAPI.
    Regards,
    Jos

  • Problem while calling an RFC Function Module in Background

    Hello,
    I have created a RFC function module for reading data from an external DB system. The FM calls an external RFC program (coded in C++ using RFC SDK), which delivers the required data. This external program is maintainged as an TCP RFC Connection in SM59.
    Further I have created a report, that calls the RFC function module to get the data from the external RFC programm.
    My problem is, when I call the report in foreground, everything works OK, the RFC connection works and data can be read from the external program.
    However, when I schedule the report to run in background as a job, the report is stating in the protocoll that there was a problem calling the defined RFC connection (although the connection is working properly at that time).
    More funny is, this particular problem with running in background occurs only in the productive system, in test and development system the report works correctly also while running as a job in background.
    Can you suggest the solution to this problem? Could it be something with authorisations or server settings?
    I will be on holiday for the next 6 weeks, so take your time to answer .
    Regards,
    Dusan.
    Edited by: Julius Bussche on Jan 22, 2009 7:19 PM
    Please read the forum rules about u r g e n t ...

    This is an external RFC server program, not a remote enabled ABAP RFC function module as the others seem to be assuming, right?
    Is it possible that your DEV and QAS systems only have one application server, but the PROD has many and dedicated one(s) for processing low priority background jobs?
    It might be that the target server of your TCP connection is not this BTC instance, and your RFC server is returning the data "locally" - so, into nirvana...
    Just guessing, but might be worth checking.
    Cheers,
    Julius

  • Problem while calling the user exit

    Hi All,
    In one of the program one user exit is called. Before this user exit ther is one FM . If I copy the same function module with a new name Z* , this user exit is not getting triggered. The program is going till the point where CALL CUSTOMER-FUNCTION '001' IS written but after that it's not going inside the user exit. But if I put back the original FM , this suer exit is getting triggered and it's gong inside the exit. I've activated the Project for this user exit also. As per our requirement I've to copy the original FM into Z* FM.But my doubt is when I put back the original FM , this User Exit is getting triggered whereas when I copied this FM it's not working .
    Anybody could helpme out why it's happening ?
    Thanks
    Alok

    Srinivas,
    Yes it's related to the other post where I had to copy one standard Function Pool.While copying the function pool I copied the FMs also.This problem is coming out of one FM ,when I changed this to Z* at the place where it is called, the user exit which is written inside that FM is not getting triggered even though program is reaching till the point where this user exit is called .
    Any clue ?
    Thanks
    Alok

  • Original I phone4 user facing problem while calling or receiving a call.

    I have an Iphone 4 which i purchased from HK. All of a sudden now, (after a year) I have started facing a problem when I talk on the phone. While talking (whether i received a call or made) I can hear the other person but the person on the other side cannot hear me. Further, when this happens, I need to restart my phone. It then works ok for a few mnutes and again during a call I face the same problem. Please advise what could be the possible cause and how can this be rectified? As I am based in India, there is no Apple Store to which I could turn to.
    Thank you,

    Warranty and support are only valid in the country of origin, in your case, that is Hong Kong.
    Basic troubleshooting from the User's Guide is reset, restart, restore (first from backup then as new).  Try each of these in order until the issue is resolved.
    The fact that it seems to clear up after a restart leads me to believe it is not a hardware issue but rather a software issue or network problem.
    Have you contacted the carrier?

  • Problem while calling a report from the report

    Hi
    i want call a report from the report, i have written URL in the Hyperlink and its working
    but
    1) i want open it in the diffrent window.
    2) suppose if u have a report called emp it should call antoher 2 report at a time.
    ( how to put 2 URL in the hyperlink?).
    i,e if i press a hyperlink it should open emp1 and emp2
    Please help me.
    thanks and regards

    Thanx,
    I have solved this problem.
    Regards,
    Hafeez

  • Problem While calling a session bean (J2EE)

    Hi!!
    Please see my client-side code..where I am calling a session bean (J2EE Server)
    It's correct or not?????
    InitialContext ctx = new InitialContext();
    Object objref = ctx.lookup("SecDbSecRoleJndi");
    SecBusSecRoleHome home =(SecBusSecRoleHome)PortableRemoteObject.narrow(objref,SecBusSecRoleHome.class);
    SecBusSecRoleRemote remote =(SecBusSecRoleRemote)PortableRemoteObject.narrow(home.create(),SecBusSecRoleRemote.class);
    Here I am getting the error at 3rd line
    java.lang.ClassCastException
    at com.sun.corba.se.internal.javax.rmi.PortableRemoteObject.narrow(PortableRemoteObject.java:296)
    at javax.rmi.PortableRemoteObject.narrow(PortableRemoteObject.java:137)
    at TestServlet.init(TestServlet.java:22)
    Please do the favor to me..reply me back.
    Bhumika

    Hello,
    Hope you are bale to sole the problem by this time. Iam using the follwing code and its working fine for me. i'm using the weblogic application server.
    <%@ page import="javax.naming.*, java.rmi.*, javax.ejb.*, java.util.*,java.rmi.server.*,java.net.*,javax.rmi.PortableRemoteObject,com.hmp.webcasting.services.ejb.*"%>
    <%
    try{             
    Properties prop = new Properties();
    prop.put(Context.INITIAL_CONTEXT_FACTORY, "weblogic.jndi.WLInitialContextFactory");
              System.out.println("Hello......3333333333Test");
              prop.put(Context.PROVIDER_URL, "t3://pani:7001");
              InitialContext ctx = new InitialContext(prop);
    Object home = ctx.lookup("personMgr");
              KeywordsMgrHome roleHome = (KeywordsMgrHome) javax.rmi.PortableRemoteObject.narrow(home, KeywordsMgrHome.class);
              KeywordsMgr kmgr=roleHome.create();
              //KeywordsMgrHome roleHome = (KeywordsMgrHome) ctx.lookup("personMgr");;
              System.out.println(roleHome);
              System.out.println(kmgr);
              }catch(Exception e){
              e.printStackTrace();
              %>
    Try using this.
    Genrally calss cast exception occurs if you are using classes out of a shared library directory instead of within the webapp, or if you are somehow maintaining references to object instances created with the old class and trying to use them after the reload. So try to delete the old file files and deploy the bean once again . Hope this may help you. Anyway if you can give the full code i will check by deploying it.([email protected])

  • Problem while calling a Webservice from a Stand alone java program

    Hello Everyone,
    I am using a java program to call a webservice as follows. For this I have generated the client proxy definition for Stand alone proxy using NWDS.
    Now when I call the method of the webservice I am getting the correct result but along with the result I am getting one error and one warning message in the output.
    The java code to call the webservice is as follows.
    public class ZMATRDESCProxyClient {
         public static void main(String[] args) throws Exception {
              Z_MATRDESC_WSDService ws = new Z_MATRDESC_WSDServiceImpl();
              Z_MATRDESC_WSD port = (Z_MATRDESC_WSD)ws.getLogicalPort("Z_MATRDESC_WSDSoapBinding",Z_MATRDESC_WSD.class);
              String res = port.zXiTestGetMatrDesc("ABCD134");
              System.out.print(res);
    The result I am getting is :
    Warning ! Protocol Implementation [com.sap.engine.services.webservices.jaxrpc.wsdl2java.features.builtin.MessageIdProtocol] could not be loaded (NoClassDefFoundError) !
    Error Message is :com/sap/guid/GUIDGeneratorFactory
    <b>Material Not Found</b> -
    > This is the output of webservice method and it is right.
    Can any one please let me know why I am getting the warning and error message and how can I fix this.
    Thanks
    Abinash

    Hi Abinash,
    I have the same problem. Have you solve that problem?
    I am using a java program to call a webservice too. And I have generated the client proxy definition for Stand alone proxy using NWDS. When I call the method of the webservice I am getting the correct result but along with the result I am getting one error and one warning message in the output.
    The java code to call the webservice is as follows.
    MIDadosPessoaisSyncService service = new MIDadosPessoaisSyncServiceImpl();
    MIDadosPessoaisSync port = service.getLogicalPort("MIDadosPessoaisSyncPort");
    port._setProperty("javax.xml.rpc.security.auth.username","xpto");
    port._setProperty("javax.xml.rpc.security.auth.password","xpto");
    String out = port.MIDadosPessoaisSync("xpto", "xpto");
    System.out.println(out);
    The result I am getting is :
    Warning ! Protocol Implementation [com.sap.engine.services.webservices.jaxrpc.wsdl2java.features.builtin.MessageIdProtocol] could not be loaded (NoClassDefFoundError) !
    Error Message is :com/sap/guid/GUIDGeneratorFactory
    <b>The result of the WS is correct!!!</b>
    The Java project does not have any warning. But the stand alone proxy project has following warnings associated with it.
    This method has a constructor name     MIDadosPessoaisSync.java     
    The import javax.xml.rpc.holders is never used     MIDadosPessoaisSyncBindingStub.java     
    The import javax.xml.rpc.encoding is never used     MIDadosPessoaisSyncBindingStub.java     
    The constructor BaseRuntimeException(ResourceAccessor, String, Throwable) is deprecated     MIDadosPessoaisSyncBindingStub.java
    It is very similar with your problem, could you help me?
    Thanks
    Gustavo Freitas

  • Problem while calling java function from html

    when i tried to call a java function from html i'm getting an error
    object don't support this property.
    what could be the reason.
    This is my html.
    I got this from this forum only.
    My applet is accessing the system property "user.home".
    I ran it in IE
    <DIV id="dvObjectHolder">Applet comes here</DIV>
    <br><br>
    <script>
    if(window.navigator.appName.toLowerCase().indexOf("netscape")!=-1){ // set object for Netscape:
         document.getElementById('dvObjectHolder').innerHTML = " <object ID='appletTest1' classid=\"java:test.class\"" +
    "height=\"0\" width=\"0\" onError=\"changeObject();\"" +
              ">" +
    "<param name=\"mayscript\" value=\"Y\">" +
    "<param name=\"archive\" value=\"sTest.jar\">" +
    "</object>";
    }else if(window.navigator.appName.toLowerCase().indexOf('internet explorer')!=-1){ //set object for IE
         document.getElementById('dvObjectHolder').innerHTML = "<object ID='appletTest1' classid=\"clsid:8AD9C840-044E-11D1-B3E9-00805F499D93\"" +
              " height=\"0\" width=\"0\" >" +
              " <param name=\"code\" value=\"test.class\" />" +
         "<param name=\"archive\" value=\"sTest.jar\">" +
              " </object>"
    </script>
    <LABEL id="lblOutputText">This text will be replaced by the applet</LABEL>
    <BR>
    <input value="Javascript to java" type=button onClick="document.appletTest1.fromJavaScript()">

    I tried this example using the repy given to an earlier post.
    But its not working with me.
    What i did in addition was adding plugin.jar to classpath to import netscape.javascript.*;
    Let me add some more details
    1) I'll add the stack trace
    2) my java progrma
    3) batch file to sign the applet.
    1) This is the stack trace i don't know whether u will undertand this
    load: class test.class not found.
    java.lang.ClassNotFoundException: test.class
         at sun.applet.AppletClassLoader.findClass(Unknown Source)
         at java.lang.ClassLoader.loadClass(Unknown Source)
         at sun.applet.AppletClassLoader.loadClass(Unknown Source)
         at java.lang.ClassLoader.loadClass(Unknown Source)
         at sun.applet.AppletClassLoader.loadCode(Unknown Source)
         at sun.applet.AppletPanel.createApplet(Unknown Source)
         at sun.plugin.AppletViewer.createApplet(Unknown Source)
         at sun.applet.AppletPanel.runLoader(Unknown Source)
         at sun.applet.AppletPanel.run(Unknown Source)
         at java.lang.Thread.run(Unknown Source)
    Caused by: java.io.FileNotFoundException: C:\FastranJava\AppletObject\bin\test\class.class (The system cannot find the path specified)
         at java.io.FileInputStream.open(Native Method)
         at java.io.FileInputStream.<init>(Unknown Source)
         at java.io.FileInputStream.<init>(Unknown Source)
         at sun.net.www.protocol.file.FileURLConnection.connect(Unknown Source)
         at sun.net.www.protocol.file.FileURLConnection.getInputStream(Unknown Source)
         at sun.applet.AppletClassLoader.getBytes(Unknown Source)
         at sun.applet.AppletClassLoader.access$100(Unknown Source)
         at sun.applet.AppletClassLoader$1.run(Unknown Source)
         at java.security.AccessController.doPrivileged(Native Method)
         ... 10 more
    Exception in thread "Thread-5" java.lang.NullPointerException
         at sun.plugin.util.GrayBoxPainter.showLoadingError(Unknown Source)
         at sun.plugin.AppletViewer.showAppletException(Unknown Source)
         at sun.applet.AppletPanel.runLoader(Unknown Source)
         at sun.applet.AppletPanel.run(Unknown Source)
         at java.lang.Thread.run(Unknown Source)
    2) Java Program
    import netscape.javascript.*;
    import java.applet.*;
    public class test extends Applet
         private JSObject win;
         private JSObject outputLabel;
         private boolean buttonFromJavaClicked=false;
         checkJavaScriptEvent evt=new checkJavaScriptEvent();
         public void init()
              try
                   evt.start();
                   win=JSObject.getWindow(this);
                   outputLabel=(JSObject)win.eval("document.getElementById('lblOutputText')");
                   outputLabel.setMember("innerHTML", "<center><h1>From Init<br>Your Home directory" + System.getProperty("user.home") + "</h1></center>");
              catch(Exception e)
                   e.printStackTrace();
         public void fromJavaScript()
              buttonFromJavaClicked=true;          
         public void fromJavaScript2()
              System.out.println("Started Form JavaScript2");
              try
                   String strLbl="<center><h1>From JavaScript<br>Your Homedir:" + System.getProperty("user.home") + "</h1></center>";
                   outputLabel.setMember("innerHTML", strLbl);
              catch(Exception e)
                   e.printStackTrace();
         class checkJavaScriptEvent extends Thread
              public void run()
                   while(true)
                        if(test.this.buttonFromJavaClicked)
                             System.out.println("OK buttonfromjava is true");
                             test.this.buttonFromJavaClicked=false;
                             fromJavaScript2();
                        try
                             Thread.sleep(3000);
                        catch(Exception e)
                             e.printStackTrace();
    3) Batch file
    del *.cer
    del *.com
    del *.jar
    del *.class
    javac -classpath ".;C:\Program Files\Java\jre1.5.0_06\lib\plugin.jar" test.java
    keytool -genkey -keystore harm.com -keyalg rsa -dname "CN=Harm Meijer, OU=Technology, O=org, L=Amsterdam, ST=, C=NL" -alias harm -validity 3600 -keypass password -storepass password
    jar cf0 test.jar *.class
    jarsigner -keystore harm.com -storepass password -keypass password -signedjar sTest.jar test.jar harm
    del *.class

  • Problem while calling RFC function module in java

    Hi all
    com.sap.mw.jco.JCO$Exception: (102) RFC_ERROR_COMMUNICATION: Connect to SAP gateway failed
    Connect_PM  GWHOST=<system.ab.ydydy.yyyd.com>, GWSERV=sapgw00, ASHOST=<system.ab.ydydy.yyyd.com>, SYSNR=00
    LOCATION    CPIC (TCP/IP) on local host
    ERROR       hostname '<system.ab.ydydy.yyyd.com>' unknown
    TIME        Mon Jun 06 14:50:25 2005
    RELEASE     640
    COMPONENT   NI (network interface)
    VERSION     37
    RC          -2
    MODULE      ninti.c
    LINE        332
    DETAIL      NiPGetHostByName2: hostname '<system.ab.ydydy.yyyd.com>' not found
    SYSTEM CALL gethostbyname_r
    COUNTER     1
         at com.sap.mw.jco.rfc.MiddlewareRFC$Client.nativeConnect(Native Method)
         at com.sap.mw.jco.rfc.MiddlewareRFC$Client.connect(MiddlewareRFC.java:1098)
         at com.sap.mw.jco.JCO$Client.connect(JCO.java:2983)
         at MyProject.Bapi2.<init>(Bapi2.java:43)
         at MyProject.Bapi2.main(Bapi2.java:231)
    Pl help me
    pradeep

    Hi
    This is my code....
    Created on Jun 2, 2005
    To change the template for this generated file go to
    Window&gt;Preferences&gt;Java&gt;Code Generation&gt;Code and Comments
    package MyProject;
    @author pradeep
    To change the template for this generated type comment go to
    Window&gt;Preferences&gt;Java&gt;Code Generation&gt;Code and Comments
    import com.sap.mw.jco.*;
    public class Bapi2 extends Object {
       JCO.Client mConnection;
       JCO.Repository mRepository;
       public Bapi2() {
           try {
              // Change the logon information to your own system/user
              mConnection =
                JCO.createClient("122", // SAP client
                   "<pradeep>", // userid
                   "*****", // password
                   "EN", // language
                   "<abc11.aa.abc23.company.com>", // application server host name
                   "<00>");//system no
              mConnection.connect();
              mRepository = new JCO.Repository("HLL", mConnection);
          catch (Exception ex) {
            ex.printStackTrace();
            System.exit(1);
          JCO.Function function = null;
          JCO.Table codes = null;
            try {
               function = this.createFunction("BAPI_COMPANYCODE_GETLIST");
               if (function == null) {
                 System.out.println("BAPI_COMPANYCODE_GETLIST" +
                                         " not found in SAP.");
                 System.exit(1);
               mConnection.execute(function);
               JCO.Structure returnStructure =
                 function.getExportParameterList().getStructure("RETURN");
               if (! (returnStructure.getString("TYPE").equals("") ||
                        returnStructure.getString("TYPE").equals("S")) ) {
                 System.out.println(returnStructure.getString("MESSAGE"));
                 System.exit(1);
               codes =
                 function.getTableParameterList().getTable("COMPANYCODE_LIST");
               codes.setRow(2);
    codes.deleteRow();
    codes.deleteRow(5);
    codes.appendRow();
    codes.setValue("XXXX", "COMP_CODE");
    codes.setValue("Does not exist", "COMP_NAME");
    codes.appendRows(2);
    codes.setValue("YYYY", "COMP_CODE");
    codes.setValue("Does not exist either", "COMP_NAME");
    codes.nextRow();
    codes.setValue("ZZZZ", "COMP_CODE");
    codes.setValue("Nor does this", "COMP_NAME");
    for (int i = 0; i < codes.getNumRows(); i++) {
    codes.setRow(i);
                 System.out.println(codes.getString("COMP_CODE") + '\t' +
                                         codes.getString("COMP_NAME"));
            catch (Exception ex) {
               ex.printStackTrace();
               System.exit(1);
            try {
               codes.firstRow();
               for (int i = 0; i < codes.getNumRows(); i++, codes.nextRow()) {
                 function = this.createFunction("BAPI_COMPANYCODE_GETDETAIL");
                 if (function == null) {
                    System.out.println("BAPI_COMPANYCODE_GETDETAIL" +
                                            " not found in SAP.");
                    System.exit(1);
                 function.getImportParameterList().
                    setValue(codes.getString("COMP_CODE"), "COMPANYCODEID");
                 mConnection.execute(function);
                 JCO.Structure returnStructure =
                    function.getExportParameterList().getStructure("RETURN");
                 if (! (returnStructure.getString("TYPE").equals("") ||
                          returnStructure.getString("TYPE").equals("S") ||
                          returnStructure.getString("TYPE").equals("W")) ) {
                    System.out.println(returnStructure.getString("MESSAGE"));
                 JCO.Structure detail =
                    function.getExportParameterList().
                    getStructure("COMPANYCODE_DETAIL");
                 System.out.println(detail.getString("COMP_CODE") + '\t' +
                                         detail.getString("COUNTRY") + '\t' +
                                         detail.getString("CITY"));
           catch (Exception ex) {
              ex.printStackTrace();
              System.exit(1);
           mConnection.disconnect();
         public JCO.Function createFunction(String name) throws Exception {
           try {
              IFunctionTemplate ft =
                mRepository.getFunctionTemplate(name.toUpperCase());
              if (ft == null)
                return null;
              return ft.getFunction();
          catch (Exception ex) {
            throw new Exception("Problem retrieving JCO.Function object.");
       public static void main (String args[]) {
          Bapi2 app = new Bapi2();
    This is the error i'm getting...
    com.sap.mw.jco.JCO$Exception: (102) RFC_ERROR_COMMUNICATION: Connect to SAP gateway failed
    Connect_PM  GWHOST=<abc11.aa.abc23.company.com>, GWSERV=sapgw00, ASHOST=<abc11.aa.abc23.company.com>, SYSNR=00
    LOCATION    CPIC (TCP/IP) on local host
    ERROR       hostname '<abc11.aa.abc23.company.com>' unknown
    TIME        Mon Jun 06 17:15:12 2005
    RELEASE     640
    COMPONENT   NI (network interface)
    VERSION     37
    RC          -2
    MODULE      ninti.c
    LINE        332
    DETAIL      NiPGetHostByName2: hostname
                '<abc11.aa.abc23.company.com>' not
         at com.sap.mw.jco.rfc.MiddlewareRFC$Client.nativeConnect(Native Method)
         at com.sap.mw.jco.rfc.MiddlewareRFC$Client.connect(MiddlewareRFC.java:1098)
         at com.sap.mw.jco.JCO$Client.connect(JCO.java:2983)
         at MyProject.Bapi2.<init>(Bapi2.java:45)
         at MyProject.Bapi2.main(Bapi2.java:233)
    Thx
    PRadeep

  • Problem while calling servlet from java bean

    I am trying to call a servlet from java bean in cep.
    My java bean:
    package com.bea.wlevs.example.algotrading;
    import com.bea.wlevs.ede.api.StreamSink;
    import com.bea.wlevs.example.algotrading.event.MarketEvent;
    import javax.xml.bind.JAXBContext;
    import javax.xml.bind.Unmarshaller;
    import java.io.BufferedReader;
    import java.io.BufferedWriter;
    import java.io.IOException;
    import java.io.InputStreamReader;
    import java.io.OutputStreamWriter;
    import java.io.StringReader;
    import java.net.MalformedURLException;
    import java.net.URL;
    import java.net.URLConnection;
    public class MarketEventBean implements StreamSink {
         String s=null;
         public void onInsertEvent(Object event) {
              if (event instanceof MarketEvent) {
                   MarketEvent marketEvent = (MarketEvent) event;
                   try {
                        JAXBContext cxt = JAXBContext.newInstance(MarketEvent.class);
                        Unmarshaller unmarsh = cxt.createUnmarshaller();
                        StringReader strReader = new StringReader(marketEvent.getString_1());
                        MarketEvent obj = (MarketEvent) unmarsh.unmarshal(strReader);
                        s=obj.getSymbol();
                        System.out.println("data: " + s);
                   } catch(Exception e) {
                        e.printStackTrace();
                   try {
                        System.out.println("test1");
         URL url = new URL("http://172.18.21.94:7001/AppServletrecv-Model-context-root/ReceiveServlet");
         URLConnection conn = url.openConnection();
              System.out.println("test2");
         conn.setDoOutput(true);
              System.out.println("test3");
         BufferedWriter out =
         new BufferedWriter( new OutputStreamWriter( conn.getOutputStream() ) );
         out.write("symbol="+s);
              System.out.println("test4");
         out.flush();
         System.out.println("test5");
         out.close();
         System.out.println("test6");
         BufferedReader in =
         new BufferedReader( new InputStreamReader( conn.getInputStream() ) );
              System.out.println("test7");
         String response;
         while ( (response = in.readLine()) != null ) {
         System.out.println( response );
         in.close();
         catch ( MalformedURLException ex ) {
         // a real program would need to handle this exception
         catch ( IOException ex ) {
         // a real program would need to handle this exception
    My servlet code:
    package model;
    import javax.servlet.http.HttpServlet;
    import java.io.IOException;
    import java.io.PrintWriter;
    import javax.servlet.http.HttpServlet;
    import javax.servlet.http.HttpServletRequest;
    import javax.servlet.http.HttpServletResponse;
    public class ReceiveServlet extends HttpServlet {
    private final static String _SYMBOL = "symbol";
    public void doPost(HttpServletRequest request, HttpServletResponse response) {
    * Get the value of form parameter
    // private final static String USERNAME = "username";
    String symbol = request.getParameter( _SYMBOL );
    * Set the content type(MIME Type) of the response.
    response.setContentType("text/html");
    * Write the HTML to the response
    try {
    PrintWriter out = response.getWriter();
    out.println("<html>");
    out.println("<head>");
    out.println("<title> A very simple servlet example</title>");
    out.println("</head>");
    out.println("<body>");
    out.println("<h1>Hello " + symbol +"</h1>");
    out.println("</body>");
    out.println("</html>");
    out.close();
    } catch (IOException e) {
    Web.xml:
    <?xml version = '1.0' encoding = 'windows-1252'?>
    <web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
    version="2.5" xmlns="http://java.sun.com/xml/ns/javaee">
    <servlet>
    <servlet-name>ReceiveServlet</servlet-name>
    <servlet-class>model.ReceiveServlet</servlet-class>
    </servlet>
    <servlet-mapping>
    <servlet-name>ReceiveServlet</servlet-name>
    <url-pattern>/ReceiveServlet</url-pattern>
    </servlet-mapping>
    </web-app>
    My servlet is running in weblogic server.
    But when I am running this program in weblogic server side there is no log.
    Edited by: 856272 on Jun 23, 2011 6:43 AM

    I would run both sides in a debugger and see what code is getting invoked

  • Problem while calling RFC in java

    hi,
    I writed a java program  calling a batch input RFC.  The RFC return an internal table which storing the system messages of the batch input process. My problem is:
    When i debug the java program,the RFC excecuted and return the correct internal table to me.
    But when i executed it not in debug mode, there is no batch input messages return to me.
    My code is:
    package com.hongta.com.z_delivery_bdc;
    import com.sap.mw.jco.IFunctionTemplate;
    import com.sap.mw.jco.JCO;
    import com.sap.mw.jco.JCO.ParameterList;
    @author Administrator
    To change the template for this generated type comment go to
    Window&gt;Preferences&gt;Java&gt;Code Generation&gt;Code and Comments
    public class ConnectRFC extends Object {
         JCO.Client mConnection;
         JCO.Repository mRepository;
         String filePath;
         String BDCLOG;
         JCO.Function function;
         public void Connect1() {
              filePath =
                   "C:
    Documents and Settings
    Administrator.3939200975DB4C5
    desktop
    cigaXY2008-12-15.xml";
              function = null;
              try {
                   // Change the logon information to your own system/user
                        mConnection = JCO.createClient("610", // SAP client
              "xxxxxx", // userid
              "xxxxxx", // password
              null, // language
              "10.96.0.53", // application server host name
         "01"); // system number
          // mConnection.setAbapDebug(true);
                   mConnection.connect();
                   mRepository = new JCO.Repository("ARBsoft", mConnection);
              } catch (Exception ex) {
                   ex.printStackTrace();
                   System.out.println("jco connect failed");
                                            mConnection.disconnect();
                   System.exit(1);
              //JCO.Table codes = null;
              try {
                   function = this.createFunction("Z_BAPI_CONTRACT_BDC");
                   if (function == null) {
                        System.out.println(
                             "Z_BAPI_contract_bdc" + " not found in SAP.");
                        if ( mConnection != null && mConnection.isAlive()) {
                             mConnection.disconnect();
                        System.exit(1);
                   //function.getImportParameterList().setValue(filePath, "FILEPATH");               
                   //function.getImportParameterList().setValue(BDCLOG, "BDCLOG");
                   mConnection.execute(function);
                                   catch (Exception ex) {
                                       //System.out.println(ex.toString());
                                    ex.printStackTrace();
                                     System.out.println("execute failed");
                                            mConnection.disconnect();
                                     System.exit(1);
              JCO.Table codes = null;
              codes =
                 function.getTableParameterList().getTable("MESSAGE");
              try {
                        codes.firstRow();
                        for (int i = 0; i < codes.getNumRows(); i++, codes.nextRow()) {
                        System.out.println(codes.getString("CON")"  "codes.getString("MESG"));
              catch(Exception ex1){
                   ex1.printStackTrace();
                   System.out.println("codes");
              if ( mConnection != null && mConnection.isAlive()) {
                   mConnection.disconnect();
                   System.out.println("chenggong");
              public JCO.Function createFunction(String name) throws Exception {
                   try {
                        IFunctionTemplate ft =
                             mRepository.getFunctionTemplate(name.toUpperCase());
                        if (ft == null){
                             return null;
                        return ft.getFunction();
                   } catch (Exception ex) {
                        throw new Exception("Problem retrieving JCO.Function object.");
              public static void main(String[] args) {
                   ConnectRFC app = new ConnectRFC();
                   app.Connect1();
    Regards,
    taowenbo.

    hi,
    i had resolved my problem in other way.I don't upload my data using ws_upload now,but upload with table.
    here is my code.Maybe helpful to somebody:
           JCO.Table C_XYORDERTable;
         JCO.Table C_XYORDPR_FINALTable;
         public void getXyordprFinalElement(Element e) {
              try {
                   for (Iterator i = e.getChildren().iterator(); i.hasNext();) {
                        Element child = (Element) i.next();
                        if (child.getName().equals("ORDER_ID"))
                             C_XYORDPR_FINALTable.setValue(child.getText(), "ORDER_ID");
                        else if (child.getName().equals("ID"))
                             C_XYORDPR_FINALTable.setValue(child.getText(), "ID");
                        else if (child.getName().equals("PRODUCT_ID"))
                             C_XYORDPR_FINALTable.setValue(
                                  child.getText(),
                                  "PRODUCT_ID");
                        else if (child.getName().equals("MATNR"))
                             C_XYORDPR_FINALTable.setValue(child.getText(), "MATNR");
                        else if (child.getName().equals("QUANTITY"))
                             C_XYORDPR_FINALTable.setValue(child.getText(), "QUANTITY");
                   C_XYORDPR_FINALTable.nextRow();
              } catch (Exception ex) {
                   ex.printStackTrace();

Maybe you are looking for

  • Background print of object connected via object services

    SAP's Object Services allows external objects (spreadsheets, Word docs, web sites, ...) to be attached to SAP documents. Some of our invoice documents have a URL attachment. Opening the URL displays a word document which is a statement of the service

  • Data Merge Crash

    This has probably been answered. Please link me to the solution if its been addressed already. Data Merge Indesign CS2 crashes once I click "Create Merge Document" Process:         Adobe InDesign CS2 [94022] Path:            /Applications/Adobe InDes

  • CDATA in mapping

    Hi All, The output of the mapping that U am implementing expects CDATA part in the output The CDATA part should be this way <v1:Body messageType="CUSTIMPORT"><![CDATA[<.....Message xsi:schemaLocation="http://www.../Webservice/....Message/ MicCustImpo

  • Some Photos Missing

    Quite a few photos have gone missing from my library. I first noticed (0) next to the album and then looked in the library, but they are missing there also. If I go through the finder, the photo names are there but Zero kB size. Some of the thumbs ha

  • Labview executable immediately quits on WIndows XP

     Greetings, Short description of the problem: I build an executable of my Labview 2010 (32-bit) project on my Windows 7 (64-bit) development machine and it runs fine. When I attempt to run the .exe on a different Windows 7 (32-bit) machine it runs fi