‎2009 Mar 20 7:51 AM
Hello everyone,
I have a requirement to implement a SAP project for interest calculation, that instead of customer-based it is accounts receivable-based, which pretty much means that all records overdue in table bseg (in this case i use bsad and bsid) have to be included. I have already modified a lot of SAP standards to get the interest indicator to the places customer wants them (va41/42/fb02/fb03 etc.) and while creating the document, the info is written in a special z* table that i've created. So that works mostly, now... I have created a raport that has a selection screen at first and then displays all the data in a ALV grid. I have all the information in that raport that I need to create an invoice.. How do I do that? The invoice should not have a SD document number, but it should have XBLNR - document reference number. I probably have to use a function module, but I can't find the right one, spent the whole yesterday reading forums.... 'rv_invoice_create' I did try to use.. but not really what I'm looking for. Does anyone have any ideas what so ever?
Thanks!
‎2009 Mar 20 8:07 AM
‎2009 Mar 20 8:14 AM
Hello Marten,
Did you try a std. SAP trxn FINT? It calculates the int. on the overdue items & posts a FI doc.
May be you can search SDN for further details.
@ Amit: It's against forum rules to ask for award points.
BR,
Suhas
Edited by: Suhas Saha on Mar 20, 2009 9:14 AM
‎2009 Mar 20 8:34 AM
Hi,
Thanks for the answers.
I managed to create an interest invoice with fint, but can't find the invoice anywhere??
Plus FINT creates the interest calculation based on customer information, not as I need it.
Thanks
‎2009 Mar 20 8:49 AM
Hi,
have you tried to use standard BAPI for FI posting BAPI_ACC_DOCUMENT_POST or more specific BAPIs like BAPI_ACC_GL_POSTING_POST or BAPI_ACC_BILLING_POST. Check documentation for these BAPI and there are plenty of posts related to these BAPIs on this forum as well.
Cheers
‎2009 Mar 20 2:20 PM
I keep getting an error while using BAPI_ACC_DOCUMENT_POST
Incorrect entry in field OBJ_TYPE: BKPF <
doc_header-obj_type = 'BKPF'.
doc_header-obj_key = 'test1'.
doc_header-bus_act = 'RFBU'.
doc_header-username = sy-uname.
doc_header-doc_date = ztodat.
doc_header-header_txt = 'test'.
doc_header-comp_code = '0060'.
doc_header-doc_type = 'DV'.
doc_header-ref_doc_no = '999999999999'.
CALL FUNCTION 'BAPI_ACC_DOCUMENT_POST'
EXPORTING
DOCUMENTHEADER = doc_header
IMPORTING
OBJ_TYPE = obj_type
OBJ_KEY = obj_key
OBJ_SYS = obj_sys
TABLES
CURRENCYAMOUNT = it_ca
RETURN = return.
‎2009 Mar 20 2:28 PM
Try leaving obj_type and obj_key blank, and likely you will have to pass table "accountgl" and/or "accountreceivable" as well to the BAPI.
Thomas
‎2009 Mar 23 10:10 AM
Can't make it work.
Is there a demo program for posting DV type documents or has anyone ever done it?
Thanks!
‎2009 Mar 23 3:21 PM
Ok, so..
I think I got the point of this now.
document header is for BKPF table 1 row
accountgl is for BSEG table 2 rows
accountreceivable is for BSID table 1 row
if I get them filled up properly, it should work?
thanks
‎2009 Mar 23 4:27 PM
Hi Märten,
You should also fill up the CurrencyAmount parameter with an internal table that would have all the amounts you want to assign to both GL accounts and to the A/R line (customer).
Hope it helps you.
Regards,
Daniel.
‎2009 Mar 23 4:53 PM
> Ok, so..
> I think I got the point of this now.
> document header is for BKPF table 1 row
> accountgl is for BSEG table 2 rows
> accountreceivable is for BSID table 1 row
>
> if I get them filled up properly, it should work?
>
>
> thanks
Yes, one "accountgl" per G/L account item, one "accountreceivable" per customer item. It depends how the posted document should look like, from a functional point of view.
This BAPI has an online documentation, with references to yet more documentation, did you check that? Also check the where-used list of that function module in your system for samples of the correct usage.
Thomas
‎2009 Mar 24 8:29 AM
Hey Thomas,
where can I get the online documentation?
I did fill up the currency table, so that should be ok.
Thanks!
‎2009 Mar 24 12:41 PM
When you display the source code in SE37, there is a button "function module documentation".
Thomas
‎2009 Mar 26 8:57 AM
Hello,
Thanks for all the answers.
I used trans. SHDB to generate my own function module, which simulates transaction FB70. It was faster.
Thank you, I will now close this thread.
‎2009 Mar 26 9:03 AM
Well, using the BAPI would be much more future (i.e. upgrade) proof than creating fragile recordings, but there you go.
Thomas
‎2009 Mar 26 9:07 AM
true,
but as I'm little bit in a hurry, I first need to get this worked for testing and then later I will have more time to use the BAPI.
Thanks