Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Generate Invoice

Former Member
0 Kudos

Hi All,

I am in need of generating an INVOICE from FB01 tcode. I have to generate the invoice according to the USER6 field in the table AUFK. The invoice amount should be totalled according to the USER6 field. It should also have a logo.

I am plannig to use the BAPI - BAPI_ACC_GL_POSTING_POST.

But it doesnot hold the USER6 field. The details for posting are enterd through a Selection-screen in a Custom Program.

Let me know how to proceed. Will the BAPI be useful in generating the invoice.

Regards,

Priyanka.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi Priyanka,

From your requirement I understand that you want to post an accounting document instead of invoice.

The amount BAPI_ACC_DOCUMENT_POST is useful for your requirement.

From the order number given on the inut screen ( AUFNR needs to be given on the input screen ) , Get the USER6 Filed from AUFK and the filed value is the amount( DMBTR) in the BAPI.

Regards,

Sai

7 REPLIES 7

Former Member
0 Kudos

Hi Priyanka,

From your requirement I understand that you want to post an accounting document instead of invoice.

The amount BAPI_ACC_DOCUMENT_POST is useful for your requirement.

From the order number given on the inut screen ( AUFNR needs to be given on the input screen ) , Get the USER6 Filed from AUFK and the filed value is the amount( DMBTR) in the BAPI.

Regards,

Sai

0 Kudos

Hi Sai,

Thanks a lot for the reply.

But the USER6 field is not defined in the BAPI and no where in the tcode FB01. Let me know how to pass that particular fields to be in the document.

Thanks,

Priyanka

0 Kudos

Yes Priyanka. USER6 will not be there in BAPI. The value stored in USER6 to be moved to amount field (DMBTR) in accounting document.

Regards,

Sai

0 Kudos

Hi,

In the Function Module BAPI_ACC_GL_POSTING_POST in the tables we have two tables ACCOUNTGL

and CURRENCYAMOUNT.

There is a common field for both the tables POSNR_ACC with which the items are to be sent to the BAPI.

Please let me know from which table we get the field so that i can send the data through the tables.

Thanks,

Priyanka.

0 Kudos

Hi Priyanka,

You can check n BSEG table.

What happens in Accounting document is: There should be a credit entry for every debit entry.

In GL account internal table, you need to pass the both Credit and debit GL account information.

In the amounts internal table, you need to pass the Amout that is credit for each GL.

Example: GL: 10000 Credit. Amount : 500 /-

GL: 10030 Debit Amount : 500 /-.

Regards,

Sai

0 Kudos

Hi Sai,

BSEG table doesnot hold the field.

In my scenario i am getting data from BSEG and BKPF. Calculating the total amount for particular accounting number ans then passing them through the BAPI to post the document.

My doubt is POSNR_ACC should be sent through my internal table..how will i send the data??

Thanks,

Priyanka.

0 Kudos

Hi Priyanka,

POSNR_ACC gets automaticall picks up. I think need not to send it.

If it fails to post the document, then send it as 10 , 20 , 30 for resprctive items.

Regards,

Sai