Try dis code\\n\\n\\n INCLUDE .\\n\\n DATA : WI_ID LIKE SWWVPUBLIC-WI_ID,\\n OBJKEY LIKE SWEINSTCOU-OBJKEY,\\n OBJECT TYPE SWC_OBJECT.\\n DATA : L_CREATOR LIKE SWWWIHEAD-WI_CREATOR.\\n DATA : IT_SWHACTOR TYPE STANDARD TABLE OF SWHACTOR.\\n DATA : WA_SWHACTOR LIKE LINE OF IT_SWHACTOR.\\n DATA : IT_SWWWIHEAD TYPE STANDARD TABLE OF SWWWIHEAD.\\n DATA : WA_SWWWIHEAD LIKE LINE OF IT_SWWWIHEAD,\\n WI_CONTAINER LIKE SWCONT OCCURS 0 WITH HEADER LINE,\\n WI_AGENT LIKE SWHACTOR OCCURS 0 WITH HEADER LINE,\\n AGENTS LIKE SWHACTOR OCCURS 0 WITH HEADER LINE.\\n\\n\\n L_CREATOR = sy-uname.\\n\\n SWC_SET_ELEMENT WI_CONTAINER 'C_USER' L_CREATOR.\\n\\n CALL FUNCTION 'SWW_WI_START_SIMPLE'\\n EXPORTING\\n CREATOR = L_CREATOR\\n TASK = 'WS86500062'\\n IMPORTING\\n WI_ID = WI_ID\\n TABLES\\n AGENTS = AGENTS\\n WI_CONTAINER = WI_CONTAINER.\\n\\nThis Code will Directly trigger Workflow.. Not through Any event.. Follow previous msges for Event triggering..\\n\\nRegards Dev\\n\\nEdited by: Dev on Aug 7, 2008 3:49 AM\",\"author\":\"username\":\"former.member\",\"displayName\":\"Former Member\",\"groupIcons\":[],\"suspended\":true,\"isCurrentUser\":false,\"parentAuthor\":\"username\":\"former.member\",\"displayName\":\"Former Member\",\"groupIcons\":[],\"suspended\":true,\"isCurrentUser\":false,\"id\":4559215,\"creationDate\":1218095246000,\"activeRevisionId\":6349948,\"lastActivity\":1218095425000,\"parentId\":4556811,\"originalParentId\":4555937,\"likeCount\":0,\"visibility\":\"full\",\"depth\":0,\"attachments\":[],\"canVoteUpOrCancel\":false,\"relations\":\"canReport\":false,\"visibility\":\"full\",\"canEdit\":false,\"canUseDelete\":false,\"isLiked\":false,\"type\":\"comment\",\"canVoteUpOrCancel\":false,\"canConvertToAnswer\":false,\"canBeModerated\":false,\"canViewRevisions\":false,\"showInReply\":false,\"reported\":false,\"canCancelReport\":false,\"canDelete\":false,\"canVoteDownOrCancel\":false,\"canComment\":false,\"canViewReports\":false,\"isCurrentUserAuthor\":false,\"liked\":false,\"moderatorComment\":false}]}}"); const simplifiedQuestionView = JSON.parse("true"); (function() window.pageContext = mergeDeep(pageContext, question: id: 4555937, plug: "how-to-call-the-workflow-from-program", votes: 0, questionTitle: "How to call the workflow from program", isClosed: false, isLocked: false, isRedirected: false, redirectedFromTitle: "", redirectedFromId: "", closedStatusData: JSON.parse(""), userVoted: false, relations: JSON.parse("\"canClose\":false,\"canUnredirect\":false,\"canReport\":false,\"visibility\":\"full\",\"canEdit\":false,\"canUseDelete\":false,\"canReopen\":false,\"type\":\"question\",\"canVoteUpOrCancel\":false,\"canViewRevisions\":true,\"canUnlock\":false,\"reported\":false,\"canVoteDownOrCancel\":false,\"canLock\":false,\"canCancelReport\":false,\"canComment\":true,\"isCurrentUserAuthor\":false,\"canViewReports\":false"), isQuestionAccepted: false , childToViewInfo: id: "" , comments: JSON.parse("\"4556811\":\"rootParentId\":4556811,\"commentsCount\":1,\"comments\":[\"body\":\"Try dis code\\n\\n\\n INCLUDE .\\n\\n DATA : WI_ID LIKE SWWVPUBLIC-WI_ID,\\n OBJKEY LIKE SWEINSTCOU-OBJKEY,\\n OBJECT TYPE SWC_OBJECT.\\n DATA : L_CREATOR LIKE SWWWIHEAD-WI_CREATOR.\\n DATA : IT_SWHACTOR TYPE STANDARD TABLE OF SWHACTOR.\\n DATA : WA_SWHACTOR LIKE LINE OF IT_SWHACTOR.\\n DATA : IT_SWWWIHEAD TYPE STANDARD TABLE OF SWWWIHEAD.\\n DATA : WA_SWWWIHEAD LIKE LINE OF IT_SWWWIHEAD,\\n WI_CONTAINER LIKE SWCONT OCCURS 0 WITH HEADER LINE,\\n WI_AGENT LIKE SWHACTOR OCCURS 0 WITH HEADER LINE,\\n AGENTS LIKE SWHACTOR OCCURS 0 WITH HEADER LINE.\\n\\n\\n L_CREATOR = sy-uname.\\n\\n SWC_SET_ELEMENT WI_CONTAINER 'C_USER' L_CREATOR.\\n\\n CALL FUNCTION 'SWW_WI_START_SIMPLE'\\n EXPORTING\\n CREATOR = L_CREATOR\\n TASK = 'WS86500062'\\n IMPORTING\\n WI_ID = WI_ID\\n TABLES\\n AGENTS = AGENTS\\n WI_CONTAINER = WI_CONTAINER.\\n\\nThis Code will Directly trigger Workflow.. Not through Any event.. Follow previous msges for Event triggering..\\n\\nRegards Dev\\n\\nEdited by: Dev on Aug 7, 2008 3:49 AM\",\"author\":\"username\":\"former.member\",\"displayName\":\"Former Member\",\"groupIcons\":[],\"suspended\":true,\"isCurrentUser\":false,\"parentAuthor\":\"username\":\"former.member\",\"displayName\":\"Former Member\",\"groupIcons\":[],\"suspended\":true,\"isCurrentUser\":false,\"id\":4559215,\"creationDate\":1218095246000,\"activeRevisionId\":6349948,\"lastActivity\":1218095425000,\"parentId\":4556811,\"originalParentId\":4555937,\"likeCount\":0,\"visibility\":\"full\",\"depth\":0,\"attachments\":[],\"canVoteUpOrCancel\":false,\"relations\":\"canReport\":false,\"visibility\":\"full\",\"canEdit\":false,\"canUseDelete\":false,\"isLiked\":false,\"type\":\"comment\",\"canVoteUpOrCancel\":false,\"canConvertToAnswer\":false,\"canBeModerated\":false,\"canViewRevisions\":false,\"showInReply\":false,\"reported\":false,\"canCancelReport\":false,\"canDelete\":false,\"canVoteDownOrCancel\":false,\"canComment\":false,\"canViewReports\":false,\"isCurrentUserAuthor\":false,\"liked\":false,\"moderatorComment\":false]"), answerPager: answersCount: 6, page: 1, pageSize: 10, pageCount: 1, sort: "votes" , answers: JSON.parse("[\"body\":\"Hi,Use SAP_WAPI_START_WORKFLOW in conjunction with SAP_WAPI_CREATE_EVENT to trigger the workflow in ABAP.Hope this helpsvenu\",\"author\":\"username\":\"former.member\",\"displayName\":\"Former Member\",\"groupIcons\":[],\"suspended\":true,\"isCurrentUser\":false,\"id\":4556811,\"posted\":1218057582000,\"votes\":1,\"isAccepted\":false,\"isLocked\":false,\"userVoted\":\"\",\"relations\":\"score\":1,\"canCancelAccept\":false,\"canUnlock\":false,\"canUseDelete\":false,\"canVoteDownOrCancel\":false,\"canLock\":false,\"canAccept\":false,\"type\":\"answer\",\"canVoteUpOrCancel\":false,\"isCurrentUserAuthor\":false,\"attachments\":[],\"body\":\"Hi,\\n\\nYou have to trigger the Business Object and then it triggers the workflow.\\nUse SWE_EVENT_CREATE function module....\\nIn that Mention your Business object and also the Event for which the workflow should get triggered.\\nAnd make sure that you mention the same Business object and also the same event in the \\nHeader data (cap Icon in SWDD) --> Start Events.\\n[function module SWE_EVENT_CREATE,\"body\":\"Hi rohit,\\nINCLUDE . \\nshould be define in your code\\nthen you can call it from anywhere and you can also use it in BAPI.\\nAnd \\nCALL FUNCTION 'EWW_WORKFLOW_START'\\n EXPORTING\\n X_TASK = TASK\\n\\n X_START_DATE = NO_DATE\\n X_START_TIME = NO_TIME\\n\\n IMPORTING\\n Y_WORKFLOW_ID = Y_WORKFLOW_ID\\n TABLES\\n X_CONTAINER = LT_EVENT_CONTAINER\\n\\n X_AGENTS =\\n\\n EXCEPTIONS\\n INVALID_TASK = 1\\n NO_ACTIVE_PLVAR = 2\\n START_FAILED = 3\\n GENERAL_ERROR = 4\\n OTHERS = 5\\n .\\nevery time this will trigeer this returns a unique workitem id.\\nif you using web dynpro this will help to EP persons also!!\",\"author\":\"username\":\"former.member\",\"displayName\":\"Former Member\",\"groupIcons\":[],\"suspended\":true,\"isCurrentUser\":false,\"id\":4609359,\"posted\":1219060808000,\"votes\":0,\"isAccepted\":false,\"isLocked\":false,\"userVoted\":\"\",\"relations\":\"canCancelAccept\":false,\"canUnlock\":false,\"canUseDelete\":false,\"canVoteDownOrCancel\":false,\"canLock\":false,\"canAccept\":false,\"type\":\"answer\",\"canVoteUpOrCancel\":false,\"isCurrentUserAuthor\":false,\"attachments\":[],\"body\":\"Hi,Try the following code*DATA form TYPE swc_object.DATA: objtype LIKE swetypecou-objtype, event LIKE swetypecou-event, event_creator LIKE sweinstcou-recid, objkey LIKE sweinstcou-objkey, eventid LIKE swedumevid-evtid, number like SWXFORMABS-FORMNUMBER.DATA: event_container LIKE swcont OCCURS 0 WITH HEADER LINE.Create the request numberCALL FUNCTION 'SWX_FORMABS_CREATE' IMPORTING formnumber = number EXCEPTIONS form_not_created = 01 aborted = 02.CASE sy-subrc. WHEN 00. objkey = number. event = 'CREATED'. event_creator = sy-uname.Generate the event for the created request number CALL FUNCTION 'SWE_EVENT_CREATE' EXPORTING objtype = 'FORMABSENC' objkey = objkey event = event creator = crea start_with_delay = ' ' IMPORTING event_id = eventid TABLES event_container = event_container EXCEPTIONS objtype_not_found = 01. IF sy-subrc NE 0.raise no_event_created. ENDIF. COMMIT WORK. WHEN 01. WHEN 02.ENDCASE.Regards,Chandu\",\"author\":\"username\":\"former.member\",\"displayName\":\"Former Member\",\"groupIcons\":[],\"suspended\":true,\"isCurrentUser\":false,\"id\":4609698,\"posted\":1219063269000,\"votes\":0,\"isAccepted\":false,\"isLocked\":false,\"userVoted\":\"\",\"relations\":\"canCancelAccept\":false,\"canUnlock\":false,\"canUseDelete\":false,\"canVoteDownOrCancel\":false,\"canLock\":false,\"canAccept\":false,\"type\":\"answer\",\"canVoteUpOrCancel\":false,\"isCurrentUserAuthor\":false,\"attachments\":[],\"body\":\"Hi, \\n \\nAnother way (but fits only to this requirement) is to use Call Transaction from your program. \\n \\n\\nCALL TRANSACTION 'SWXF'.\\n \\n\",\"author\":\"username\":\"former.member\",\"displayName\":\"Former Member\",\"groupIcons\":[],\"suspended\":true,\"isCurrentUser\":false,\"id\":4610261,\"posted\":1219068080000,\"votes\":0,\"isAccepted\":false,\"isLocked\":false,\"userVoted\":\"\",\"relations\":\"canCancelAccept\":false,\"canUnlock\":false,\"canUseDelete\":false,\"canVoteDownOrCancel\":false,\"canLock\":false,\"canAccept\":false,\"type\":\"answer\",\"canVoteUpOrCancel\":false,\"isCurrentUserAuthor\":false,\"attachments\":[],\"body\":\"Hi rohit, \\n \\nTo trigger an event programmatically u have to create an event and a business object.This event should be triggered whenever a leave is applied. \\n \\nIn order to trigger an event programmatically, use function module 'SWE_EVENT_CREATE'. Also do not forget to use COMMIT WORK at the end of FM. \\n \\nIn order to test whether the event is getting triggered or not, use transaction SWELS. \\n \\nExample:- \\nREPORT ZDEMO_TRIGGER_EVENT.\\n\\nDATA: KEY LIKE SWEINSTCOU-OBJKEY.\\n\\nKEY = '1163'. u201C Material Number (hard-coded)\\n\\nCALL FUNCTION 'SWE_EVENT_CREATE'\\nEXPORTING\\nobjtype = 'BUS1001006'\\nobjkey = KEY\\nevent = 'CREATED'\\n* CREATOR = ' '\\n* TAKE_WORKITEM_REQUESTER = ' '\\n* START_WITH_DELAY = ' '\\n* START_RECFB_SYNCHRON = ' '\\n* NO_COMMIT_FOR_QUEUE = ' '\\n* DEBUG_FLAG = ' '\\n* NO_LOGGING = ' '\\n* IDENT =\\n* IMPORTING\\n* EVENT_ID =\\n* TABLES\\n* EVENT_CONTAINER =\\nEXCEPTIONS\\nOBJTYPE_NOT_FOUND = 1\\nOTHERS = 2\\n.\\nIF sy-subrc 0.\\nMESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO\\nWITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.\\nELSE.\\nWRITE 'Event Triggered'.\\nENDIF.\\n\\nCOMMIT WORK. \\n \\n \\nBest of luck, \\nBhumika\",\"author\":\"username\":\"former.member\",\"displayName\":\"Former Member\",\"groupIcons\":[],\"suspended\":true,\"isCurrentUser\":false,\"id\":4610719,\"posted\":1219072557000,\"votes\":0,\"isAccepted\":false,\"isLocked\":false,\"userVoted\":\"\",\"relations\":\"canCancelAccept\":false,\"canUnlock\":false,\"canUseDelete\":false,\"canVoteDownOrCancel\":false,\"canLock\":false,\"canAccept\":false,\"type\":\"answer\",\"canVoteUpOrCancel\":false,\"isCurrentUserAuthor\":false,\"attachments\":[]]"), answerForm: formAction: "/answers/4555937/post.json", textareaName: "body", textareaErrors: "", isAttachmentsEnabled: true, answerEditorialGuideline: title: "Before answering", content: "You should only submit an answer when you are proposing a solution to the poster\'s problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that your answer complies with our Rules of Engagement.", links: [ title: "Rules of Engagement", href: " -of-engagement.html", ] , answerMinBodyLength: '10', answerMaxBodyLength: '20000' , currentUser: sapInternalId: '', permissions: canVoteUpOrCancel: false, canVoteDownOrCancel: false, canModerate: false, , isVotedUp: false, isVotedDown: false , alerts: alertModeratorMinLength : "It should be given a proper explanation about why the content is inappropriate.", alertModeratorMinLengthValue : "10", alreadyReportedMessage : "You already have an active moderator alert for this content." , url: profileApiBaseUrl: ' -api.services.sap.com', followUnfollowQuestion: '/sap/nodeSubscription.json', isFollowingQuestion: '/sap/isFollowingNode.json', vote: voteUp: '/commands/0/voteup.json', voteDown: '/commands/0/votedown.json', cancelVote: '/commands/0/cancelvote.json' , rss: answers: '/feed/4555937/answers.rss', answersAndComments: '/feed/4555937/comments-and-answers.rss' , authorizeUploadContext: type: 'answer' , atMention: userSearchServiceUrl: ' ', currentUserName: '', useNewUSSCORS: true, atMentionDelayMs: 100, showMentionInRedactor: true , attachmentSettings: commentMaxAttachments: '2', answerMaxAttachments: '10', commentMaxAttachmentSizeBytes: '1048576', answerMaxAttachmentSizeBytes: '1048576', commentAttachmentsSizeBytesTotal: '2097152', answerAttachmentsSizeBytesTotal: '10485760' , editor: editorClipboardUploadEnabled: true ) )(); Home
Community
Ask a Question
Write a Blog Post
Login / Sign-up Search Questions and Answers 0 Former Member Aug 06, 2008 at 05:09 PM How to call the workflow from program 2323 Views Follow RSS Feed Hi all,
How To Call Workflow From Abap Program Sap
DOWNLOAD: https://miimms.com/2vFHpN
2ff7e9595c
Comments