Vous êtes sur la page 1sur 6

7/9/2015

HowtotriggerworkflowfromWDAandreadworkf...|SCN

GettingStarted Newsletters

Hi,Guest

LogOn

JoinUs

Store

SearchtheCommunity

Products

Services&Support

AboutSCN

Downloads

Industries

Training&Education

Partnership

DeveloperCenter

Activity

LinesofBusiness

UniversityAlliances

Events&Webinars

Innovation

Browse

Communications

Actions

10Replies Latestreply:Jun4,20114:24AMbyPavanBhamidipati

Tweet

TranVanDuc

Jun2,20113:06PM

HowtotriggerworkflowfromWDAandread
workflowcontainerintoWDAscreen
ThisquestionhasbeenAnswered.
DearExpert,

Pleasesuggestthesolutionforthefollowingrequirement:

1.Create1leaverequestfromWDAandsubmitforapproval
2.WhenUserpress"submit"buttoninWDAscreen,workflowwillbetriggeredforprocessing
approval.
3.When1requestissenttoapprover,helogonintoportalandaccesstoUWLtoprocesstask
himself.
4.Afterhepressapprovallink,thesystemwillcallWDAscreentoprocessapproval(thisscreenwill
containfullinformationofrequester.)
5.Afterfinishingprocess,theresultwillreturnworkflowandendofprocess.

Pleasesendsimpleexampleforstep1andoneforgetdatafromworkflowintoWDAscreenat
step4

Anyhelpwouldbeappreciated

Thanksandbestregards,
DucTV.

CorrectAnswer
bySanjayPalonJun3,201111:20AM
Hi,

PleasecheckvaluesoftablesMESSAGE_LINESandMESSAGE_STRUCTafterexecutionofthe
FMSAP_WAPI_START_WORKFLOWindebugmode.Youcanfindtherootcauseoftheissue.

Ifthevaluesoftheinputcontainerisnotpassingtoworkflowpleasecheckthetypesofthe
workflowcontainerelemets.
Ifthedatatypesaremismatchthenvalueswillnotbetransferred.Generallyworkfklowcontainer
elementshouldbecharectertype.

Thanksandregards,
SNJY

HelpfulAnswersbySanjayPal,SanjayPal,PavanBhamidipati

1857Views

AverageUserRating
(0ratings)

https://scn.sap.com/thread/1967152

1/6

7/9/2015

HowtotriggerworkflowfromWDAandreadworkf...|SCN
SanjayPal Jun2,20114:35PM (inresponsetoTranVanDuc)
Re:HowtotriggerworkflowfromWDAandreadworkflowcontainerintoWDAscreen

Hi,

'SUBMIT'buttonislinkedwithaactionmenthod.
WritethecodetotriggertheworkflowbyusingFMSAP_WAPI_START_WORKFLOW.
YougetworkitemidfromthisFM.

Youmustpasstheapproveridastheworkflowcontainerelement.
Withintheworkflowcreateataskandsendittoworkflow.

NowrequesttoPortalteamtochangetheXMLcodewithWDAappilcationandtheTasknumber
accordinglysothatthiscanbeavaliableinUWL.AlsomakechangesintcodeSWFVISU.

NowwhentheapproerclickthelinkWDAwillbelauched.
Iftheapproverclicksonthe"Approve"bittion...
WritethecodewithintheactionmethodtocompletetheworkflowbyusingFM
SAP_WAPI_WORKITEM_COMPLETE.

YoucanalsoreadthecontainerusingFMSAP_WAPI_READ_CONTAINER.

CALLFUNCTION'SAP_WAPI_READ_CONTAINER'
EXPORTING
WORKITEM_ID=P_WIID
TABLES
SIMPLE_CONTAINER=LT_CONTAINER.
Thanksandregards,
SNJY

Editedby:Sanju.palonJun2,20118:02PM

Like(0)

TranVanDuc Jun2,20115:25PM (inresponsetoSanjayPal)

Re:HowtotriggerworkflowfromWDAandreadworkflowcontainerintoWDAscreen
DearSanju,
Thankyouverymuchforyourquickresponse,
Iamdeveloping2programs,oneforsubmittingleaverequestandoneforapproval.Please
helpmeanswerthefollowingquestions:
1.RelatedtoFMCALLFUNCTION'SAP_WAPI_READ_CONTAINER'
EXPORTING
WORKITEM_ID=P_WIID
TABLES
SIMPLE_CONTAINER=LT_CONTAINER.

Inthiscase,willinternaltableLT_CONTAINERcontainworkflowcontainerortask
container?

2.ShouldIuse'UserDecision'inWFtosubmitrequesttoUWLornot?

