Documentos de Académico
Documentos de Profesional
Documentos de Cultura
SAP Community Network Wiki - ABAP Development - Business Transaction Event - RWBAPI01 - For Accounting Document Interface
Welcome, Guest Login Register Getting Started Newsletters Store
Solutions Services & Support About SCN Downloads Industries Training & Education Partnership Developer Center Lines of Business University Alliances Events & Webinars Innovation
You are viewing an old version of this page. View the current version.
Compare with Current | View Page History
<< Previous Version 8 Next >>
Useful Inform ation Short quick summary to catch the reader's attention and of course the search engine
Applies to:
SAP 4.7x and above.
Summary
While Creating the Accounting document through BAPI - BAPI_ACC_DOCUMENT_POST posting keys are determined automatically based on the configuration. Since this BAPI doesn't have any structure field to pass the posting key, posting keys are picked up automatically based on the document type passed in BAPI header structure. This document narrates how to change the default posting key w hile creating the Accounting document using the above BAPI. This document also explains the steps involved in implementing a Business Transaction Event.
Author(s) Bio Vinod Kumar is an ABAP Consultant w orking w ith NIIT Technologies Limited.
wiki.sdn.sap.com/wiki/pages/viewpage.action?pageId=195726664
1/4
3/3/13
SAP Community Network Wiki - ABAP Development - Business Transaction Event - RWBAPI01 - For Accounting Document Interface
* *c l e a ri n t e r n a lt a b l e R E F R E S H: i t _ a c c o u n t g l , i t _ a c c o u n t r e c e i v a b l e , i t _ c u r r e n c y a m o u n t , i t _ r e t u r n , i t _ e x t e n s i o n 1 . * *F i l lh e a d e rd a t a . C L E A R:w a _ d o c u m e n t h e a d e r . M O V Es y u n a m e T Ow a _ d o c u m e n t h e a d e r u s e r n a m e . " U s e r n a m e " M O V E' T e s t ' T Ow a _ d o c u m e n t h e a d e r h e a d e r _ t x t . " H e a d e rT e x t " M O V E' 0 1 0 3 ' T Ow a _ d o c u m e n t h e a d e r c o m p _ c o d e ." C o m p a n yC o d e " M O V Es y d a t u m T Ow a _ d o c u m e n t h e a d e r d o c _ d a t e . " D o cD a t e " M O V Es y d a t u m T Ow a _ d o c u m e n t h e a d e r p s t n g _ d a t e . " P o s t i n gD a t e " M O V E' D Z ' T Ow a _ d o c u m e n t h e a d e r d o c _ t y p e . " D o cT y p e " M O V E' T e s t ' T Ow a _ d o c u m e n t h e a d e r r e f _ d o c _ n o . " R e f e r e n c e " M O V E' R F B U ' T Ow a _ d o c u m e n t h e a d e r b u s _ a c t . M O V E' B K P F F ' T Ow a _ d o c u m e n t h e a d e r o b j _ t y p e . " C o m m e n tf o r> =E C C 5 . 0 M O V E' $ ' T Ow a _ d o c u m e n t h e a d e r o b j _ k e y . " C o m m e n tf o r> =E C C 5 . 0 M O V Es y m a n d t T Ow a _ d o c u m e n t h e a d e r o b j _ s y s . " C o m m e n tf o r> =E C C 5 . 0 * * F i l lG LA c c o u n tL i n ei t e m . C L E A R:w a _ a c c o u n t g l ,w a _ c u r r e n c y a m o u n t . M O V E' 0 0 0 0 0 0 0 0 0 1 'T Ow a _ a c c o u n t g l i t e m n o _ a c c . " L i n eI t e mN o " M O V E' 0 0 1 4 0 0 0 0 4 1 'T Ow a _ a c c o u n t g l g l _ a c c o u n t . " G / LA c c o u n t " M O V E' I t e m T e s t ' T Ow a _ a c c o u n t g l i t e m _ t e x t . " I t e mT e x t " M O V E' 0 1 0 3 ' T Ow a _ a c c o u n t g l c o m p _ c o d e . " C o m p a n yC o d e " M O V E' 0 0 0 0 9 0 0 3 9 0 'T Ow a _ a c c o u n t g l p r o f i t _ c t r . " P r o f i tC e n t e r " M O V E' A s s i g n 1 ' T Ow a _ a c c o u n t g l a l l o c _ n m b r . " A s s i g n m e n t " A P P E N Dw a _ a c c o u n t g lT Oi t _ a c c o u n t g l . M O V E' 0 0 0 0 0 0 0 0 0 1 'T Ow a _ c u r r e n c y a m o u n t i t e m n o _ a c c . " L i n eI t e mN o " M O V E' 0 0 ' T Ow a _ c u r r e n c y a m o u n t c u r r _ t y p e . " C u r r e n c yT y p e " M O V E' I N R ' T Ow a _ c u r r e n c y a m o u n t c u r r e n c y . " C u r r e n c y " M O V Ed o c _ a m t _ c r T Ow a _ c u r r e n c y a m o u n t a m t _ d o c c u r ." A m o u n t " A P P E N Dw a _ c u r r e n c y a m o u n tT Oi t _ c u r r e n c y a m o u n t . * *F i l lC u s t o m e rL i n ei t e m C L E A R: w a _ a c c o u n t r e c e i v a b l e ,w a _ c u r r e n c y a m o u n t . M O V E' 0 0 0 0 0 0 0 0 0 2 'T Ow a _ a c c o u n t r e c e i v a b l e i t e m n o _ a c c ." I t e mN o " M O V E' 0 0 0 1 0 0 0 0 7 6 'T Ow a _ a c c o u n t r e c e i v a b l e c u s t o m e r . " C u s t o m e r " M O V E' I t e m T e s t ' T Ow a _ a c c o u n t r e c e i v a b l e i t e m _ t e x t . " I t e mT e x t " M O V E' 0 1 0 3 ' T Ow a _ a c c o u n t r e c e i v a b l e c o m p _ c o d e . " C o m p a n yC o d e " M O V E' A s s i g n 2 ' T Ow a _ a c c o u n t r e c e i v a b l e a l l o c _ n m b r ." A s s i g n m e n t . A P P E N Dw a _ a c c o u n t r e c e i v a b l eT Oi t _ a c c o u n t r e c e i v a b l e . M O V E' 0 0 0 0 0 0 0 0 0 2 'T Ow a _ c u r r e n c y a m o u n t i t e m n o _ a c c . " L i n eI t e mN o " M O V E' 0 0 ' T Ow a _ c u r r e n c y a m o u n t c u r r _ t y p e . " C u r r e n c yT y p e " M O V E' I N R ' T Ow a _ c u r r e n c y a m o u n t c u r r e n c y . " C u r r e n c y " M O V Ed o c _ a m t _ d r T Ow a _ c u r r e n c y a m o u n t a m t _ d o c c u r ." A m o u n t " A P P E N Dw a _ c u r r e n c y a m o u n tT Oi t _ c u r r e n c y a m o u n t . * * F i l lE x t e n s i o n 1S t r u c t u r eu s e db yB T E * * P o s t i n gk e yi st ob ec h a n g e df o ro n l yf o rC u s t o m e rl i n ei t e m( 0 0 0 0 0 0 0 0 0 2 ) * * R e c o r d si nt h i si n t e r n a lt a b l ew i l lb ec h e c k e di nB T E C L E A R:w a _ e x t e n s i o n 1 . M O V E' 0 0 0 0 0 0 0 0 0 2 0 4 'T Ow a _ e x t e n s i o n 1 f i e l d 1 . A P P E N Dw a _ e x t e n s i o n 1T Oi t _ e x t e n s i o n 1 . * *C a l lB a p i C A L LF U N C T I O N' B A P I _ A C C _ D O C U M E N T _ P O S T ' E X P O R T I N G d o c u m e n t h e a d e r =w a _ d o c u m e n t h e a d e r I M P O R T I N G " C o m m e n tf o r> = E C C 5 . 0 o b j _ t y p e =l v _ t y p e " C o m m e n tf o r> = E C C 5 . 0 o b j _ k e y =l v _ k e y " C o m m e n tf o r> = E C C 5 . 0 o b j _ s y s =l v _ s y s " C o m m e n tf o r> = E C C 5 . 0 T A B L E S a c c o u n t g l =i t _ a c c o u n t g l a c c o u n t r e c e i v a b l e=i t _ a c c o u n t r e c e i v a b l e c u r r e n c y a m o u n t =i t _ c u r r e n c y a m o u n t e x t e n s i o n 1 =i t _ e x t e n s i o n 1 r e t u r n =i t _ r e t u r n . * *C h e c kf o re r r o r s . C L E A R:w a _ r e t u r n . R E A DT A B L Ei t _ r e t u r nI N T Ow a _ r e t u r nW I T HK E Yt y p e=' E ' . I Fs y s u b r cN E0 . C A L LF U N C T I O N' B A P I _ T R A N S A C T I O N _ C O M M I T ' . E N D I F . * *d i s p l a yt h eo u t p u t L O O PA Ti t _ r e t u r nI N T Ow a _ r e t u r n . W R I T E: /w a _ r e t u r n t y p e , w a _ r e t u r n i d , w a _ r e t u r n n u m b e r , w a _ r e t u r n m e s s a g e . E N D L O O P .
wiki.sdn.sap.com/wiki/pages/viewpage.action?pageId=195726664
2/4
3/3/13
SAP Community Network Wiki - ABAP Development - Business Transaction Event - RWBAPI01 - For Accounting Document Interface
Configuration
Step 1: Go To Transaction code FIBF Step 2: Add Customer Product. Use Menu Option : Settings -> Products -> ...of a Customer
Step 3: Save the Product. Step 4: Create a Link betw een BTE and Product created in Step2. Use the menu option : Settings -> Process Modules -> ... of a customer
Summary
When the BAPI is executed, Code w ritten in the BTE - function module w ill be executed and the posting key of related line item w ill be changed before posting the documents.
Related Content
https://forums.sme.sap.com/message.jspa?messageID=8284886 http://forums.sdn.sap.com/message.jspa?messageID=9288661 http://forums.sdn.sap.com/thread.jspa?threadID=999473
wiki.sdn.sap.com/wiki/pages/viewpage.action?pageId=195726664
3/4
3/3/13
SAP Community Network Wiki - ABAP Development - Business Transaction Event - RWBAPI01 - For Accounting Document Interface
Follow SCN Contact Us SAP Help Portal Privacy Terms of Use Legal Disclosure Copyright
wiki.sdn.sap.com/wiki/pages/viewpage.action?pageId=195726664
4/4