SAP R/3 форум ABAP консультантов
Russian ABAP Developer's Club

Home - FAQ - Search - Memberlist - Usergroups - Profile - Log in to check your private messages - Register - Log in - English
Blogs - Weblogs News

BAPI_ACC_BILLING_POST



 
Post new topic   Reply to topic    Russian ABAP Developer's Club Forum Index -> Interfaces | Интерфейсы -> BAPI
View previous topic :: View next topic  
Author Message
admin
Администратор
Администратор



Joined: 01 Sep 2007
Posts: 1639

PostPosted: Sat Apr 12, 2008 12:37 am    Post subject: BAPI_ACC_BILLING_POST Reply with quote

BAPI_ACC_BILLING_POST - Учет и отчетность: проводка фактуры

He encontrado este ejemplo de código de llamada a la bapi en cuestión,
pero no consigo hacer que me reconozca el cliente.
He probado con alguna entrada de la KNA1 y de BSID o BSAK, pero no los encuentra:

Error en el documento: BKPFF $ ...

El deudor 100193 SH06 no existe.

Donde SH06 es la sociedad donde estoy haciendo las pruebas y el deudor 100193 existe en la tabla BSID.

Code:

************************************************** ****************
** Codigo de prueba para el uso de BAPI_ACC_BILLING_POST
************************************************** ****************

DATA: documentheader LIKE bapiache01 ,
accountreceivable LIKE bapiacar01 OCCURS 0 WITH HEADER LINE,
* wa_accountreceivable LIKE LINE OF bapiacar01,
accountgl LIKE bapiacgl01 OCCURS 0 WITH HEADER LINE,
* wa_accountgl LIKE LINE OF bapiacgl01,
currencyamount LIKE bapiaccr01 OCCURS 0 WITH HEADER LINE,
* wa_currencyamount LIKE LINE OF bapiaccr01,
accounttax LIKE bapiactx01 OCCURS 0 WITH HEADER LINE,
return LIKE bapiret2 OCCURS 0 WITH HEADER LINE.

* header
documentheader-obj_type = 'BKPFF'.
documentheader-obj_key = '$'.
*documentheader-obj_key(10) = number.
*documentheader-obj_key+10(4) = '1000'.
*documentheader-obj_key+14(4) = '2003'.
documentheader-obj_sys = 'HOTCLNT201'.
*documentheader-obj_sys(1) = 'Z'.
*documentheader-obj_sys+1(3) = sy-sysid.
*documentheader-obj_sys+4(3) = sy-mandt.
documentheader-username = sy-uname.
documentheader-header_txt = 'BAPI Billing Example'.
documentheader-obj_key_r = ''.
documentheader-comp_code = 'SH06'.
documentheader-ac_doc_no = sy-datlo."number.
documentheader-fisc_year = '2006'.
documentheader-doc_date = '20060110'.
documentheader-pstng_date = '20060110'.
documentheader-trans_date = '20060110'.
documentheader-fis_period = '10'.
documentheader-doc_type = 'RV'.
documentheader-ref_doc_no = 'xx-xx-xx'.
documentheader-compo_acc = ''.
documentheader-reason_rev = ''.

************************************************** ******************
* cuentas a cobrar
*wa_
accountreceivable-itemno_acc = '1'.
accountreceivable-customer = '100193'. "Customer number
accountreceivable-item_text = 'TEXTO'. "Item Text
* wa_ACCOUNTRECEIVABLE-GL_ACCOUNT = '7690000001'.
APPEND accountreceivable." TO accountreceivable.

*wa_
accountgl-itemno_acc = '2'.
accountgl-gl_account = '9001100100'. "????????????
accountgl-tax_code = 'R2'.                                  "'K2'.
APPEND accountgl." TO accountgl.


************************************************** ******************
* Items
*wa_
currencyamount-itemno_acc = '1'.
currencyamount-currency = 'EUR'.
currencyamount-amt_doccur = '1200'.
APPEND currencyamount." TO currencyamount.

*wa_
currencyamount-itemno_acc = '2'.
currencyamount-currency = 'EUR'.
currencyamount-amt_doccur = '-1200'.
currencyamount-amt_base = currencyamount-amt_doccur.
APPEND currencyamount." TO currencyamount.

************************************************** ******************
* Llamada a la bapi de facturas

CALL FUNCTION 'BAPI_ACC_BILLING_POST'
  EXPORTING
    documentheader    = documentheader
  TABLES
    accountreceivable = accountreceivable
    accountgl         = accountgl
    accounttax        = accounttax
    currencyamount    = currencyamount
    return            = return.

LOOP AT return.
  WRITE : /, return-message.
ENDLOOP.

CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
  EXPORTING
    wait   = 'X'
  TABLES
    return = return.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Russian ABAP Developer's Club Forum Index -> Interfaces | Интерфейсы -> BAPI All times are GMT + 4 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


All product names are trademarks of their respective companies. SAPNET.RU websites are in no way affiliated with SAP AG.
SAP, SAP R/3, R/3 software, mySAP, ABAP, BAPI, xApps, SAP NetWeaver and any other are registered trademarks of SAP AG.
Every effort is made to ensure content integrity. Use information on this site at your own risk.