cancel
Showing results for 
Search instead for 
Did you mean: 

Passing Workitem Id In URl

Former Member
0 Kudos

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.

Accepted Solutions (1)

Accepted Solutions (1)

bpawanchand
Active Contributor
0 Kudos

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.

Former Member
0 Kudos

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.

bpawanchand
Active Contributor
0 Kudos
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

Former Member
0 Kudos

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.

bpawanchand
Active Contributor
0 Kudos

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.

narin_nandivada3
Active Contributor
0 Kudos

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

Former Member
0 Kudos

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.

narin_nandivada3
Active Contributor
0 Kudos

Hi,

In WD Application parameters Tab have you added that WI_ID parameter? unless its added you will not get the value.

Regards

Narin

Former Member
0 Kudos

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.

narin_nandivada3
Active Contributor
0 Kudos

Hi,

Again same reply..... ok anyways

Have you added WI_ID in Webdynpro application parameters Tab?

Regards

Narin

Former Member
0 Kudos

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.

narin_nandivada3
Active Contributor
0 Kudos

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

Former Member
0 Kudos

Hi Narin,

Yes i do want it from R/3 only as of now which is why i am trying to pass the workitem id to the url in the above mentioned way.

Please let me know where i am going wrong.

Chaitanya.

bpawanchand
Active Contributor
0 Kudos

Did you try to make use of the memory ID concept, by using the EXPORT IMPORT statements, Try to export the workitem Id to a memeory ID and then try to import it in the Applcation and check..

narin_nandivada3
Active Contributor
0 Kudos

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

Former Member
0 Kudos

Dear Pavan/Narin,

Thanks a lot for your inputs. Problem solved it needed some workflow configuration. Keep the good work going.

Chaitanya.

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi,

Try putting in Importing Parameter of Execute method, the name of the Workitem.

Regards,