Using this as String reference

Hi friends,
Can anybody help find my mistake in the following code.?
public class ThisCheck
{ public ThisCheck()
{System.out.printf("%s",this);
public String str()
{return "shiva";
public static void main(String a[])
{ ThisCheck the=new ThisCheck();
the output I am expecting is Shiva.
But the output Iam getting is the address of the object ThisCheck
as ThisCheck@7d772e
What's going wrong?
I appreciate ur help.

A: using this as String reference

Try:public class ThisCheck {
    public ThisCheck() {
        System.out.printf("%s", this);
    public String toString() {
        return "shiva";
    public static void main(String a[]) {
        ThisCheck the = new ThisCheck();
}The %s flag in printf() looks for the toString() method of the corresponding
argument. (Details here: http://java.sun.com/j2se/1.5.0/docs/api/java/util/Formatter.html)
When you post it's a good idea to use the Formatting tips
http://forum.java.sun.com/help.jspa?sec=formatting
Basically it means putting [code] at the start of your code and [/code] at
the end.

Try:public class ThisCheck {
    public ThisCheck() {
        System.out.printf("%s", this);
    public String toString() {
        return "shiva";
    public static void main(String a[]) {
        ThisCheck the = new ThisCheck();
}The %s flag in printf() looks for the toString() method of the corresponding
argument. (Details here: http://java.sun.com/j2se/1.5.0/docs/api/java/util/Formatter.html)
When you post it's a good idea to use the Formatting tips
http://forum.java.sun.com/help.jspa?sec=formatting
Basically it means putting [code] at the start of your code and [/code] at
the end.

Similar Messages

  • Why can't I use this Find string in the Mac version of Word?

    Dear all,
    I've found this macro of Paul Edstein:
    http://tinyurl.com/onypmay
    The macro works fine in Word for Windows, but in Word:mac I get an error for this line:
    .Text = "\<[!\>\<]{1,}\>"
    Why would that be?
    BTW: What exactly is Paul doing here?
    How to make this macro work in Word:mac 2011 too?
    Thanks!
    Hans

    Since Word is not an Apple product, I suggest you post on the Microsoft Mac forums since it's their software you have questions about:
    http://answers.microsoft.com/en-us/mac

  • Can substitution strings be used for table name references?

    Hi,
    I was wondering if it's possible to use substituion strings for table names in SQL queries. This would allow for me to edit all references to a table at one location. For instance, if a table name or dblink changed, I could edit the substitution string or application item to ensure all the queries reference the new table.
    For example:
    select * from &table1.
    table1 would be the substitution string for the actual table name
    I know this is possible if I used a pl/sql function returning a query, but I would much rather use a substition string in a SQL query.
    Thanks in advance.
    Brian

    i think not
    because how create the fields of * in this case
    in the other because all is dynamic, i think that you obtain only an error

  • HT3354 how can i use one table for reference to another

    how can i use a table for a referance to another eg when i type a word in a cell, i will like it to match the word with another table then return the information in the cell i am using

    you can use vlookup() (or any of the lookup family of functions) to locate an item based on a key value:
    Here is an example of something you can do with two tables:
    The table on the right is title "Data" and stores a list of names with age and favorite color.
    The table on the left uses the value in the first column to lookup up information in the table Data
    in the table on the left:
    B2=IFERROR(A2&" is " & VLOOKUP(A2, Data :: A:D, 2, 0)&" years old and likes the color "& VLOOKUP(A2, Data :: A:D, 3, 0), "NOT FOUND")
    I know this look complicated.  so I'll break it up into smalled pieces:
    first the "&" is called the concatenate operator and joins two strings.  like this:
    a string is a set of characters between double quotes.
    so "string 1" & "string 2" becomes "string 1string2"  or "Sam " & "Jones" becomes "Sam Jones"
    you can use cell references instead of strings directly in which case the concatenation is performed on the contents of the cells.
    so if cell A1 contains "Hi " and the cell A2 contains "There"  then A1 & A2 will result in "Hi There"
    so you could add the formula
    A3=A1 & A2
    this is short hand for select cell A3 then type everything including the A3 so that A3 contains "=A1 & A2" (omit the double quote)
    OK.  So the formula I provided concatenates several items together:
    it concatenates A2, then the string " is " then a formula, then the string " years old and likes the color " then a formula
    the two formulas (highlighted in blue) perform a lookup of the value in cell A2 in columns A thru D of the table named "Data".  If if finds the value in cell A2 in the first column of the lookup range in the table Data (column A) then it returns the value from the same row but in the second or third column.
    all that is in a function calld iserror() to trap the condition where the calue you enter in A2 does not exist in the table Data:
    You will find the Numbers users guide and function reference helpful.  You can download then from Apple here:
    http://support.apple.com/manuals/#productivitysoftware

  • Can i use this script in illustrator?

    can i use this script in illustrator?
    Newsgroup_User

    // This script exports extended layer.bounds information to [psd_file_name].xml
    // by pattesdours
    function docCheck() {
        // ensure that there is at least one document open
        if (!documents.length) {
            alert('There are no documents open.');
            return; // quit
    docCheck();
    var originalRulerUnits = preferences.rulerUnits;
    preferences.rulerUnits = Units.PIXELS;
    var docRef = activeDocument;
    var docWidth = docRef.width.value;
    var docHeight = docRef.height.value;
    var mySourceFilePath = activeDocument.fullName.path + "/";
    //  Code to get layer index / descriptor
    cTID = function(s) { return app.charIDToTypeID(s); };
    sTID = function(s) { return app.stringIDToTypeID(s); };
    function getLayerDescriptor (doc, layer) {
        var ref = new ActionReference();
        ref.putEnumerated(cTID("Lyr "), cTID("Ordn"), cTID("Trgt"));
        return executeActionGet(ref)
    function getLayerID(doc, layer) {
      var d = getLayerDescriptor(doc, layer);
      return d.getInteger(cTID('LyrI'));
    var stackorder = 0;
    // function from Xbytor to traverse all layers
    traverseLayers = function(doc, ftn, reverse) {
      function _traverse(doc, layers, ftn, reverse) {
        var ok = true;
        for (var i = 1; i <= layers.length && ok != false; i++) {
          var index = (reverse == true) ? layers.length-i : i - 1;
          var layer = layers[index];
          //  alert("layer.typename  >>> "+layer.typename ); 
          if (layer.typename == "LayerSet") {
            ok = _traverse(doc, layer.layers, ftn, reverse);
          } else {
      stackorder = stackorder + 1;
            ok = ftn(doc, layer, stackorder);
        return ok;
      return _traverse(doc, doc.layers, ftn, reverse);
    // create a string to hold the data
    var str ="";
    // class using a contructor
    function cLayer(doc, layer) {
    //this.layerID = Stdlib.getLayerID(doc, layer);
      this.layerID = getLayerID(doc, layer);
      //alert("layer ID: " + this.layerID);
      this.layerWidth = layer.bounds[2].value - layer.bounds[0].value;
          this.layerHeight = layer.bounds[3].value - layer.bounds[1].value;
      // these return object coordinates relative to canvas
          this.upperLeftX = layer.bounds[0].value;
          this.upperLeftY = layer.bounds[1].value;
          this.upperCenterX = this.layerWidth / 2 + layer.bounds[0].value;
          this.upperCenterY = layer.bounds[1].value;
          this.upperRightX = layer.bounds[2].value;
          this.upperRightY = layer.bounds[1].value;
          this.middleLeftX = layer.bounds[0].value;
          this.middleLeftY = this.layerHeight / 2 + layer.bounds[1].value;
          this.middleCenterX = this.layerWidth / 2 + layer.bounds[0].value;
          this.middleCenterY = this.layerHeight / 2 + layer.bounds[1].value;
          this.middleRightX = layer.bounds[2].value;
          this.middleRightY = this.layerHeight / 2 + layer.bounds[1].value;
          this.lowerLeftX = layer.bounds[0].value;
          this.lowerLeftY = layer.bounds[3].value;
          this.lowerCenterX = this.layerWidth / 2 + layer.bounds[0].value;
          this.lowerCenterY = layer.bounds[3].value;
          this.lowerRightX = layer.bounds[2].value;
          this.lowerRightY = layer.bounds[3].value;
       // I'm adding these for easier editing of flash symbol transformation point (outputs a 'x, y' format)
       // because I like to assign shortcut keys that use the numeric pad keyboard, like such:
       // 7 8 9
       // 4 5 6
       // 1 2 3
          var windowW=2048;
          var windowH=1536;
       this.leftBottom = this.lowerLeftX + ", " + (windowH-this.lowerLeftY);
       this.bottomCenter = this.lowerCenterX + ", " +  (windowH-this.lowerCenterY);
       this.rightBottom = this.lowerRightX + ", " + this.lowerRightY;
       this.leftCenter = this.middleLeftX + ", " + this.middleLeftY;
       this.center = this.middleCenterX + ", " + this.middleCenterY;
       this.rightCenter = this.middleRightX + ", " + this.middleRightY;
       this.leftTop = this.upperLeftX + ", " + this.upperLeftY;
       this.topCenter = this.upperCenterX + ", " + this.upperCenterY;
       this.rightTop = this.upperRightX + ", " + this.upperRightY;
      // these return object coordinates relative to layer bounds
          this.relUpperLeftX = layer.bounds[1].value - layer.bounds[1].value;
          this.relUpperLeftY =  layer.bounds[0].value - layer.bounds[0].value;
          this.relUpperCenterX = this.layerWidth / 2;
          this.relUpperCenterY = layer.bounds[0].value - layer.bounds[0].value;
          this.relUpperRightX = this.layerWidth;
          this.relUpperRightY = layer.bounds[0].value - layer.bounds[0].value;
          this.relMiddleLeftX = layer.bounds[1].value - layer.bounds[1].value;
          this.relMiddleLeftY = this.layerHeight / 2;
          this.relMiddleCenterX = this.layerWidth / 2;
          this.relMiddleCenterY = this.layerHeight / 2;
          this.relMiddleRightX = this.layerWidth;
      this.relMiddleRightY = this.layerHeight / 2;
          this.relLowerLeftX = layer.bounds[1].value - layer.bounds[1].value;
          this.relLowerLeftY = this.layerHeight;
          this.relLowerCenterX = this.layerWidth / 2;
      this.relLowerCenterY = this.layerHeight / 2;
          this.relLowerRightY = this.layerHeight;
          this.relLowerRightX = this.layerWidth;
          this.relLowerRightY = this.layerHeight;
      return this;
    // add header line
    str = "<psd filename=\"" + docRef.name + "\" path=\"" + mySourceFilePath + "\" width=\"" + docWidth + "\" height=\"" + docHeight + "\">\n";
    // now a function to collect the data
    var isParentAvailable=false;
    var prevLayerSetName="";
    function exportBounds(doc, layer, i) {
        var isVisible = layer.visible;
        var layerData = cLayer(doc, layer);
    //alert("layer.name  >>> "+layer.name );
    //alert("typename >>> "+layer.typename);
    /*if(layer.parent.name == "ParentTest"){
    for(var i in layer.parent){
        alert(" III >>> "+i+"<<<layer.parent>>"+layer.parent[i]);
      if(isVisible){
    // Layer object main coordinates relative to its active pixels
    var startStr="";
        if(layer.parent.typename=="LayerSet"){
            if(prevLayerSetName!="LayerSet")    {
                startStr="\t<parentlayer id='"+layer.parent.name+"'>\n\t";
            }else{
                   startStr="\t";
            // endStr="\t</parentlayer>\n";
             prevLayerSetName=layer.parent.typename;
          }else{
               if(prevLayerSetName=="LayerSet"){
                    startStr="\t</parentlayer>\n";
                prevLayerSetName="";
      var positionStr=layer.name.split(".")[0].substr(layer.name.split(".")[0].length-3,layer.name. split(".")[0].length);
      var assetPosition=leftTop;
      if(positionStr=="L_B"){
      assetPosition=leftBottom;
      }else if(positionStr=="B_C"){
      assetPosition=bottomCenter;
      }else if(positionStr=="R_B"){
      assetPosition=rightBottom;
      }else if(positionStr=="L_C"){
      assetPosition=leftCenter;
      }else if(positionStr=="C"){
      assetPosition=center;
      }else if(positionStr=="R_C"){
      assetPosition=rightCenter;
      }else if(positionStr=="L_T"){
      assetPosition=leftTop;
      }else if(positionStr=="T_C"){
      assetPosition=topCenter;
      }else if(positionStr=="R_T"){
      assetPosition=rightTop;
      var str2 =startStr+ "\t<layer name=\"" + layer.name
      + "\" stack=\"" + (i - 1) // order in which layers are stacked, starting with zero for the bottom-most layer
      + "\" position=\"" + assetPosition // this is the
      + "\" layerwidth=\"" + layerData.layerWidth
      + "\" layerheight=\"" + layerData.layerHeight
      + "\" transformpoint=\"" + "center" + "\">" // hard-coding 'center' as the default transformation point
      + layer.name + ".png" + "</layer>\n" // I have to put some content here otherwise sometimes tags are ignored
    str += str2.toString();
    // call X's function using the one above
    traverseLayers(app.activeDocument, exportBounds, true);
    // Use this to export XML file to same directory where PSD file is located
        var mySourceFilePath = activeDocument.fullName.path + "/";
    // create a reference to a file for output
        var csvFile = new File(mySourceFilePath.toString().match(/([^\.]+)/)[1] + app.activeDocument.name.match(/([^\.]+)/)[1] + ".xml");
    // open the file, write the data, then close the file
    csvFile.open('w');
    csvFile.writeln(str + "</psd>");
    csvFile.close();
    preferences.rulerUnits = originalRulerUnits;
    // Confirm that operation has completed
    alert("Operation Complete!" + "\n" + "Layer coordinates were successfully exported to:" + "\n" + "\n" + mySourceFilePath.toString().match(/([^\.]+)/)[1] + app.activeDocument.name.match(/([^\.]+)/)[1] + ".xml");

  • Using EBS search strings to allocate a customer profit center

    Hi All,
    I am using IHC for my incoming payments. I use substitution for profit centers in customer orders, I would like the EBS to automatically deposit into the customer's account using the same profit center used when creating the customer orders. I have been researching on the use of search string, whoever am failing to see how to set this up.
    Any suggestion is greatly appreciated.
    Thanks & Regards,
    Godhelp

    Hi Shannon,
    Thanks for your response.  Here are the results of my latest test.
    I set the algorithms in both the transaction mapping and the search string allocation to "021".  FEBSTS did not find the imbedded reference numbers.
    I left the algorithms in the transaction mapping at "021", but added "000" to the search string allocation (so that both "000" and "021" were active there).  FEBSTS did execute the search strings and returned the reference numbers.
    Unless there is some magic somewhere or I am really misunderstanding something, all of my tests are telling me that the simulation (and presumably the live program) will NOT execute the search strings properly unless "000" is active in the search string functionality, and that means the document retrieval must be done in the user exit.
    This may be part of why SAP recommends that one does not use MT940, but one must deal with what one has.
    Patricia

  • How to use this .WSDL file

    Hello,
    I was given this .WSDL file and asked to import it into PI. It's a very simple operation. From ECC  we will send some user data in the header and some Ticket data in the body. It is forwarded by PI to 3rd party ticket system. The result sent back is the ticket ID that is created in ticket system.
    However i'm facing difficulties with this. Please see actions i've done below.
    <?xml version="1.0" encoding="utf-8"?>
    <wsdl:definitions
        xmlns:soap = "http://schemas.xmlsoap.org/wsdl/soap/"
        xmlns:tm = "http://microsoft.com/wsdl/mime/textMatching/"
        xmlns:soapenc = "http://schemas.xmlsoap.org/soap/encoding/"
        xmlns:mime = "http://schemas.xmlsoap.org/wsdl/mime/"
        xmlns:tns = "http://srv-dca-sc-web1.AAAA.com/"
        xmlns:s = "http://www.w3.org/2001/XMLSchema"
        xmlns:http = "http://schemas.xmlsoap.org/wsdl/http/"
        targetNamespace = "http://srv-dca-sc-web1.AAAA.com/"
        xmlns:wsdl = "http://schemas.xmlsoap.org/wsdl/">
        <wsdl:types>
            <s:schema elementFormDefault = "qualified" targetNamespace = "http://srv-dca-sc-web1.AAAA.com/">
                <s:element name = "HrwHeader" type = "tns:HrwHeader"/>
                <s:complexType name = "HrwHeader">
                    <s:sequence>
                        <s:element minOccurs = "0" maxOccurs = "1" name = "Username" type = "s:string"/>
                        <s:element minOccurs = "0" maxOccurs = "1" name = "Password" type = "s:string"/>
                        <s:element minOccurs = "0" maxOccurs = "1" name = "EmployeeId" type = "s:string"/>
                        <s:element minOccurs = "1" maxOccurs = "1" name = "CompanyId" type = "s:int"/>
                    </s:sequence>
                    <s:anyAttribute/>
                </s:complexType>
                <s:element name = "CreateTicket">
                    <s:complexType>
                        <s:sequence>
                            <s:element minOccurs = "0" maxOccurs = "1" name = "description" type = "s:string"/>
                            <s:element minOccurs = "1" maxOccurs = "1" name = "serviceId" type = "s:int"/>
                            <s:element minOccurs = "1" maxOccurs = "1" name = "priorityId" type = "s:int"/>
                            <s:element minOccurs = "1" maxOccurs = "1" name = "levelId" type = "s:int"/>
                            <s:element minOccurs = "0" maxOccurs = "1" name = "thirdPartySystemID" type = "s:string"/>
                        </s:sequence>
                    </s:complexType>
                </s:element>
                <s:element name = "CreateTicketResponse">
                    <s:complexType>
                        <s:sequence>
                            <s:element minOccurs = "1" maxOccurs = "1" name = "CreateTicketResult" type = "s:int"/>
                        </s:sequence>
                    </s:complexType>
                </s:element>
            </s:schema>
        </wsdl:types>
        <wsdl:message name = "CreateTicketSoapIn">
            <wsdl:part name = "parameters" element = "tns:CreateTicket"/>
        </wsdl:message>
        <wsdl:message name = "CreateTicketSoapOut">
            <wsdl:part name = "parameters" element = "tns:CreateTicketResponse"/>
        </wsdl:message>
        <wsdl:message name = "CreateTicketHrwHeader">
            <wsdl:part name = "HrwHeader" element = "tns:HrwHeader"/>
        </wsdl:message>
        <wsdl:portType name = "TicketServiceSoap">
            <wsdl:operation name = "CreateTicket">
                <wsdl:documentation xmlns:wsdl = "http://schemas.xmlsoap.org/wsdl/">Create new ticket and return the Ticket ID as an integer</wsdl:documentation>
                <wsdl:input message = "tns:CreateTicketSoapIn"/>
                <wsdl:output message = "tns:CreateTicketSoapOut"/>
            </wsdl:operation>
        </wsdl:portType>
        <wsdl:binding name = "TicketServiceSoap" type = "tns:TicketServiceSoap">
            <soap:binding transport = "http://schemas.xmlsoap.org/soap/http"/>
            <wsdl:operation name = "CreateTicket">
                <soap:operation soapAction = "http://srv-dca-sc-web1.AAAA.com/CreateTicket" style = "document"/>
                <wsdl:input>
                    <soap:body use = "literal"/>
                    <soap:header message = "tns:CreateTicketHrwHeader" part = "HrwHeader" use = "literal"/>
                </wsdl:input>
                <wsdl:output>
                    <soap:body use = "literal"/>
                </wsdl:output>
            </wsdl:operation>
        </wsdl:binding>
    </wsdl:definitions>
    What i wanted to do was to create a service interface in PI that could be used in ECC to create a proxy of. The service interface needs to use the HRWheader and Ticket SoapIn combined. However when I import the .WSDL in an external definition i see three separate messages (header, soapin, soapout) and there is no way i can use the two messages in one SI.
    I also tried importing the .WSDL using "do not extract" but that doesn't help either.
    I also tried importing the .WSDL file as a Service Interface directly and it neatly creates a synchronous interfaces with the soapin as request and soapout as response, but it still doesn't show the header. If i check the WSDL tab for my newly created interface i also miss the reference to the Header message.
    So my question is for some help and what would be the best way to handle this.
    Kr
    Regards

    hi ,
    check this link ,
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/244e7923-0a01-0010-5887-fe0b0c6dbb8d
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/30f1b585-0a01-0010-3d96-ad0ea291c4f9
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/media/uuid/db785a70-0701-0010-858c-eee0ec4fe1b3
    In Web Dynpro ABAP there is nothing special about calling a web service. Unlike WD Java, there are not dedicated model object types in WD ABAP. WD ABAP simply has the ability to interact with other ABAP development object types. You can call function modules, ABAP classes, even modules in old dynpro apps.
    So calling the webservice from ABAP therefore is just the process of generating the ABAP Proxy Class. This is the same process regardless of if you want to use this proxy class from WDA or any other type of ABAP development object. You can then call the proxy class from WDA just like any other type of ABAP class. There is a service wizard option in later support package levels that includes an option for ABAP Proxy classes - although it doesn't generate the proxy class it just generates the code and context for the call to an already existing proxy class. The service wizards in WD ABAP are not required however. They are just shortcut code generators and often can't even generate a complete context for a complex web service proxy - so expect to do some manual adjustment after running the wizard.
    Regards ,
    venkat .

  • How to use 'this' with synchronization?

    Hi, I have the following program and the results are not synchronized as expected.
    The TransThread class includes a synchronized block and a synchronized method. In my opinion, a non-static synchronized method will refer to 'this' as its objectidentifier so I use 'this' as the objectidentifier of synchronized block,too. But no synchronization happens. Would you like tell me why? Thank you in advance.
    // SynTestDemo.java
    class SynTestDemo
    public static void main (String [] args)
    FinTrans ft = new FinTrans ();
    TransThread tt1 = new TransThread (ft, "Deposit Thread");
    TransThread tt2 = new TransThread (ft, "Withdrawal Thread");
    tt1.start ();
    tt2.start ();
    class FinTrans
    public static String transName;
    public static double amount;
    class TransThread extends Thread
    private FinTrans ft;
    TransThread (FinTrans ft, String name)
    super (name); // Save thread's name
    this.ft = ft; // Save reference to financial transaction object
    public synchronized void WithdrawOp()
    ft.transName = "Withdrawal";
    try
    Thread.sleep ((int) (Math.random () * 1000));
    catch (InterruptedException e)
    ft.amount = 250.0;
    System.out.println (ft.transName + " " + ft.amount);
    public void run ()
    for (int i = 0; i < 100; i++)
    if (getName ().equals ("Deposit Thread"))
    synchronized (this)
    ft.transName = "Deposit";
    try
    Thread.sleep ((int) (Math.random () * 1000));
    catch (InterruptedException e)
    ft.amount = 2000.0;
    System.out.println (ft.transName + " " + ft.amount);
    else
    WithdrawOp();

    Thank you for your advice. I modified my code. But the outcome is incorrect if I use
    if (thdName == "Deposit Thread")
    the amount is always 100
    while
    the outcome is correct if I use
    if (getName ().equals ("Deposit Thread"))
    // SynTestDemo.java
    class SynTestDemo
    public static void main (String [] args)
    FinTrans ft = new FinTrans ();
    TransThread tt1 = new TransThread (ft, "Deposit Thread");
    TransThread tt2 = new TransThread (ft, "Withdrawal Thread");
    tt1.start ();
    tt2.start ();
    class FinTrans
    public static String transName;
    public static double amount;
    public synchronized void update(String transName, double amount)
    this.transName = transName;
    this.amount = amount;
    try
    Thread.sleep ((int) (Math.random () * 1000));
    catch (InterruptedException e)
    System.out.println (transName + " " + amount);
    class TransThread extends Thread
    private FinTrans ft;
    TransThread (FinTrans ft, String name)
    super (name); // Save thread's name
    this.ft = ft; // Save reference to financial transaction object
    String thdName = getName();
    public void run ()
    for (int i = 0; i < 40; i++)
    if (thdName == "Deposit Thread")
    // if (getName ().equals ("Deposit Thread"))
    ft.update(thdName,1000);
    else
    ft.update(thdName,100);

  • How to use SAP Router String with SAP Web Services

    Hi All,
    I have developed an SAP Web Service and I'm using it from a vb.net dll by using web reference.
    I want to use an SAP Router string when I try to call web service but I don't how to do it.Should the url of my proxy contain this router string in itself or is there any other attribute that I should configure for this purpose?
    Please help!!!
    MERAL
    My code is as in the followings .
    (And my SAP router string is like /H/111.11.111.11/H/)
    Dim srvProxy As New PSUDamacanaProxy4.Z_SDB_RFC_GetList
                srvProxy.Url = s"http://21.11.1.43:8000/sap/bc/soap/rfc"
                srvProxy.Timeout = 10000
                srvProxy.Credentials = New System.Net.NetworkCredential(strUserName, strPassword)
                srvProxy.Z_SDB_RFC_GetList(p_bayi, durum, True, miktar, telefon, expMusteri, expReturnValue, expSiparis, expTeslimat, expAdSoyad)
                musteriAdSoyad = expAdSoyad
                ReturnValue = expReturnValue
                srvProxy.Dispose()
                srvProxy = Nothing

    Since I posted this question, I have abandoned the notion of
    auto-generated web services and embraced the good old FDS concept
    where the RemoteObject meta-tag does all the conversion work for
    me. We are now using the Granite DS package and it is working well
    for us. I would love to consume web services, but it just isn't
    worth the hassle when all you have to do with Granite (and FDS) is
    cast your return objects to the proper object type.
    BTW, since this posting, I have investigated competing Flex
    app frameworks. After my research, I checked out the PureMVC
    framework. Wow!! Cairngorm always left me with an uneasy feeling
    and I guess I am not alone. Apparently, Cliff Hall felt the same
    way. That is why he started the project. I like his approach alot
    more than Cairngorm especially since it includes notifications
    which allow me to broadcast my own app level events independent
    from the AS Event framework. Check out PureMVC. For what it is
    worth, it has my humble endorsement. Cliff was even gracious enough
    to acknowledge the other Adobe Consulting guys for their work. Good
    for you Cliff, I respect that. Check out a better way at
    http://www.puremvc.org/

  • When to use "this." when not to ?

    Hi, I know this will be a basic question, but can someone tell me the rule of when to use this.method/variable/etc and when not to ?
    If I have (And I'll cut down the code,leaving construtors, etc.)
    public abstract class DataStuff
    protected String message = null;
    protected void clearMessage()
    this.message = null; // Do I use this.
    message = null; // Or not ?
    } // End clearMessage()
    } // End Class ---------
    Lets get more complicated
    public class MoreStuff extends DataStuff
    public void someMethod()
    this.message = "Do I use This ?";
    message = "Or Do I not ?";
    this.clearMessage(); // or
    clearMessage();
    } // End someMethod()
    } // End Class ------
    I know this will be fairly simple, and I am sure there are lots of Tutorials I could not find that explain the difference between "this"
    thanks
    Paul

    Besides using the this reference for instance variables that have the same name as a local variable, it is also used when your class implements an interface and uses it in the class. Let me further explain. Lets pretend that you create a JFrame that has buttons on it. You want your buttons to handle events so you add an ActionListener to the buttons. You also want to code your event handling in the JFrame so you cause your JFrame to implement the ActionListener interface and implement the required method actionPerformed() in your JFrame class. Well, when you add and actionListener to the buttons, you have to use the this reference in the method signature. See code for example.import javax.swing.*;
    import java.awt.event.*;
    import java.awt.*;
    public class ExampleJFrame extends JFrame implements ActionListener {
       public ExampleJFrame() {
          super("Example using 'this' reference!");
          Container c = getContentPane();
          JButton button = new JButton("Push Me");
          /* Here is the example of how the 'this' reference is
             used.  Since this class implements ActionListener,
             that means it is an ActionListener.  So, when
             we add the method addActionListener to the button,
             it requires that an ActionListener be put into
             the method signature.  So, I just pass a reference
             to this class into it (using the 'this' reference).
             Its actionPerformed method will be called.  There
             are 3 ways I could think of to handle the
             events for this button.  One is to do it the way
             I chose to do it; that is, have the originating
             class (ExampleJFrame) handle it.  That is where
             the 'this' reference comes into play.  Two is
             to use an anonymous inner class.  The second
             option is useful if the code is small and
             self contained.  Three is to have another
             class handle it, such as an Action. */
          button.addActionListener(this);
          c.add(button);
          /* incidentally, you could put the this keyword in
             front of each of these methods for readability,
             but most people don't. I used it on the first
             one to demonstrate it.  */
                   //cause the program to end when closing
          this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
          pack();
          setVisible(true);
       }//end constructor
       /*=**************************************************
       * actionPerformed(): required ActionListener method *
       public void actionPerformed(ActionEvent e) {
          /* the this reference is also used in here because
             the showMessageDialog() should have as its
             parent a component and we want the component to
             be this JFrame */
          JOptionPane.showMessageDialog(this,"You used the this pointer!");
       }//end actionPerformed
       public static void main(String args[]) {
          /* when you run this class, a small JFrame with
             a button will appear in the top left corner. */
          ExampleJFrame app = new ExampleJFrame();
       }//end main
    }//end ExampleJFrame classtajenkins

  • Posting string reference 961 not planned

    Hi
    From the output list of MB51, while I try to open a material document with Mvt Type 961(Backflush GI for Order), the system throws out a error "Posting string reference 961 not planned".
    The same error appears when I try to access from Production Order -> Documented Goods Mvt -> Material document (with 961 Mvt).
    Material documents is displayed for all other Mvt types.
    Why is it so happening?
    Thanks
    Velu

    Dear Velu,
    Please check SE16 transaction:
    Table: T156
    BWART BUSTR
    961   961    <<<<<<<<<<<<
    This is the reason for the error message you are facing.
    After 4.6A version, it is not possible to create custom movement type
    by using a custom posting string reference.
    Possible solution:
    1) Deleting the movement and recreating the movement again in
       reference to a standard movement. This is the best and recommendable
       way.
    2) Use SE16 and manually change the reference movement to a standard
       movement.
    3)  Release 470 has additional table MIGO_T156 that has to be updated if you want to continue using a customer movement type that does not reference a standard movement in T156 but i think you have to tested it out as it is not supported by SAP Support, this is modification. Keep fields XTRANSFER_MVT,
    XSTOCK_TYPE_MVT, XREMOVE_FROM_MVT and XPLACE_IN_MVT as initial.
    Regards,
    ian Wong Loke Foong

  • Get string inside brackets - Using Scan from string

    I have a very basic question here. I would like extract a portion of a string which is inside brackets (Example: I work with [National Instruments]). In the string I only want to extract National Instruments, I do know logic to extract by finding the brackets and extracting them. But I am interested in using the Scan from string or possibly any other primitive in one shot. Please suggest if anyone has any idea, I am really not use to the format specifiers. I got this link for reference but I am not able to figure out a solution.
    The best solution is the one you find it by yourself
    Solved!
    Go to Solution.

    Hi,
    I cannot say that it is the best solution, I use two Scan From String functions instead of one but it does work, so far ;-)
    I use Characters in set.
    I could not attach VI so FP is below.
    Duri

  • Use Operator == for String Comparison

    Hi,
    I would like to know more about the impact of using operator == in String Comparison.
    From the reference I get, it state this :
    "Operator (==) compares two object addresses to see whether it refers to the same object."
    I've tested it with 2 codes as below :
    Code 1:
              String Pass1 = "cosmo";
              String Pass2 = "cosmo";          
    if (Pass1==Pass2)
                   System.out.println("1&2:same");
              else
                   System.out.println("1&2:not same");
    Output : 1&2:same
    Code 2:
              String Pass3 = new String("cosmo");
              String Pass4 = new String("cosmo");
              if (Pass3==Pass4)
                   System.out.println("3&4:same");
              else
                   System.out.println("3&4:not same");
    Output : 3&4:not same
    Can anyone kindly explain why is the result so? If operator == compares the addresses, isn't it that the 1st code should also have the output :"1&2:not same".

    Can anyone kindly explain why is the result so?It's an implementation artifact. Strings are pooled internally and because of that any String literal will be represented by exactly one object reference.
    Knowledge of this shouldn't be utilized though. It's safer to follow the basic rule: Use == to compare object references and equals to compare object values, such as String literals.

  • String reference equality

    I don't understand why following code when executed returns false
    String s1= " string".trim();
      if(s1 == "string"){
      System.out.println("true");
      else{
      System.out.println("false");

    In this case the strings are located in the String pool and are the same reference.
    It stops working, when you use
    String s1 = new String("String");
    String s2 = new String("String");
    System.out.println(s1 ==s2);
    Just stop using == when comparing Strings, unless you wnat to compare the objects.

  • Practical uses of Weak/Soft references

    Hello,
    I understand how weak- and soft-references behave. However I would be grateful if someone could give me a practical example of why one would use them in a real-life application.
    Thanks in advance,
    Julien.

    SourceError, seems like what you described in your last post is what I described in my post. see for yourself.
    package com.rigidsoftware.Automotive.ASCAD.DataBase;
    import java.lang.ref.*;
    import java.util.*;
    * This class is used to ensure that if anyone holds a particular DBObject, everyone
    * that looks for that object gets a reference to the exact same instance.  That
    * way any name changes are immediately reflected in the data of the object.
    * Of course that does not cause them to realize it...But since they all hold the
    * reference, a listener should be easy!?
    * The purpose of this cache is not speed but consistency of data.  This is a
    * form of the Singleton pattern, Multiton.
    * Why wont a weak map or weak set work? do they only work for the keys and not
    * the objects? probably do.
    * <p>Title: ASCAE</p>
    * <p>Description: Automotive Systems Computer Aided Engineering Tool</p>
    * <p>Copyright: Copyright (c) 2001</p>
    * <p>Company: Rigidsoftware</p>
    * @author C.L. Gilbert
    * @version 1.0
    class DBCacher {
         private volatile Map m_Cache;
         private volatile Map m_ReverseCacheMapping; //cant think of any other way to remove values without keys.
         private volatile java.lang.ref.ReferenceQueue q;
         private volatile String name;//unsure if this ensures no NPE in case of thread starting before name assignment because optimizing compiler
         public DBCacher(String name){
              this.name = name;
              m_Cache = new HashMap();
              m_ReverseCacheMapping = new HashMap();
              q = new ReferenceQueue();
              Thread t = new CacheCleaner(name);
              int priority = Thread.currentThread().getPriority()-1; //slightly reduce the priority
              t.setPriority( (priority < Thread.MIN_PRIORITY) ? Thread.MIN_PRIORITY : priority );
              t.setDaemon(true);
              t.start();          
         public DBCacher(){
              this("DBCacher");
          * Needs to by synchronized because of concurrent access to ReferenceQuque
          * and Map.
         public synchronized void CachePut(Object key,Object obj) {
             Reference r = new SoftReference(obj,q);
              m_Cache.put(key,r);
              m_ReverseCacheMapping.put(r,key);
          * key is the Long ID of the object typically
         public synchronized Object CacheGet(Object key){
              SoftReference sr = (SoftReference)m_Cache.get(key);
              if(sr != null) {
                   System.out.println(name + " cache hit " + key);
              return (sr != null) ? sr.get() : null;
         private class CacheCleaner extends Thread {
              public CacheCleaner(String name){
                   super(name);
              public void run() {
                   while(true) {
                        try {
                             Reference ref = q.remove();
                             Object value;
                             Object key;
                             synchronized(DBCacher.this) {
                                  key = m_ReverseCacheMapping.remove(ref);
                                  value = m_Cache.remove(key);
                             java.lang.System.out.println(name + " removed object from map " + key);
                        catch(InterruptedException ie){
                             ie.printStackTrace();
    }Each of my db object classes can only be obtained through an instance of this class by calling
    instance.CacheGet( recordID );
    and if no object is returned, then one is created externally and put into the cache with
    instance.CachePut(object, recordID);
    if your ids were more detailed you could use fewer instances of this class.
    I wish I could find a way to get rid of that reverse cache lookup mess, but I could not. Feel free to use this code if its helpful.

Maybe you are looking for

  • Fully Close Off Under Delivered Schedule Agreement Line Items

    Hi There, I am supporting a customer who is having an issue with line items on a scheduled agreement, which she has closed off, appearing in MIGO. Example: I have a scheduled line item of 100 EA.  I GR 90 EA but I am happy with this so I want to clos

  • SOLVED: Getting an Input/Output error when accessing certain files

    My system started failing a few days ago because of sudden Input/Output errors when trying to access certain files. It was running fine until various applications started crashing like for example Pidgin (in retrospect probably because of DBus crashi

  • Can't print to LPT1 from a command prompt - WIN XP

    I have an HP Deskjet 722C hooked straight up to the computer via a standard parallel printer cable (DB25 to Centronics) to the machine's parallel port. OS is XP Pro on a single user system with no network involved. For example, I load a file in DOS E

  • Server name not showing up in shared list.

    Wondering if anyone may know what's up with this.  We have a mac mini server with Yosemite server on it.  The name for the server isn't showing up on the client computers in the office in the "Shared" list of computers in the Finder. Any ideas?

  • Regarding collect statement - Production report

    Dear Experts, I've the following requirement A ) I'm creating a ALV report from Z table where i want the summary of the qty across different processing type like CT , ST , WS  & FG . B ) For each processing types i want the total qty to be displayed