on 10-16-2007 7:21 AM
Hi Sapgurus,
I have made a scenerio in which if user enters the measuring point value greater than target value in IK11 then a notification is generated *(i.e IW21) now i want when this notification is generated a workflow should trigger that can intimate user that the notification has been generated my problem is when i try to trigger it i get the short dumb saying
The call of a COMMIT WORK in a FORM, that will not be executed until
the commit or rollback point of the caller using the variant
PERFORM ... ON COMMIT or PERFORM ... ON ROLLBACK is not permitted.
Could anyone please tell mee what is the reason below is the code which i m writing to trigger the workflow.
*&!!!@@@@@@@@@@##############$%%%%%%%%%%^^^^^^^^^^^^^^^&&&&&&&&&&&&&&&&&&&&&
CLEAR wa_swcont.
wa_swcont-element = 'FLAG'.
wa_swcont-elemlength = '001'.
wa_swcont-type = 'I'.
lv_test = p_key.
wa_swcont-value = lv_test.
APPEND wa_swcont TO i_container.
it_container-container = p_key.
append it_container.
*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
CALL FUNCTION 'SAP_WAPI_START_WORKFLOW'
EXPORTING
TASK = 'WS99900237'
LANGUAGE = SY-LANGU
DO_COMMIT = 'X'
USER = SY-UNAME
START_ASYNCHRONOUS = ' '
DESIRED_START_DATE =
DESIRED_START_TIME =
DESIRED_START_ZONLO = SY-ZONLO
IFS_XML_CONTAINER =
IMPORTING
RETURN_CODE =
WORKITEM_ID =
NEW_STATUS =
*TABLES
INPUT_CONTAINER = it_container
MESSAGE_LINES =
MESSAGE_STRUCT =
AGENTS =
.
CALL FUNCTION 'SWE_EVENT_CREATE'
EXPORTING
OBJTYPE = 'BUS2038'
OBJKEY = p_key
EVENT = 'CREATED'
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.
ENDIF.
*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
wa_agents-objid = 'BSPDEV01'.
APPEND wa_agents TO i_agents.
*CALL FUNCTION 'SWW_WI_START_SIMPLE'
EXPORTING
CREATOR = ' '
PRIORITY = SWFCO_NO_PRIO
TASK = 'WS99900237'
CALLED_IN_BACKGROUND = ' '
DEADLINE_DATA = ' '
NO_DEADLINE_PARAMETERS = ' '
IMPORTING
WI_ID =
WI_HEADER =
RETURN =
WI_RESULT =
SWF_RETURN =
TABLES
AGENTS = i_agents
DEADLINE_AGENTS =
DESIRED_END_AGENTS =
LATEST_START_AGENTS =
EXCLUDED_AGENTS =
NOTIFICATION_AGENTS =
SECONDARY_METHODS =
WI_CONTAINER = i_container
CHANGING
WI_CONTAINER_HANDLE =
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.
*
*
**commit WORK.
endif.
I have used the all the FM to triiger workflow but getting the same dumb again and again.
the FM i have user are
1. SAP_WAPI_START_WORKFLOW
2. SWE_EVENT_CREATE
3. SWW_WI_START_SIMPLE
All are giving the same dumb.
Please help me out.
Thanks and Regards,
Rachit Khanna
Hi Rachit,
Another thought ! If you just need to send a notification , I think no need to go for workflow !
As you are using the SWE_EVENT_CREATE , I hope you already have the user-exit available. Check based on these required condition, use FM to send mail.
Regarding your point about error/dump, as transaction IW21 has not yet been completed and still you are executing <b>commit work</b> statement for raising the event, dump might be occuring.
Hope this helps to start off..
Regards,
Akshay
Message was edited by:
Akshay Bhagwat
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Karuna,
I am now able to trigger the workflow but the problem is that in my SBWP inbox the title is coming in German Language the code which i m writing to trigger the workflow is :-
CALL FUNCTION 'SWE_EVENT_CREATE'
EXPORTING
OBJTYPE = 'BUS2038'
OBJKEY = 'WS99900237'
EVENT = 'CREATED'
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.
ENDIF.
Could i can have the title in my SAP inbox as English.
And one more thing if i want that when the mail is send to the outlook through my report can i do something so that i can know that the user has read the mail or not.
Thanks and Regards,
Rachit Khanna
Hi Rachit,
In such case , you will have to go with workflow option, that too you will have to use work items for the same. i.e use a custom dummy method - which does nothing- so that you can create task basedon this method and then assign required agent. So that user receives Work item in his inbox when workflow is triggered.
Also You can use deadline monitoring , such that if he does not act on this work item for say 1 day, then you can intimate his manager or some admin person etc etc..and in turn make sure that person sees / executes the work item.
Hope this serves your requirement.
Regards,
Akshay
Hi Khanna,
>if user enters the measuring point value greater than target value in IK11 then a >notification is generated
My openion, why do not you use Start condition using tcode SWB_COND, start conditions are used for triggering EVENTS only.
Ex:
If greater than xxx value ,
True -
> Start Workflow
False -
> No Action
Thanks and Regards,
Prabhakar Dharmala
Hi Akshay ,
Thanks for your reply but i m really confused for BOR objects role, its use i have read the forums also but not able to understand the importance of BOR objects in Workflow.
My second doubt is how to pass the value from my program to workflow container element.
I tried to create my own BOR object but not able to do so.
I have seen in the forums that when we are using the FM SWE_EVENT _CREATE
CALL FUNCTION 'SWE_EVENT_CREATE'
EXPORTING
OBJTYPE = 'BUS20838'
OBJKEY = p_key
EVENT = 'CREATED'
what we have to give in OBJTYPE ?
Do we have to give my workflow name or the BOR object name
In OBJKEY what i have to give?
the value that i want to pass in my workflow ot some other thing
Please help me out as i m really very confused.
Please..........
Thanks and Regards,
Rachit Khanna
Hi Rachit,
Pls fine pointwise reply:
1. Object type is the type name whch you have created in SWO1.
e.g refer Object BUS1001006 i.e. material in SWO1 and you will have an idea.
2. Object nkey is the key field which oyu have used for your custom BO type.
e.g. In case of material object it is material number i.e. value of matnr from mara table.
Hope it helps to resolve your confusion.
Regards,
Akshay
Some points would be nice if it helps
User | Count |
---|---|
68 | |
8 | |
7 | |
6 | |
6 | |
6 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.