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
Similar Messages
-
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,
GSMHello
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 -
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? -
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 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 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 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 request information in a webservice implementation (10.1.3)
Hi,
I have created a java webservice from WSDL in JDeveloper 10.1.3.4.
In the Impl class I would like to access HTTP request information.
Can I do this in a direct way?
If not, I have made a custom javax.xml.rpc.handler.Handler (by extending GenericHandler)
In this class I can access the information that I need from the MessageContext that is available there.
How can I get information from the Handler to my Impl?
Groeten,
HJHFound 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 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 request content using MultipartMessage Object
I want to take a file from the Client and upload it as a FileInputStream on the server.
I have a simple form as follows:
<form action="scan" name="scan_files" method="post"
enctype="multipart/form-data">
<input type="file" name="file1">
<input type="file" name"file2"/>
<input type="Submit" name="insert_scaned" value="Upload"/>
</form>
In my servlet I tried to use the com.sap.engine.services.servlets_jsp.lib.multipart.MultipartMessage
class to parse the form information.
protected void doPost(
HttpServletRequest request,
HttpServletResponse response)
throws ServletException, IOException {
MultipartMessage multipartMsg =
(MultipartMessage)request.getAttribute("com.sap.servlet.multipart.body");
if (multipartMsg != null) {
multipartMsg.addFormParametersToRequest();
The help said that once this is done the form information should be accessible via the
request getParameter() method. However, I can't seem to get it working?
How can I access the file so that I can parse it into a FileInputStream?
Thanks.Hi Mat,
first, welcome on SDN!
About your question:
From the APIDoc - https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/javadocs/nw04/sp12/j2ee%20engine/com/sap/engine/services/servlets_jsp/lib/multipart/multipartmessage.html - I would expect this as a solution:
MultipartMessage multipartMsg = (MultipartMessage)request.getAttribute(MultipartMessage.MULTIPART_BODY_KEY);
if (multipartMsg != null) {
for (int i = 0; i < multipartMsg.getCount(); i++) {
MultiPart mp = multipartMsg.getBodyPart(i);
// mp.getInputStream, mp.getBody() or whatever you need
Hope it helps
Detlev
PS: Please consider rewarding points for helpful answers on SDN. Thanks in advance! -
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 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. -
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
Maybe you are looking for
-
Lines in shaded table cells do not render properly in pdf created in Word 2010
When creating a pdf with shaded table cells using MS Word 2010; the black lines in the shaded table cells do not show up when looking at the page at a fit page view (anything under around 60%). They print, they are there when I zoom in, but will not
-
Why am I seeing frequent crashes while using Bridge CC on my iMac?
This is very predictable and each time I made sure crash data was submitted to Adobe for this.... I am usually working with images in a specific folder...
-
I have Java Consoles in my add on's from version 6.0.03 to 6.0.22. I'm not sure how it's effecting my browser, except pages take a long time to load, a real long time, and seems to crash more too. What is the best way to deal with this? I am using ve
-
Looking for a way to move entire pages from one photo book into another photo book.
I haven't found out how to move pages from one photo book into another. Surely this is possible? Also on the subject of photo books: it seems that it is not possible to enlarge the size of a text box. Or has anyone found a way to accomodate more than
-
Grants on Function and Procedure for Network user
Hi all, On my computer (user1), i created one function ( fun1 ). In the network, another user(user2) is there. I want to give execute or alter privilege on this function to user2. I created TNS name for user2 in my TNSNAMES.ORA. what is the statement