Why we need casting in OO Concept

Hi Gurus,
  I am new to OO ABAP. Recently I learnt about casting concept in OO-ABAP. I was curious to know what is the use of casting, what is the need to use or know casting in OO concept.
  I searched for this topic in SDN but didn't got use full answers.
Thanks you
Sreeni

Hi,
OO is a reusable code concept.
Look for IF_PURCHASE_ORDER_MM interface and cl_po_header_handle_mm  class.
The class was designed with this interface (and others too).
Then, the class has the interface (methods and attributes).
When you code:
  o_purchase_order ?= im_header.
*(o_purchase_order type class and im_header type interface)
You will initialize the object o_purchase_order, passing all the attributes and values from interface object im_header.
Note that o_purchase_order has other interfaces, and to initialize theirs values you will need to do the same with their respective interfaces.
Using casting command you will reduce effort, creating clean and quality code.

Similar Messages

  • Why we need a BDoc

    Hi,
    Can anyone tell me why we need a BDoc in CRM. As we already have an IDoc concept which is similar to BDoc. Why can't we use the same the IDoc to exchange data with CRM.

    Hi kumar,
    Bdoc concept is the technology used in CRM Middleware where as Idocs used in ALE and EDI. Middleware is used for data exchange with in CRM system and between CRM and any other sap or non-sap system.
    Please also look into the following sap help link which gives the differences between BDoc and IDoc messages
    http://help.sap.com/saphelp_crm50/helpdata/en/c7/95fc381478ab6fe10000000a11402f/frameset.htm
    <b>Reward points if it helps</b>
    Murali

  • Why we need clusters

    Hello
    Just curious to know why we need to cluster servers and why can't we just have say 3 or 4 managed servers as part of weblogic domain and deploy application onto them and configure a load balancer to look at the managed servers individually than the cluster..I know general concept of clusters ,advantages of using it etc..but just wanted to know if there are any specific disadvantages if we don't cluster servers
    thanks

    Hi,
    Scenario: Suppose you have 2 ManagedServers MS1 and MS2
    Now Suppose you have One Application (AppOne.war) deployed on both ManagedServers MS1 & MS2
    Now see what the Load balancer can do in above scenario...
    *1).* If from Client-A a Request comes then the Load Balancer will either redirect the request to MS1 or MS2....Suppose this time it is MS1. Now MS1 started Serving the request.
    *2).* It means the Http Session of Client-A is available inside the MS1 Server JVM. As the Session is created on MS1 ...now the client-A can access any page available in the Application.which requires a Valid Http Session Object.
    *3).* Now Suppose Suddenly MS1 Goes Down/Crashes... Now if the Client-A will refresh his browser ...Means Client-A is sending a Fresh request...But this time as the MS1 already went down .... So the LoadBalancer will forward the request to MS2....
    BUT now the Problem is MS2 doesn't have Client-A HttpSession Data...so the Client will be Moved to the Login Page rather then the Page he actually requested for.
    Now this is the Point where we need the  Clustering....Suppose MS1 & MS2 would have been part of a Cluster in above scenario then ...his Session Data might have been replicated to Both the Managed Servers ...(As Primary HttpSession and Secondary HttpSession)...so even if any one of the ManagedServer Crashes still client will be able to access the application in the same Manner without any Interruption...Or Even Without even knowing that something Wrong happened with the Server.
    Thanks
    Jay SenSharma

  • We have XML,why we need SOAP?

    Hi all,
    Every Technolgies accept the XML then why we need SOAP.

    You refered different concepts by using Xml and SOAP.
    SOAP is a type of internet protocol. By using this, you can use Xml Web Services in a secure way. Besides, this protocol provides you to send your action and take your response which is covered by Xml through the HTML protocol.

  • HT4910 i save my photos to camera roll. then back up but can't see it on icloud. why? we just lost 300 photos on my other iphone because we do not get proper help. that's why i need to learn now.

    i save my photos to camera roll. then back up but can't see it on icloud. why? we just lost 300 photos on my other iphone because we do not get proper help. that's why i need to learn now.

    You can't view your back up files at icloud.com.
    You can't view your camera roll and you can't view your Photo Stream files at icloud.com.
    The icloud back up plan allows you to "restore" your iOS device from the files you backed up at icloud.com.

  • I am not able to register my Apple ID for iCloud and the error is "the maximum no of free accounts have been activated on this phone" can any one help me why I need to do

    I am not able to register my Apple ID for iCloud and the error is "the maximum no of free accounts have been activated on this phone" can any one help me why I need to do

    Sir, your Apple ID can be used as an iCloud account as well. They are both the same thing.
    You can learn more from --> Set up your Apple ID for iCloud and iTunes - Apple Support

  • Can you give me some reasons about why I need to buy an iPod touch 5.Although I have the iPhone ,iPod nano, iPad ,MacBook pro,I think the iPod touch 5 is so attractive that I can't help buying it at once.If I have it,what I can do with it,can you tell me?

    can you give me some reasons about why I need to buy an iPod touch 5.Although I have the iPhone ,iPod nano, iPad ,MacBook pro,I think the iPod touch 5 is so attractive that I can't help buying it at once.If I have it,what I can do with it,can you tell me?

    All I can say is that I REALLY like my Touch 4th gen because I have all sorts of capabilities in a small form: e-mail, web browsing, news, weather, books, magazines, etc. etc.  Plus lots and lots of apps out there, including so many free ones.  I use the Cloud a lot so it's great to have everything sync'd to my MacBookPro (e-mail, Evernote, Pocket, etc.)
    It would be easier, though, to do some of this, especially magazines, on the iPad mini, but, again, I love the small size of the Touch. 
    As for the 5th gen instead of the 4th, the fifth has Siri and the 3D feature in maps, which are great.  And I'm sure it's a lot faster in iOS 6 than the 4th gen.  And cool colors! 
    Don't know if this helps . . .

  • IF Auto Update Statistics ENABLED in Database Design, Why we need to Update Statistics as a maintenance plan

    Hi Experts,
    IF Auto Update Statistics ENABLED in Database Design, Why we need to Update Statistics as a maintenance plan for Daily/weekly??
    Vinai Kumar Gandla

    Hi Vikki,
    Many systems rely solely on SQL Server to update statistics automatically(AUTO UPDATE STATISTICS enabled), however, based on my research, large tables, tables with uneven data distributions, tables with ever-increasing keys and tables that have significant
    changes in distribution often require manual statistics updates as the following explanation.
    1.If a table is very big, then waiting for 20% of rows to change before SQL Server automatically updates the statistics could mean that millions of rows are modified, added or removed before it happens. Depending on the workload patterns and the data,
    this could mean the optimizer is choosing a substandard execution plans long before SQL Server reaches the threshold where it invalidates statistics for a table and starts to update them automatically. In such cases, you might consider updating statistics
    manually for those tables on a defined schedule (while leaving AUTO UPDATE STATISTICS enabled so that SQL Server continues to maintain statistics for other tables).
    2.In cases where you know data distribution in a column is "skewed", it may be necessary to update statistics manually with a full sample, or create a set of filtered statistics in order to generate query plans of good quality. Remember,
    however, that sampling with FULLSCAN can be costly for larger tables, and must be done so as not to affect production performance.
    3.It is quite common to see an ascending key, such as an IDENTITY or date/time data types, used as the leading column in an index. In such cases, the statistic for the key rarely matches the actual data, unless we update the Statistic manually after
    every insert.
    So in the case above, we could perform manual statistics updates by
    creating a maintenance plan that will run the UPDATE STATISTICS command, and update statistics on a regular schedule. For more information about the process, please refer to the article:
    https://www.simple-talk.com/sql/performance/managing-sql-server-statistics/
    Regards,
    Michelle Li

  • Why we need ABAP if we can connect With Crystal Reports to SAP R/3

    Hi,
        I am new to Crystal reports.I came to know that we can connect SAP R/3 by using SAP InfoSet,SAP Table Cluster and Function connectivity in Crystal Reports.So we can generate reports for SAP R/3 database with out need of ABAP.So why we need to go ABAP module.Is there any disadvantages if we dont use ABAP to generate reports or we can use always Crystal Reports to generate Reports for R/3 database?

    Hi,
    it is correct that you can built a Crystal Report without the need to use ABAP, but we have lots of customers that have invested over the years into ABAP Routines and Crystal REports is able to leverage those as well. So with Crystal Reports you have the choice to leverage existing ABAP Functions as a source for reporting - which might help to leverage complex processing on the backend - or to use InfoSets and tables.
    regards
    Ingo

  • Why I need a code for rent a film and where ist the code? (I dont have a card)

    Why I need a code for rent a film and where ist the code? (I dont have a card)

    it's unclear what you mean
    you say you dont have a card which I guess is you don't have a creditcard
    in which case the other option is to pay by a giftcard which include a code which you put in
    because to rent you have to pay otherwise it's not really renting

  • I need  information  about  oops  concept  programming  in abap

    Hi  ,
    I need  information  about  oops  concept  programming  in abap
    Thanks,
    Asha

    Of course, the best place to start is help.sap.com.
    http://help.sap.com/saphelp_nw2004s/helpdata/en/ce/b518b6513611d194a50000e8353423/frameset.htm
    There are a couple good books out there as well.  You can get them at www.amazon.com
    Regards,
    Rich Heilman

  • Why we need Java Class in c++ pof Serialization

    Hi,
    I'm really confused why we need java class which implements PortableObject to support complex objects of c++. If we are not using any queries or entry processors in the application can't we keep the object as serialized byte format and can't we retrieve in from the c++ deserialization.
    Please share your thoughts if there's a way if we can skip any Java implementation.
    regards,
    Sura

    feel both are doing same work. Also can anyone tell me what is teh difference between Serilization and Exgternalization.If you need someone to tell you the difference, (a) how can you possibly 'feel both are doing the same work'? and (b) why don't you look it up in the Javadoc?
    It's not a secret.

  • Why we need Acrobat 9.2 Professional?

    Hi,
        Thanks for replying my previous post....
        there is one question on my mind...why we need Acrobat 9.2 Professional?
        I mean in the whole process of word to pdf generation what is the function of
        Acrobat 9.2 Professional?
       Thanks nd regards,
       Barun barik

    Acrobat includes a plugin to Office that performs the actual conversion.   Generator automates the calling of that plugin

  • Why we need crm middleware for material replication?

    Hi Experts,
    Why we need CRM middleware for material replication from ECC to SRM when we can do the vendor replication from ECC to SRM with ABAP report? IS there any technical limitation?
    Thanks and regards,
    Ranjan

    Hello,
    Vendors and locations, for example, you can replicate from ECC to SRM using ABAP reports.
    However, if you want to replicate the following information, you should use the middleware:
    - DNL-CUST-BASIS3 - Basis CRM online
    - DNL-CUST-PROD0 - Material number conversions
    - DNL-CUST-PROD1 - Product : categories
    - DNL_CUST_SRVMAS - Customizing: Service Master
    - MATERIAL - R/3 Material Master
    - SERVICE_MASTER - R/3 Service Master
    Check note 872533. It provides more information.
    Regards,
    Ricardo

  • Why we need doGet() or doPost() instead of service()

    Though we have service() method in http servlet why we need to override the doGet() or doPost() of Httpservlets
    2services methods are availbale in HttpServlets
    1.protected void service( Httpservelt request hreq, HttpServletResponse hresp);
    2. Public void service( servletRequest req, servletResponse resp)
    Read this and tell how it is(it was collected from documentation of Jguru site)
    NOTE: the doGet() and doPost() methods (as well as other HttpServlet methods) are called by the service() method.

    The service() method from the Servlet interface is overloaded in HttpServlet to accept HttpServletRequest and HttpServletResponse. If you read the API documentation, you will note that it says the overloaded service() method will dispatch to doGet, doPost, doPut, etc. based on the type of request.
    This approach makes sense, because it is bad design to put all your code in one method, or one class for that matter. Usually the doGet/doPost/do<Whatever> methods are themselves dispatcher methods that call the proper classes/methods based on the logical contents of the request.
    This is in fact a common pattern in servlet frameworks like Struts and Spring. Said frameworks use a generic DispatcherServlet that redirects requests to the appropriate classes/beans as declared in the configuration files.

Maybe you are looking for

  • I want to download a trial of in design, but it states i do not have the right system requirements? I am running windows xp, is this to old?

    I have been trying to download in design and it keeps thinking, thinking, thinking and then does nothing.. So then i tried to go online and download a trial version from there and then it states i don't have the right system requirements, i am runnin

  • SBH80 headphones completely dead!

    Hi I got headphones yesterday and switched on and paired with iPhone 4S no problem. Then tried to use them but the headphones appeared to have switched off. Realised I might need to charge so did overnight but still nothing no light, no vibration, no

  • Markers in CC

    Lots of nice features in CC. The new M+M feature works fine to open the marker comments in the timeline but it doesn't work in the source panel. You get double markers. Am I missing something. Setting?

  • Won't update to 4.2.8, I get error 3194

    Won't update to 4.2.8, I get error 3194. I tried restarting my computer, and disabling my firewall but nothing is working. I dont have any security software or anything either, nor am I using a proxy to connect to the internet.

  • Tell me if I'm crazy

    OK. I'm into doing consumer video with iMovie 08. I may go to iMovie 6 or FCE for some more advanced post, but right now I'm still in iMovie 08. I capture interviews and church events. Family footage, things like that. Usually low-light stuff. Occasi