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
Similar Messages
-
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
MahathiHi 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? -
I have an ancient laptop (from 2005) that has my entire music library. This laptop barely works and some keys don't type anymore. How can I get all this music transferred to another computer, or available to me on the cloud?
No... do not move programs.
About the iTunes library files
Your iTunes library files track the media you add to iTunes, how you've organized it, and other information such as playlists. By default, these two files are in your iTunes folder:
Mac OS X: /Users/username/Music/iTunes/
Windows XP: C:\Documents and Settings\username\My Documents\My Music\iTunes\
Windows Vista: C:\Users\username\Music\iTunes\
Windows 7: C:\Users\username\My Music\iTunes\
Windows 8: C:\Users\username\My Music\iTunes\ -
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 AMCan 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 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- AbhishekHi 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 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 XM attribute name in servlet ?
Hi All,
Anybody please tell me how to access attribute name in servlet ?
ThanksHi 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 a function of an object from another object
Hi all, here's my problem, I have three classes;
1)Class human
2)Class animal
3)Class environment
class environment
public static void main(String[] args)
human luffy = new human();
animal chpper = new animal();
class human
// here I wanna access a method in chpper,
// what's the best way to day that?
// and is it even possible with this structure??
}Thanks
Roronoa Zoro
Edited by: Roronoa.Zoro on Nov 19, 2009 6:55 PM
Edited by: Roronoa.Zoro on Nov 19, 2009 6:55 PM
Edited by: Roronoa.Zoro on Nov 19, 2009 6:56 PMAlright guyz, I guess I'm super stupid but please stay with me.
Here's the whole problem; I'm writing an application that draws rectangles, so this application is a JPanel that has a layout which has two JPanels, first JPanel contains the JButtons and an ActionPerformed function, and the second JPanel has the canvas that I should draw on.
Here's the whole code;
public class animationAll extends JPanel
public animationAll()
this.setLayout(new BorderLayout());
this.add(new animationButtons(), BorderLayout.WEST);
this.add(new animationCanvas(), BorderLayout.CENTER);
public class animationButtons extends JPanel implements ActionListener
JButton btnCreate = new JButton("Create");
public animationButtons()
JButton btnCreate= new JButton("Create");
btnCreate.addActionListener(this);
public void actionPerformed(ActionEvent e)
if(e.getSource() == btnCreate)
//here I want to call the draw method in animationCanvas.
} Thank you in advance, and please bare with me on this one
Roronoa Zoro -
How to access multiple attributes of a node at the same time in XML AS3
<chapter id="1" title="">
<screen title="lesson">
<swf>EXCEL/CH01/CH01_S01.swf</swf>
<ltitle>Chapter 1</ltitle>
<rtitle>Setting Up a Workbook</rtitle>
<prompt>Choose a lesson</prompt>
</screen>
<screen title="lesson" tasks="3">
<swf>EXCEL/CH01/CH01_S02.swf</swf>
<ltitle>Chapter 1</ltitle>
<rtitle>Setting Up a Workbook</rtitle>
<prompt>Click Next to continue</prompt>
</screen>
I have 2 attributes of screen node which are title and tasks.
how can I access these 2 attributes at the same time in AS3
Is that correct:
excel.chapter.screen.(@title == "lesson").@tasks
Thanks alot in advance.var excel:XML = <data>
<chapter id="1" title="">
<screen title="lesson" tasks="">
<swf>EXCEL/CH01/CH01_S01.swf</swf>
<ltitle>Chapter 1</ltitle>
<rtitle>Setting Up a Workbook</rtitle>
<prompt>Choose a lesson</prompt>
</screen>
<screen title="lesson" tasks="3">
<swf>EXCEL/CH01/CH01_S02.swf</swf>
<ltitle>Chapter 1</ltitle>
<rtitle>Setting Up a Workbook</rtitle>
<prompt>Click Next to continue</prompt>
</screen>
</chapter>
</data>;
trace(excel.chapter.screen.(@title == "lesson" && @tasks == "3").toXMLString());
Note that for this to work (and not throw an error) every screen node needs a tasks attribute.
In your sample code, the first screen node did not have a tasks attribute, in which case an error is thrown when using @tasks == "3" -
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 -
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ürgenHello
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 request attributes in a portlet?
Hello Experts,
request.getParameter() in the reset method works fine in a pageflow but doesnt work in a portlet or a portal and always returns null for all the attributes/parameters,is there any special way of getting the request attributes in a portlet..any wrapper class around the original HttpRequestObject..Please let me know.
Thx!Found the answers:
1. The service Impl should implement the javax.xml.rpc.server.ServiceLifecycle interface.
In this way you get access to a javax.xml.rpc.server.ServletEndpointContext, which gives access to amongst others javax.xml.rpc.handler.MessageContext, which gives access to request information
2. In the Handler it is possible to store information on the MessageContext, which can be accessed in the service Impl (see 1.).
Groeten,
HJH -
How to access marketting attribute of CRM
Hi All,
I have a specific requirement for CRM 2005. Currently we are maintaining some values in Marketting Attribute of BP transaction. Now I need to access those values through some programme or FM or BADI. So, is there any way I can sccess those values in a structure. Actually I need to return those values to UI. Please also let me know is there any standard FM exists for this purpose.Hi,
I agree what you said but if we clear the context element it giving a dump as the program is refering to the NULL reference.As I said earlier my table has no data but still I am applying Filter and then clearing the Filter node value.
It is working correct when my table is not initial.
i hope you got my point.
Please find the code below,
METHOD onactionclear_filter .
DATA: l_node TYPE REF TO if_wd_context_node. "This is context for Filter
DATA: lo_nd_nrs_status TYPE REF TO if_wd_context_node. " This is context for Table
DATA lo_api_controller TYPE REF TO if_wd_controller.
DATA lo_message_manager TYPE REF TO if_wd_message_manager.
Data clr TYPE wd_this->element_nrs_status.
DATA flg TYPE wdy_boolean.
DATA l_ele TYPE REF TO if_wd_context_element.
*data node_ele TYPE REF TO CL_WDR_CONTEXT_ELEMENT.
*data node_val TYPE REF TO CL_WDR_CONTEXT_NODE_VAL.
*data node type ref to CL_WDR_CONTEXT_NODE.
*data node_tab type WDR_CONTEXT_PROP_FOR_NODE_TAB.
l_node = wd_context->get_child_node( if_table_view=>wdctx_filter ).
lo_nd_nrs_status = wd_context->get_child_node( name = wd_this->wdctx_nrs_status ).
CALL METHOD l_node->get_static_attributes
IMPORTING
static_attributes = clr.
IF clr IS INITIAL.
lo_api_controller ?= wd_this->wd_get_api( ).
CALL METHOD lo_api_controller->get_message_manager
RECEIVING
message_manager = lo_message_manager .
report message
CALL METHOD lo_message_manager->report_error_message
EXPORTING
message_text = 'Incorrect Selection' .
EXIT.
ENDIF.
l_node->INVALIDATE( ).
ENDMETHOD.
Thanks & Regards,
Ravi Ganji -
How to Access Custom Attributes created in UME.
Hi All,
I have created a custom attribute in UME by using the config tool, the problem that i was facing is i am unable to access those custom attributes via Iuser Api i.e even though i am using the method getAttributeNamespaces() it is returning all the attributes except the custom attributes that i have created in UME.
Thanks in Advance,
RV.Hi RV,
Use the user.api jar in your appln.
follow these steps in your code:
IWDClientUser wdUser = WDClientUser.getCurrentUser();
IUser user = wdUser.getSAPUser();
user.getAttribute("com.sap.security.core.usermanagement", "exact name of the custom attribute");
if you are still facing the problem paste your code here for analysis.
Maybe you are looking for
-
I was also missing the "extensions.sqlite" file but changing the folder properties from read only allowed that file to save. AV installed is Bit Defender but I do not see a section there that would be protecting that folder from overwrites.
-
EPS File Not Using Proper Fonts in Illustrator
I am trying to import an EPS file that I created in Finale 2014 into Illustrator CS6 (64 bit). It seems to not want to use the Maestro font for the noteheads, rather replacing it with Myriad Pro. I have tried this on multiple machines with the same r
-
All, If I have 3 GRs that I want to settle using MRRL. I settle with a document selection option of 4 (document selection per delivery document/service entry). This will result in 3 separate invoices. The first invoice that is created the FI do
-
My Black Berry Desk Top Manager doesn't work on my computer help!
On March 6 I took my BlackBerry® Style™ 9670 smartphone in for software issues after tech support did a hard reset on the device. I went home to back up my information and was unsuccessful. The connection failed this is the first time that the desk
-
Hi I have the following configuration: linux SLES 10 SP2, ocfs2 , RAC (oracle 10.2.0.4) si SAP ERP 6.0. Database is in the "archivelog" mod and archivelogs are generate in a ocfs2 mount point type . We set a retention of 14 days to archivelogs and th