on 10-13-2009 1:26 PM
Hi Experts,
I am new to workflow so request you all to bear with any dumb questions :). I require to call a webdynpro component when user clicks on a workitem in his box. i am using the method cl_gui_frontend_services=>execute and this happens fine . But i am unable to get the Workitem Id in my webdynpro when i tried to use some of the FM's that give us the workitem id .
After going through some of the threads posted in this forum i found out that we need to pass the work item id to the url of the component itself so could someone please tell me how we can retrieve the WI ID in the method of the task and pass it in the component url.
Thanks In Advance,
Chaitanya.
In applications window handle default method declare the palce holder name similar to the name which is getting populated in the URL . Make sure the names are identical and define this variable in the method in which you want to acees this makes sure that your workitem ID is accessible through out your application.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Pavan,
Thanks for your reply, could you please tell me how the workitem is passed to the component url in the first place. I have already configured the task in swfvisu. So if i access a workitem in my inbox (SBWP) by clicking it would the Webdynpro Component be automatically called with a url that has the workitem id ?
Thanks in Advance,
Chaitanya.
I have already configured the task in swfvisu
Why did you configure the task in the SWFVISU tx, are you going you access the workitem from UWL?.
I think there is no necessity of configuring the task in this txn unleass you try to execute it from the UWL.
If at all you are executing it from the UWL then you ahve to make sure that you confiugure the required Visualization Parameters
like below
APPLICATION : < application name>
DYNPARAM WI_ID=${item.externalId}
NAMESPACE sap
Hi Pavan,
Our requirement is to access it from both UWL & SBWP , hence the configuration. I am working on the part where the Component is called from SBWP first. Here in a task i have called the method CL_GUI_FRONTEND_SERVICES->execute to give a call to the
Component but since i am hardcoding the URL it doesnot pass me a WI_ID. My question now is how can i fetch the workitem id
in the task and pass it to the url.
I have already created an importing variable in the handle default method of the component.
Would really appreciate your inputs on this issue.
Chaitanya.
Now I got you you want the current running workitem from which you are calling the class, if this is the case then it is too simple
use the below lies of code and then append the workitem ID to the URL with name WI_ID
DATA : lv_wi_object type swc_oject,
lv_wiid type sww_wiid.
swc_get_element container '_Workitem' lv_wi_object.
swc_get_property lv_wi_object 'Workitemid' lv_wiid.
Once the lv_wiid is populated with the current running task workitem ID then you concatenate this wiid to the URL.
Ensure that DYNPARAM for that Workitem ID and application for the task is configured as suggested by pavan.
1. In Window of Webdynpro application, Default Handler Method that particular Parameter which was configured in
SWFVISU would be available.
2. In Wapplication parameters add the WI_ID as a parameter which you would get through F4 help too
Revert for any other clarifications.
Regards
Narin
Hi Pavan / Narin,
Thanks a lot for your inputs , need some assistance with one small issue.
When i retrieve the work item with your above code and concatenate it to the end of my url like below:
l_v_url = 'http://ddadb409.ctr.globedev.ddc:8002/sap/bc/webdynpro/webdynpro_prototype?WI_ID=lv_wiid'.
Where lv_wiid has the workitem id.
Then in the component i have used the same parameter WI_ID to the method handledefault of the window. Here when i check
WI_ID in the debug mode the value is blank.
Please let me know where i am going wrong.
Thank you for your patience,
Chaitanya.
Hi Pavan / Narin,
Thanks a lot for your inputs , need some assistance with one small issue.
When i retrieve the work item with your above code and concatenate it to the end of my url like below:
l_v_url = 'http://ddadb409.ctr.globedev.ddc:8002/sap/bc/webdynpro/webdynpro_prototype?WI_ID=lv_wiid'.
Where lv_wiid has the workitem id.
Then in the component i have used the same parameter WI_ID to the method handledefault of the window. Here when i check
WI_ID in the debug mode the value is blank.
Please let me know where i am going wrong.
Thank you for your patience,
Chaitanya.
Hi Narin/ Pavan,
Yes i did add use the parameter in the applications area of the component. This is the code in my task:
Please tell me where i am going wrong.
data: l_v_url type string,
l_wi_id type SWW_WIID.
DATA : lv_wi_object like SWOTOBJID,
lv_wiid like SWOTOBJID-OBJKEY.
CALL FUNCTION 'SWE_WI_GET_FROM_REQUESTER'
IMPORTING
REQUESTER_WORKITEM = lv_wi_object
REQUESTER_WORKITEMID = lv_wiid.
l_v_url = 'http://ddadb409.ctr.globedev.ddc:8002/sap/bc/webdynpro/glb/'&
'usability_prototype?WI_ID=lv_wiid'.
CALL METHOD cl_gui_frontend_services=>execute
EXPORTING
application = l_v_url
EXCEPTIONS
cntl_error = 1
error_no_gui = 2
bad_parameter = 3
file_not_found = 4
path_not_found = 5
file_extension_unknown = 6
WI_ID has been used in the handle default as well which is why it is very strange that there is no data in it. Even when i pass
a hard coded value to WI_ID it is still initial in the handle default method.
Thanks again for your inputs.
Regards,
Chaitanya.
Hi,
Do you mean that you want this application with out executing it from UWL(portal) ie Only from R/3?
If you have configured in VISU you need to Write code in any task.
If its from portal then no need of any such code. Just addid the element in the parameters Tab of application would fetch the value.
Regards
Narin
l_v_url = 'http://ddadb409.ctr.globedev.ddc:8002/sap/bc/webdynpro/glb/'&
'usability_prototype?WI_ID=lv_wiid'.
Is the usability_prototype is the application name? If so in its application have you added WI_ID as a parameter in parameters TAB?
if not, double click on the appliction, you woul get Properties Tab and Parameters Tab.
In Parameters Tab press F4 add WI_ID.
Regards
Narin
Hi,
Try putting in Importing Parameter of Execute method, the name of the Workitem.
Regards,
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
86 | |
10 | |
10 | |
9 | |
7 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.