on 01-25-2011 7:23 AM
Dear all,
I have created a purchase requisition IDoc generation workflow which triggers from SWUE and behaves as expected.But, it is not triggering from ME51N.No entries are seen in SWEL(Trace is switched on at SWELS).I am using BUS2105 with event created and changed.
For the event CHANGED, the workflow behaves as expected from ME52N.
Business object is properly released and generated.Change document 'BANF' at SWEC is selected.In SWED, it was not checked for 'On Create'.So, I manually checked it.Is it O.K ?
Event linkage is active.No start condition/check function module is with workflow.
The BAdI which is used to trigger the workflow is ME_REQ_POSTED.It's implementation is active.
I checked at SWU2,SM58,ST22 and SM21.There is no entry in these transactions.I refreshed buffers at SWU_OBUF and PPWFBUF.
When the workflow triggers from SWUE for the event CREATED ,why it is not triggering from ME51N ?
Please help me to trigger the workflow from ME51N for which I will be grateful forever.
Regards,
S.Suresh
Dear all,
Thanks a lot for reading my post with intention to answer.
The issue is resolved now.
The problem was at BAdI.To trigger the workflow with event CREATED for purchase requisition, BAdI named ME_REQ_POSTED needs to be used :
Following coding is used for the same :
method IF_EX_ME_REQ_POSTED~POSTED.
DATA: WA_EBAN TYPE EBAN.
DATA L_S_EBAN TYPE UEBAN.
DATA: OBJKEY TYPE SWEINSTCOU-OBJKEY .
LOOP AT IM_EBAN INTO L_S_EBAN .
ENDLOOP.
IF ( SY-TCODE = 'ME51N' AND SY-UCOMM NE 'MECHECKDOC' ) OR SY-TCODE = 'ME52N' .
IF L_S_EBAN-BSART = 'ZNB'.
OBJKEY = L_S_EBAN-BANFN.
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 = 'CREATED'
COMMIT_WORK = 'X'
EVENT_LANGUAGE = SY-LANGU
LANGUAGE = SY-LANGU
USER = SY-UNAME
* IFS_XML_CONTAINER =
* IMPORTING
* RETURN_CODE =
* EVENT_ID =
* TABLES
* INPUT_CONTAINER =
* MESSAGE_LINES =
* MESSAGE_STRUCT =
.
endif.
endif.
endif.
endmethod.
I have missed the loop block.That's why the workflow was not triggering.
Regards,
S.Suresh
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 | |
25 | |
12 | |
9 | |
6 | |
6 | |
5 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.