on 12-09-2008 10:15 AM
Hello Experts,
I have created a custom Event ZCREATED in ZBUS2105 (Subtype) by copying BUS2105, I have saved and released it. Then maintend change document for BANF in SWEC T-CODE. Also maintained deligatoin in SWO6 T-Code.
But still the event is not getting triggered on Purchase Requisition create. It works fine when I test it from SWUE t-code.
What needs to be done for resloving the issue. Please suggest
Thanks in Advance,
Sandhya.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi SV,
one question, was there any other purpose for creating the ZCREATED event as BUS2105 already has RELEASESTEPCREATED event and generally you create an event CHANGE since BUS2105 doesnt have a change event.
Hope you have implemented your BOR and clicked the Generate button.
Hope it helps.
Aditya
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Adithya,
Problem with the event RELEASESTEPCREATED is that its not getting triggered when a PR is created. I need to trigger an event when ever a PR is cereated. For that reason I have created a custom event, I have generated my Z object in BOR. Event work's fine from SWUE T-Code. But its not getting triggred on a PR create.
Thanks,
Sandhya
Hi Sandhya,
below is the code that i used to trigger the PR workflow.
Hope it works for you as well. Copy and customize the code as per your requirement.
I used this code in enhancing the BADi ME_REQ_POSTED.
METHOD IF_EX_ME_REQ_POSTED~POSTED.
DATA : RE_DATA TYPE MEREQ_HEADER.
IF SY-TCODE = 'ME51N' OR SY-TCODE = 'ME52N' .
CALL METHOD IM_EBAN->GET_DATA
RECEIVING
RE_DATA = RE_DATA.
ENDIF.
DATA: WA_EBAN TYPE EBAN.
DATA L_S_EBAN TYPE UEBAN.
LOOP AT IM_EBAN INTO L_S_EBAN .
ENDLOOP.
DATA: OBJKEY TYPE SWEINSTCOU-OBJKEY .
BREAK-POINT.
IF ( SY-TCODE = 'ME51N' AND SY-UCOMM NE 'MECHECKDOC' ) OR SY-TCODE = 'ME52N' OR SY-TCODE = 'ME53N'.
IF ( L_S_EBAN-BSART = 'ZRAS' OR L_S_EBAN-BSART = 'ZRCG' OR L_S_EBAN-BSART = 'ZREC' OR L_S_EBAN-BSART = 'ZRFS' OR L_S_EBAN-BSART = 'ZRIM' OR L_S_EBAN-BSART = 'ZRLC' OR
L_S_EBAN-BSART = 'ZROC' OR L_S_EBAN-BSART = 'ZRPC' OR L_S_EBAN-BSART = 'ZRRM' OR L_S_EBAN-BSART = 'ZRPM' OR L_S_EBAN-BSART = 'ZRPR' OR L_S_EBAN-BSART = 'ZRPU' OR
L_S_EBAN-BSART = 'ZRQS' OR L_S_EBAN-BSART = 'ZRSS' OR L_S_EBAN-BSART = 'NB' ).
OBJKEY = L_S_EBAN-BANFN.
IF SY-TCODE = 'ME51N' .
SELECT SINGLE * FROM EBAN INTO WA_EBAN WHERE BANFN EQ OBJKEY.
IF SY-SUBRC NE 0.
CALL FUNCTION 'SAP_WAPI_CREATE_EVENT'
EXPORTING
OBJECT_TYPE = 'BUS2105'
OBJECT_KEY = OBJKEY
EVENT = 'RELEASESTEPCREATED'
COMMIT_WORK = 'X'
EVENT_LANGUAGE = SY-LANGU
LANGUAGE = SY-LANGU
USER = SY-UNAME.
ENDIF.
ENDIF.
IF SY-TCODE = 'ME52N' OR SY-TCODE = 'ME53N' .
CALL FUNCTION 'SAP_WAPI_CREATE_EVENT'
EXPORTING
OBJECT_TYPE = 'BUS2105'
OBJECT_KEY = OBJKEY
EVENT = 'SIGNIFICANTLYCHANGED'
COMMIT_WORK = 'X'
EVENT_LANGUAGE = SY-LANGU
LANGUAGE = SY-LANGU
USER = SY-UNAME.
ENDIF.
IFS_XML_CONTAINER =
IMPORTING
RETURN_CODE = return_code
EVENT_ID = event_id
TABLES
INPUT_CONTAINER = INPUT_CONTAINER
MESSAGE_LINES = MESSAGE_LINES
MESSAGE_STRUCT = MESSAGE_STRUCT
.
ENDIF.
ENDIF.
DATA : LINES11 TYPE TLINE ,"OCCURS 0 WITH HEADER LINE,
DESNO TYPE TLINE-TDLINE,
DESNO1 TYPE TLINE-TDLINE,
DESNO11 TYPE TLINE-TDLINE,
EN TYPE THEAD-TDSPRAS,
TDNAME(70) TYPE C," LIKE THEAD-TDNAME,
OBJECT TYPE THEAD-TDOBJECT,
ID TYPE THEAD-TDID.
DATA: LINES1 TYPE STANDARD TABLE OF TLINE.
DATA: LINES2 TYPE TLINE.
DATA: DESTINATION1 TYPE STRING .
DATA: DESTINATION11 TYPE STRING .
DATA: DESTINATION111 TYPE STRING .
data: st type string.
LOOP AT IM_EBAN INTO L_S_EBAN .
ENDLOOP.
*
CONCATENATE L_S_EBAN-BANFN L_S_EBAN-BNFPO INTO TDNAME.
.
*
TDNAME = L_S_EBAN-BANFN.
OBJECT = 'EBAN'.
ID = 'B01'.
EN = 'EN'.
*
CALL FUNCTION 'READ_TEXT'
EXPORTING
CLIENT = SY-MANDT
ID = ID
LANGUAGE = EN
NAME = TDNAME
OBJECT = OBJECT
TABLES
LINES = LINES1
EXCEPTIONS
ID = 1
LANGUAGE = 2
NAME = 3
NOT_FOUND = 4
OBJECT = 5
REFERENCE_CHECK = 6
WRONG_ACCESS_TO_ARCHIVE = 7
OTHERS = 8.
*
DELETE LINES1 WHERE TDLINE IS INITIAL.
LOOP AT LINES1 INTO LINES2.
IF LINES2-TDLINE = ' '.
CONTINUE.
ELSE.
DESNO = LINES2-TDLINE.
CONCATENATE DESTINATION1 DESNO INTO DESTINATION1.
MOVE DESNO TO DESTINATION1.
*
EXIT.
ENDIF.
ENDLOOP.
IT_LG-VBELN = TDNAME.
IT_LG-LRNO = DESTINATION1.
DATA: LI TYPE I.
CONDENSE DESTINATION1 NO-GAPS.
LI = STRLEN( DESTINATION1 ).
IF LI <= 0.
*
concatenate 'Item Text Is Missing for Line Item ' L_S_EBAN-BNFPO into st.
MESSAGE st TYPE 'E'.
*
ENDIF.
FREE LINES1.
FREE DESNO.
FREE DESTINATION1.
REFRESH LINES1.
CLEAR LINES1.
CLEAR DESNO.
CLEAR DESTINATION1.
ENDLOOP.
ENDMETHOD.
let me know if you still have any queries.
Regards,
Raj
Hi,
Did you check the Event Simulation ? (SWU0)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Sandhya,
As i said yesterday, use the BADi, Me_REQ_POSTED.
In that use the FM SAP_WAPI_CREATE_EVENT or SWE_CREATE_EVENT.
pass your BO name and event name to this FM also with the object key
This is sample code below.
CALL FUNCTION 'SAP_WAPI_CREATE_EVENT'
EXPORTING
OBJECT_TYPE = 'BUS2105'
OBJECT_KEY = OBJKEY
EVENT = 'RELEASESTEPCREATED'
COMMIT_WORK = 'X'
EVENT_LANGUAGE = SY-LANGU
LANGUAGE = SY-LANGU
USER = SY-UNAME.
ENDIF.
let me know if you have any queries.
Regards,
Raj
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
84 | |
9 | |
9 | |
8 | |
7 | |
7 | |
6 | |
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.