Trigger an workflow from webdynpro abap.
hai
gurus!
iam new to webdynpro.iam femilier with workflow . can anybody explain me with an clear example, how to trigger an workflow from webdynpro abap.
regards
rose
Hi Rose
<a href="https://www.sdn.sap.comhttp://www.sdn.sap.comhttp://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/webdynpro/using%20web%20dynpro%20java%20and%20web%20dynpro%20abap%20applications%20in%20universal%20work%20list.pdf">Click</a> Here, to know the step by step procedure of using Webdynpro in Workflows
Use SAP_WAPI_START_WORKFLOW RFC
Regards
Abhimanyu L
Message was edited by:
Abhimanyu Lagishetti
Similar Messages
-
Trigger MDM workflow from Webdynpro Java
Hi All,
After updating records in MDM, I want to trigger an MDM workflow from Webdynpro Java and pass those updated records to workflow. Any inputs on how to accomplish this. Workflow has already been developed using MSVISIO by the MDM team.
Thanks,
TomBy following steps, it is possible to integrate workflow (or any workflow designed in MDM) within portal:
1. UWL (Universal Worklist): The UWL gives users unified and centralized way to access their work and the relevant
information in the portal. It collects tasks and notifications from multiple provider systems. One can expose MDM
workflow functionality on Portal using UWL.
2. JAVA APIu2019s: MDM Java API consists of set of classes related to MDM workflows through which one can create an
application that provide the MDM workflow functionality and expose the application as an iView in the portal. -
Trigger a workflow from ABAP Webdynpro
My Scenario:
Step 1: When a user hits the SAVE button on the webdynpro form, check if that data is consistent only and trigger a message(I have a BAPI to handle this check).
Step 2: If the data is consistent, then trigger a workflow to send an alert to an agent along with the data user entered on the form.
Step 3: AGENT shall review the data(Same form from step 1 should appear here) and will have the option to SUBMIT / POST or REJECT. If SUBMITTED, data will be posted to R/3(I have a 2nd BAPI to handle this). If REJECTED, send an alert back to the USER who entered data in step 1.
I checked lots of threads from the forum, none gave me a complete idea. Can any one give me a good documentation to trigger workflow from webdynpro to handle my requirement.
I am new to webdynpro.
I checked this blogs & articles also...
/people/ginger.gatling/blog/2005/12/14/create-new-uis-for-existing-workflow-tasks-with-abap-web-dynpro-and-universal-worklist
http://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/user-interface-technology/wd%20java/wdjava%20archive/using%20web%20dynpro%20java%20and%20web%20dynpro%20abap%20applications%20in%20universal%20work%20list.pdf
Thanks a lot in advance.
Best Regards,
KiranHello Kiran,
I slightly misunderstood you requirement earlier. But if I am not wrong this time, here is what you need to do:
1) The Web dynpro form that you are creating is only for data entry purpose. But the agent who is going to review the data will need an access to this form. So this means that you need to save the content of this form to the database and provide a URL in the workflow workitem which the agent can use to open the web dynpro application with the form data on it.
2) To access the correct form, you need to save the form data in a Z-table with a GUID attached to it. Generate this GUID using GUID_CREATE function module. In the window controller of the Web dynpro component, there will be a handleDefault method where you can read the parameter'GUID' from the incoming request and use it to read the form data from the database to display the form.
3) You can use Object Oriented programming approach for creating Workflow. Check the following article to learn how to do that:
[http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/b0409e6c-d213-2d10-3cb6-c12d417626c1?quicklink=index&overridelayout=true]
4) Create a Z-class and use this class as object type in your workflow (instead of BOR object).
5) In the constructor of this class, pass a parameter GUID, which would be passed when you create an object of this class in the Web Dynpro forms "OnActionSave" method.
6) Create a method in this class which will do the task of calling the BAPI to save the Acct Document. This method will be used in a Background task in a workflow step (after the agent approves the workitem).
7) Create a method in the class which generates the URL to the webdynpro application with the GUID passed as parameter.
(for eg: http://urltoserver/appname?GUID='guidoftheform').
8) In your save method of WD application, call the method to raise event that triggers the workflow (using OO)
lv_guid = '04AE4546EED7101DE10000000A424026'. "use GUID_CREATE
lv_objtype = 'ZWFCLASS'. " create a Z-class of your own
TRY.
CALL METHOD cl_swf_evt_event=>raise
EXPORTING
im_objcateg = 'CL'
im_objtype = lv_objtype
im_event = 'FORM_APPROVE' " this event needs to be defined in ZWFCLASS
im_objkey = lv_guid.
CATCH: cx_swf_evt_exception.
ENDTRY.
Please read through the workflow using Object Oriented document in the URL that I have mentioned above before you read through these instructions.
There would be a way to do this using BOR objects, but this is the way that I have tried and tested to use trigger workflows from Web dynpro applications.
Best Regards,
Gaurav
Edited by: Gaurav Salkar on Apr 6, 2010 6:13 PM -
Binding Structure/Internal Table to Workflow from Webdynpro
Hi Gurus,
I have to trigger workflow from WEBDYNPRO application. For now I have two ways they are:
1. Triggering WFLow using SAP_WAPI_START_WORKFLOW (Successfull):
How could I bind Structure/Internal Table (DDIC referred structure) to workflow directly. Presently I am mapping indvidual fields which makes my code complex using FM SAP_WAPI_START_WORKFLOW.
2. Triggering WFLow using SAP_WAPI_CREATE_EVENT (Bindind issues):
Also When I try to submit using BOR event with SAP_WAPI_CREATE_EVENT workflow triggers successfully But I cannot able to bind the values. So are there any specific configuration need to be made.( like making task as General while triggering workflow using SAP_WAPI_START_WORKFLOW).
<<text removed>>
Edited by: Matt on Aug 5, 2011 7:49 PMHi
Please make use of the below code
INCLUDE cntn01_swc.
DATA lt_kna1 TYPE TABLE OF kna1.
DATA lt_cont TYPE TABLE OF swcont.
DATA lv_wiid TYPE sww_wiid.
swc0_create_container lt_cont.
SELECT * FROM kna1 INTO TABLE lt_kna1 UP TO 10 ROWS.
swc0_set_table lt_cont 'CUST' lt_kna1.
CALL FUNCTION 'SWW_WI_START'
EXPORTING
creator = sy-uname
task = 'WSXXXXXXXX'
do_commit = 'X'
IMPORTING
wi_id = lv_wiid
TABLES
wi_container = lt_cont
EXCEPTIONS
id_not_created = 1
read_failed = 2
immediate_start_not_possible = 3
execution_failed = 4
invalid_status = 5
OTHERS = 6.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
The other way to do is you can also make use of OO ABAP classes to trigger the workflow. If you want to create a rfc function module then create a wrapper function module .
SAP_WAPI_START_WORKFLOW cannot transfer structures or tables which are more thatn 255 characters. So the work around is either make use of OO container or SWCONT container.
The above code snippet should be included in the assistance class of the webdynpro application and you need to include the define the include cntn01_swc in the class local types under macros.
and then you create a method ....... and include the above code in that method. excluding the include statement.
Regards
Pavan -
Kicking off workflow from webdynpro using events?
I have abap experience but no workflow. Any advice will be appreciated.
I have to kick off a workflow from webdynpro. I assume that I have to set up a business object (eg. ZOBJECT), create an event therein (eg. ZEVENT).
Then when webdynpro runs I use a rfc function module to trigger this event.
The questions I have are:
1. How do I set up the workflow to be triggered by this event?
2. Do I set up an event in Business object builder or in SM62?
3. How do I trigger an event in a function module. I have found SWE_EVENT_CREATE but don't want to create an event just want to trigger the event and in turn set off the workflow?
Thank you,
Warren.try this below parameters are passed or not
CALL FUNCTION 'SAP_WAPI_CREATE_EVENT'
EXPORTING
object_type = 'BUS2105'
object_key = lv_objkey
event = 'CREATED'
commit_work = 'X'
event_language = sy-langu
language = sy-langu
user = sy-uname. -
How to trigger the workflow from the excel sheet
hello friends,
my problem is that i should trigger the workflow from a excel sheet which contains a list of appraisers and appraisees.how to do this. can anyone help on this.
thanks.Hi Murthy,
If you are asking if a workflow can be started on R/3 while in Excel - may be possible if you can develop some fancy macros that can make RFC calls to an ABAP function module. I won't even attempt to travel that route.
Save the excel sheet as CSV or Tab delimited file and process it using ABAP. You can use the WAPI function module SAP_WAPI_CREATE_EVENT (Rel 4.7)to start the Workflow by raising the relevant event. In earlier releases, see FM SWE_EVENT_CREATE.
Please do keep in mind there could be performance and response time issues for dialog users of the system if you are going to start several workflows using a report program.
Cheers,
Ramki. -
How to trigger the workflow from RFC
Hi,
I need to trigger a workflow from a RFC.How can I call the event and start my workflow?
How can i do this?
please advice.
Thanks,
AnandHello Anand,
Goto swetypv transaction.Mention the abap class/bor object with the corresponding event.
In the receiver type, just mention some unique name.In the receiver function module mention the async RFC.
Mention the SENDER TYPE SIBFLPORB Local Persistent Object Reference - BOR Compatible
EVENT TYPE SIBFEVENT Event
RECTYPE TYPE SWFERECTYP Name of Receiver Type
HANDLER TYPE SIBFLPORB Local Persistent Object Reference - BOR Compatible
EXCEPTIONS_ALLOWED TYPE SWEFLAGS-EXC_OK SPACE Checkbox
XML_SIZE TYPE SWF_XMLSIZ Size in Bytes
EVENT_CONTAINER TYPE SWF_XMLCNT Container as XML Stream of Fixed Width
So that the guid can be used inorder to identify the instance.
you can use : "sap_wapi_start_workflow" fn module.
Hope this helps.
Best Regards,
Saujanya -
Initiate Workflow within WebDynpro ABAP
Hi,
Can anyone list the steps to be followed in creating a new workflow and initiating the workflow from WebDynpro for ABAP ?
Regards
RavikumarCheck this elearning for creating a workflow,
[Tutorial 1|https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/e0bbdb3c-d640-2a10-d3b2-e4d9b90536a6]
[Tutorial 2|https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/30488d68-8451-2a10-d993-bb36e56a1dc8]
For calling a workflow from webdynpro, chek this thread
[how to call workflow from webdynpro ?]
For questions purely related to workflow, please post your queries in the Workflow forum
Hope it helps!
Regards,
Radhika.
Edited by: Radhika Vadher on May 23, 2009 11:40 AM -
Trigger MDM Workflow Using MDM ABAP API
Hi ,
I have requriment to trigger MDM Workflow from ABAP , Please suggest how to do it ?'
Thanks in Advance.
Shyam.Hi,
Are you creating material in MDM using Data Manager or Portal. or Using ABAP API.
If your workflow trigger Action is "Record Create" then it should trigger workflow as soon as new material is created. I don't see any problem in this.
Regards,
Shiv -
Debugging is not working in R/3 from WebDynpro-ABAP developed webpage input
Dear Friends,
We are facing a serious problem for debugging. Expecting valuable input for the same.
Debugging is not working in R/3 from WebDynpro-ABAP developed webpage input in Production Server.
The debugging (for WebDynpro-ABAP application) is working in Dev. Server for
1st ] Within R/3
Ex. debug for bapi within R/3. i.e. value enter as input in R/3 only.
2nd ] From webpage to R/3
Ex. Some input given on the internet web page developed through WebDynpro and external breakpoint set in R/3 it works. It directs to R/3 code through debugging.
In Prod. Server the 1st case above is working but the 2nd case is not working.
In Prod. Server the WebDynpro developed applications are running successfully through internet explorer webpage inputs. So running the application is not a problem in prod. Server but debugging of the same is the problem.
The setting which are done in Prod. server are,
1] RZ10 in parameters are set for port and host name.
2.1] In SMICM check for ICM.
2.2] Host file updated in Windows-System 32.
3] In SICF following services are active,
3.1] default_host/sap/bc/webdynpro
3.2] default_host/sap/public/bc
3.3] default_host/sap/public/bc/webdynpro/viewdesigner
3.4] default_host/sap/bc/wdvd
3.5] default_host/sap/public/icman
3.6] default_host/sap/bc/gui/sap/its/webgui
3.7] default_host/sap/public/ping
3.8] default_host/sap/bc/error
3.9] default_host/sap/bc/echo
4] In SE80
4.1] Internet services-System-are published
4.2] Internet services-WEBGUI-are published
4.3] Utilities-Setting-ABAP Editor-Debugging-Username & New Debugger set.
4.4] Utilities-Setting-ABAP Editor-Editor-Front-End Editor(New) set.
5] In Su01 for user profiles sap_all & sap_new is assigned and role SAP_BC_WEBSERVICE_DEBUGGER is assigned.
6] The support packages are also updated to latest level.
7] Gone through following links but not getting any clues.
http://help.sap.com/saphelp_nw70ehp1/helpdata/en/48/74d50bd1431b5ae10000000a42189c/frameset.htm
http://help.sap.com/saphelp_nw04s/helpdata/EN/77/3545415ea6f523e10000000a155106/frameset.htm
Thanks in Advance.
Best Regards,
Abhijit.No cross posting
Read the "Rules of Engagament"
Regards
Juan -
Error when Interative Adobe Form is called from Webdynpro ABAP.
Hi Experts,
I trying to call a Interactive adobe form from ABAP Webdynpro application but I am facing the below error.
Line: -
The following error text was processed in the system GJD : User session (HTTP/SMTP/..) closed after timeout
The error occurred on the application server az18u021_GJD_01 and in the work process 0 .
The termination type was: ERROR_MESSAGE_STATE
The ABAP call stack was:
Method: PREPROCESS_REQUEST of program CL_WDR_CLIENT_ABSTRACT_HTTP===CP
Method: IF_HTTP_EXTENSION~HANDLE_REQUEST of program CL_WDR_MAIN_TASK==============CP
Method: EXECUTE_REQUEST_FROM_MEMORY of program CL_HTTP_SERVER================CP
Function: HTTP_DISPATCH_REQUEST of program SAPLHTTP_RUNTIME
Module: %_HTTP_START of program SAPMHTTP
Line: -
When I uncheck the enabled property of the Interactive From in the Page of the WebDynpro I am able to execute the application successfully.But the Adobe form behaves as a Static Form when I uncheck the enabled property.
So kindly provide your valuable suggestions to avoid the above error when I am calling a Interactive adobe form from Webdynpro ABAP.
Thanks in Advance.
Regards,
Arun.Hello,
Hello, are you sure you have your ADS credentials configured correctly and valid? I guess you know that is the only difference between clicking enabled on true or false. If you are not sure, you can use SE38, search for FP_* and pick some reports to check the licencing. The names of the reports are good enough to recognize the right one.
Or maybe that is a security problem? Have you checked the ADS_ERROR string? Did you use the ADS trace?
check: http://help.sap.com/saphelp_nw70/helpdata/en/2c/241a427ff6db2ce10000000a1550b0/content.htm
and especially note 999998
Regards, Otto -
Calling a webservice from webdynpro ABAP.
Hi,
Anybody have doc/material with screenshots on calling a webservice from webdynpro ABAP (In WAS 7.0 version using service calls ) with clear steps ?
Thanks in advance. Ponts will not be a constraint for right answers
Praveen
Edited by: Praveen kumar Kadi on Feb 23, 2009 11:19 AMHi Praveen,
1st Step : configure Logical Port
http://help.sap.com/saphelp_nw70/helpdata/EN/16/285d32996b25428dc2eedf2b0eadd8/frameset.htm
2nd Step : Generate Proxy Object
http://help.sap.com/saphelp_nw70/helpdata/EN/16/285d32996b25428dc2eedf2b0eadd8/frameset.htm
3rd Step : Instantiating the proxy object & calling the methods exposed by webservice
data: sys_exception type ref to cx_ai_system_fault,
sys_exception2 type ref to cx_ai_application_fault,
client_proxy type ref to zco_myesa, "MY PROXY CLASS
lv_ret_code type int4,
lv_input type zsend_email_input,
lv_response type zsend_email_response.
data: lv_from type string,
lv_from_address type string,
lv_to type string,
lv_to_address type string,
lv_subject type string,
lv_msg type string.
lv_input-from = 'MYSAPTEST'.
lv_input-from_address = '<someAddress>'.
lv_input-to = 'Prashant'.
lv_input-to_address = '<someAddress>'.
lv_input-subject = ' TEST'.
lv_input-msg_body = ' Hi this is wonderfull to see it work'.
try.
create object client_proxy
exporting
logical_port_name = 'BASIC'. " Basic is a TYPE G RFC Destination
call method client_proxy->send_email
exporting
input = lv_input
importing
output = lv_response .
catch cx_ai_system_fault into sys_exception .
data lv_err type string.
lv_err = sys_exception->if_message~get_text( ).
write: / lv_err.
catch cx_ai_application_fault into sys_exception2 .
lv_err = sys_exception->if_message~get_text( ).
write: / lv_err.
endtry.
if lv_response is initial.
write: /'Not Executed'.
else.
write: /'Did Execute'.
endif.
Greetings
Prashant -
Calling Webdynpro Java Application from Webdynpro ABAP Application.
Hi,
We have developed one Application using Webdynpro Java and I m in need to call the Webdynpro Java application from Webdynpro ABAP.
Require Suggestions to acheive this.
Thanks In advance.
Reg,
Ajay.Dear Ajay,
Assuming that both your applications WDA & WDJ are in the portal & you don't have to pass any parameters to the WDJ application.
Write the following code on the action where you would call the WDJ application.
DATA:
lr_compcontroller TYPE REF TO ig_componentcontroller,
l_component TYPE REF TO if_wd_component ,
lr_port_manager TYPE REF TO if_wd_portal_integration ,
wa_navigation TYPE navigation.
lr_compcontroller = wd_this->get_componentcontroller_ctr( ).
l_component = lr_compcontroller->wd_get_api( ).
lr_port_manager = l_component->get_portal_manager( ) .
* The value inserted into the navigation-target field can be found in the Portal
* content administration tab of your portal. It is the ID or PCD Location field
wa_navigation-target = pcd. " Please provide the PCD Location of the WDJ Application here.
wa_navigation-mode = '0'. "0 = INTERNAL(same page) and 1 = EXTERNAL(new page).
CALL METHOD lr_port_manager->navigate_absolute
EXPORTING
navigation_target = wa_navigation-target
navigation_mode = wa_navigation-mode.
You can get the PCD from the Page properties of the WDJ application page in the Portal.
Hope it helps!
Warm regards,
Upendra Agrawal -
HOW TO TRIGGER AN WORKFLOW FROM A PROGRAM ?
HELLO THERE ,
CAN ANYBODY PLZ TELL ME HOW TO TRIGGER AN WORKFLOW FROM AN PROGRAM AND TO PAS THE VALUE TO THE CONTAINER ?Hello Neon,
If you want to trigger the workflow directly, use the FM, SWU_START_WORKFLOW
CALL FUNCTION 'SWU_START_WORKFLOW'
EXPORTING
task =
* LANGUAGE = SY-LANGU
user =
* SENDER_ID =
* IMPORTING
* RETURN_CODE =
* WORKITEM_ID =
tables
* CONTAINER =
* MESSAGE_LINES =
attachment_list =
A workflow can also be triggered by and event which is in turn triggered by a program.
By the FM, SWE_CREATE_EVENT
Example:
w_key = 'Connie'.
w_creator-otype = 'US'.
w_creator-objid = 'SAPDEV02'.
CALL FUNCTION 'SWE_EVENT_CREATE'
EXPORTING
objtype = 'YH_BUDDIES'
objkey = w_key
event = 'event'
creator = w_creator
* TAKE_WORKITEM_REQUESTER = ' '
* START_WITH_DELAY = ' '
* START_RECFB_SYNCHRON = ' '
* NO_COMMIT_FOR_QUEUE = ' '
* DEBUG_FLAG = ' '
* NO_LOGGING = ' '
* IDENT =
* IMPORTING
* EVENT_ID =
* TABLES
* EVENT_CONTAINER =
EXCEPTIONS
objtype_not_found = 1
OTHERS = 2
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ELSE.
WRITE: / 'EVENT TRIGGERED'.
ENDIF.
COMMIT WORK.
Hope it helps you.
Regards
Indu. -
Calling Java code from Webdynpro Abap UI
Hi All,
Can anybody tell me, How to make calls to java code on a button click from webdynpro ABAP UI ?
Thanks in Advance.
Jenish .V. JoyHi Jenish,
As I am new to WebDynpro for ABAP I could not help you out exactly.But See this link which will help you to create applications in WebDynpro by using ABAP language.
https://www.sdn.sap.com/irj/sdn/developerareas/abap?
rid=/library/uuid/02e1fa45-0801-0010-10a0-f1cf47e8c943
If you get any answer for your question let me know.
Regards,
Karthick K Eswaran
Maybe you are looking for
-
How to include ehp4 into ecc60 upgrade
Hi , I have a question about EHP4 and upgrade. I have SAP R/3 4.7 win/sql 64bit and i want to include EHP4 into the upgrade. I have downloaded EHP4 stack from MOPZ . Is during the prepare that sap ask me to include EHP4 : so if i answer yes what will
-
Novatel u720 sprint broad band card
Hi I bought a u720 broad band card by sprint . I tried but cant get it to work with my mac book pro.I need help to get to broad band.
-
When will the new camera raw update come out for my nikon d7100
when will the new camera raw update come out for my nikon d7100
-
WRT160N: Wireless Works Great, Wired is Slow
I replaced my old Linksys 8-port router with a wireless WRT160N so that my iPhone would have Wi-Fi in the house. (AT&T network isn't great where I live.) My iPhone screams now, great connectivity. But, my two desktops which are connected directly t
-
Flash CS3, Captivate 4 Single File SWF output- playback problems
Hello, I am trying to upload a swf file that I created to a website. I am doing this because that it the only format the site editor will allow me to do. I tried following the steps in the tutorial on how to embed a swf into a pdf. (http://www.adobe