Linktoaction in webdynpro
Hi,
I have one column in the table of view, I have bound the table with my context. now i want to apply linktoaction on my first column, so when user clicks on this column, it should be hyperlinked and another view will be open to show the details. Pls let me the the steps of applying linktoaction only.
Thanks,
Hello,
See these: [https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/c05e232d-0701-0010-6684-fd8e72f38784], [/people/david.halitsky/blog/2006/09/22/learning-what-you-dont-need-is-as-important-as-learning-what-you-do-parts-10b-c-of-event-driven-tutorial-on-wdrtestuielements] and [http://help.sap.com/saphelp_nw04s/helpdata/en/0f/e8884118aa1709e10000000a155106/frameset.htm].
Regards.
Similar Messages
-
ABAP Webdynpro Linktoaction in table
Hi,
In my webdynro view i have a table with some fields as linktoaction.
In the context for table following attributes are set:
Initialize Lead Selection = 'X'
Singleton = 'X'
How can I get the row where the linktoaction is clicked on in the corresponding methods.
I added following code but in stru_sales_order i always get the data of index 1.
DATA:
node_z_dws_get_salesorder TYPE REF TO if_wd_context_node.
DATA:
node_changing TYPE REF TO if_wd_context_node.
DATA:
node_e_sales_orders TYPE REF TO if_wd_context_node.
DATA:
stru_sales_order TYPE ig_componentcontroller=>element_e_sales_orders.
node_z_dws_get_salesorder = wd_context->get_child_node( `Z_DWS_GET_SALESORDER` ).
node_changing = node_z_dws_get_salesorder->get_child_node( `CHANGING` ).
node_e_sales_orders = node_changing->get_child_node( `E_SALES_ORDERS` ).
node_e_sales_orders->get_static_attributes(
IMPORTING static_attributes = stru_sales_order ).
Kind regards,
Vincent.OK I have no idea what you said since I am new to this WDA, but I did get someone to help with this.
I had to change the table configuration to selectionMode Single and create an event for onLeadSelect.
in the onLeadSelect code I have the following:
LR_NODE = WD_CONTEXT->GET_CHILD_NODE( 'PARKED_TRANSACTIONS' ).
LR_ELEMENT = LR_NODE->GET_LEAD_SELECTION( ).
Thanks for the help all! -
Error while Uploading the docs into KM using webdynpro for java
In My view I have create a context node(ctx_va_FileData) with value attribute (ctx_va_FileResource) of type ,Resource.
Select the Simple Type, navigate to Dictionaries u2192 Local Dictionary u2192com.sap.ide.webdynpro.uielementdefinitions and select Resource.
In View part of Layout :Create one u201CFileUpload u201C UI with Create one LinkToAction IU element and assign u201CaUploadFileinto_KMu201D action to this action
Coding Part in Web Dynpro java
Step 1:
Go to the wdDoInit() method and paste the following code
public void wdDoInit()
//@@begin wdDoInit()
try {
IPrivateUploadFile_KMView.ICtx_vn_FileDataElement element = wdContext.createCtx_vn_FileDataElement();
if (element != null)
wdContext.nodeCtx_vn_FileData().bind(element);
}catch (Exception e) {
wdComponentAPI.getMessageManager().reportSuccess("Error: " + e.getCause().toString());
//@@end
Go to the onActionaUploadFileinto_KM and paste the following code
public void onActionaUploadFileinto_KM(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent )
//@@begin onActionaUploadFileinto_KM(ServerEvent)
msgMgr = wdComponentAPI.getMessageManager();
IPrivateUploadFile_KMView.ICtx_vn_FileDataElement element =
wdcontext.currentCtx_vn_FileDataElement();
IWDResource resource = element.getCtx_va_FileResource();
if(resource!=null){
try {
//To get the Current User
IWDClientUser wdClientUser = WDClientUser.getCurrentUser();
com.sap.security.api.IUser sapUser = wdClientUser.getSAPUser();
com.sapportals.portal.security.usermanagement.IUser ep5User =
WPUMFactory.getUserFactory().getEP5User(sapUser);
ResourceContext resourseContext = new ResourceContext(ep5User);
//Portal KM Path
RID pathRID = RID.getRID("/documents/SDN"); //Root Directory
IResourceFactory resourseFactory =
com.sapportals.wcm.repository.ResourceFactory.getInstance();
ICollection collection = (ICollection)resourseFactory.getResource(pathRID,
resourseContext);
//Read the File
InputStream stream = resource.read(true);
String resourceName = resource.getResourceName();
String resourceExtn = resource.getResourceType().getFileExtension();
//KM Content
Content cont = new Content(stream,"application/octet-stream",-1,"UTF-16");
//create a file in above mentioned path in KM
com.sapportals.wcm.repository.IResource new_resource =
(com.sapportals.wcm.repository.IResource)collection.
createResource(resourceName, null, cont);
//Get the File length
long contentLen = new_resource.getContent().getContentLength();
//If no data in file
if(contentLen <= 0){
msgMgr.reportException("No data in file" , true);
}else {
msgMgr.reportMessage(IMessageUploadFile_KMComp.SF__UPLOAD,
new Object[] {resourceName},true);
} catch (NotSupportedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (AccessDeniedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (WDUMException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (ResourceException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (ContentException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (UserManagementException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}else
msgMgr.reportException("No file Selected ,Browse the file!",true);
element.setCtx_va_FileResource(null);
}//End of Action
But in the onActionaUploadFileinto_KM part IUser is deprecated and i m stuck at that point.
Plz provide me the solution and is there ant alternative solution for this and MY Portal is EP6 Nwds version is 7.0.9Hi Sukalyan,
Have you checked the below links?
These will give you step by step implementation procedure.
http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/a099a3bd-17ef-2b10-e6ac-9c1ea42af0e9?quicklink=index&overridelayout=true
http://wiki.sdn.sap.com/wiki/display/WDJava/KmuploadusingWebdynproapplication
Regards,
Sandip -
I am getting the following exception when I trying to go to Details view from my results view.
com.sap.tc.webdynpro.services.exceptions.WDRuntimeException: Instance of view controller ResultsView does not exist.
at com.sap.tc.webdynpro.progmodel.controller.Component.getController(Component.java:356)
at com.sap.tc.webdynpro.clientimpl.html.client.HtmlClient.handleUIElementEvent(HtmlClient.java:832)
at com.sap.tc.webdynpro.clientimpl.html.client.HtmlClient.updateEventQueue(HtmlClient.java:763)
at com.sap.tc.webdynpro.clientserver.cal.AbstractClient.initEvents(AbstractClient.java:131)
at com.sap.tc.webdynpro.clientserver.cal.AbstractClient.prepareTasks(AbstractClient.java:99)
at com.sap.tc.webdynpro.clientserver.cal.ClientManager.doProcessing(ClientManager.java:250)
at com.sap.tc.webdynpro.serverimpl.defaultimpl.DispatcherServlet.doWebDynproProcessing(DispatcherServlet.java:154)
at com.sap.tc.webdynpro.serverimpl.defaultimpl.DispatcherServlet.doContent(DispatcherServlet.java:116)
at com.sap.tc.webdynpro.serverimpl.defaultimpl.DispatcherServlet.doPost(DispatcherServlet.java:55)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.runServlet(HttpHandlerImpl.java:390)
at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.handleRequest(HttpHandlerImpl.java:264)
at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:347)
at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:325)
at com.sap.engine.services.httpserver.server.RequestAnalizer.invokeWebContainer(RequestAnalizer.java:887)
at com.sap.engine.services.httpserver.server.RequestAnalizer.handle(RequestAnalizer.java:241)
at com.sap.engine.services.httpserver.server.Client.handle(Client.java:92)
at com.sap.engine.services.httpserver.server.Processor.request(Processor.java:148)
at com.sap.engine.core.service630.context.cluster.session.ApplicationSessionMessageListener.process(ApplicationSessionMessageListener.java:33)
at com.sap.engine.core.cluster.impl6.session.MessageRunner.run(MessageRunner.java:41)
at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37)
at java.security.AccessController.doPrivileged(Native Method)
at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:100)
at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:170)
To explain further, I have 3 views in my webdynpro project, list view, results view and detail view that is embedded in the same window.
In the list view, I have a table of materials with linktoaction event that when clicked will go to detail material view to display material information. In this scenario this is working with no problems for all the items in the list.
When I do the same thing from the result view as the list view, only the first url link action works to display the detail view , the others fail with the above exception.
Any help on resolving this issue is appreciated.
Thanks,
Sunitha.Ayyapparaj,
The lifespan of ResultsView is "FrameworkControlled".
Following is the code snippet for onclick of a row in the table in the results view,
IWDMessageManager messageMgr = wdThis.wdGetAPI().getComponent().getMessageManager();
// getting the user's assigned SoldTo from the UME profile
String[] customer = null;
String SoldTo = null;
try
IUser user = WDClientUser.getLoggedInClientUser().getSAPUser();
IUserAccount[] acct = user.getUserAccounts();
customer = user.getAttribute(AvailabilityApp.NAMESPACE_LENNOX,AvailabilityApp.ATTR_SOLDTO);
SoldTo = customer[0];
} catch (UMException e)
// TODO Auto-generated catch block
messageMgr.reportException(e.getMessage(),false);
//create the instance and pass parameters for RFC Z_RFC_HRP_MATERIAL_INFO_Input
Z_Rfc_Hrp_Material_Info_Input input = new Z_Rfc_Hrp_Material_Info_Input();
wdContext.nodeZ_Rfc_Hrp_Material_Info_Input().bind(input);
input.setMatnr(wdContext.currentATP_To_AtpElement().getMatnr().toUpperCase());
input.setUser_Id(SoldTo);
//executing the RFC Z_Rfc_Wwhc_Zatp
wdThis.wdGetAvailabilityAppController().ExecuteZ_RFC_HRP_MATERIAL_INFO();
wdContext.currentContextElement().setReturnTextDisplay("Availability Results");
wdThis.wdFirePlugToDetailView();
When it goes to Detail view and try to display the UI bound to the output from the above
Z_RFC_HRP_MATERIAL_INFO() , it shows this error.
Please note that the above code does not fail for the first row of the results table in the results view, but it does for all the others. Is there something that I am missing here ?
Thanks,
Sunitha. -
Calling different views at runtime based on my condition abap webdynpro
Hi friends,
Could you pls help me in this issue.
I am new to webdynpro abap.
I have an action on my first view.
basically its a sales order linktoaction. when i click it, i have to check a condition.
if process type = A,
then navigate to view 2(different abap webdynpro component's view)
elseif process type = B,
then navigate to view 3(different abap webdynpro component's view)
endif.
I only have experience in calling one view for a action, so i dont have much idea on this how to acheive.
I have this IF condition, on action event.ON that i need to call view of another application.
thanks in advance,
NirajaHi Niraja,
If you want to pass parameters to a WDA application you can pass them by URL link.
Example: http://...?pass1=value1&pass2=value2 In this case you pass two parameters to the application.
In WDA application you can control parameters in windows, you can add parameters in the plug 'Startup' which names are same as URL parameters, and then you can create notes/attributes in the context of windows then map them to the context of view. In the method of startup plug you can pass the parameters to the context of windows. You can search WDA help by WDA application parameters.
You can check this [link |http://****************/Tutorials/WebDynproABAP/DynamicViews/Window.htm]for dynamic view navigation in a window. And no its a pdf file. It takes you to another website where they have explained it with step-by-step screenshots.
You may also be interested in checking out this [link |http://****************/Tutorials/WebDynproABAP/views/navigation.htm]where they have explained Navigation from one View to other View along with parameters using Plugs with out using Component Controller context. It too isn't a pdf & does take you to another website.
Hope these help.
Regards,
Uday -
Calling sap transaction in webdynpro
hi friends,
can any body provide the solution how to call the standard transaction like va02 or .any . in Web dynpro abap.
thanks in advance.
sai.Hi,
It can be posible to display a standard transaction into Webdynpro.for that no coding required.you need to use webgui for that. ( pls refer transaction SICF ). in that case u can specify the Tcode u want use in URL.
like
http://<server-name>:8000/sap/bc/gui/sap/its/webgui?~TRANSACTION=va02
Call this url from linktourl or linktoaction
Tell me if you find any problem in doing this
Regards,
Edited by: Raju.. on Jun 30, 2009 5:51 PM -
How to call Standard Iviews in Webdynpro application?
How to call STD iviews in the wwbdynpro application.
can any of friends give the codeUse this snippet to call standard iviews from your webdynpro code :
//use LinktoAction UI element
onActionClick (com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent)
WDPortalNavigation.navigateAbsolute("ROLES://portal_content/folders/X.Iview", WDPortalNavigationMode.SHOW_INPLACE, (String)null, (String)null, WDPortalNavigationHistoryMode.NO_DUPLICATIONS, "Called iView Name", (String)null, (String)null);
Hope this helps.
Rgds
Prabhakar -
Hello All:
I am facing an issue, with opening pdf forms using webdynpro applcaions, after applyign support stacks.
I am using linktoaction UI element to display a pdf form which is stored in mimereporsitory, and i am displaying it after getting URL. and by using abap class cl_wd_runtime_services=>attach_file_to_response.
This was working fine until, our recent support packs, but after support packs are applied, we are getting an error saying
Unable to open form yyyy.pdf from yyy.yyyy.com .
Unable to open this internet site. the requested site is either unavailable or cannot be found.
We applied support stacks both to, abap side and portal side, and we confirmed that issue is comign from portal side.
One other thing, the applicaiton works fine when i test applicaiton by itself, but the problem arises when the application is opened from portal.
And the error occurs only when i open portal using IE8, but it works fine IE9, chrome or mozilla.
We are on the latest SP Stack 10 for Application Server Java on EHP1 FOR SAP NETWEAVER 7.0
Thanks,
Ratna.Hi Ratna,
We are having the same issue when downloading pdf with Internet Explorer 8.
We have EHP1 too, and the WDA works nice without the portal.
Did you find the solution?
Thank you. -
Closing the NonModel External Window in Webdynpro
Hi,
I have a Webdynpro Application, in which i used to call the webdynpro application in a Separate external window by using the below code.
String depObjectName =wdComponentAPI.getDeployableObjectPart().getDeployableObjectName();
WDDeployableObjectPart depObjectpart=WDDeployableObject.getDeployableObjectPart(depObjectName,"TestApp",WDDeployableObjectPartType.APPLICATION);
String url = URLGenerator.getApplicationURL(depObjectpart) ;
*// Code to Popup the View in External window by calling the Application *
window = wdComponentAPI.getWindowManager().createNonModalExternalWindow(url,"Update View");
wdContext.currentContextElement().setCtx_WindowInstance(window);
window.setWindowSize(625, 225);
window.setWindowPosition(50, 75);
*window.setTitle("Update View"); *
window.show();
This opens the Separate external window and after editing some fields, I need to Update the DB and close the window.
When i try to use the code,
window.destroyInstance();
The window is not getting closed. I have used the window instance as the static IWDWindow window, still i am not able to close the window.
Anyone Please let me know how to close the External Non Model Window.
Thanks and Regards,
SekarHi Sekar,
my suggestion is to open another window that contains html code which invokes opener . close() on the parent window - your window to be closed. This worked for me and made my day.
I open an HTML file created as IWDCachedWebResource as nonModalExternalWindow over a LinkToAction which invokes onActionClose. There is a second window opening for a short moment which will be closed by its onLoad event.
The HTML code is basically sporting a < script >-section which contains a call to opener . close().
regards,
Christian
Ps: sorry, I can't post the code - it simply does not work... Had the same problem days ago with another thread . -
Horizontal scroll in webdynpro java table
Hello,
I have a webdynpro java application in which i have a table with 15 columns. I have set the scrollableColCount property of the table to 5.
Now on click of some link(LinkToAction), i want to scroll horizontally to column 8. Can i do this from the program?
Please help me with the code.
Thank you,
NavyaDear navya,
IWDTable table = (IWDTable)view.getElement("TableName");
table.setFirstVisibleScrollableCol("columID");
here table name is your tablename , and columnID is your 8th Coulmn name
what you can do is create an attribute of type IWDTable in context , and set your table id to it in view
wdDoModifyView() method
if(firstTime)
wdContext.current**********Element().set******TablelID((IWDTable)view.getElement("TableName"));
onActionLink() // which is binded to your linktoAction UI Element
wdContext.current**********Element().get******TablelID.setFirstVisibleScrollableCol("columID");
Regards
Govardan -
Drill Down report using Webdynpro
Hi Guys,
Is it possible to develope a drill down report in Webdynpro?
If yes, can somobody direct me to any tutorial for creating Drill Down Webdynpro Report.
I need to convert an ABAP drill down report to Webdynpro Drill Drown.
Thanks,
miniHello,
Yes, it's possible, using the linktoaction element please see this: [/people/david.halitsky/blog/2006/09/22/learning-what-you-dont-need-is-as-important-as-learning-what-you-do-parts-10b-c-of-event-driven-tutorial-on-wdrtestuielements] and [https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/db22242d-0701-0010-28a2-aeaa1fefd706].
Regards. -
How to call Function Module from webdynpro application ,up on click url in
Hi Experts,
I need your help for the following scenario.
In my WebDynpro application , I am displaying the sales orders in a table.
one of the column in table i.e. sales order number is displayed with hyper link, up on click the sales order number column, i have to pass the po number to the a remotefunction with as one parameter and enjoy = 'x' as another parameter that should call me23n transaction and the transaction screen should be displayed in the webdynpro application with po details.
Thanks In Advance.
your help is rewarded.
Best Regards.
Rao.Hi Rao,
1.Create binding to view to Controller.
2.Create table->Add column->Add table cell Editor(select LinkToAction UI Element in options).
3. Bind the property <i>text ->sales order number</i> (Output/<model node>)
4. Create an Event <salesOrder>
// do null check
// set your input parameters
// input sales order number = current output sales order number
// enjoy="x"
// call controller's method() that executes RFC
5. Bind this event LinkToAction property action-> <salesOrder>
To execute RFC, the code is available in sample tutorials.
Hope this helps
regards,
Siva -
Calling an Portal Webdynpro iView from another Webdynpro iView - Error
Hi,
I have modified the DefaultFramework Page by adding an Alert iView (based on WebDynpro) and assigned this modified framework page to all users. It works fine.
The Alert iView on the Left hand side (right above the Detailed Navigation) consists of links to different WebDynpro iViews in the same Portal.
I have used LinkToAction UI element, on event of click
i am executing this piece of code.
onActionClick (com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent)
WDPortalNavigation.navigateAbsolute("ROLES://portal_content/folders/X.Iview", WDPortalNavigationMode.SHOW_INPLACE, (String)null, (String)null, WDPortalNavigationHistoryMode.NO_DUPLICATIONS, "Called iView Name", (String)null, (String)null);
I have picked up the iView name from the Portal(exact PCD location).
It is not working. Once in a while it worked. But now it is not loading at all.
Please let me know your thoughts on the same.
Thanks
SenthilHi,
Got it solved. User has authorization to execute the page.Their roles were not added in Permission list of that Page.
Added the roles. Now it works fine.
Thanks
Senthil -
Calling an Portal iView from Webdynpro - Error
Hi,
I have two iViews in a page in my Portal. Both of them are WebDynpro iViews.
The iView on the Left hand side consists of links to different WebDynpro iViews in the same Portal.
I have used LinkToAction UI element, on event of click
i am executing this piece of code.
onActionClick (com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent)
WDPortalNavigation.navigateAbsolute("ROLES://portal_content/folders/X.Iview", WDPortalNavigationMode.SHOW_INPLACE, (String)null, (String)null, WDPortalNavigationHistoryMode.NO_DUPLICATIONS, "Called iView Name", (String)null, (String)null);
I have picked up the iView name from the Portal(exact PCD location).
This is not giving me consistent results.
Please let me know your thoughts.
Thanks
SenthilHi,
Had some permission issues in the loading iView, got that sorted. Now it works fine.
Thanks
Senthil -
Some rows requires Link&some don't require link in LinkToAction tablecolumn
Hi,
I code in WebDynpro for java.
I have a column in a table which is a LinkToAction.
Only for specific values which i get to this column, i require link and for others i do not want a link to appear in this column in that particular row.
For example, i query a RFC and get values for this LinkToAction column. If values i got from RFC is "Seats Available", i require a link in this column in that row.
If the value i get from RFC is "Seats Full", i do not want a link in this column in that particular row.
Can anyone give some hints on how to achieve this?
Thanks,
BhuvanaHi Bhuvana,
You can bind the property of the Link to action UI elemet's type property with one value attribute with the type com.sap.ide.webdynpro.uielementdefinitions.LinkType
and you can change the property as per your condition. This will change the display of the UI element.
Kind regards,
Mukesh
Maybe you are looking for
-
Possible to use iMovie HD with Yosemite?
Just upgraded to Yosemite and was extremely bummed to find that iMovie HD is not compatible. I much prefer it for simple projects. Any way to use it in Yosemite?
-
i connect my ipod using my charger and it is shown on my computer (Windows 7) as a USB and it charges aswell but it doesn't show up on itunes.Whats happening?
-
How do I stop attachments embedding in mail?
-
ACPI tables, Resource conflict, Dell Dimension 8100 - need Solaris 7
I just bought a new Dell Dimension 8100 and I am getting the same error as SunilPP, "ACPI tables not in reclaim memory" and "Recourse conflict, both devices are added NON ACPI device ...". One of the solutions suggested on this forum is to install So
-
hi all, we do the depot sales. in that the trading material is maintained with the MRP views. and client do the mrp run for the material . since they woundnot maintain the plnn strategy .how we capture the requirement from the customer oder for the