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

Similar Messages

  • How to access private attribute of a class from its Friend Class

    Hi Experts ,
    I am coding in Method (DO_SAVE) of class /BOBF/CL_TRA_TRANSACTION_MGR.
    I need to access private variable ( MO_BOPF) of class /BOBF/CL_TRA_SERVICE_MGR ( Friend of /BOBF/CL_TRA_TRANSACTION_MGR ).
    Please help me to understand how can i access private attribute of one class from its friend class.
    Regards- Abhishek

    Hi Reny,
    You should be able to access by creating object of friend class.
    Sample:
    data lo_frnd     TYPE REF TO  /BOBF/CL_TRA_SERVICE_MGR.
    data lo_compl  type REF TO /BOBF/IF_TRA_TRANS_MGR_COMPL.
       create OBJECT lo_frnd
         exporting
                   iv_bo_key = '111'
                   IO_COMPL_TRANSACTION_MANAGER = lo_compl.
    "access the private object of friend class
       clear lo_frnd->MO_BOPF.
    Note: need to provide iv_bo_key & IO_COMPL_TRANSACTION_MANAGER while creating object.
    Hope this helps you.
    Regards,
    Rama

  • How to access variables declared in java class file from jsp

    i have a java package which reads values from property file. i have imported the package.classname in jsp file and also i have created an object for the class file like
    classname object=new classname();
    now iam able to access only the methods defined in the class but not the variables. i have defined connection properties in class file.
    in jsp i need to use
    statement=con.createstatement(); but it shows variable not declared.
    con is declared in java class file.
    how to access the variables?
    thanks

    here is the code
    * testbean.java
    * Created on October 31, 2006, 12:14 PM
    package property;
    import java.beans.*;
    import java.io.Serializable;
    public class testbean extends Object implements Serializable {
    public String sampleProperty="test2";
        public String getSampleProperty() {
            return sampleProperty;
    }jsp file
    <%@ page contentType="text/html;charset=windows-1252"%>
    <%@ page import="java.sql.*,java.util.*"%>
    <html>
    <head>
    <title>Schedule Details</title>
    </head>
    <jsp:useBean id="ConProp" class="property.testbean"/>
    <body>
    Messge is : <jsp:getProperty name="msg" property="sampleProperty"/>
    <%
      out.println(ConProp.sampleProperty);
    %>
    </body>
    </html>out.println(ConProp.sampleProperty) prints null value.
    is this the right procedure to access bean variables
    thanks

  • How to access an attribute(this is referencing to another class) in a class

    Dear Gurus,
    I have to read an attribute of a class and that attributes type another class.
    I have intantiated the class and my question is how to read the attribute. I know I can not dirrectly read the attribute since this is another class. I think I have to first reference the attribute right? Please advise me.
    My code looks like below:
    data: lo_fpm                                 type ref to if_fpm.
    data: lo_msg_mgr                        type ref to if_fpm_message_manager.
    data: lo_component_manager    type ref to cl_fpm_component_manager.
    lo_fpm = cl_fpm_factory=>get_instance( ).    " cl_fpm_factory is a class which has a static method get_instance
    lo_msg_mgr = lo_fpm->mo_message_manager.
    lo_component_manager = lo_fpm->mo_component_manager.
    The above statement is giving syntax error. I do not know why.
    The basic difference b/n the two methods is if_fpm~mo_message_manager    type ref to if_fpm_message_manager    and
    mo_component_manager     type ref to cl_fpm_component_manager.
    Any help would be appreciated.
    Thanks,
    GSM

    Hello
    I cannot test the following coding because I do not get the singleton instance yet it should work:
    *& Report  ZUS_SDN_CL_FPM_FACTORY
    *& Thread: How to access an attribute(this is referencing to another class) in a class
    *& <a class="jive_macro jive_macro_thread" href="" __jive_macro_name="thread" modifiedtitle="true" __default_attr="1398429"></a>
    REPORT  zus_sdn_cl_fpm_factory.
    DATA: go_fpm TYPE REF TO cl_fpm.  " class implements if_fpm.
    DATA: go_msg_mgr TYPE REF TO if_fpm_message_manager.
    DATA: go_component_manager TYPE REF TO cl_fpm_component_manager.
    START-OF-SELECTION.
      BREAK-POINT.
      go_fpm ?= cl_fpm_factory=>get_instance( ). " cl_fpm_factory is a class which has a static method get_instance
      CHECK ( go_fpm IS BOUND ).
      go_msg_mgr           = go_fpm->mo_message_manager.
      go_component_manager = go_fpm->mo_component_manager.
    END-OF-SELECTION.
    Regards
      Uwe

  • Accessing private attribute of a class from its Friend Class

    Hi Experts ,
    Please help me to understand how can i access private attribute of one class from its friend class.
    I am coding in Method (DO_SAVE) of class /BOBF/CL_TRA_TRANSACTION_MGR.
    I need to access private variable ( MO_BOPF) of class /BOBF/CL_TRA_SERVICE_MGR ( Friend of /BOBF/CL_TRA_TRANSACTION_MGR ).
    Regards,
    Reny Richard

    Hi Reny,
    You should be able to access by creating object of friend class.
    Sample:
    data lo_frnd     TYPE REF TO  /BOBF/CL_TRA_SERVICE_MGR.
    data lo_compl  type REF TO /BOBF/IF_TRA_TRANS_MGR_COMPL.
       create OBJECT lo_frnd
         exporting
                   iv_bo_key = '111'
                   IO_COMPL_TRANSACTION_MANAGER = lo_compl.
    "access the private object of friend class
       clear lo_frnd->MO_BOPF.
    Note: need to provide iv_bo_key & IO_COMPL_TRANSACTION_MANAGER while creating object.
    Hope this helps you.
    Regards,
    Rama

  • How to access the attributes from a method

    Hi,
    Thanks to all who replied to my previous thread. Please let me know how to access the attributes in method of component controller in the view.
    Let Component_method be my method in component controller which contrains few attributes like this
    method component_method.
    data : node1 type ref to if_wd_context_node,
            itab type standard type of mara.
    endmethod.
    I want to access the above attributes in method of view.
    method view1.
    wd_comp_controller->method_component( ).
    ????? how to access the data of the method_component?
    endmethod.
    Kindly help me out in the syntax.
    Rgrds
    Mahathi

    Hi mahathi
    You should define the parameters in the header, not in the body of the method:
    You can define it as importing, exporting, changing or returning, as you need. For example, in SE80
    Parameter             Cl.declar.          RefTo        Opt        Type ref
    node1                    importing            X                          if_wd_context_node
    itab                       exporting                                        mara
    method_component().
    " code here...
    endmethod.
    and when you have to call the method,
    wd_comp_controller->method_component(
                    EXPORTING     node1 = nodelocal   " not importing!!!
                    IMPORTING      itab   = itablocal      " not exporting!!!
    i think that it's this what you want, don't i?

  • How to access Selection Attribute Filter Key on a TG through CRMD_MKTTG* ??

    Hello,
    We need to apply all the attributes filters on a TG (for instance city filter) for searching an address  that comply with the filters.
    To create a segment at CRMD_MKTSEG transaction for using it later in a campaign, it could be done by 3 ways:
    1. Create a simple profile
    2. Create a target group: create a profile and build the targe group
    3. Create a profile set: create a profile and build for profile set
    When creating first the profile, it is possible to apply attributes filters. This atributes filters are stored in BD tables of marketing. We are able to find the filters for the first and third case, but not for second case.
    I proceed to explain the first and third case:
    CRMD_MKTTG_TG_H: CRM Marketing: Target Group Header Data
         GUID: CRM Marketing: GUID of Target Group (this data I know beforehand)
         SET_H_GUID: CRM Marketing: GUID Profile Set
         SET_GUID: CRM Marketing: GUID Profile Set
         PROF_GUID: CRM Marketing: GUID of a Profile
    For the first case directly we do a select on CRMD_MKTTG_PF_S where  PF_GUID = CRMD_MKTTG_TG_H-PROF_GUID:
    CRMD_MKTTG_PF_S: CRM Marketing: Selection Criterion of a Profile
         GUID:CRM Marketing: GUID for a Target Group Selection Criterion
         PF_GUID: CRM Marketing: GUID of a Profile
    For the third case we do select on CRMD_MKTTG_PF_H where SET_GUID = CRMD_MKTTG_TG_H-SET_H_GUID and we retive GUID:
    CRMD_MKTTG_PF_H: CRM Marketing: Profile
    GUID: CRM Marketing: GUID of a Profile
    SET_GUID     :CRM Marketing: GUID Profile Set
    Then  we do select select on CRMD_MKTTG_PF_S where  PF_GUID = CRMD_MKTTG_PF_H-GUID.
    And we can obtain the filters through:
    .INCLUDE     CRMT_MKTTG_PF_S_RANGE:CRM Marketing: Selection Range
    SEL_SIGN: CRM Marketing: Component SIGN for Selection Criterion
    SEL_OPTION: CRM Marketing: Component "OPTION" for Selection Criterion
    SEL_LOW     : CRM Marketing: Component "LOW" for Selection Criterion
    SEL_HIGH     :CRM Marketing: Component "HIGH" for Selection Criterion
    But what about the second case that correspond to CRMD_MKTTG_TG_H-SET_GUID?
    Could somebody explain how to access the filters when the second case happen? ¿What relationship MKT tables is based on?
    I would appreciate any suggestion.
    Best regards,
    Rosa
    Edited by: Carlos de Cozar on Feb 15, 2008 12:13 PM
    Edited by: Rosa on Feb 20, 2008 9:42 AM

    Can you please let me know how I can find out the duplicate record.
    you need to split the records from flat file structure into your internal table ans use a delete ADJACENT duplicates comparing fields
    split flat_str into wa_f1 wa_f2 wa_f2 at tab_space.

  • How to access XM attribute name in servlet ?

    Hi All,
    Anybody please tell me how to access attribute name in servlet ?
    Thanks

    Hi All,
    I have modified the source code of af:showDetailItem as following:
    <af:forEach items="#{bindings.VerticalAppMenus.children}" var="globalMenu" varStatus="globalMenuVarStatus">
               <af:showDetailItem text="#{globalMenu.MenuLabel}" id="sdi1" disclosureListener="#{pageFlowScope.globalMenus.refreshLineMenus}"
                 disclosed="#{(pageFlowScope.globalMenus.currentVerticalMenuId == globalMenu.MenuId) ? true : false}">
                  <f:attribute name="currentVerticalMenuId" value="#{globalMenu.MenuId}"/>
    </af:showDetailItem>
    </af:forEach>For the code *disclosed="#{(pageFlowScope.globalMenus.currentVerticalMenuId == globalMenu.MenuId) ? true : false}"*, at runtime it is giving the following error:
    *java.lang.IllegalArgumentException: Cannot convert 32 of type class oracle.jbo.domain.Number to class java.lang.Long*.
    Is there any way to cast the long to number or number to long in EL?
    Any help will be highly appreciated
    Thanks ... Best Regards
    Bilal
    Edited by: Bilal on 04-Apr-2012 19:32

  • How to access source attribute in ITEM-Plugin development

    Hi everybody,
    I'm trying to code an item plugin which is working fine so far. Now I'm busy optimizing it by using the standard attributes instead of custom attributes.
    One of the standard attributes I'd like to utilize is the "Has Source Attrbutes"-option which basically allows for a SQL-Statement to be defined as the item source.
    As I did this in a custom attribute so far, I want to switch over to the standard attributes. In the Region Plugin type, there is t_region.source to access the query, but the t_page_item type lacks such a possibility.
    How would I get access to the source SQL-Statement for an ITEM-Plugin?
    Best regards,
    Jürgen

    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

  • How to access a method of a class which just known class name as String

    Hi,
    Now I have several class and I want to access the method of these class. But what I have is a String which contain the complete name of the class.
    For example, I have two class name class1and class2, there are method getValue in each class. Now I have a String containing one class name of these two class. I want to access the method and get the return value.
    How could I do?
    With Class.forName().newInstance I can get a Object. but it doesn't help to access and execute the method I want .
    Could anybody help me?
    Thanks

    Or, if Class1 and Class2 have a common parent class or interface (and they should if you're handling them the same way in the same codepath)...Class c = Class.forName("ClassName");
    Object o = c.newInstance(); // assumes there's a public no-arg constructor
    ParentClassOrInterface pcoi = (ParentClassOrInterface)o;
    Something result = pcoi.someMethod(); Or, if you're on 5.0, I think generics let you do it this way: Class<ParentClassOrInterface> c = Class.forName("ClassName");
    // or maybe
    Class<C extends ParentClassOrInterface> c = Class.forName("ClassName");
    ParentClassOrInterface pcoi = c.newInstance();
    Something result = pcoi.someMethod();

  • How to access custom attribute value on the timecard at runtime

    I have created 2 attributes; Project and Task.
    Once a employee selects the Project from the Projects custom LOV I want the Task LOV to display only the tasks related to that particular project.
    How to access the PROJECT_ID during runtime which the user selects from Projects LOV?

    Hi
    I have added the below text in the ldt file.
    But its not working? Any suggestions?
    What may be going wrong?
    # CSR Project List
    BEGIN HXC_LAYOUT_COMPONENTS "XXCSR1 Payroll Timecard Layout - Project"
    OWNER = "CUSTOM"
    COMPONENT_VALUE = "XXCSRPROJECT"
    REGION_CODE = "HXC_CUI_TIMECARD"
    REGION_CODE_APP_SHORT_NAME = "HXC"
    ATTRIBUTE_CODE = "XXCSR_HXC_TIMECARD_PROJECT"
    ATTRIBUTE_CODE_APP_SHORT_NAME = "HXC"
    SEQUENCE = "211"
    COMPONENT_DEFINITION = "CHOICE_LIST"
    RENDER_TYPE = "WEB"
    PARENT_COMPONENT =
    "XXCSR1 Payroll Timecard Layout - Day Scope Building blocks for worker timecard matrix"
    BEGIN HXC_LAYOUT_COMP_QUALIFIERS "XXCSR1 Payroll Timecard Layout - Project"
    OWNER = "CUSTOM"
    QUALIFIER_ATTRIBUTE_CATEGORY = "CHOICE_LIST"
    QUALIFIER_ATTRIBUTE1 = "Custom1VO"
    QUALIFIER_ATTRIBUTE4 = "N"
    QUALIFIER_ATTRIBUTE5 = "15"
    QUALIFIER_ATTRIBUTE6 =
    "XxcsrProjectId|Projects List|RESULT|N"
    QUALIFIER_ATTRIBUTE10 =
    "oracle.apps.hxc.selfservice.timecard.server.Custom1VO"
    QUALIFIER_ATTRIBUTE20 = "N"
    QUALIFIER_ATTRIBUTE21 = "Y"
    QUALIFIER_ATTRIBUTE22 = "L"
    QUALIFIER_ATTRIBUTE25 = "FLEX"
    QUALIFIER_ATTRIBUTE26 = "Projects List"
    QUALIFIER_ATTRIBUTE27 = "Attribute1"
    QUALIFIER_ATTRIBUTE28 = "Projects List"
    END HXC_LAYOUT_COMP_QUALIFIERS
    END HXC_LAYOUT_COMPONENTS
    # CSR Project List
    # CSR Task List
    BEGIN HXC_LAYOUT_COMPONENTS "XXCSR1 Payroll Timecard Layout - Task"
    OWNER = "CUSTOM"
    COMPONENT_VALUE = "XXCSRTASK"
    REGION_CODE = "HXC_CUI_TIMECARD"
    REGION_CODE_APP_SHORT_NAME = "HXC"
    ATTRIBUTE_CODE = "XXCSR_HXC_TIMECARD_TASK"
    ATTRIBUTE_CODE_APP_SHORT_NAME = "HXC"
    SEQUENCE = "212"
    COMPONENT_DEFINITION = "CHOICE_LIST"
    RENDER_TYPE = "WEB"
    PARENT_COMPONENT =
    "XXCSR1 Payroll Timecard Layout - Day Scope Building blocks for worker timecard matrix"
    BEGIN HXC_LAYOUT_COMP_QUALIFIERS "XXCSR1 Payroll Timecard Layout - Task"
    OWNER = "CUSTOM"
    QUALIFIER_ATTRIBUTE_CATEGORY = "CHOICE_LIST"
    QUALIFIER_ATTRIBUTE1 = "Custom2VO"
    QUALIFIER_ATTRIBUTE4 = "N"
    QUALIFIER_ATTRIBUTE5 = "15"
    QUALIFIER_ATTRIBUTE10 =
    "oracle.apps.hxc.selfservice.timecard.server.Custom2VO"
    QUALIFIER_ATTRIBUTE14 =
    "HxcCuiTaskProjectId|PROJECT|Y"
    QUALIFIER_ATTRIBUTE15 =
    "pro_id = ::XxcsrProjectId"
    QUALIFIER_ATTRIBUTE20 = "N"
    QUALIFIER_ATTRIBUTE21 = "Y"
    QUALIFIER_ATTRIBUTE22 = "L"
    QUALIFIER_ATTRIBUTE25 = "FLEX"
    QUALIFIER_ATTRIBUTE26 = "Projects List"
    QUALIFIER_ATTRIBUTE27 = "Attribute2"
    QUALIFIER_ATTRIBUTE28 = "Task List"
    END HXC_LAYOUT_COMP_QUALIFIERS
    END HXC_LAYOUT_COMPONENTS
    # CSR Task List
    ###########################################################

  • How to access XML attributes with JSTL

    Hello,
    I'm using the XML functions of JSTL. I'm trying to parse the following RSS feed.
    http://weather.yahooapis.com/forecastrss?p=USNY0996
    I can get it parsed and access the elements via JSTL, but is it possible to access the attributes of some of the elements?
    For example, how can I get the city attribute out of
    <yweather:location city="New York" region="NY" country="US" />

    Hello,
    I'm using the XML functions of JSTL. I'm trying to parse the following RSS feed.
    http://weather.yahooapis.com/forecastrss?p=USNY0996
    I can get it parsed and access the elements via JSTL, but is it possible to access the attributes of some of the elements?
    For example, how can I get the city attribute out of
    <yweather:location city="New York" region="NY" country="US" />

  • How to Access Protected Method of a Class

    Hi,
         I need to access a Protected method (ADOPT_LAYOUT) of class CL_REIS_VIEW_DEFAULT.
    If i try to call that method by using class Instance it is giving error as no access to protected class. Is there any other way to access it..

    Hi,
        You can create a sub-class of this class CL_REIS_VIEW_DEFAULT, add a new method which is in public section and call the method ADOPT_LAYOUT of the super-class in the new method. Now you can create an instance of the sub-class and call the new sub-class method.
    REPORT  ZCD_TEST.
    class sub_class definition inheriting from CL_REIS_VIEW_DEFAULT.
    public section.
      methods: meth1 changing cs_layout type LVC_S_LAYO.
    endclass.
    class sub_class implementation.
    method meth1.
      call method ADOPT_LAYOUT changing CS_LAYOUT = cs_layout.
    endmethod.
    endclass.
    data: cref type ref to sub_class.
    data: v_layout type LVC_S_LAYO.
    start-of-selection.
    create object cref.
    call method cref->meth1 changing cs_layout = v_layout.

  • Accessing the attributes of a class using field symbols?

    An option to pulll a variable into a user exit that otherwise would be out of reach is detailed [here|https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/208811b0-00b2-2910-c5ac-dd2c7c50c8e8]
    Can a similar approach involving field symbols or otherwise, be used to pull in the attributes of a class into the exit? For now, I'm trying to access the A_FRONTEND_INDEX attribute of the class CL_HRXSS_REM.
    any ideas?
    ~Suresh

    Hi,
    Have you already tried (PROGRAM)(OBJECT)->A_FRONTEND_INDEX in your code? I prepared small testing scenario with two programs and it works.
    REPORT  zmv_test1.
    FORM test.
      FIELD-SYMBOLS: <fs> TYPE ANY.
      ASSIGN '(ZMV_TEST2)zip->crc32_map' TO <fs>.
      IF sy-subrc EQ 0.
        <fs> = 'Test'.
      ENDIF.
    ENDFORM.                    "test
    REPORT  zmv_test2.
    DATA: zip TYPE REF TO cl_abap_zip.
    START-OF-SELECTION.
      CREATE OBJECT zip.
      PERFORM test IN PROGRAM zmv_test1.
    Cheers,

  • How to access BW RFC FM as web service from Enterprise portal using SSO

    We have developed a custom remote function module in our BW system. We are accessing this function module as a webservice from a java class we have written. This java class access the BW webservice and formats the output. We created a webservice on top of this java class and deployed on the Enterprise Portal. SSO is setup between EP and BW systems. So when i make call to the BW RFC webservice, i would like to make use of SSO setup between EP and BW instead of hardcoding the user id and password while calling the webservice. Please advise on how to achive this.
    Thanks for the help.
    Thanks
    Hari
    Edited by: Hari Krishna Nalluri on Mar 19, 2008 12:41 PM

    Hi,
    Go to webserive perspective -> WebService Configuration -> Expand config node->Security-> Select HTTP Authentication and check Use SAP logon tickets option.
    Ashutosh

Maybe you are looking for

  • Skill Group Name is not coming on Cisco CTI Tool Kit real time status

    Hi, I have UCCE 9.0.3 in my environment but when supervisor is monitoring agent state on CTI Toolkit Team Real Time Status we are not able to see Skill Group name. For your reference I have enclosed screen shot of that.

  • Keeping Menu Visible When Scrolling Page

    Hi, I have a flash website that has a fair amount of conent on one of the pages such that you need to scroll down a few pages to get to the end of it. I have a verticaly oriented menu bar on the right side of the screen that I would like to move down

  • Listing files on FMS server @ client

    Hi Everybody! I want to show list of FLV files placed on FMS server. do u guys have any sample code for that. Looking forward for reply! thanks.

  • Keyboard doens't work, what to do?

    hey guys! I know, this is kinda stupid, but milk got on my MacBook. I whiped it off and it worked well for like 2-3 hours, but right now I figured, that the letter "a" doens't respond. What shoul I do?? I need held asap cuz I need my MacBook for scho

  • Transfer music from ipod do PC????

    Well i have an ipod video 30GB and the thing is.....if i lose my computer or something like that, can i copy all the songs and videos from ipod to a new computer??? If i copy all the songs to ipod as files("disk use") is alright, but if i use itunes,