BTE - Business Transaction Event
Transcript of BTE - Business Transaction Event
-
7/25/2019 BTE - Business Transaction Event
1/57
BTE - Business Transaction Event
BTE - Business Transaction Event
Enhancement type developed for FI (Financial Accounting).
SAP Reference IMG ! Financial Accounting ! Financial Accounting Glo"al Setting# ! $u#ine## %ran#action Event# .
&u#tomi'ing can "e done via tran#action FI$F.
Main #tep# for activating a $%E
. &hec* +SS note for documentation and e,planation
-. &opy #ample function module SAMPE/I0%ERFA&E/1event/num"er! to &u#tomer name#pace
2. Ma*e #ure the application i# active for $u#ine## %ran#action Event# 3 el#e maintain ta"le %$E.
4. Maintain ta"le %$E24 and %$E5
6. Enter code to the $%E function module
7o8 to chec*9de"ug:
%o chec* the functionality3 you can put a "rea*point in your $%E function module. If it;# not called3 put a "rea*point at FM
+PE0/FI/PERF+RM/1$%E num"er!/E.
Related %ran#action &ode
$ERE $u#ine## Event Repo#itory
$ERP $u#ine## Proce##e#
$F2 Application module# per Event
$F2- Partner Module# per Event
$F24 &u#tomer Module# per Event
$F4 Application Module# per Proce##
$F4- Partner Module# per Proce##
$F44 &u#tomer Module# per Proce##
$%E e,it# to add additional component# to the SAP #tandard #y#tem3 for e,ample in the form of function module#. %here
are t8o type# of interface
Publish and Subscribe interfaces
%he#e give information that #pecific event# have occurred in the SAP #tandard application and provide the data
generated to e,ternal #oft8are. 7o8ever the e,ternal #oft8are doe# not return any data to the SAP #tandard #y#tem.
Process interfaces
%he#e #u"
-
7/25/2019 BTE - Business Transaction Event
2/57
A $%E e,it i# called up in the proce##3 meaning that proce## module# chec* the event# in &u#tomi'ing for calling up the
$%E e,it#. In the $%E method3 function module# are called up in #pecified event#3 to 8hich they have "een a##igned in
&u#tomi'ing. %he event interface i# predefined. %o activate the proce## module#3 choo#e /Setting# for Proce## Interface# !
A##ign &u#tomer Function Module# to Proce## Interface#.
$u#ine## %ran#action Event R>$API5 For Accounting?ocument Interface
u#ine## %ran#action Event R>$API5 For Accounting ?ocumentInterface
Link to Content's target Space :
http998i*i.#dn.#ap.com98i*i9di#play9A$AP9$%E@@$u#ine##@%ran#action@Event
Applies to:
SAP 4., and a"ove.
Suar!
>hile &reating the Accounting document through $API $API/A&&/?+&BME0%/P+S% po#ting *ey# are determinedautomatically "a#ed on the configuration. Since thi# $API doe#n;t have any #tructure field to pa## the po#ting *ey3 po#ting
*ey# are pic*ed up automatically "a#ed on the document type pa##ed in $API header #tructure.
%hi# document narrate# ho8 to change the default po#ting *ey 8hile creating the Accounting document u#ing the a"ove
$API. %hi# document al#o e,plain# the #tep# involved in implementing a $u#ine## %ran#action Event.
Author"s#: $inod %uar T
Copan!: 0II% %echnologie# imited
Created on: -5.5.-55
Author"s# BioCinod Dumar i# an A$AP &on#ultant 8or*ing 8ith 0II% %echnologie# imited.
Po#ting of Accounting ?ocument B#ing $API $API/A&&/?ocumentPo#t
http://wiki.scn.sap.com/wiki/display/ABAP/Business+Transaction+Event+-+RWBAPI01+-+For+Accounting+Document+Interfacehttp://wiki.scn.sap.com/wiki/display/ABAP/Business+Transaction+Event+-+RWBAPI01+-+For+Accounting+Document+Interfacehttp://wiki.sdn.sap.com/wiki/display/ABAP/BTE+-+Business+Transaction+Eventhttp://wiki.scn.sap.com/wiki/display/ABAP/Business+Transaction+Event+-+RWBAPI01+-+For+Accounting+Document+Interfacehttp://wiki.scn.sap.com/wiki/display/ABAP/Business+Transaction+Event+-+RWBAPI01+-+For+Accounting+Document+Interfacehttp://wiki.sdn.sap.com/wiki/display/ABAP/BTE+-+Business+Transaction+Event -
7/25/2019 BTE - Business Transaction Event
3/57
Scenario
&reate the accounting document for &u#tomer advance payment again#t 0et"an*ing tran#action. ?ocument i# to "e
created 8ith the accounting document type (?&u#tomer Payment). $a#ed on the &onfiguration3 &u#tomer line item i#
po#ted again#t the po#ting *ey 5(Invoice?e"it) and G Account line item i# po#ted again#t the po#ting *ey 65(G&redit).
Since the FI document# of cu#tomer payment and Advance payment i# to "e #eparated3 &u#tomer line item of a"ove entrie#
are to "e po#ted 8ith po#ting *ey 54 (+ther Receiva"le# ?e"it) and G Account line item to "e po#ted 8ith po#ting *ey 65
(G &redit)
Additional Structure for BAP&
For pa##ing the additional data related to po#ting *ey#3 Structure E%E0SI+0 i# to "e filled 8ith the reuired data.
$u#ine## %ran#action Event u#ed for changing the Po#ting *ey 8ill "e e,ecuted only 8hen the record(#) are availa"le in thi#
#tructure. See the &all to $%E in line num"er 6H of $API.
Code for Creating Account docuent using BAP&
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
REPORT zacctesting.
**Internal table and Work area declarations
DATA: wa_docuent!eader T"PEba#iac!e$%&
it_accountgl T"PE'TA(DARDTA)EO+ ba#iacgl$%&
wa_accountgl T"PEba#iacgl$%&
it_accountrecei,able T"PE'TA(DARDTA)EO+ ba#iacar$%&
wa_accountrecei,able T"PEba#iacar$%&
it_currenc-aount T"PE'TA(DARDTA)EO+ ba#iaccr$%&
wa_currenc-aount T"PEba#iaccr$%&
it_return T"PE'TA(DARDTA)EO+ ba#iret&
wa_return T"PEba#iret&
it_e/tension0 T"PE'TA(DARDTA)EO+ ba#iace/tc&
wa_e/tension0 T"PEba#iace/tc.
DATA: doc_at_cr T"PEba#iwrbtr 1A2E 345$.$$3&
doc_at_dr T"PEba#iwrbtr 1A2E 35$.$$3.
DATA: l,_t-#e T"PEba#iac!e$%4ob6_t-#e&
l,_ke- T"PEba#iac!e$%4ob6_ke-&
-
7/25/2019 BTE - Business Transaction Event
4/57
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
l,_s-s T"PEba#iac!e$%4ob6_s-s.
**clear internal table
RE+RE'7:it_accountgl&
it_accountrecei,able&
it_currenc-aount&
it_return&
it_e/tension0.
**+ill !eader data.
8EAR: wa_docuent!eader.
9O1Es-4unae TOwa_docuent!eader4usernae. 2sernae
9O1E3Test3 TOwa_docuent!eader4!eader_t/t.7eader Te/t
9O1E3$0$;3 TOwa_docuent!eader4co#_code. 8o#an- 8ode
9O1Es-4datu TOwa_docuent!eader4doc_date. Doc Date
9O1Es-4datu TOwa_docuent!eader4#stng_date.Posting Date
9O1E3DP++3 TOwa_docuent!eader4ob6_t-#e. 8oent =or ?@ E885.$
9O1E 33 TO wa_docuent!eader4ob6_ke-. 8oent =or ?@ E885.$
9O1Es-4andt TOwa_docuent!eader4ob6_s-s. 8oent =or ?@ E885.$
**+ill B Account ine ite.
8EAR : wa_accountgl& wa_currenc-aount.
9O1E 3$$$$$$$$$03 TO wa_accountgl4iteno_acc. ine Ite (o
9O1E 3$$0C$$$$C03 TO wa_accountgl4gl_account. B Account
9O1E 3IteTest3 TO wa_accountgl4ite_te/t. Ite Te/t
9O1E 3$0$;3 TO wa_accountgl4co#_code. 8o#an- 8ode
9O1E 3$$$$%$$;%$3 TO wa_accountgl4#ro=it_ctr. Pro=it 8enter
-
7/25/2019 BTE - Business Transaction Event
5/57
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
9O1E 3Assign03 TO wa_accountgl4alloc_nbr. Assignent
APPE(D wa_accountgl TO it_accountgl.
9O1E 3$$$$$$$$$03 TO wa_currenc-aount4iteno_acc. ine Ite (o
9O1E 3$$3 TO wa_currenc-aount4curr_t-#e. 8urrenc- T-#e
9O1E 3I(R3 TO wa_currenc-aount4currenc-. 8urrenc-
9O1E doc_at_cr TO wa_currenc-aount4at_doccur. Aount
APPE(D wa_currenc-aount TO it_currenc-aount.
** +ill 8ustoer ine ite
8EAR :wa_accountrecei,able& wa_currenc-aount.
9O1E 3$$$$$$$$$3 TO wa_accountrecei,able4iteno_acc. Ite (o
9O1E 3$$$0$$$$F3 TO wa_accountrecei,able4custoer. 8ustoer
9O1E 3IteTest3 TO wa_accountrecei,able4ite_te/t. Ite Te/t
9O1E 3$0$;3 TO wa_accountrecei,able4co#_code. 8o#an- 8ode
9O1E 3Assign3 TO wa_accountrecei,able4alloc_nbr. Assignent.
APPE(Dwa_accountrecei,able TOit_accountrecei,able.
9O1E3$$$$$$$$$3TOwa_currenc-aount4iteno_acc. ine Ite (o
9O1E3$$3 TOwa_currenc-aount4curr_t-#e. 8urrenc- T-#e
9O1E3I(R3 TOwa_currenc-aount4currenc-. 8urrenc-
9O1Edoc_at_dr TOwa_currenc-aount4at_doccur. Aount
APPE(Dwa_currenc-aount TOit_currenc-aount.
**+ill E/tension0 'tructure used b- )TE
**Posting ke- is to be c!anged =or onl- =or 8ustoer line ite
G$$$$$$$$$H
**Records in t!is internal table will be c!ecked in )TE
8EAR: wa_e/tension0.
9O1E3$$$$$$$$$$C3TOwa_e/tension04=ield0.
APPE(Dwa_e/tension0 TOit_e/tension0.
**8all )a#i
-
7/25/2019 BTE - Business Transaction Event
6/57
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
8A+2(8TIO(3)API_A88_DO829E(T_PO'T3
EPORTI(B
docuent!eader @ wa_docuent!eader
I9PORTI(B
8oent =or ?@E885.$
ob6_t-#e @ l,_t-#e 8oent =or ?@E885.$
ob6_ke- @ l,_ke- 8oent =or ?@E885.$
ob6_s-s @ l,_s-s 8oent =or ?@E885.$
TA)E'
accountgl @ it_accountgl
accountrecei,able @ it_accountrecei,able
currenc-aount @ it_currenc-aount
e/tension0 @ it_e/tension0
return @ it_return.
**8!eck =or errors.
8EAR: wa_return.
READTA)Eit_return I(TOwa_return WIT7>E" t-#e @ 3E3.
I+s-4subrc (E$.
8A+2(8TIO(3)API_TRA('A8TIO(_8O99IT3.
E(DI+.
**dis#la- t!e out#ut
OOPATit_return I(TOwa_return.
WRITE: wa_return4t-#e&
wa_return4id&
wa_return4nuber&
wa_return4essage.
E(DOOP.
-
7/25/2019 BTE - Business Transaction Event
7/57
95
96
97
Implementing $u#ine## %ran#action Event R>$API5
Code for BTE unction (odule
Step &reate a 0e8 function group u#ing tran#action code SE5
Step - &opy the #tandard function module of $%E JSAMPE/I0%ERFA&E/R>$API5J to a Function module3 #ay
JSAMPE/I0%ERFA&E/R>$API5J
Step 2 Add Follo8ing &ode into the ne8 function module and activate
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
+2(8TIO(zsa#le_inter=ace_rwba#i$0.
*44444444444444444444444444444444444444444444444444444444444444444444
ocal Inter=ace:
* TA)E'
* IT_A88IT 'TR28T2RE A88IT
* IT_A888R 'TR28T2RE A888R
* RET2R('TR28T2RE )APIRET
* ETE('IO( 'TR28T2RE )APIA8ET8
* IT_A88WT 'TR28T2RE A88IT_WT
* 87A(BI(B
* 1A2EGDO829E(T_7EADERH I>E A887D 'TR28T2RE A887D
*44444444444444444444444444444444444444444444444444444444444444444444
DATA: wa_e/tension T"PEba#iace/tc.
8EAR: wa_e/tension.
OOPATe/tension I(TOwa_e/tension.
-
7/25/2019 BTE - Business Transaction Event
8/57
16
17
18
19
20
21
22
READTA)Eit_accit WIT7>E" #osnr @ wa_e/tension4=ield0G0$H.
I+s-4subrc EJ$.
it_accit4bsc!l @ wa_e/tension4=ield0K0$GH.
9ODI+"it_accit I(DEs-4tabi/.
E(DI+.
E(DOOP.
E(D+2(8TIO(.
&onfiguration
Step Go %o %ran#action code FI$F
Step - Add &u#tomer Product. B#e Menu +ption Setting# ! Product# ! ...of a
&u#tomer
Step 2 Save the Product.
Step 4 &reate a in* "et8een $%E and Product created in Step-. B#e the menu option Setting# ! Proce## Module#
! ... of a
cu#tomer
-
7/25/2019 BTE - Business Transaction Event
9/57
Step 6 Save the in*.
$u#ine## %ran#action Event# for Filtering +ut"ound
Ma#ter I?+
$u#ine## %ran#action Event# for Filtering +ut"ound Ma#ter I?+
Suar!
%hi# po#t narrate# the u#e of P9S (Pu"li#h K Su"#cri"e) $u#ine## %ran#action Event# for Filtering of +ut"ound I?+ ofMa#ter ?ata.
Author"s#: $inod %uar T
Copan!: 0II% %echnologie# imited
Created on: L.5.-55
Author"s# Bio
Cinod Dumar i# an A$AP &on#ultant 8or*ing 8ith 0II% %echnologie# imited.
Scenario
Standard SAP program R$?MI?+& i# u#ed to trigger the +ut"ound I?+ "a#ed on &hange pointer concept. AE
?i#tri"ution Model ($?L4) and partner configuration (>E-5) i# u#ed to determine the receiving partner#. I?+ are
tran#mitted to all the partner# defined in a"ove configuration.
http://wiki.scn.sap.com/wiki/display/ABAP/Business+Transaction+Events+for+Filtering+Outbound+Master+IDOCshttp://wiki.scn.sap.com/wiki/display/ABAP/Business+Transaction+Events+for+Filtering+Outbound+Master+IDOCshttp://wiki.scn.sap.com/wiki/display/ABAP/Business+Transaction+Events+for+Filtering+Outbound+Master+IDOCshttp://wiki.scn.sap.com/wiki/display/ABAP/Business+Transaction+Events+for+Filtering+Outbound+Master+IDOCs -
7/25/2019 BTE - Business Transaction Event
10/57
Process lo)
Standard program R$?MI?+& refer# the ta"le %$?ME to get the function module 8hich i# to "e e,ecuted for creating
I?+. For e,ample3 the me##age type &+0?/A (Pricing condition#) 3 Standard function module
MAS%ERI?+&/&REA%E/SM?/&+0?/A i# e,ecuted to generate the I?+. %he function module e,tract# all the record#
8hich are not yet proce##ed u#ing the function module &7A0GE/P+I0%ERS/REA?. %he#e record# 8ill "e converted a#per #egment# in the $a#ic I?+& type 9 me##age type and 8ill "e tran#mitted to all the Partner# 8hich are maintained in
>E-5 (Partner Profile &onfiguration) and $?L4 (?i#tri"ution Model).
Change *e+uireent
. I?+ to "e generated for #pecific Partner# "a#ed on $u#ine## reuirement#. In thi# #cenario3 I?+ need to
filter# #o that the un8anted Partner doe#n;t receive the I?+&.
-. I?+ to "e generated "a#ed on #ome dynamic criteria "a#ed on the ?ata record# of the I?+&. For e,ample3
I?+ need to "e generated only if the pricing condition value i# greater than 55 and &ondition type i# ;;.
,se of PS "Publish Subscribe# BTE.
Pu"li#h K Su"#cri"e $u#ine## %ran#action Event (P9S $%E) can "e u#ed to filter the generation of I?+. &u#tomi'ed
function module 8ith comple, filtering condition# can "e a##igned to thi# $%E 8hich 8ill "e triggered during the +ut"ound
Proce##ing of I?+&.
List of P/S Business Transaction Events attached to 0utbound &10C Processing
5. &&5555 E&MMAS +ut"ound Proce##ing for AE ?i#tri". Bnit
Message Type ECMMAS - Engineering Change Management
Processing Function Module MASTER_!"C_CREATE_SM!_ECMMAS
BTE Function Module SAMP#E_$TERFACE_CC%%%&&%
-
7/25/2019 BTE - Business Transaction Event
11/57
5-. &7R5555 &7RMAS +ut"ound Proce##ing for AE ?i#tri"ution
Message Type C'RMAS - Class system( Characteristics master
Processing Function Module MASTER!"C_CREATE_SM!_C'RMAS
BTE Function Module SAMP#E_$TERFACE_C'R%%&%%
52. &F5555 &FMAS +ut"ound Proce##ing for AE ?i#tri"ution
Message Type C#FMAS - Class system( Classi)ication master
Processing Function Module MASTER!"C_CREATE_SM!_C#FMAS
BTE Function Module SAMP#E_$TERFACE_C#F%%&%%
54. &S5555 &SMAS +ut"ound +roce##ing for AE ?i#tri"n unit
Message Type C#SMAS - Class system( Classes master
Processing Function Module MASTER!"C_CREATE_SM!_C#SMAS
BTE Function Module SAMP#E_$TERFACE_C#S%%&%%
-
7/25/2019 BTE - Business Transaction Event
12/57
56. &S55556 $+MMA% +ut"ound Proce##ing for AE ?i#tri"n unit
Message Type B"MMAT - B"Ms( Material B"M
Processing Function Module M!M_!"C_CREATE_SM!_B"MMAT
BTE Function Module SAMP#E_$TERFACE_CS%%%&%*
5L &C55555 ?+&MAS +ut"ound Proce##ing for AE ?i#tri"n unit
Message Type !"CMAS - Master document
Processing Function Module MASTER!"C_CREATE_SM!_!"CMAS
BTE Function Module SAMP#E_$TERFACE_C+%%%&%%
5. ?EP5555 ?EP0E% +ut"ound Proce##ing for AE ?i#tri"n Bnit
Message Type !EP$ET - !ependency net
Processing Function Module MASTER!"C_CREATE_SM!_!EP$ET
BTE Function Module SAMP#E_$TERFACE_!EP%%&%%
-
7/25/2019 BTE - Business Transaction Event
13/57
5. ?+5555 ?+MAS +ut"ound proce##ing for AE ?i#tri"n Bnit
Message Type !"#MAS - !ocument-o,ect lin.s
Processing Function Module MASTER!"C_CREATE_SM!_!"#MAS
BTE Function Module SAMP#E_$TERFACE_!"#%%&%%
5H. D0+5555 D0+MAS +ut"ound Proce##ing for AE ?i#tri"n Bnit
Message Type /$"MAS - 0lo,al o,ect dependencies
Processing Function Module MASTER!"C_CREATE_SM!_/$"MAS
BTE Function Module SAMP#E_$TERFACE_/$"%%&%%
5. MGC5555 MA%MAS +ut"ound proce##ing for AE ?i#tri"n Bnit
Message Type MATMAS - Material master
Processing Function Module MASTER!"C_CREATE_SM!_MATMAS
BTE Function Module SAMP#E_$TERFACE_M0+%%&%%
-
7/25/2019 BTE - Business Transaction Event
14/57
. CFB5555 CF0MAS +ut"ound Proce##ing for AE ?i#tri"n Bnit
Message Type +F$MAS - +ariant )unction
Processing Function Module MASTER!"C_CREATE_SM!_+F$MAS
BTE Function Module SAMP#E_$TERFACE_+F1%%&%%
-. CD+A555 &+0?/A +ut"ound Proce##ing for AE ?i#tri"n Bnit
Message Type C"$!_A - Conditions( master data )or price determination
Processing Function Module MASTER!"C_CREATE_SM!_C"$!_A
BTE Function Module SAMP#E_$TERFACE_+/"A%&%%
2. C%A5555 C%AMAS +ut"ound Proce##ing for AE ?i#tri"ution
Message Type +TAMAS - Structure o) variant ta,le
Processing Function Module MASTER!"C_CREATE_SM!_+TAMAS
BTE Function Module SAMP#E_$TERFACE_+TA%%&%%
-
7/25/2019 BTE - Business Transaction Event
15/57
4. C%M5555 C%MMAS +ut"ound Proce##ing for AE ?i#tri"ution
Message Type +TMMAS - Contents o) variant ta,le
Processing Function Module MASTER!"C_CREATE_SM!_+TMMAS
BTE Function Module SAMP#E_$TERFACE_+TM%%&%%
Configurations *e+uired to Activate BTE
.
a. &reate a Function group u#ing %ran#action code SE5.
". &opy the #tandard $%E Function module (for Eg. SAMPE/I0%ERFA&E/CD+A555 for Pricing
condition#) to Funtion module (Eg. SAMPE/I0%ERFA&E/CD+A555) in the a"ove function group u#ing %ran#action
code SE2 and activate it.
c. &reate &u#tomer Product (%ran#action code FI$F ! Setting# ! Product# ! ... of a cu#tomer)
d. Add the appropriate PKS $%E and a##ign the Function module created in Step" u#ing menu
option(%ran#action code FI$F ! Setting# ! P9S Module# ! ... of a cu#tomer)
e. See thi# >iDi po#t 8hich e,plain# the #tep# to configure PKS $%E for Pricing condition# PKS $%E
#etting# for Pricing &ondition# +ut"ound I?+& Filtering
Saple code 2ritten in 3-( : 3SA(PLE4&5TE*ACE4$%0A6766 "or Pricing
Conditions &10C#
1
2
3
4
5
+2(8TIO(zsa#le_inter=ace_,koa$0$$.
*4444444444444444444444444444444444444444444444444444444444444444444444
**ocal Inter=ace:
* TA)E'
* IDO8_DATA 'TR28T2RE EDIDD
http://wiki.sdn.sap.com/wiki/display/ABAP/Business+Transaction+Event+-+VKOA0100+-+For+Outbound+Pricing+IDOC+Filteringhttp://wiki.sdn.sap.com/wiki/display/ABAP/Business+Transaction+Event+-+VKOA0100+-+For+Outbound+Pricing+IDOC+Filteringhttp://wiki.sdn.sap.com/wiki/display/ABAP/Business+Transaction+Event+-+VKOA0100+-+For+Outbound+Pricing+IDOC+Filteringhttp://wiki.sdn.sap.com/wiki/display/ABAP/Business+Transaction+Event+-+VKOA0100+-+For+Outbound+Pricing+IDOC+Filtering -
7/25/2019 BTE - Business Transaction Event
16/57
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
* 87A(BI(B
* RE+ERE(8EGIDO8_7EADERH T"PE EDID8
* E8EPTIO('
* ERROR
*4444444444444444444444444444444444444444444444444444444444444444444444
* E,ent rissen b- t!e AE outbound #rocess =or 8O(D_A.
* It allows to odi=- t!e idoc3s control !eader t!e idoc data aswell
* as serialization in=oration created b- t!e standard 'AP outbound
* #rocess.
* Raising t!e E8EPTIO( ERROR will #re,ent t!e IDO8 =ro being
* subitted to t!e AE la-er.
* )E 8ARE+2 WIT7 A(" 87A(BE' TO IDO8_8O(TRO. IT 9A" E++E8T "O2R W7OE
* AE4'8E(ARIO
* +iltering o= IDO8s based on Recei,ing Partner can be done using t!e
* ,alidation in structure IDO8_7EADER.
DATA : l,_=lag T"PE c!ar$0&
l,_kbetr T"PE kbetr.
8EAR : l,_=lag& l,_kbetr.
OOP AT idoc_data.
I+ idoc_data4segna EJ 3E0>O(P3.
9O1E idoc_data4sdataKFCG0FH TO l,_kbetr.
-
7/25/2019 BTE - Business Transaction Event
17/57
32
33
34
35
36
37
38
39
40
41
42
43
44
I+ l,_kbetr T 0$$.
9O1E 33 TO l,_=lag.
EIT.
E(DI+.
E(DI+.
E(DOOP.
I+ l,_=lag EJ 33.
RE+RE'7: idoc_data.
RAI'Eerror.
E(DI+.
E(D+2(8TIO(.
$u#ine## %ran#action Event# Proce## Interface Event
5555525 cu#tomer implementation for printing dunningnotice
Business Transaction Events Process &nterface "&nfo-s!stes Process#
Business Transaction Events -
http://wiki.scn.sap.com/wiki/display/ABAP/Business+Transaction+Events+-+Process+Interface+-+Event+00001030+-+customer+implementation+for+printing+dunning+noticehttp://wiki.scn.sap.com/wiki/display/ABAP/Business+Transaction+Events+-+Process+Interface+-+Event+00001030+-+customer+implementation+for+printing+dunning+noticehttp://wiki.scn.sap.com/wiki/display/ABAP/Business+Transaction+Events+-+Process+Interface+-+Event+00001030+-+customer+implementation+for+printing+dunning+noticehttp://wiki.scn.sap.com/wiki/display/ABAP/Business+Transaction+Events+-+Process+Interface+-+Event+00001030+-+customer+implementation+for+printing+dunning+noticehttp://wiki.scn.sap.com/wiki/display/ABAP/Business+Transaction+Events+-+Process+Interface+-+Event+00001030+-+customer+implementation+for+printing+dunning+noticehttp://wiki.scn.sap.com/wiki/display/ABAP/Business+Transaction+Events+-+Process+Interface+-+Event+00001030+-+customer+implementation+for+printing+dunning+notice -
7/25/2019 BTE - Business Transaction Event
18/57
i*e S? u#er e,it#3 $%E are the enhancement techniue# that are de#igned and u#ed mainly for FI (Finance) module.
Bnli*e $A?I3 "u#ine## tran#action event# are implemented #pecifically (individually) for ;SAP;3 ;Partner; and ;&u#tomer;.
Each (SAP3 Partner and cu#tomer) 8ill have different implementation# 8hich 8ill not intervene into each other.
%hi# i# 8hat ma*e# it more functionally "u#ine## oriented and allo8# different e,ternal a# 8ell a# internal application# to
connect via interface#.
Each (SAP3 Partner and cu#tomer) 8ill develop it# o8n function module 8hich 8ill uniuely identify it# logic and 8ill regi#ter
8ith the #y#tem (a# a product 8ith the cu#tom or #tandard function module).
-
7/25/2019 BTE - Business Transaction Event
19/57
%hi# facilitate# the #y#tem to chec* each one# (SAP3 Partner and cu#tomer) implementation#.
After all3 the main reuirement lie# in enhancing the #tandard proce##.
0o83 8hen 8e tal* a"out $%E data e,change3 8e have interface# playing a vital role.
%here are t8o $%E interface#3
Pu"li#h K Su"#cri"e interface# (Informing Interface#)
Proce## Interface# (Proce##)
& )ould suggest referring to the SAP docuentation available for the t)o interfaces.
7ere3 thi# #cenario deal# 8ith the ;Proce## Interface; for event ;5555525; (+PE0/FI/PERF+RM/5555525/P) for
replacing the #tandard dunning form #upplied during the ;&u#tomi'ing #etting#; at runtime 8ithout actually replacing the entry
in ;&u#tomi'ing #etting#;.
+ur implementation 8ill act a# a ;7oo*; point 8hich 8ill trigger the cu#tomi'ed form at runtime.
Business Area: 1unning "&-
1unning -
It i# a proce## "y 8hich reminder# are #ent to the cu#tomer# reue#ting them to pay their due# for their re#pective ;+pen
item#;. %he#e reminder# are automatically #ent "a#ed on the ;?unning procedure;3 ;dunning area; and ;dunning level; mainly
8hich are maintained in the ;&u#tomi'ed #etting#;.
Al#o3 the form (notice) to "e printed "a#ed on the logic of ;dunning level; i# a##igned in the cu#tomi'ed #etting#.
If the cu#tomer fail# to pay the reue#ted amount 8ithin the due date#3 fir#tly the cu#tomer lo#e# the opportunitie# to avail
#ome di#count #cheme# a# 8ell a# 8hen the final gentle notice a ;egal notice; i# #ent to the cu#tomer 8ith #ome #urcharge
"a#ed on certain calculation#.
%he#e #etting# are performed "y the FI con#ultant3 "ut
-
7/25/2019 BTE - Business Transaction Event
20/57
Another 8ay to do that i# ;?unning; ;?unning Procedure; ;?unning %e,t#;.
-
7/25/2019 BTE - Business Transaction Event
21/57
0o83 the ;dunning procedure; maintained for a cu#tomer (#ay) ;%SLLA5; i# ;555; 8hich i# (#ay) ;Fourlevel dunning3
every t8o 8ee*#; for country code (#ay) ;555;.
>e can maintain ;dunning procedure; for a #pecific dunning area too3 li*e ;5; for ;dome#tic cu#tomer; and ;5-; for ;foreign
cu#tomer;3
Fir#t3 8e 8ill o"#erve the #tandard functionality3
%he tran#action for dunning i# ;F65;.
7ere3 8e maintain the nece##ary dunning parameter# 8hich are e##ential to ;?unn; for a cu#tomer9vendor.
-
7/25/2019 BTE - Business Transaction Event
22/57
Save the parameter#3
After all the parameter# are maintained3 generate an ;Individual ?unning 0otice; and ena"le the printing ;chec*"o,;.
-
7/25/2019 BTE - Business Transaction Event
23/57
+"#erve the #tandard dunning notice generated3
-
7/25/2019 BTE - Business Transaction Event
24/57
0o83 to enhance the #tandard proce##3 8e ta*e help of the $%E.
%he allinone place for $%E i# tran#action ;FI$F;.
0avigate to the ;Info #y#tem (Proce##e#); module3
-
7/25/2019 BTE - Business Transaction Event
25/57
For the attri"ute type ;A; that i# ;Application &omponent;3 e,ecute to find the po##i"le ;$%E; under it.
ocate the #uita"le $%E (here 5555525) and o"#erve the functional documentation a# ho8 the $%E 8ill 8or*:
Secondly3 clic* on the ;Sample function module; to reference the cu#tom 8ith the #tandard.
-
7/25/2019 BTE - Business Transaction Event
26/57
7ere i# the functionality thi# $%E 8ill offer (Refer documentation).
-
7/25/2019 BTE - Business Transaction Event
27/57
&opy the #ample function module into function module in cu#tomer name#pace3
>rite the #ource code 8hich need# to "e trigger at runtime3 ;&/F+R0R; denote# the ;form name;.
-
7/25/2019 BTE - Business Transaction Event
28/57
Activate the function module.
0o8 it;# the time to regi#ter thi# product a# a ;&u#tomer; or ;Partner; ...
Fir#t create a product3 navigate to the product#. +"#erve3
-
7/25/2019 BTE - Business Transaction Event
29/57
&reate any entry for the product3
%he ne,t mo#t important #tep 8ould "e to regi#ter the ;Event; 8ith the product (#ay) ;?ACE;3
So "a#ed on the category (partner or cu#tomer) regi#ter3
-
7/25/2019 BTE - Business Transaction Event
30/57
Ma*e a ne8 entry3
>ell3 that;# itN %he time ha# come to o"#erve the de#ired functionality achieved.
A# li*e maintained in the previou# #tage# of thi# ;>i*i;3 maintain parameter# of the ;?unn; run and generate the ;Individual;
dunning notice.
%ry po##i"ly ;?e"ugging; the application #o a# to under#tand the complete replacement form $%E3
+"#erve3
-
7/25/2019 BTE - Business Transaction Event
31/57
After drilling deep into the function module3 o"#erve the ta"le ;AP&BS%A$; 8hich denote# the cu#tomer ta"le populated if
the $%E i# implemented a# a ;&u#tomer;. >herea#3 the ta"le ;APPR%%A$J denote# the partner ta"le and ;APSAP%A$;
denote# SAP implementation ta"le re#pectively.
Generally3 8hen there i# no $%E implementation (&u#tomer or Partner)3 then the SAP implementation 8hich i# a #tandard
one i# triggered.
-
7/25/2019 BTE - Business Transaction Event
32/57
%he good ne8# i# thatN %he ta"le ;APP&BS%A$; contain# #ome entry. $ut3 8hat doe# it have in it. +"#erve to find out.
%o confirm 8ith3 the #tatu# for cu#tomer implementation can "e verified during de"ugging.
%he indicator ;&; indicate# ;&u#tomer; implementation.
-
7/25/2019 BTE - Business Transaction Event
33/57
+nce again3
7ere it i#N %hi# confirm# that our implementation function module ha# triggered and u#ed "y the #y#tem for the dunning
form printing procedure.
-
7/25/2019 BTE - Business Transaction Event
34/57
+"#erve the cu#tomer implementation code 8here the value# of the cu#tom form have "een accepted.
+"#erve the $%E function module acce##ed3
-
7/25/2019 BTE - Business Transaction Event
35/57
Finally3 o"#erve the print notice after the $%E ha# triggered.
%he indication# in ;RE?; #ho8 the added te,t in the ;; form #upplied (hardcoded) in the $%E.
-
7/25/2019 BTE - Business Transaction Event
36/57
$u#ine## %ran#action Event# Proce## Interface Event55555L5 cu#tomer implementation for cu#tomi'ingdunning notice
Business Transaction Events Process &nterface "&nfo-s!stes Process#
%o refer detailed di#cu##ion on $%E and a #cenario on printing of dunning notice refer my >i*i3
$u#ine## %ran#action Event# Proce## Interface Event 5555525 cu#tomer implementation for printing dunning notice
1unning -
It i# a proce## "y 8hich reminder# are #ent to the cu#tomer# reue#ting them to pay their due# for their re#pective ;+pen
http://wiki.scn.sap.com/wiki/display/ABAP/Business+Transaction+Events+-+Process+Interface+-+Event+00001060+-+customer+implementation+for+customizing+dunning+noticehttp://wiki.scn.sap.com/wiki/display/ABAP/Business+Transaction+Events+-+Process+Interface+-+Event+00001060+-+customer+implementation+for+customizing+dunning+noticehttp://wiki.scn.sap.com/wiki/display/ABAP/Business+Transaction+Events+-+Process+Interface+-+Event+00001060+-+customer+implementation+for+customizing+dunning+noticehttps://wiki.sdn.sap.com/wiki/x/UACRBQhttp://wiki.scn.sap.com/wiki/display/ABAP/Business+Transaction+Events+-+Process+Interface+-+Event+00001060+-+customer+implementation+for+customizing+dunning+noticehttp://wiki.scn.sap.com/wiki/display/ABAP/Business+Transaction+Events+-+Process+Interface+-+Event+00001060+-+customer+implementation+for+customizing+dunning+noticehttp://wiki.scn.sap.com/wiki/display/ABAP/Business+Transaction+Events+-+Process+Interface+-+Event+00001060+-+customer+implementation+for+customizing+dunning+noticehttps://wiki.sdn.sap.com/wiki/x/UACRBQ -
7/25/2019 BTE - Business Transaction Event
37/57
item#;. %he#e reminder# are automatically #ent "a#ed on the ;?unning procedure;3 ;dunning area; and ;dunning level; mainly
8hich are maintained in the ;&u#tomi'ed #etting#;.
Al#o3 the form (notice) to "e printed "a#ed on the logic of ;dunning level; i# a##igned in the cu#tomi'ed #etting#.
If the cu#tomer fail# to pay the reue#ted amount 8ithin the due date#3 fir#tly the cu#tomer lo#e# the opportunitie# to avail
#ome di#count #cheme# a# 8ell a# 8hen the final gentle notice a
;egal notice; i# #ent to the cu#tomer 8ith #ome #urcharge "a#ed on certain calculation#.
%he#e #etting# are performed "y the FI con#ultant3 "ut
-
7/25/2019 BTE - Business Transaction Event
38/57
;$an*a""uchung; and ;O"er8ei#ung; re#pectively.
In #uch a ca#e dunning i# not po##i"le and to print a dunning notice.
$ut3 in "u#ine## a#pect# irre#pective of the incoming payment method active the dunning notice ha# to "e #ent to the
cu#tomer a# that 8ill impact the "u#ine##.
So3 8e have a $%E 8hich 8ill allo8# printing the dunning notice in#pite of an ;Incoming payment; method active 8ithout
changing the method or the indicator.
Al#o3 thi# $%E can "loc* the entire cu#tomer to "e dunned3 although in the cu#tomer ma#ter #ho8# ;Free for dunning;
indicator (that i# #pace).
%o #tart 8ith 8e o"#erve the #tandard proce##3
Go to tran#action ;F65; for dunning and maintain the parameter# fir#t.
-
7/25/2019 BTE - Business Transaction Event
39/57
Ma*e a dunning #cheduling run and give the printing in#truction#.
After the run3 o"#erve the ;?unning log;3 due the ;incoming payment; method there i# no ;#cheduling; and ;printing; of
dunning notice.
-
7/25/2019 BTE - Business Transaction Event
40/57
0o83 to ma*e it po##i"le to #end a reminder a"out the overdue item# of the cu#tomer to "e paid 8e need to #end it
irre#pective of any incoming payment method3 $%E come# for the re#cue.
Go to the $%E tran#action ;FI$F;.
E,ecute the tran#action and #elect the de#ired $%E for the reuirement.
Fir#t after reading the documentation3 analy'e the #ample function module.
-
7/25/2019 BTE - Business Transaction Event
41/57
Ma*e a copy of the #tandard function module under ;cu#tomer; name#pace.
>rite the code a# per reuirement. 7ere3 hen there i# a payment method ;Incoming; e#pecially active then the value of the parameter ;&/A$; or ;M70?
A$; "ecome# ;; and the dunning notice doe# not get printed.
-
7/25/2019 BTE - Business Transaction Event
42/57
%o o"#erve the overriding of the parameter ;M70?A$; 8ithout actually changing the value in the ma#ter ta"le3
de"ug the application.
Fir#t3 go to tran#action ;F65; ?unning and fill in the nece##ary parameter#3
-
7/25/2019 BTE - Business Transaction Event
43/57
%hen #chedule the dunning run.
After #cheduling confirm that the run and the print i# complete3
-
7/25/2019 BTE - Business Transaction Event
44/57
Al#o3 confirm the log and the de#ired functionality ha# "een achieved in#pite of an incoming payment method.
-
7/25/2019 BTE - Business Transaction Event
45/57
I 8ould #ugge#t going for "ac*ground de"ugging for under#tanding the complete proce## and the functionalityenhancement.
-
7/25/2019 BTE - Business Transaction Event
46/57
See the de#ired $%E proce## i# in the li#t and a# there i# #ome active cu#tomer9partner product regi#tered the value
;EMP%; i# not ;;.
-
7/25/2019 BTE - Business Transaction Event
47/57
At la#t thing# mu#t go perfect 8hen you #ee an entry of our function module in the ta"le (cu#tomer ta"le) ;AP&BS%A$;3
chec* thi# out.
$efore our cu#tomer enhancement code i# encountered the #tatu# of the original functionality i# ;?unning notice not to "e
printed;3 confirm it thi# 8ay.
-
7/25/2019 BTE - Business Transaction Event
48/57
+"#erve the parameter# ;&/FAE;3 ;&/A$; and ;&/MA0SP; re#pectively.
0o83 8hen our functionality i# triggered3 o"#erve the change. %he parameter ;&/A$; ha# "een changed to (Space).
-
7/25/2019 BTE - Business Transaction Event
49/57
+"#erve the notice 8hich get# printed in#pite of ;incoming payment; method.
-
7/25/2019 BTE - Business Transaction Event
50/57
7ere to utili'e the functionality of $%E 55555L5 proce## interface3 8e con#ider another #cenario in the ca#e 8hen a
cu#tomer ha# to "e "loc*ed temporarily 8ithout changing the ma#ter data. %hen thi# $%E can ma*e a difference.
0ote I 8ould #ugge#t you to follo8 the #ame proce## for #cheduling a dunning run and printing a# demon#trated "efore.
In the cu#tomer ma#ter the ;?unning "loc*; i# not active or the #tatu# i# ;Freed for dunning;. >hich mean# the cu#tomer
can "e dunned and notice can "e printed.
-
7/25/2019 BTE - Business Transaction Event
51/57
In order to "loc* the cu#tomer 8ithout changing the cu#tomer ma#ter3 creating our o8n cu#tomer implementation 8ill
ma*e thi# po##i"le.
So3 here the #ame proce## i# follo8ed3
%ran#action ;FI$F; Proce## Interface Event 55555L5 (&hec* M70?) #ample function module (8ith documentation)
&opy the #tandard #ample function module to cu#tomer name #pace and o"#erve the parameter# #et.
7ere the parameter ;&/MA0SP; indicate# the dunning "loc*. If thi# indicator i# #et ;;3 then the cu#tomer #tatu# i# #et a#
;"loc*ed;.
-
7/25/2019 BTE - Business Transaction Event
52/57
0o83 after dunning run i# proce##ed vie8 the log to chec* the #tatu#.
A# the cu#tomer i# "loc*ed the dunning notice 8ill not "e printed.
-
7/25/2019 BTE - Business Transaction Event
53/57
$u#ine## %ran#action Event CD+A555 For +ut"oundPricing I?+& Filtering
$u#ine## %ran#action Event CD+A555 For +ut"ound Pricing
I?+& Filtering
Suar!
%hi# po#t narrate# the u#e of $u#ine## %ran#action Event for filtering of Pricing &ondition# +ut"ound I?+.
http://wiki.scn.sap.com/wiki/display/ABAP/Business+Transaction+Event+-+VKOA0100+-+For+Outbound+Pricing+IDOC+Filteringhttp://wiki.scn.sap.com/wiki/display/ABAP/Business+Transaction+Event+-+VKOA0100+-+For+Outbound+Pricing+IDOC+Filteringhttp://wiki.scn.sap.com/wiki/display/ABAP/Business+Transaction+Event+-+VKOA0100+-+For+Outbound+Pricing+IDOC+Filteringhttp://wiki.scn.sap.com/wiki/display/ABAP/Business+Transaction+Event+-+VKOA0100+-+For+Outbound+Pricing+IDOC+Filtering -
7/25/2019 BTE - Business Transaction Event
54/57
Author"s#: $inod %uar T
Copan!: 0II% %echnologie# imited
Created on: -.5.-55
Author"s# BioCinod Dumar i# an A$AP &on#ultant 8or*ing 8ith 0II% %echnologie# imited.
Scenario
Pricing condition# are tran#mitted to different AE Partner# through the Program R$?MI?+&. Standard Me##age type
&+0?/A i# u#ed to create the I?+.
8o) &10Cs are Created9
Standard program R$?MI?+& refer# the ta"le %$?ME to get the function module 8hich i# to "e e,ecuted for creatingI?+. For me##age type &+0?/A3 Standard function module MAS%ERI?+&/&REA%E/SM?/&+0?/A i# e,ecuted to
generate the I?+. Since thi# function module 8or*# on the concept of &7A0GE P+I0%ERS all the pricing condition
record# 8hich are not yet proce##ed 8ill "e pic*ed up u#ing the function module &7A0GE/P+I0%ERS/REA?. %he#e
record# 8ill "e converted a# per #egment# in the $a#ic I?+& type 9 me##age type and 8ill "e tran#mitted to all the Partner#
8hich are maintained in >E-5 (Partner Profile &onfiguration) and $?L4 (?i#tri"ution Model).
Business *e+uireent
A# per the ne8 reuirement3 &ondition# record# #ati#fying certain reuirement# are only to "e tran#mitted (eg. All the
record# 8ith pricing condition value greater than 55 K Receiving Partner i# ). ?ata filtering u#ing $?L4 (?i#tri"ution
Model) 8a# not a"le to handle the #uch comple, filtering of I?+.
BTE as a Solution
$u#ine## %ran#action Event $%0A6766can "e u#ed to filter the generation of I?+. &u#tomi'ed function module 8ith
comple, filtering condition# can "e a##igned to thi# $%E 8hich 8ill "e triggered during the +ut"ound Proce##ing of I?+&.
Configurations *e+uired to Activate BTE
&reate a Function group u#ing %ran#action code SE5.
&opy the #tandard function module SAMPE/I0%ERFA&E/CD+A555 to SAMPE/I0%ERFA&E/CD+A555 in
the a"ove function group u#ing %ran#action code SE2 and activate it.
-
7/25/2019 BTE - Business Transaction Event
55/57
&reate &u#tomer Product (%ran#action code FI$F ! Setting# ! Product# ! ... of a cu#tomer
&reate &u#tomer PKS Module (%ran#action code FI$F ! Setting# ! P9S Module# ! ... of a
&u#tomer
Saple code 2ritten in ( : 3SA(PLE4&5TE*ACE4$%0A6766
1
2
3
4
5
6
7
8
+2(8TIO(zsa#le_inter=ace_,koa$0$$.
*4444444444444444444444444444444444444444444444444444444444444444444444
**ocal Inter=ace:
* TA)E'
* IDO8_DATA 'TR28T2RE EDIDD
* 87A(BI(B
* RE+ERE(8EGIDO8_7EADERH T"PE EDID8
* E8EPTIO('
-
7/25/2019 BTE - Business Transaction Event
56/57
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
* ERROR
*4444444444444444444444444444444444444444444444444444444444444444444444
* E,ent rissen b- t!e AE outbound #rocess =or 8O(D_A.
* It allows to odi=- t!e idoc3s control !eader t!e idoc data aswell
* as serialization in=oration created b- t!e standard 'AP outbound
* #rocess.
* Raising t!e E8EPTIO( ERROR will #re,ent t!e IDO8 =ro being
* subitted to t!e AE la-er.
* )E 8ARE+2 WIT7 A(" 87A(BE' TO IDO8_8O(TRO. IT 9A" E++E8T "O2R W7OE
* AE4'8E(ARIO
* +iltering o= IDO8s based on Recei,ing Partner can be done using t!e
* ,alidation in structure IDO8_7EADER
DATA : l,_=lag T"PE c!ar$0&
l,_kbetr T"PE kbetr.
8EAR : l,_=lag& l,_kbetr.
OOP AT idoc_data.
I+ idoc_data4segna EJ 3E0>O(P3.
9O1E idoc_data4sdataKFCG0FH TO l,_kbetr.
I+ l,_kbetr T 0$$.
9O1E 33 TO l,_=lag.
EIT.
E(DI+.
-
7/25/2019 BTE - Business Transaction Event
57/57
35
36
37
38
39
40
41
42
43
E(DI+.
E(DOOP.
I+ l,_=lag EJ 33.
RE+RE'7: idoc_data.
RAI'Eerror.
E(DI+.
E(D+2(8TIO(.