Changing public instance attribute

Hi all,
i'm a newbie in programming OO. So i have a little Problem with my Coding.
i have to change a value vom a structure. It an public instance attribute from the superclass. So how can i change it?
coding it like this:
go_busobj_created-ms_detail-nr = '1020'.
shows an error that go_busobj_created ist an objectreferenz and does'n own a component "ms_detail-snunr" - But in debugging i can navigate with doubleclick into ms_detail and ich can change manually thy value.
The other way i tried is using the method from a superclass that my object (go_busobj_created) inherits during runtime. But i don't know how to call it.
call METHOD CL_SUPERCLASS=>('SET_NR')
or
call METHOD ('IF_SUPERCLASS~SET_NR')
I can call static or dynamic - everytime it dumps..
Thanks for your help.
Stefan

Hello Stefan
Based on my knowledge from RE-FX I assume that GO_BUSOBJ is a very generic object reference. Thus, in order to access the instance attribute MS_DETAIL you have to do a narrowing cast:
DATA:
  go_busobj       TYPE REF TO <generic class>,
  go_specific      TYPE REF TO <specific class which is a subclass of generic class>.
  go_specific ?= go_busobj.  " narrowing cast
  go_specific_created->ms_detail-nr = '1020'.
For example, the BDT function modules in RE-FX pass most (if not all) object references as TYPE REF TO cl_reca_storable. The actual object may be a contract (CL_RECN_CONTRACT), a building (CL_REBD_BUILDING) or some other RE object.
Regards
  Uwe