3.workitemidwillbedifferencewhenWFislaunched,right?

Pleaseadvise...

Thanksandbestregards,
DucTV

Like(0)

RickBakker Jun3,201112:29AM (inresponsetoTranVanDuc)

Re:HowtotriggerworkflowfromWDAandreadworkflowcontainerintoWDAscreen
Hello,

1."Inthiscase,willinternaltableLT_CONTAINERcontainworkflowcontainerortask
container?"
Itwillcontainthecontainerassociatedwiththeworkitemid.Ifit'stheworkitemidofatask,
yougetthecontainerofthetask.

2."ShouldIuse'UserDecision'inWFtosubmitrequesttoUWLornot?"

https://scn.sap.com/thread/1967152

2/6

7/9/2015

HowtotriggerworkflowfromWDAandreadworkf...|SCN
Yes.

3."workitemidwillbedifferencewhenWFislaunched,right?"
Differentfromwhat?

regards
RickBakker
hanabitechnology

Like(0)

PavanBhamidipati Jun3,20114:03AM (inresponsetoTranVanDuc)

Re:HowtotriggerworkflowfromWDAandreadworkflowcontainerintoWDAscreen
Hi,

IamnotsureforwhatreasonsyouaredevelopingaapplicationbutSAPhasitsown
standardworkflowprocessforapplyingleavefromESSportal..

1.ASsoonasyouclickonthesubmitbuttonoftheapplicaitonthenyouneedtotriggera
workflowrightinthatcaseyoumakesurethatyouneedtopasssomedatatotheworkflow
containerIhopeyoumightbeusingeitherSAP_WAPI_CREATE_EVENTor
SAP_WAPI_START_WORKFLOWtostarttheworkflowinboththefunctionmoduleyou
havetofillthistableinOrdertopassthevaluesfromABAPprogramtoworkflowcontainer.

TheanswertoyourquestionisitdependsonthetypeoftheworkitemIDyouarepassing
totheSAP_WAPI_READ_CONTAINERifyouarepassingatopworkitemIDthenyouwill
haveworkflowcontainerinLT_CONTAINERifyouarepassinganyofthechildordependent
workitemidsofthetopworkitemidthenyouhavethatrespectivetaskcontainervalue.

2.Youcanmakeuseoftheanyforegroundactivityoradecisionstep,itdependsonhow
youwanttogetbacktheresult,ifyouuseaforegroundactivitysteptheninthatcaseyou
havetopopulatetheresultbacktothetaskcontainerandifletsayyouareusingadecision
steptheninthatcaseyoudonothavetopopulatetheresulttherewillbestandardcontainer
element_RESULTinthedecisionstepitwillbefilled.

MakesureifyouareexpectingsomeworkiteminUWLandassoonasyouclickonthework
itemyourapplicationshouldopenthenconfigureinSWFVISUtransactionandmaintainDTD
inUWLanyportalconsultantcanperformthisstepsinfewseconds.

3.Whentheworkflowisstartedthentheworkitemwhichyouareabletogetbackistheone
whichhelpstoidentifydependentworkitemidsitistheTOPorPARENTworkitemID.

Regards

Pavan

Like(0)

TranVanDuc Jun3,20118:26AM (inresponsetoPavanBhamidipati)

Re:HowtotriggerworkflowfromWDAandreadworkflowcontainerinto
WDAscreen
DearPavanandRick,

Thankverymuchforyoursupport,

