Java basic doubt

In java String is treated as object but when we pass the String value as a parameter to a method and reassigned the value of the object inside the method Still the initial object is not getting changed why ?
public class A
     public void m(String a)
          a="ddd";
     public static void main (String a[])
          String a1 ="Sun";
          new A().m(a1);
          System.out.println(a1);
out put : Sun
Thanks,
Suneesh

Yes I got it only property changes in the object is
getting reflected in the initial object's state .In
this case the object itself assigned to another
object . Am I right ??All parameters to methods are passed "by value." In other words, values of parameter variables in a method are copies of the values the invoker specified as arguments. If you pass a double to a method, its parameter is a copy of whatever value was being passed as an argument, and the method can change its parameter's value without affecting values in the code that invoked the method. For example:
class PassByValue {
    public static void main(String[] args) {
        double one = 1.0;
        System.out.println("before: one = " + one);
        halveIt(one);
        System.out.println("after: one = " + one);
    public static void halveIt(double arg) {
        arg /= 2.0;     // divide arg by two
        System.out.println("halved: arg = " + arg);
}The following output illustrates that the value of arg inside halveIt is divided by two without affecting the value of the variable one in main:before: one = 1.0
halved: arg = 0.5
after: one = 1.0You should note that when the parameter is an object reference, the object reference -- not the object itself -- is what is passed "by value." Thus, you can change which object a parameter refers to inside the method without affecting the reference that was passed. But if you change any fields of the object or invoke methods that change the object's state, the object is changed for every part of the program that holds a reference to it. Here is an example to show the distinction:
class PassRef {
    public static void main(String[] args) {
        Body sirius = new Body("Sirius", null);
        System.out.println("before: " + sirius);
        commonName(sirius);
        System.out.println("after:  " + sirius);
    public static void commonName(Body bodyRef) {
        bodyRef.name = "Dog Star";
        bodyRef = null;
}This program produces the following output: before: 0 (Sirius)
after:  0 (Dog Star)Notice that the contents of the object have been modified with a name change, while the variable sirius still refers to the Body object even though the method commonName changed the value of its bodyRef parameter variable to null. This requires some explanation.
The following diagram shows the state of the variables just after main invokes commonName:
main()            |              |
    sirius------->| idNum: 0     |
                  | name --------+------>"Sirius"       
commonName()----->| orbits: null  |
    bodyRef       |______________|At this point, the two variables sirius (in main) and bodyRef (in commonName) both refer to the same underlying object. When commonName changes the field bodyRef.name, the name is changed in the underlying object that the two variables share. When commonName changes the value of bodyRef to null, only the value of the bodyRef variable is changed; the value of sirius remains unchanged because the parameter bodyRef is a pass-by-value copy of sirius. Inside the method commonName, all you are changing is the value in the parameter variable bodyRef, just as all you changed in halveIt was the value in the parameter variable arg. If changing bodyRef affected the value of sirius in main, the "after" line would say "null". However, the variable bodyRef in commonName and the variable sirius in main both refer to the same underlying object, so the change made inside commonName is visible through the reference sirius.
Some people will say incorrectly that objects are passed "by reference." In programming language design, the term pass by reference properly means that when an argument is passed to a function, the invoked function gets a reference to the original value, not a copy of its value. If the function modifies its parameter, the value in the calling code will be changed because the argument and parameter use the same slot in memory. If the Java programming language actually had pass-by-reference parameters, there would be a way to declare halveIt so that the preceding code would modify the value of one, or so that commonName could change the variable sirius to null. This is not possible. The Java programming language does not pass objects by reference; it passes object references by value. Because two copies of the same reference refer to the same actual object, changes made through one reference variable are visible through the other. There is exactly one parameter passing mode -- pass by value -- and that helps keep things simple.
Quoted directly from:
Arnold, K., Gosling J., Holmes D. (2000). The Java� Programming Language Third Edition. Boston: Addison-Wesley.
I've said that java handles arrays and objects "by reference." Don't confuse this with the phrase "pass by reference." "Pass by reference" is a term used to describe the method-calling conventions of some programming languages. In a pass-by-reference language, values -- even primitive values -- are not passed directly to methods. Instead, methods are always passed references to values. Thus, if the method modifies its parameters, those modifications are visible when the method returns, even for primitive types.
Java does not do this; it is a "pass by value" language. However, when a reference type is involved, the value that is passed is a reference. But this is not the same as pass-by-reference. If Java were a pass-by-reference language, when a reference type was passed to a method, it would be passed as a reference to the reference.
Flanagan, D. (1999). Java In A Nutshell. p. 74. Sebastopol, CA: O'Reilly & Associates, Inc.

Similar Messages

  • How do you check what version of the java basic libs

    Dear SDN team,
      I am currently using EP 6.0.2.5 , I have just installed patch 5 and I am wondering if I should patch my JAVA Basic libs.  2 Questions
    1.   How can I tell which version I am using now
    2.   Should I patch these libs and why?
    Thanks
    Jeremy

    Hi,
    In The SDM Tool look for an SDA that was deployed from the SAP Java Libs package and then you will see something like:
    Software Type: JAVA-LIB
    Implementation Version: 6.20.<b>14</b>20031219134547.0000
    This means that you are using SAP Java Libs 14.
    It is recommanded to use the latest Java Libs because fixed and enhancements are provided with these libraries.
    Kind regsrds,
    Aviad

  • Basic Doubts

    Hello Experts,
    Please any one of them clarify my some of the Basic doubts
    1.Reg ODS activation failure in Process chain,I know how to correct incase if ods activation failed.I want to know,What could be the reason for failure and in background whats happening(Techincally)
    2.Reg Attribute change run failure in process chain,what could be the reason.(technically)
    3.Whats is the purpose of trfc and what we have to check in SM58.
    4.What is the diff between the IDOC(transfer method) and Idoc which is used to transfer the data in PSA transfer method..(For ex - If i am using the PSA transfer method,even there to transfer the datapackets,we are using Idoc)
    5.Some of the time,I am getting the error like this"Non updated idoc in source system and error mesg from the source system/Business warehouse.
    This mean,what could be the reason.(Frequently i am getting the above errors and If i used the repeat option,It has been corrected and loaded succesfully)
    6.How many datasources can be assigned to one Infosource(Is any limit is there)
    I request you to advise on the above doubts and I will assign the points.
    Thanks in advance
    Regards
    Kumar

    Hi,
    1. During the month end procedures and week ends the number of records will be more rather than the week days, so the data packages defined will run for long time, so we will be getting Time out error, we have to manually activate the data packages.
    2. if you r not using Attribute change run, then your Master data(text, attribute, hierarchy wont get activated when you run a process chain)
    .so it is mandatory that once you fill the master data u have to activate those, for that we need Attribute change run.
    3. tRFC calls which transfer IDocs use the function module IDOC_INBOUND_ASYNCHRONOUS at reception If an IDoc in the sending system has been passed to tRFC (IDoc status "03"), but has not yet been input in the receiving system, this means that the tRFC call has not yet been executed.
    In the standard SAP system, if tRFC errors occur, a background job is generated to re-establish the connection. In certain circumstances this could result in a large number of background jobs being started that completely block background processing. To cancel a background job if tRFC errors occur use program RSARFCEX to restart tRFC.we go for SM59 transaction for this.
    Choose Destination ® tRFC Options and select the option Suppress Background Job at Comm. Error. 
    4. PSA :
    The data is sent directly from the source system to the BW and it  is stored in the PSA (Persistent Staging Area), we can update  automatically/manually to corresponding Info providers .The transfer type here is called the TRF (Transactional Remote Function).
    IDOC :
    The data is packed into IDocs by the source system and sent to the Business Information Warehouse. In BW the data is saved persistently and intransparently in the IDoc store. we have some prerequisite here to use this method ,Transfer  transfer structure must not have more than 1000 Bytes in the character format.
    6. One datasource can be assigned to one info source.

  • Oracle Business INtelligence -installation, basic doubts

    can i shoot oracle BI installation related basic doubts, and other issues that may arise in this forum ???

    if it's enterprise edition.. you can post here..
    Business Intelligence Suite Enterprise Edition

  • Java basic tools

    To start, sorry for posting this here, but this question did not fit on the java tools category.
    I need some guidance on (preferably free/open source tools) for java in order to :
    1. Test java basic code
    2. Test GUI code (can this be done?)
    3. Software quality tools like profilers, etc
    Any help/ideas will be apreciated guys!
    Thank you in advance

    Alexandros wrote:
    To start, sorry for posting this here, but this question did not fit on the java tools category.
    I need some guidance on (preferably free/open source tools) for java in order to :
    1. Test java basic code
    JUnit & TestNG?
    2. Test GUI code (can this be done?)[Test Driven Development: A Practical Guide|http://www.amazon.co.uk/Test-Driven-Development-Practical-Guide/dp/0131016490/ref=sr_1_3?ie=UTF8&s=books&qid=1211543555&sr=8-3] goes over a list of options for this. Alas I can only remember brute force (using java.awt.Robot) and JFCUnit. Neither of them are the one used by the example. The other option is not to and test the Listeners & Swing Models (with the test frameworks above). After all you are really only testing the framework will fire an even when asked, and thats what the frameworks test suite is for.
    3. Software quality tools
    FindBugs
    [Cr�p4J|http://www.cr%61p4j.org/]
    I personally find this one a little to spammy, but if I forced myself to tone them down a little and follow the rules they could help:
    PDM
    CheckStyle
    like profilers, etcNetBeans has a profile built in. It is very pretty. Lots of fancy graphs and lines.
    Edit: De-* Cr�p4, add statement on testing GUIs that will get me flamed.
    Edited by: mlk on 23-May-2008 12:05

  • Redologs basic doubt

    Hi,
    version is 10g, no archive log mode.....
    I have one basic doubt. please bare with me..... I have gone through documents..but still some doubts...
    One person asked me this doubt, when a long running transaction is going on , there is no commit, lot of redo activity is there, if we dont commit, those changed information is gone, when the redo log files are over written, is it true???? he asked like that,
    My answer is like below.......
    There is a long running transaction going on ( insert the data into one table).
    Redo log files are 10 MB size ( 2 Redo log groups with 2 members each).... when insertion is going on, changes are entering into redo log files. stil there is no commit.....
    (a) one redo log file got filled up
    (b) next log switch
    (c) next redo logfile got filled up
    see here still there is no commit
    (d)next system uses first redo log switch and overwrites the data in redo log file
    So, when coming to my doubt, all un commited data already written to data files and when we rollback, those data which is written in datafiles will be rolled back by using undo information in undo files.
    am i right????
    all the new information wile insertion, that data is written into datafiles. old data is written to undo files. when we roll back
    Please correct me, if my undestanding is wrong......
    Edited by: oraDBA2 on Oct 23, 2008 12:53 PM

    Dear friend,
    Oracle's Redo Log
    Each Oracle database has a redo log. This redo log records all CHANGES made in datafiles. The redo log makes it possible to replay SQL statements.
    Before Oracle changes data in a datafile it writes these changes to the redo log.
    As Oracle rotates through its redo log groups, it will eventually overwrite a group which it has already written to. Data that is being overwriten would of course be useless for a recovery scenario. In order to prevent that, a database can (and for production databases should) be run in archive log mode. Simply stated, in archive log mode, Oracle makes sure that online redo log files are not overwritten unless they have been savely archived somewhere.
    THUS, to ANWSER YOUR QUESTION: If Archive Log is ON, your LONG-RUNNING uncommited transaction is generating large volumes of ARCHIVE LOGS !!!!!
    ALSO:
    LGWR writes the redo log buffers to disk. The background process in charge for archiving redo logs is ARCn (if automatic archiving is enabled.)
    In order to find out in which mode the instance runs, one can use archive log list from within sql plus.
    Log Buffer: All changes that are covered by redo is first written into the log buffer. The idea to first store it in the memory is to reduce disk IO. Of course, when a transaction commits, the redo log buffer must be flushed to disk, because otherwise the recovery for that commit could not be guaranteed. It is LGWR (Log Writer) that does that flushing.
    Determining amount of generated redo log
    select
    n.name, t.value
    from
    v$mystat t join
    v$statname n
    on
    t.statistic# = n.statistic#
    where
    n.name = 'redo size';
    See also the package redo_diff
    RBA (Redo Byte Address)
    The RBA consists of three parts and is ten bytes long:
    * Log sequence number
    * Block number within this sequence
    * Offset within this block
    The location of each redo log entry is identified through an RBA. The RBAs are important for dirty db blocks in the buffer cache.
    Determining optimal redo log size
    The optimal size of redo log files can be queried with
    select optimal_logfile_size from v$instance_recovery;
    Good luck!

  • Very basic doubt regarding transporting abap developments

    Hi All,
    It may be very basic doubt, But I need an answer.
    If we develop some objects in the development and transported them to quality and for some reason some errors occured and the for correction of the errors we created some more requests and ported them to Quality.
    the number of requests are say more than 15. and if we lost track of sequece of the requests to be ported to production.
    How can we overcome this problem?
    Can we create a new transport request by right clicking the package (of course all the objects are in only one package) , this will solve the purpose. I mean to say if we transport this single request to quality then to production, all the things will get transported?
    Please give your valuable inputs..
    Thanks and Regards
    KK

    Hi All,
    I really appreciate all your quick replys.
    My question is if we create a new request from the package in SE80, can we leave the old requests,
    That is if I transport a request say req 2 of domain for solving the dependency error of the previous request say req1 ( of data element ). and again transport req 1 after transporting req 2, this will solve the dependency problem. Like this if some dependency related issues are there and we lose track of sequence of request which needs to be transported, what could be the ideal solution?
    So I mean to ask that if I create a new request for the package in SE80, will all the developments will be included in the request or do we need to follow the sequence only?
    Thanks and regards
    KK

  • Oracle Apps - 9iAS : Basic doubts

    Hello,
    I am new to Oracle Apps and 9iAS
    I have few basic doubts regarding the integration of these
    Can anybody please clarify...
    The middle tier of Orcale Apps is the 9iAS Application Server.
    Read that Oracle9i AS Components are :
    - J2EE and Internet Applications (sub-components are Oracle HTTP Server, OC4J, Web services etc)
    - Portals
    - Wireless
    - Web cache
    - Business Intelligence
    - E-Business Integration
    Read that middle tier of Oracle Apps has following servers
    - Web server
    - Forms server
    - Concurrent Processing server
    - Reports server
    - Discoverer server (optional)
    - Admin server
    So, all the components of 9iAS are installed with Oracle Apps ?
    If only some, then which are those ?
    Where do Concurrent Processing server, Reports server etc come from as these are not the components of 9iAS ?
    Are these very specific to Oracle Apps only ?
    As the core database administration knowledge is required for Apps administration (for managing database tier), isn't the 9iAS knowledge required (for managing the middle tier) ?
    If yes, then upto what level ?
    Knowing about Oracle HTTP Server, Apache server, Web cache, OC4J etc etc is required ?
    Please suggest some links / documents related to all these ?
    I found a couple of them on metalink & OTN, but not very useful !
    Thanks

    9iAS consist of Apache and an Oracle database on the middle tier.
    The other components come from the developer suite.
    http://otn.oracle.com/software/products/forms/index.html

  • Application Server and Oracle Apps - basic doubts

    Hello
    I am pretty new to Oracle 9iAS and Oracle Apps 11i
    Please clarify my basic doubts
    Read that Oracle9i AS Components are :
    - J2EE and Internet Applications (sub-components are Oracle HTTP Server, OC4J, Web services etc)
    - Portals
    - Wireless
    - Web cache
    - Business Intelligence
    - E-Business Integration
    Read that middle tier of Oracle Apps has following servers
    - Web server
    - Forms server
    - Concurrent Processing server
    - Reports server
    - Discoverer server (optional)
    - Admin server
    My doubts are -
    1. When Oracle Apps 11i is installed, Oracle 9iAS becomes the middle tier of it
    Yes / No / Partailly ?
    2. If partially, then only the 'J2EE and Internet Applications' component is installed
    Yes / No / Partially ?
    3. If partially, then Web server (Oracle HTTP Server) and Forms server come from Oracle 9iAS and Report Server, Concurrent Processing server, Admin server etc seperate components only specific to Oracle Apps 11i ?
    Yes / No
    Please let me know the answers with the explanation
    Thanks a ton

    Oracle Applications 11i uses Oracle 9iASv1 (10222, specifically) as the underlying midtier technology stack. The latest release of 11i (11.5.10), to be released this summer, can leverage specific features of Oracle AS 10g (904), namely SSO authentication and OID user management, Portal, and Discoverer. This capability will be backported to 11i releases 11.5.8 and 11.5.9, and is currently available now to limited customers through the Early Adopter program. When installed in this configuration, there is a 9iASv1 tech stack installed as part of the 11i installation, and a separate AS 10g installed for SSO, OID, Portal, Discoverer, and any other AS products the customer may be using. Aside from SSO, OID, Portal, and Disco, 11i does not yet run on other components of 9iAS or 10g (e.g., OC4J). Applications plans to move to 10g as the underlying tech stack in a future release.
    John

  • Where do i post java script doubts?

    Where do i post java script doubts?

    JavaScript has nothing to with Java at all, so if you are searching for a sub-forum of this forum to post JavaScript questions then I can't help you.
    You will need to google for a JavaScript forum, maybe someone around here knows of a good one.

  • Basic doubt regarding Java

    Hi Friends,
    I started to learn Using Java in Oracle.
    My Oracle Version is 9i and i have installed java packages to my database server.
    Now i want to steady about writing Java code for Select,Insert,Delete and Update Statements to my database tables.
    I also want to know about creating stored procedures,stored functions,writing java source code for the required things.
    I have seen one Java Class file in the web and i have a doubt in that..
    Here is the code.
    Test JDBC Connection, JDBC Driver Name and Version
    import java.sql.Connection;
    import java.sql.DatabaseMetaData;
    import java.sql.DriverManager;
    import java.sql.SQLException;
    public class JDBCDriverInformation {
         static String userid="scott", password = "tiger";
         static String url = "jdbc:odbc:bob";     
         static Connection con = null;
         public static void main(String[] args) throws Exception {
         Connection con = getOracleJDBCConnection();
         if(con!= null){
              System.out.println("Got Connection.");
              DatabaseMetaData meta = con.getMetaData();
              System.out.println("Driver Name : "+meta.getDriverName());
              System.out.println("Driver Version : "+meta.getDriverVersion());
         }else{
              System.out.println("Could not Get Connection");
         public static Connection getOracleJDBCConnection(){
              try {
                   Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");     
              } catch(java.lang.ClassNotFoundException e) {
                   System.err.print("ClassNotFoundException: ");
                   System.err.println(e.getMessage());
              try {
                   con = DriverManager.getConnection(url,     userid, password);
              } catch(SQLException ex) {
                   System.err.println("SQLException: " + ex.getMessage());
              return con;
    But i couldnot understand the code, it simply compiles without errors when i execute that to my database.
    But the code was not seen in the Java source and i didn't get any results from that.
    As iam just now starting to learn about Java in oracle, someone help me please.
    Thanks,
    Symon

    Hi,
    I suggest to:
    1/ read the free chapter of my book @http://books.elsevier.com/bookscat/samples/1555583296/Sample_Chapters/02~chapter_one.pdf
    2/ play with OTN codes sample @ http://www.oracle.com/technology/sample_code/tech/java/jsp/oracle9ijsp.html
    3/ play with my book's code samples @
    http://books.elsevier.com/companions/1555583296?country=United+States
    Kuassi http://db360.blogspot.com

  • Doubts in java basics.

    class A {
         public void methodTest() {
              System.out.println("Inside class A");
    class B extends A {
         public void methodTest() {
              System.out.println("Inside class B");
    class C extends B {
         public void methodTest() {
              System.out.println("Inside class C");
         public static void main(String arg[]) {
              A aObj = new C();
              aObj.methodTest();
    }The above program prints Inside class C and i understood why it is so.
    class A {
         public void methodTest(A a) {
              System.out.println("Inside class A");
    class B extends A {
         public void methodTest(B b) {
              System.out.println("Inside class B");
    class C extends B {
         public void methodTest(C c) {
              System.out.println("Inside class C");
         public static void main(String arg[]) {
              A aObj = new C();
              aObj.methodTest(aObj);
    }Why the above code is printing Inside class A. I am not understading why is it is not printing Inside class C.
    Thanks for your time.

    The above program prints Inside class C and iunderstood why it is
    so.Why do you think the first prints this?
    A aObj = new C();From the above line i understood that, I am declaring an Obj which is of type A and
    then assigning it a reference of class C. So when we say aObj.methodTest(); its calling class C's method.
    If i am wrong please let me know, i am still new in java.
    Why the above code is printing Inside class A.The methodTest() methods have different signatures,
    and the
    compiler must decide which one to use. Since
    you declare aObj
    as A, it uses public void methodTest(A a).

  • One very basic doubt regarding J2EE

    Hi Java Gurus
    I want to clarify one very basic point regarding J2EE. As per to my understanding a J2EE is a 3 tier system, proposed by Sun for dvelopment and deployment of component based distributed applications. A J2EE based system requires application server as a middle tier, where business logic runs. So far so good.
    Suppose i have a system which uses only JSPs and/or Servlets (No more EJBs and Application server). This system is also 3 tier system,(Client tier, Web-Server Tier and DB tier). In this case there is Web Server and no Application Server. So my doubt here is===== Can I call this as a J2EE based solution. (Assuming both the systems are performing the same task).??
    Plz help.
    Thanx
    Jam

    A bit of elaboration and clarification. (AKA, the long answer)
    The "3-tier" phrase should avoid any technological implication, thus be defined as Presentation Tier, Business Tier, Data Tier. It's meant to convey the clear separation of responsibility. A JSP/Servlet/DAO system, could constitute a 3-tier system, if applied correctly.
    The J2EE platform encompases a number of technologies, JSP, Servlet, EJB, etc.
    A J2EE compliant application server (i.e. JBoss) supports all the features of J2EE
    A Servlet engine (i.e. Tomcat) only supports a sub-set of those technologies, thus it would not correctly be called a J2EE app server.
    Calling something a "J2EE Application" really doesn't mean much, since many projects don't use every piece of J2EE technology available. Though I will agree that use of EJB is a key indicator. If it makes some manager feel better to call a JSP/Servlet app a "J2EE Application", fine.
    Calling yourself (not you, just the general "you") a J2EE developer, should mean you have experience with developing the breadth of J2EE, so having hacked out some JSPs doesn't count :)

  • IDOCs creation - Transfer Orders(TOs)  for Deliveries - Basic doubts, thanq

    Hi Experts,
    Am new to IDOCs.  I hv a requirement, so, request u that, Can I get some Wht to do tips from u?
    My doubts:
    1- I hv been asked to create IDOC, Wht does it mean?
    2 - How the created IDOC will be get posted?
    My requirement is:
    Original inbound idoc sent from Gentran will update the delivery with all serial numbers per material for all serialized product.  The message code will be the indicator that a Transfer Order-TO, idoc must be created for TO confirmation.
    I need to do===>   Should be executed only when the message code on the delivery idoc is u201CTOCu201D.  Look up the warehouse code on the delivery header using the delivery nbr in the delivery idoc.  Create a new TO confirm idoc per delivery idoc being processed.  Create a line item on this idoc for every line on the delivery idoc.  Each TO line includes the delivery number and delivery item number so the TO number and line number can be looked up in table LTAP by using the delivery number and line item number found on the delivery idoc.  There will be at 2 transfer orders for each delivery item b/c of the 2 step pick process, so select the TO nbr that has 916 as the destination storage type (LTAP-NLTYP).  There may be more than 1 pair of TOs per delivery item so this must be completed for each TO found relevant to each delivery item.
    The inbound delvry03 idoc will update the delivery with the serial numbers as part of the standard functionality.  Since the transfer order must also be confirmed with the quantities on the inbound idoc, an additional idoc must be created from within the delivery update process.  The transfer order can be updated and confirmed using the standard idoc and function module which should be created and initiated from the delivery update function module customer exit.
    Source = DELVRY03     Destination = WMTCID01
    Record Name-Field Name-Record Name-Field Name-Description---Comments
    E1EDL20     VBELN-E1LTCOH-LGNUM-Warehouse Number-Look w/ idoc delivery nbr
    E1EDL20     VBELN-E1LTCOH-TANUM-Transfer Order Number- Look w/ idoc delivery nbr
    E1EDL24     POSNR-E1LTCOI-TAPOS-Transfer Order Line Item- Look  w/ idoc delivery line nbr
    EVERY THING IS DATA TRIGGERED!!!
    thanq
    Edited by: Srinivas on Jun 27, 2008 4:41 PM

    IDOC Programming
    There are two processes in IDOC processing one is INBOUND PROCESS( IDOC coming to the system and its handling at various stages) and the other is OUTBOUND PROCESS( IDOC is send to other system . Separate ABAP programs are written for these 2 processes and different configuration settings are required for each one .Depending upon the trigeering mechanism different programming approaches are used.OUTBOUND PROGRAMS handle the IDOC creation and INBOUND PROGRAMS handle the inbound IDOC and the data trasfer from the IDOC to the database tables.
    NEED FOR ABAP PROGRAMMING arises if
    1)New IDOC was created
    Depending upon the triggering mechanism i.e change pointer,message control
    etc the programming technique changes and the type of process.
    2)Existing IDOC was extended
    User Exits are used to populate data in new segments added and to read them
    back.
    3)To enhance an exsiting process.
    User Exits are used .
    Basic structure of an OUTBOUND PROGRAM
    The basic structure of all outbound programs is same. The CONTROL
    record which is of TYPE EDIDC has to be filled. It contains important fields like
    IDOCTP IDOC type
    MESTYP Message Type
    RCVPRN Recieving Partner (Destination)
    RCVPRT Partner Type (it is LS i.e Logical System)
    The DATA RECORD internal table which is of TYPE EDIDD has to be filled
    in the same order as there are segments in the IDOC definition.
    It has 2 important fields which are to be filled ,these are
    SEGNAM Name of the segment
    SEGDATA Data in the segment and can be upto 1000 bytes.This field
    is corresponds to each data segment in the IDOC.
    e.g.
    DATA INT_EDIDD LIKE EDIDD OCCURS 0 WITH HEADER LINE.
    DATA W_SEGDATA LIKE zsegment "custom segment zsegment
    INT_EDIDD-SEGNAM = 'ZSEGMENT'
    W_SEGDATA-field1 = value "taken from some table
    W_SEGDATA-field2 = value "taken from some table
    INT_EDIDD-SEGDATA = W_SEGDATA
    APPEND INT_EDIDD
    This will fill the data record corresponding to the segment ZSEGMENT . For all
    segments the sam steps will be repeated until all the data corresponding to all the
    segments in the idoc is filled in the internal table of type EDIDD.
    There is only one control record and can be multile data records in the idoc
    structure.
    Which data is to be extracted from the tables to be filled in EDIDD type internal table is determined in standalone programs from the objects which are specified in the selection screen and from the object key passed to the function module in case of message control and is taken from BDCP table in case of change pointers using function modules "CHANGE_POINTERS_READ"
    In case of stand alone programs and function modules based on change pointers method the function module "MASTER_IDOC_DISTRIBUTE" is used to send the IDOC to ALE layer for distribution ,in case of message control it is handled automatically by the RSNASTED program invoked by the message control.
    OUTBOUND PROCESS AND OUTBOUND PROGRAM.
    Outbound programs are used in outbound process to genearte IDOCs . There
    purpose is to extract the data from the tables and to fill the IDOC data records
    and the control record in the IDOC and pass ito the ALE layer for distribution to the recieving system .
    Depending upon the triggering mechanism (how and when the outbound program will be started different techniques and interface is used for outbound program.
    1)Message control
    Application like PO(purchase order) creation use this technique , where the output type is linked to the application(Message control is a configurable cross application component which can be set in IMG .Such programs are created in the form of function modules and linked to the output type which is linked to the apllication.These have predefined interfaces.
    In outbound programs(function module) that use message control the key of the
    application document is passed to the function module whcig will read the data from the table depending upon the key passed(NAST structure) and fill the IDOC segemnts with the application data.The control record is also passed to the function module but is not fully filled, the rmaining fields are filled and the control is passed back to the calling program which is RSNASTED and is invoked by the
    message control to process ALE and EDI output types and this program on recieving the IDOC data will create the physical IDOC in the system.
    The parameteers passed to the function module are
    IMPORTING PARAMETERS
    OBJECT LIKE NAST
    It contains documents key.
    CONTROL_RECORD_IN LIKE EDIDC
    It contains the partailly filled control record
    EXPORETING PARAMETER
    OBJECT_TYPE
    CONTROL_RECORD_OUT LIKE EDIDC
    TABLES
    INT_EDID LIKE EDIDD
    The internal table used to fill the data records in the same order as they exists in the IDOC.
    The important parameters that should be filled in the custom function module are
    CONTROL_RECORD_OUT and INT_EDIDD .The OBJK field of the structue NAST contains the key of the apllication document.
    2)Stand alone programs
    Generally used for Master Data transfer and as such depending upon the requirement can have different interfaces.The programs have a selection screen which has select options to select the objects, and parameters for specifying the recipient Logical System and the Message Type.
    Data is selected based on the specified objects from the tables . and control record of type EDIDC is created and filled with important values like DIRECTION ,IDOCTP,RCVPRT,RCVPRN and MESTYP .
    Data is filled in an internal table of TYPE EDIDD according to segment definitions
    and in same order and the function module MASTER_IDOC_DISTRIBUTE is called passing the control record and the internal table containg IDOC data and importing an internal table consisting of control records for each communication IDOCS created.
    3)Change pointer
    Change Pointer table is read and checked if changes were made to important fields , if so the outbound program will be triggered automatically , these have predefined interfaces
    ALE/IDOC Transaction
    SALE Area Menu for ALE configurations.It includes transactions for
    Logical System definition and linking it to a client, Transactions for
    RFC Destination and Port Definition Etc.
    SM59 RFC Destination
    Here we specify the login settings for the destination including
    the I.P address or Application Server name and the User name and
    password.The information entered here is used to run Remote Function
    Calls(RFC ) on the destination server .We can create number of types
    of RFC Destinations but 3 types are important .
    R/3 (R/3 to R/3), LS(logical system) and TCP/IP.
    The name of the RFC destination should be same as that of Logical
    System as it helps in creation of automatic partner profiles.
    WE21 Port Definition.
    There are 6 types of ports but only 2 types File and Transactional RFC
    types of ports are important.
    We have to specify the RFC Destination before a port can be created.
    WE57 This is used to assign the Inbound function module to the Message Type
    and to the IDOC Type.
    WE42 This is used to define the process Code for Inbound Processing.
    BD95 Define Filter object type .We can specify the field and the table it belongs
    to as a filter object .
    BD59 Assignment of Filter object type to the Message Type .Here we create the
    link between Filter object and the segment and the message type and the
    segment Field.
    BD50 Set message Type to reducible.
    BD65 Define Mandatory Fields.
    BD64 Distribution Model . Also known as Customer Distribution Model Used to
    define all the messages that will be exchanged between remote systems
    and the name of thes logical systems. Any filters can also be specified.
    The model once created has to be distributed on every system which will
    be communicating ,It can be maintained on only One system.
    BD21 Creating IDOcs from change pointers.
    This can be used to create IDOCs from change pointers for a particular
    message LIKE MATMAS.
    BD22 This can be used to delete change pointers.
    BD87 Status Monitor. Idocs can be selected base on number of criteria and there
    processing status can be seen in detail.
    BD10 Material Master Data Distribution .
    Based on Message MATMAS.
    BD12 Customer Master Data Distribution .
    Based on Message CREMAS.
    BD14 Vendor Master Data Distribution
    Based on Message DEBMAS .
    BDFG Generate ALE Interface for BAPI.
    Here we specify the Business Object and the BAPI Function module for
    which the interface has to be created.
    WE31 Segment Editor.
    This is used to create segments. We create the segment type and
    segment definition is automatically created by editor e.g. Z1DUMMY is
    segment type and Z2DUMMY is the segment definition .We specify the
    fields and the data elements these cp\orresponds to create segments.
    WE30 IDOC Editor
    It is used to create a new IDOC Type or IDOC Extension .We specify the
    segments that will be addd to the IDOC type.
    WE02/05 IDOC List.
    Various selct options and parameters are provided to select IDOCs
    depending on the date, direction , mesage type etc.
    WE20 Partner Profile
    Here we create partner profile for each and every partner from / to which
    the messages will be exchanged.There are 6 types of PF generally only
    profiles of type LS(Logical System) ,KU(Customer) ,LI(Vendor) is used.
    We specify the partner number and partner type and the agent and
    the agent type responsible for handling of errors .
    For every message send to the partner we have a outbound record and for
    evry message coming from the partner we have the inbound record .
    We specify the message in the otbound/inbound records ,double
    clicking will take us to the detailed screen where the IDOC Type ,Port
    and whether the IDCO will be immediatelt processed or collected are
    mentioned.

  • JAVA-Maping Doubts--Urgetn

    Hi Frnds,
    i am working on JAVA Mapping, recently i started but when i started working i have some issues...
    1)With out main method how to execute JAVA Mapping, i got one link  i am trying to implement the scenario,i am terying to comile java code but its not compiling , bcz no main method, how executeJAVA Mapping.
    2) Whats the use of Stream Transformation interface.
    3) whats the use of Mapping Trace,Abstarct Trace.
    Please solve my above doubts...
    Regards,
    Raja Sekhar
    please

    Hi,
    The runtime environment for Java mappings has an mapping API. To use Java mapping, you must define a Java class that implements the Java interface com.sap.aii.mapping.api.StreamTransformation. This interface has two methods:
    public void execute(java.io.InputStream in, java.io.OutputStream out)
    At runtime, the Integration Engine calls this method to execute a mapping. This method contains an input stream for the source document and an output stream for the target document as parameters. These streams are usually XML documents. You can import the substructures to be converted from the input stream and output the converted target document in the output stream.
    ●     public void setParameter(java.util.Map param)
    The Integration Engine transfers parameters to the mapping program with this method. It evaluates these parameters at runtime in the method execute(). This enables you to control the process flow of the mapping.
    The transferred object that implements the Java interface java.util.Map contains seven key/value pairs as parameters. These correspond to corresponding fields in the message header. Apart from the MAPPING_TRACE constant, the value objects are of type java.lang.String. The key objects are defined in the class com.sap.aii.mapping.api.StreamTransformationConstants
    for more info
    http://help.sap.com/saphelp_nw04/helpdata/en/a4/64b93d0d4e6b3be10000000a114084/frameset.htm

Maybe you are looking for

  • Not able to open pdf file ( smart form from webdynpro )

    Dear friends, while trying to download pdf file from webdynpro i am getting the following error ( pls check the screen shot and also my  code ) could any one please let me know what's the issue Thanks Vijaya data    v_bin_filesize           TYPE i,  

  • Nikon D7000 LR4 Camera Raw color issues

    I just upgraded my camera from a Nikon D70 to a D7000. Problem: When I process the RAW /NEF files with Adobe Lightroom 4 the color is terrible. By that I mean, the images look dull, dark and have no pop. The coloring is not even close to what is disp

  • Hp6500 imac not detecting

    I have an HP 6500 and an iMac.  The two machines have worked fine for several years.  But now the scan function is no longer working on the HP 6500--I get a message that "no scanner is detected"  Any help will be appreciated.

  • WIP Inventory at time of physical inventory

    Discrete Manufacturer in 11.5.9. Looking for alternatives for handling WIP at the time of annual physical inventory. Have approximately 1800 released jobs of which more than 75% are pure "push" type jobs and the standard wip valuation report will fit

  • Where are my tone curve regions

    Lightroom 3 - I seem to have lost my 'regions' in the tone curve module - How do I get them back?