on 01-26-2021 8:09 AM
hi all .
have a nice day .
i used badi BADI_RECN_CONTRACT to send to me message after create new contract recn and created workflow with this badi it will done and send to me workflow but it send two message the same document .
how to make this badi send to me one message only .
can you find below my badi .
thank you .
here is the Code
* Data declarations
DATA: ld_contract TYPE REF TO cl_recn_contract,
l_objnr type RECAOBJNR.
DATA:OBJECT_KEY TYPE SWO_TYPEID.
DATA : IT_CONTAINER TYPE TABLE OF SWR_CONT,
WA_CONTAINER LIKE LINE OF IT_CONTAINER.
DATA: G_KEY TYPE SWR_STRUCT-OBJECT_KEY.
DATA: G_return_code type sy-subrc,
GLF_event_id type swr_struct-event_id.
DATA: L_ACTIVE TYPE CNJ_STAT-STTXT_INT.
data: lit_vicncn type vicncn,
wa_vicncn type vicncn,
l_dbear type vicncn-dbear.
DATA: COMPCODE(4) TYPE C,
CONTRACTNUMBER(13) type C.
data: l_vicncn type vicncn,
w_vicncn type vicncn,
RECNDACTIV type vicncn-RECNDACTIV.
CLEAR COMPCODE.
CLEAR CONTRACTNUMBER.
CLEAR G_KEY.
*---------------------------- Object Key is storing in the IO_OBJECT paramerer in the Interface of IF_EX_RECN_CONTRACT.
ld_contract ?= io_object.
l_objnr = ld_contract->md_objnr.
COMPCODE = l_objnr+2(4).
CONTRACTNUMBER = l_objnr+6(13).
CONCATENATE COMPCODE CONTRACTNUMBER INTO G_KEY.
*............................ the above code is for retrieve value from IO_Object and seperate with IS, Company code and Contract (IS100100000020001)
*............................ IS 1001 20001
select single * from vicncn into l_vicncn
where bukrs = compcode
and recnnr = contractnumber.
if sy-subrc ne 0.
IF G_KEY IS NOT INITIAL.
*.....................When SAVE - trigger an EVENT CREATED
CALL FUNCTION 'SAP_WAPI_CREATE_EVENT'
EXPORTING
object_type = 'BUS1505'
object_key = G_KEY
event = 'CREATED'
commit_work = 'X'
event_language = sy-langu
language = sy-langu
user = sy-uname
* IFS_XML_CONTAINER =
IMPORTING
return_code = G_return_code
event_id = GLF_event_id
TABLES
input_container = it_container
* message_lines =
* message_struct =.
IF SY-SUBRC = 0.
ENDIF.
ENDIF.
If you want to Send a Notification after 'ACTIVATE' button then you need to continue the the below code
else.
*.....................When ACTIVE - trigger an EVENT ACTIVATED
CALL FUNCTION 'SAP_WAPI_CREATE_EVENT'
EXPORTING
object_type = 'BUS1505'
object_key = G_KEY
event = 'ACTIVATED'
commit_work = 'X'
event_language = sy-langu
language = sy-langu
user = sy-uname
* IFS_XML_CONTAINER =
IMPORTING
return_code = G_return_code
event_id = GLF_event_id
TABLES
input_container = it_container
* message_lines =
.
* message_struct =
endif.
*endif.
User | Count |
---|---|
82 | |
10 | |
10 | |
9 | |
7 | |
6 | |
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.