cancel
Showing results for 
Search instead for 
Did you mean: 

Triggering workflow from proxy program(server proxy)

12-24-2008 10:45 AM
575 views 5 comments
0 Likes
SAP Managed Tags
Subscribe

hi friends,

i tried to trigger the work flow from the Proxy program from BPM from SAP PI.

for that i created a code as follows, but while syntax check in the proxy (server proxy) implemtation (methode), i am getting the message as "Include <CNTN01>

Within classes and interfaces, you can only use "TYPE" to refer to ABAP

Dictionary types (not "LIKE" or "STRUCTURE")."

can any body tell me how can i resolve this problem.

the fallowing is the implemented mothode code:

method ZII_WF_MI~EXECUTE_ASYNCHRONOUS.

      • **** INSERT IMPLEMENTATION HERE **** ***

include <cntn01>.

SWC_CONTAINER it_swcont.

types: BEGIN OF T_STR ,

EMPID TYPE ZEMPID,

LSDATE TYPE ZLSDATE,

LEDATE TYPE ZLSDATE,

END OF T_STR.

Data: agent_p type Standard table of sWHACTOR .

Data: IT_STR type table of t_str,

wa_str like line of it_str.

wa_STR-EMPID = INPUT-WF_MT-EMPID.

wa_STR-LSDATE = INPUT-WF_MT-SDATE.

wa_STR-LEDATE = INPUT-WF_MT-EDATE.

APPEND wa_STR to it_str. CLEAR WA_STR.

SWC_SET_element it_swcont 'abs_form_leave' IT_STR.

CALL FUNCTION 'SWW_WI_START'

EXPORTING

  • CALLBACK_FB = ' '

  • CHECKED_WI = SWFCO_NO_ID

  • CONFIRM = ' '

CREATOR = 'anilb'

  • DESIRED_END_ACTION = SWFCO_WI_DEF_DH_ACT

  • DESIRED_END_DATE = SWFCO_NO_DATE

  • DESIRED_END_TIME = SWFCO_NO_TIME

  • DESIRED_START_DATE = SWFCO_NO_DATE

  • DESIRED_START_TIME = SWFCO_NO_TIME

  • LANGUAGE = SY-LANGU

  • LATEST_END_ACTION = SWFCO_WI_DEF_DH_ACT

  • LATEST_END_DATE = SWFCO_NO_DATE

  • LATEST_END_ESCALATION = SWFCO_NO_ESC

  • LATEST_END_TIME = SWFCO_NO_TIME

  • LATEST_START_ACTION = SWFCO_WI_DEF_DH_ACT

  • LATEST_START_DATE = SWFCO_NO_DATE

  • LATEST_START_TIME = SWFCO_NO_TIME

  • MAX_EVENT_COUNT = SWFCO_DEF_MAX_EVT_CNT

  • PRIORITY = SWFCO_NO_PRIO

TASK = 'WS99900263'

  • WORKITEM_TYPE = ' '

  • DO_COMMIT = 'X'

  • DO_SYNC_CALLBACK = ' '

  • TEXT = ' '

  • DO_SYNC_WI_CHAIN = ' '

  • CREATED_BY_USER = SY-UNAME

  • CREATED_BY_ADDRESS = ' '

  • CALLED_IN_BACKGROUND = ' '

  • STEP_MODELED_WI_DISPLAY = ' '

  • NO_DEADLINE_PARAMETERS = ' '

  • RESTRICTED_LOG = ' '

  • SECONDS_UNTIL_TIMEOUT =

  • CREATE_EVENT = ' '

  • STATUS_EVENT = ' '

  • XML_PROTOCOL =

  • WLC_FLAGS =

  • START_PROPERTIES =

  • DEBUG_FLAG = ' '

  • TRACE_FLAG = ' '

  • WI_CONTAINER_HANDLE =

  • START_ASYNCHRONOUS = ' '

  • IMPORTING

  • WI_ID =

  • WI_HEADER =

  • RETURN =

  • WI_RESULT =

  • SWF_RETURN =

  • NEW_STATUS =

TABLES

AGENTS = agent_p

  • DEADLINE_AGENTS =

  • DESIRED_END_AGENTS =

  • LATEST_START_AGENTS =

  • EXCLUDED_AGENTS =

  • NOTIFICATION_AGENTS =

  • SECONDARY_METHODS =

WI_CONTAINER = it_swcont

  • COMP_EVENTS =

  • 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.

thanks,

kumar

0 Likes

Accepted Solutions (0)

Answers (4)

Answers (4)

Former Member
0 Likes

thank you all

Former Member
0 Likes

Hey Kumar,

I suggest you use the function module SAP_WAPI_CREATE_EVENT wherein you just need to put in the event of the workflow which is there as the starting condition of the workflow.

Let me know if you still face issue.

bpawanchand
Active Contributor
0 Likes

Its because that INCLUDE <CNTN01> is not supported in the classes MACRO's Definiton

  • You need to use INCLUDE cntn01_swc. in the macros defniton.

  • In the Properties Tab of the class declare SWC0 in the TYPE Groups so that you can create the instnace of the BO inside the class*

Former Member
0 Likes

thanks for your repply guys.....

but i used a function module 'SWC_ELEMENT_SET' insted of macros. so its working.

but i got the another problem in execution of the W/F , i created one of the step in the W?F definition as background task,.

what happened here was, the execution stops at that task and its showning that execution in background.

how can i see that execuion continued immedatly after reaching that step? (so that the further steps in the W/F can be executed after the background tast step)

can anybody have the solution for this?

Thsanks in advance,

Kumar

Former Member
0 Likes

Hi,

In your class go to MACROS icon (ctrlshiftf7).

Declare:

Include <CNTN02>.

Regards,

Ronit.