Currently,Ihavecreated1simpleWFwith1Userdecision(standardtaskTS#8267),1
activitytoupdateintoZtablewhenrequestapprovedand1emailwillbesentfor
employeewhenhisrequestisrejected.inWF,Ihavedefined1workflowcontainer
includingelements:employeenumber,startabsencedate,Endabsencedate,reason.
IamusingFM'SWW_WI_START_SIMPLE'withtotriggerWF,andWFhastriggered
afterIpressed'Submit'buttoninWEBDYNPROABAPscreen.However,AlthoughI

https://scn.sap.com/thread/1967152

3/6

7/9/2015

HowtotriggerworkflowfromWDAandreadworkf...|SCN
havefilleddataintocontainerwhilestartingFM,butItstillisn'tpasseditinto
workflowcontainer.
IneedthisdatatowhenWebDynproABAPiscalledfromUWL,itwillpassapproval
informationintoWebDynProABAPscreentoprocessingapproval.
(P/s:IusedFMSAP_WAPI_START_WORKFLOWbutithasnotstartedWF.)
FMdetails:
TASK='WS80000254'.
CALLFUNCTION'SWW_WI_START_SIMPLE'
EXPORTING
TASK=TASK
IMPORTING
WI_ID=LV_WORKITEM_ID
TABLES
AGENTS=SWHACTOR
WI_CONTAINER=it_inputcontainer
.

Pleaseadvise...Anyhelpwouldbeappreciated!

ThanksandBestregards,
DucTV.

Editedby:DucTV1onJun3,20118:26AM

Like(0)

SanjayPal Jun3,20118:32AM (inresponsetoTranVanDuc)

HelpfulAnswer Re:HowtotriggerworkflowfromWDAandreadworkflow
containerintoWDAscreen
Hi,

ifyouareusingSAP_WAPI_START_WORKFLOWtostartworkflowthenWokflow
templatemustbe"Generaltask"

Thanksandregards,
SNJY

Like(0)

TranVanDuc Jun3,201110:49AM (inresponsetoSanjayPal)

Re:HowtotriggerworkflowfromWDAandreadworkflowcontainerinto
WDAscreen
DearSanju,

Thanksforyourresponse,

Ihavechangedmyworkflowtemplateintogeneratetask,butcontainercould
notpassintoWF.

Pleaseadvise...

Bestregards,
DucTV

Like(0)

SanjayPal Jun3,201111:20AM (inresponsetoTranVanDuc)

CorrectAnswer Re:HowtotriggerworkflowfromWDAandread
workflowcontainerintoWDAscreen
Hi,

PleasecheckvaluesoftablesMESSAGE_LINESand
MESSAGE_STRUCTafterexecutionoftheFM
SAP_WAPI_START_WORKFLOWindebugmode.Youcanfindtheroot
causeoftheissue.

https://scn.sap.com/thread/1967152

4/6

7/9/2015

HowtotriggerworkflowfromWDAandreadworkf...|SCN

Ifthevaluesoftheinputcontainerisnotpassingtoworkflowplease
checkthetypesoftheworkflowcontainerelemets.
Ifthedatatypesaremismatchthenvalueswillnotbetransferred.
Generallyworkfklowcontainerelementshouldbecharectertype.

Thanksandregards,
SNJY

Like(0)

PavanBhamidipati Jun4,20114:24AM (inresponsetoTranVanDuc)

HelpfulAnswer Re:HowtotriggerworkflowfromWDAandreadworkflow
containerintoWDAscreen
Hi,

Makesurethatthecontainerelementnamesaresameasdefinedintheworkflow
containerotherwisetheywontbesetintheworkflowcontainer..

Regards
Pavan

Like(0)

SanjayPal Jun3,20118:05AM (inresponsetoTranVanDuc)

HelpfulAnswer Re:HowtotriggerworkflowfromWDAandreadworkflowcontainerinto
WDAscreen
Hi,

1.Inthiscase,willinternaltableLT_CONTAINERcontainworkflowcontainerortask
container?

Thisshouldbetheworkflowcontainer.

2.ShouldIuse'UserDecision'inWFtosubmitrequesttoUWLornot?

AsyouareusingtheWDA,thenpleasedonotusetheDecisionstepinworkflow.Createa
dummymethodanduseitinthetaskjusttodisplaythelinkintheUWL.Whenevertheuser
clicksonthe"Approve"buttionporperWDAwillbelaunchedandyouneedtocomoplethe
dummystep.

3.workitemidwillbedifferencewhenWFislaunched,right?
Asyouhavethemotherworkflowidformthe"SAP_WAPI_START_WORKFLOW"theyou
caneasilyfintheitsdependentworkitembyFMSWI_GET_DEPENDENT_WORKITEMS
whichisdialogtype.thencompletetheworkitem.

Samplecode:
*GetthecorrespondingworkitemIDofApprovalrequestTASK
CALLFUNCTION'SWI_GET_DEPENDENT_WORKITEMS'
EXPORTING
WI_ID=P_HISTORYWORKITEM
TABLES
DEPENDENT_WIS=LT_DEPENDANT_WI.
LOOPATLT_DEPENDANT_WIINTOLS_DEPENDANT_WIWHEREWI_TYPE='W'.
IFLS_DEPENDANT_WIWI_STATNEC_COMPLETED.
P_WIID=LS_DEPENDANT_WIWI_ID.
EXIT.
ENDIF.
ENDLOOP.

Thanksandregards,
SNJY

Like(0)

https://scn.sap.com/thread/1967152

5/6

7/9/2015

HowtotriggerworkflowfromWDAandreadworkf...|SCN
0

SiteIndex
Privacy

Tweet

ContactUs
TermsofUse

https://scn.sap.com/thread/1967152

SAPHelpPortal
LegalDisclosure

Copyright

FollowSCN

6/6