Similar Messages

  • How to access Instance Attribute in a Class Interface from FM ?

    Hi Experts
    I have the following function module code, that passes the syntax, however in the class interface ABC, I have an attribute IJK that is Instance Attribute (Public).  When I modify the code like ABC->IJK but it does not like it, the error is :-
    Field "ABC" is unknown. It is neither in one of the specified tables nor defined by a "DATA" statement. "DATA" statement.
    Question : How do I declare the Class Interface ABC in my Function Module  that will allow me to access the Instance Attribute ?
    Thanks in advance.
    FUNCTION XYZ.
    if not ABC=>EFG is initial.
        output = ABC=>EFG.
        shift output left deleting LEADING space.
      endif.
    ENDFUNCTION.

    Hello
    You question only makes sense if
    (1) the class / interface is part of the FM's interface (i.e. an IMPORTING - or perhaps CHANGING - parameter)
    (2) the class / interface is defined as global variable in the TOP include of the function group
    If either of these two options is applicable then the coding may look like this:
    " (1) IMPORTING parameter: e.g. IO_INSTANCE TYPE REF TO class / interface name
    IF ( io_instance IS BOUND ).
      io_instance->abc = 'New value'.
    ENDIF.
    " (2) Global variable of function group, e.g. GO_INSTANCE TYPE REF TO class / interface name:
    IF ( go_instance IS BOUND ).
      go_instance->abc = 'New value'.
    ENDIF.
    Obviously, the public attribute ABC must be changeable (i.e. not READ-ONLY).
    Regards
      Uwe

  • Change of Unicode attribute in a custom made class

    Hi,
    In relation to a Unicode conversion, I have a program that calls a Class ZHRxxx.
    After I have changed the attribute to Unicode check, I get a new error in the method Constructor:
    Class ZHRCLPA001,Method CONSTRUCTOR
    In the constructor method, you can only access instance attributes,instance methods, or "ME" after calling the constructor of the          
    superclass . . . . . .          
    The code is one line:
    method CONSTRUCTOR.
    Assign pernr to class attribute
    a_pernr = i_pernr.
    endmethod.
    Any ideas ?
    Thanks

    Hello Peter
    Alexander gave you already the answer. However, based on the naming of your z-class I assume that you are trying to read or access infotype tables. Are you aware of class <b>CL_PT_EMPLOYEE</b>? This class provides you with a simple acccess to any <b>infotypes</b> you need.
    [code&----
    *& Report  ZUS_SDN_CL_PT_EMPLOYEE
    REPORT  zus_sdn_cl_pt_employee.
    DATA:
      go_employee    TYPE REF TO cl_pt_employee.
    PARAMETERS:
      p_pernr        TYPE pernr_d,
      p_begda        TYPE begda,
      p_endda        TYPE endda.
    START-OF-SELECTION.
      go_employee ?= cl_pt_employee=>get_employee( p_pernr ).
      CALL METHOD go_employee->get_master_data
        EXPORTING
          im_begda = p_begda
          im_endda = p_endda
       IMPORTING
         EX_I0000 =  " infotype 0000
         EX_I0001 =  " infotype 0001
         EX_I0002 =  " infotype 0002
         EX_I0007 =
         EX_I0008 =
    Using this method you can access any infotype(s)
      CALL METHOD go_employee->if_pt_employee~get_infotypes
        EXPORTING
          i_itlist      =
         I_FROMDATE    =
         I_TODATE      =
         I_FILTER      =
         I_NOAUTHCHECK =
       IMPORTING
         E_RESULT      =
         E_RETCD       =
    END-OF-SELECTION.[/code]
    The class is final. However, if you need a class hierarchy simply define your z-classes having CL_PT_EMPLOYEE as instance attribute.
    Regards
      Uwe

  • Trouble changing a class attribute in a STATEFULL bsp app - PLEASE HELP!!!!

    hello, i have some trouble changing the value of a class attribute, in certain point of the execution of a statefull bsp app. The scenario is: the bsp app is on a url iview in a portal; i have some link in the portal, that do a window.open (pop up) of that app. the question is: how can i change the class attribute of the bsp app when i close that pop up?, if when i first click the link that show me the pop up, its doesn't create another instance of the class...i mean it continuing working with the same instance of the url iview in the portal. ANY help it will well received. Thanx in advance

    hello Durairaj...yes indeed in the other thread thats the issue with the portal_version attribute, the person who create the iview dont want to change it...so i try to solve it with something else....thats bring me to another problem (posted in this thread). Now i have a question...in the url iview it calls a template that start the bsp app...i mean is not the url iview who calls the bsp app is a middle template...with this scenario can i pass the parameter sap-sessioncmd=open to the url iview or i have to pass it to the bsp app directly when in the middle template i call it??? another question when i pass that parameter via url, it create another instances (apart) of the class or restart the same instance that the app work with until that moment....tell me more about that parameter coz' i am new in bsp and i need help....i will give a lots of rewards point who help me!!! i promise....i am kind of desperade for sure....  thanx in advance

  • Purchaser not able to change public templates

    When Purchaser is trying to change Public Templates in EB he gets an error "Error in System;Shopping cart cannot be processed further". When he press OK he is directed to EB home page.
    Kindly advice.
    Thanks and Regards
    Manoj Upadhyay

    Hi,
    If you want to get the exact error message, try to connect with the purchaser in SAPGUI, and launch the transaction.
    It can be either an authorization process,or  an attribute problem (the purchaser hasn't got the attribute values that correspond to the document data).
    Regards.
    Vadim

  • Error while changing the Display Attribute into Navigational Attribute

    Hi all.. Gud Mrng.
    I was changed the attribute (product) from display attribute into navigational attribute and while save and activating the info object it is not getting activated and it is throwing the below error message.
    Error Message: u201CThe Info object is being used in several data targetsu201D
    My Questions:
    i)     Do I need to delete the data from all the data targets (where this info object is using)??
    ii)     Do I need to delete data only from the main info object (Zmaterial)? Is this single action enough?
    Please suggest me which action I need to follow & What are the precautions need to take while changing the Display Attribute (product) into Navigational attribute of info object (Zmaterial).
    Thanks in advance.
    Thanks & Regards,
    B Venugopal

    Hi Garima
    Only in case of key figures we cannot change it from display to navigational.
    If the info object is a characteristics then in the General tab of the info object if you select 'attribute only' then the iobj would be a display attribute only. If you leave it unmarked then you can use the iobj as a navigational atribute.
    I am sure you know that these settings only mean if a IOBJ can be used as display or navigational.  To  use it as a navigational within another object you will have to change the settings from 'DIS' to 'NAV' for the said info object in the 'Attributes' tab of its parent info object.
    Further if you use the parent info object in any data target / infio provider you will have to further mark the info object as 'navigational' while defining the attrbute of the said data target / info provider. The info object gets displayed in the data target / info provider attribute properties as 'parent IOBJ_info object'
    Cheers
    Umesh

  • How to change set type attribute of a product

    Hi ;
    I created additional fields for products by using "COMM_ATTRSET". It created a table and functions but I dont know how to change this additional attributes.I cant use these attribute set functions because i dont know fragment_id yet. I think there must be a function encapsulates them.
    Is there any BAPI to change set type attributes?
    PS: In forums , I found an FM "COM_PRODUCT_MAINTAIN_MULT_API" but I think it hasnt been used anymore in CRM7.0
    Thanks

    Thanks for your reply ;
    but FM 'COM_PRODUCT_UI_MAINTAIN' doesnt have any generic import parameters to send my data to it in form of  newly created attribute set type table "ZPRODUCT".
    I want to set some fields of ZPRODUCT and i need to send them in this structure,  this table has column FRG_ID , if you set an additional  parameter for the first time , it generates new GUID..I think  'COM_PRODUCT_UI_MAINTAIN'  generates this GUID but i dont know how to use it.
    Can you give an example about using this FM?

  • How to change only one attribute at the host

    Hi experts,
    we use host configuration with special host types. If we want to change only one attribute of the host with the cli we must change all attributes associates with the host. If we define only one new attribute all other values are set (back) to the default of the host type..
    (in the gui all works fine...)
    Is there a chance to change a only one attribute and keep all other attribute values of the host ?
    Thanks,
    Chris

    No, it is not possible to do that.
    All attributes (passed via -attr) are treated as a single argument to the host modification (similar to a name or description). Essentially, when you provide a -attr argument to hdb.h.mod, the command will reset the existing overridden attributes and consider only the new attributes coming thorugh the -attr arg for overriding.
    You see it working from the UI properly because, the UI requests for overriding all atributes once again, even though you manually changed only one attribute.

  • Changing the ImageData attribute of a list viewnode..

    Hi,
    I am trying to change the Image Data attribute of a list view node after
    a user clicks on it. But it just doesnot get reflected in the listview.
    UpdateFieldFromData()/UpdateWindow() donot do the job either.
    I could ofcourse clone the node, change it's ImageData, remove the old
    node, insert the new one and then do a SetViewNodes(), but that is really
    not the solution!!
    Has anyone been in this situation before??
    Thanks in advance.
    Inderjyot Singh
    Indus Consultancy Services
    201-261-3100 x232
    [email protected]

    I discovered what was wrong with what I did.
    You have to an UpdateFieldFromData() on the DisplayNode object of the
    listview to get refreshed. Doing an UpdateWindow/UpdatefieldFromData on
    the ListView widget doesnot work!!
    Thanks.
    Inderjyot Singh
    Indus Consultancy Services
    201-261-3100 x232
    [email protected]
    -----Original Message-----
    From: Lee Wei [SMTP:[email protected]]
    Sent: Friday, February 13, 1998 9:29 AM
    To: Singh, Inder Jyot
    Subject: Re: Changing the ImageData attribute of a list view node..
    I tried the situation you described and saw the same problem.
    You should probably let Tech Support know and file a bug.
    Lee Wei
    At 09:25 AM 2/13/98 PST, you wrote:
    >
    Hi,
    I am trying to change the Image Data attribute of a list view node after
    a user clicks on it. But it just doesnot get reflected in the listview.
    UpdateFieldFromData()/UpdateWindow() donot do the job either.
    I could ofcourse clone the node, change it's ImageData, remove the old
    node, insert the new one and then do a SetViewNodes(), but that is really
    not the solution!!
    Has anyone been in this situation before??
    Thanks in advance.
    Inderjyot Singh
    Indus Consultancy Services
    201-261-3100 x232
    [email protected]

  • PRIF-33 and CRS-02307 while changing public network interface, RAC

    Hi,
    I'm working on an Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production With the Partitioning, Real Application Clusters, Automatic Storage Management. It's a 3 nodes RAC: mgvdb01/02/03
    After the installation I had to change IP (different IP and Subnet) to the RAC:
    From 172.17.1.0/24 to 10.19.201.0/24.
    Node from 172.17.1.31/32/33 to 10.19.201.31/32/33.
    The same for VIP(s): from 172.17.1.131/132/133 to 10.19.201.131/132/133.
    The oifcfg iflist shows correct ips configuration:
    [oracle@mgvdb01 bin]$ ./oifcfg iflist -p -n
    eth0  10.19.201.0  PRIVATE  255.255.255.0
    eth1  172.17.100.0  PRIVATE  255.255.255.0
    I'm following doc 276434.1 from Metalink: How to Modify Public Network Information including VIP in Oracle Clusterware, starting from Case III "Changing public network interface, subnet or netmask".
    But at the first operation I've a problem:
    [oracle@mgvdb01 bin]$ ./oifcfg getif
    eth0  172.17.1.0  global  public  **THIS HAS TO BE CHANGED**
    eth1  172.17.100.0  global  cluster_interconnect
    [oracle@mgvdb01 bin]# ./oifcfg delif -global eth0/172.17.1.0
    PRIF-33: Failed to set or delete interface because hosts could not be discovered
      CRS-02307: No GPnP services on requested remote hosts.
    PRIF-32: Error in checking for profile availability for host mgvdb02
      CRS-02306: GPnP service on host "mgvdb02" not found.
    PRIF-32: Error in checking for profile availability for host mgvdb03
      CRS-02306: GPnP service on host "mgvdb03" not found.
    [oracle@mgvdb01 bin]$ ./oifcfg delif -node mgvdb01 eth0/172.17.1.0
    [oracle@mgvdb01 bin]$ ./oifcfg setif -node mgvdb01 eth0/10.19.201.0:public
    PRIF-33: Failed to set or delete interface because hosts could not be discovered
      CRS-02307: No GPnP services on requested remote hosts.
    PRIF-32: Error in checking for profile availability for host mgvdb02
      CRS-02306: GPnP service on host "mgvdb02" not found.
    PRIF-32: Error in checking for profile availability for host mgvdb03
      CRS-02306: GPnP service on host "mgvdb03" not found.Then I restart Clusterware service, but issuing
    [oracle@mgvdb01 bin]$ ./oifcfg getif
    eth0  172.17.1.0  global  public
    eth1  172.17.100.0  global  cluster_interconnectnothing seems to be changed.
    This is blocking following operations, the ones in Case IV.
    Do you have any suggestion?
    Thanks in advance,
    Samuel

    Hi,
    I'm working on an Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production With the Partitioning, Real Application Clusters, Automatic Storage Management. It's a 3 nodes RAC: mgvdb01/02/03
    After the installation I had to change IP (different IP and Subnet) to the RAC:
    From 172.17.1.0/24 to 10.19.201.0/24.
    Node from 172.17.1.31/32/33 to 10.19.201.31/32/33.
    The same for VIP(s): from 172.17.1.131/132/133 to 10.19.201.131/132/133.
    The oifcfg iflist shows correct ips configuration:
    [oracle@mgvdb01 bin]$ ./oifcfg iflist -p -n
    eth0  10.19.201.0  PRIVATE  255.255.255.0
    eth1  172.17.100.0  PRIVATE  255.255.255.0
    I'm following doc 276434.1 from Metalink: How to Modify Public Network Information including VIP in Oracle Clusterware, starting from Case III "Changing public network interface, subnet or netmask".
    But at the first operation I've a problem:
    [oracle@mgvdb01 bin]$ ./oifcfg getif
    eth0  172.17.1.0  global  public  **THIS HAS TO BE CHANGED**
    eth1  172.17.100.0  global  cluster_interconnect
    [oracle@mgvdb01 bin]# ./oifcfg delif -global eth0/172.17.1.0
    PRIF-33: Failed to set or delete interface because hosts could not be discovered
      CRS-02307: No GPnP services on requested remote hosts.
    PRIF-32: Error in checking for profile availability for host mgvdb02
      CRS-02306: GPnP service on host "mgvdb02" not found.
    PRIF-32: Error in checking for profile availability for host mgvdb03
      CRS-02306: GPnP service on host "mgvdb03" not found.
    [oracle@mgvdb01 bin]$ ./oifcfg delif -node mgvdb01 eth0/172.17.1.0
    [oracle@mgvdb01 bin]$ ./oifcfg setif -node mgvdb01 eth0/10.19.201.0:public
    PRIF-33: Failed to set or delete interface because hosts could not be discovered
      CRS-02307: No GPnP services on requested remote hosts.
    PRIF-32: Error in checking for profile availability for host mgvdb02
      CRS-02306: GPnP service on host "mgvdb02" not found.
    PRIF-32: Error in checking for profile availability for host mgvdb03
      CRS-02306: GPnP service on host "mgvdb03" not found.Then I restart Clusterware service, but issuing
    [oracle@mgvdb01 bin]$ ./oifcfg getif
    eth0  172.17.1.0  global  public
    eth1  172.17.100.0  global  cluster_interconnectnothing seems to be changed.
    This is blocking following operations, the ones in Case IV.
    Do you have any suggestion?
    Thanks in advance,
    Samuel

  • Changing the naming attributes of o to ou

    Hi ,
    I need to change the naming attribute of 'o' to 'ou' so that whenever i create an organisation it will be referred to ou instead of o .Is there a way to do it?

    I don't know how to do that, but it sounds awfully dangerous to be making a fundamental change like that. Why not just use the OrganizationalUnit objectclass instead? I took a quick look at the schema and they use the same attributes, except for "o" and "ou".
    Just my $.02,
    Roger S.

  • How to pass a value to the export parameter for a method (public instance)?

    Hello,
      I am trying ABAP OO newly. How to pass a value to the export parameter for a method (public instance) called in a report? This *export parameter has a reference type of structure.
    Thanks in advance,
    Ranjini

    Hi,
    "class definition
    class lcl... definition.
      public section.
        method m1 imporitng par type ref to data.  "now you can pass any reference to the method, but this way you have to maintain this reference dynamically inside the method (you can't be sure what that reference is really "pointing" at)
    endclass.
    "in program
    data: r_lcl type ref to lcl...
    create object r_lcl.
    call method r_lcl
      exporting
         par    =  "pass any reference variable here
    Regards
    Marcin

  • [svn] 1445: compiler: Changing all instances of "ff" to "ild" in SignatureEvaluator.

    Revision: 1445
    Author: [email protected]
    Date: 2008-04-28 15:54:31 -0700 (Mon, 28 Apr 2008)
    Log Message:
    compiler: Changing all instances of "ff" to "ild" in SignatureEvaluator.
    * Okay, okay, StringBuffer to StringBuilder.
    Reviewer: Bruce
    Bugs: n/a
    QA: No
    Doc: No
    Modified Paths:
    flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/as3/SignatureEvaluator.java

    Good reason to use a real editor.
    You're right, that does sound odd.  Was the file created in Geany, or just opened that way?
    ... wait, here's what's going on.  Geany opened a file with Unix line endings.  It displayed correctly because Geany isn't stupid like Notepad, but Geany didn't convert the line endings when you closed the file because you didn't tell it to.  But Vim modelines take effect as if you had typed them in after opening the file.  So Vim detected that the file had Unix line endings, and opened it with fileformat=unix.  Then the modeline set fileformat=dos.  When you hit :w, Vim saved it with DOS line endings.
    The moral of the story?  Don't use modelines, and if you do, don't use them to set the file format.  (Vim detects that automatically.)

  • Changing LDAP "Search Attribute"

    Hello:
    I am authenticating against LDAP as such:
    Hashtable authEnv = new Hashtable();
    String dn =
    "CN=" + userAuth.getFirstName() + " " + userAuth.getLastName() +
    ",OU=zzzzzzzz,DC=yyyyy,DC=xxx";
    authEnv.put(Context.INITIAL_CONTEXT_FACTORY,
    "com.sun.jndi.ldap.LdapCtxFactory");
    authEnv.put(Context.PROVIDER_URL, "ldap://999.999.199.999:389");
    authEnv.put(Context.SECURITY_AUTHENTICATION, "simple");
    authEnv.put(Context.SECURITY_PRINCIPAL, dn);
    authEnv.put(Context.SECURITY_CREDENTIALS, password);
    I am using the user's first and last name to authenticate. Now, I want to use their login id to authenticate. I was told "to change the Search Attribute from 'uid' to 'sAMAccountName'". I don't know what this refers to. Does anybody have any ideas?
    Thanks
    Eric

    A call to Apple support helped solve this problem, especially to deal with a typo in the Apple Snow Leopard Server documentation:
    1. Export all of your users, groups, etc. to files. Passwords will be reset but everything else will work.
    2. In OD, change the server to be "stand alone" (basically turning off OD).
    3. From the command line run the following command, noting that you literally put the string "HostName" in the position specified, not the old host name specified in the documentation:
    sudo scutil --set HostName <fully qualified domain name>
    4. Reboot
    5. Restart Server Admin and recreate the OD master using the fully qualified name.
    6. Go to KeyChain and look for the entries for system -> com.apple.opendirectory. One should point to your server and one should be blank. Delete the bank entry.
    Done!

  • Got "HTTP - 404" error when apply change of report attributes

    Environment:
    Oracle 10g (not XE)
    APEX 3.1.2.00.02
    Oracle HTTP Server
    I tried to modify a page in "101 - Sample Application", changed the report attributes (changed the heading type from Column Names to Customer), and when I applied the change, I got a "HTTP - 404 Page not found" error.
    In error log file of Apach, the error message is "mod_plsql: /pls/apex/wwv_flow.accept HTTP-404 ORA-25402......"
    Anyone can help me? Thanks.

    Please tell us your first name and update your profile with it to help us. Thanks.
    changed the report attributes (changed the heading type from Column Names to Customer)I don't follow that.
    Can you install this application into your workspace on apex.oracle.com (request one if necessary) and reproduce this problem there?
    Scott

Maybe you are looking for

  • Can The iPod music files by imported back to iTunes To replace missing music files?

    My iTunes library is missing many of the files that I have saved. Is there a way to import the files from my iPod back into iTunes to replace the missing original files?

  • Display in Scripts

    Hi all, I have a requirement in script where the output should be displayed as follows : ProdOrder     Material     Serialno     Compnonet     compsrno                     60003345     SFP_01     1502     SFP_R1          1 60003345     SFP_01     150

  • Fm for export to DMS

    Hello, What is the function module for exporting data into a doc file saved to DSM ? Thanks

  • Can the Primary Key also be Primary key in another table

    Hi all, I am working on a project. The project specification says: Project table contains details of projects and the project number *(proj_no)* is the key. project ( proj_no , proj_date, proj_desc, proj_type, proj_status, s_no, cust_no) purchase_ord

  • Adobe AIR and Adobe´s About Flash -site?

    I encountered a strange thing while checking if I have the latest version of Adobe Flash installed. When I go to About Flash page (http://www.adobe.com/software/flash/about/) I instantly get the following notification on separate window: "Adobe AIR S