Application Development and Automation 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: 
Read only

BAPI_ACC_DOCUMENT_POST - 1 tax code, 2 lines: how to manipulate?

Former Member
0 Likes
3,034

In our company code, we have a tax code, that has 2 tax percent.rates:

Goods/services tax VST 7,000 160 100 GST

Provincial Sales Tax VST 8,025 170 100 PST

These have to be calculated on the same base amount.

E.g.

Payable line item:

amount: 1890

G/L line item:

amount: 1260,59

Tax line item 1:

amount: 115.02 (=7%)(base amount = 1260,59)

Tax line item 2:

amount: 361.45 (=8%)(base amount = 1260,59)

This has to create 2 lines in the BSET table!

When we create an invoice online (fb60), this works perfectly. When I do it via the BAPI ACC_DOCUMENT_POST it's only one line item!

The BAPI somewhat counts up the tax two amounts that I give up in the BAPI (7% amount and 8% amount are counted togehter), only one line is created.

What it needs to do is create two line items for this tax code, with on each line item: the same base amount, the respectively percentage and calculated amount

Anyone any idea how I can manipulate this somehow?

BSET table:

Invoice created online (ideal situation):

line item 1, Base amount: 1643.12, Tax amount: 115.02

line item 2, base amount: 1643.12, tax amount: 131.86

Invoice created via BAPI (wrong situation):

line item 1, Base amount: 3286.24, Tax amount: 246.88

(3286.24 = 1643.12 x 2, 246.88 = 115.02 + 131.86)

Thanks!

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
2,066

Please try using RFBIBL00 Program.

Use structure BBTAX for both lines of TAX.

I is a workaround.

In our company code, we have a tax code, that has 2 tax percent.rates:

Goods/services tax VST 7,000 160 100 GST

Provincial Sales Tax VST 8,025 170 100 PST

These have to be calculated on the same base amount.

E.g.

Payable line item:

amount: 1890

G/L line item:

amount: 1260,59

Tax line item 1:

amount: 115.02 (=7%)(base amount = 1260,59)

Tax line item 2:

amount: 361.45 (=8%)(base amount = 1260,59)

This has to create 2 lines in the BSET table!

When we create an invoice online (fb60), this works perfectly. When I do it via the BAPI ACC_DOCUMENT_POST it's only one line item!

The BAPI somewhat counts up the tax two amounts that I give up in the BAPI (7% amount and 8% amount are counted togehter), only one line is created.

What it needs to do is create two line items for this tax code, with on each line item: the same base amount, the respectively percentage and calculated amount

Anyone any idea how I can manipulate this somehow?

BSET table:

Invoice created online (ideal situation):

line item 1, Base amount: 1643.12, Tax amount: 115.02

line item 2, base amount: 1643.12, tax amount: 131.86

Invoice created via BAPI (wrong situation):

line item 1, Base amount: 3286.24, Tax amount: 246.88

(3286.24 = 1643.12 x 2, 246.88 = 115.02 + 131.86)

Thanks!

9 REPLIES 9
Read only

Former Member
0 Likes
2,066

In the BAPI, tax structure, the field: Tax Jurisdiction Code Level should contain 2 different values, then I get

a line for each rate that I enter (I enter the tax amount myself), but the underlying tax rate is actually still 8.025 for the two lines

Read only

0 Likes
2,066

Hi boiler,

Strange tax-scheme! - is it from belgium?

-> give interface rfbibl00 a trial with filling structure bbtax

Andreas

Read only

0 Likes
2,066

No, this is for Canadian tax. PST & GST tax that is

Use interface RFBIBL00? That's not to create an invoice I guess?

It's the idea (if this canadian tax code does not prevent it) to work with a BAPI since most of the invoice posting logic is present & not too much programming has to be done.

Read only

0 Likes
2,066

You can post Invoices using RFBIBL00. Its for all kind of postings.

And here as well u just have to populate data in desired format as in BAPI.

Regards

Rohit

Read only

0 Likes
2,066

hi,

with rfbibl00 you can use all booking-transctions

like fb01, fb05, fb50,FB50, FB60, FB65, FB70, FB75

and f-xx.

I use it for EU-taxes:

for an invoice in a EU-State from an foreign but EU-vendor

i creat 2 tax lines with the fm CALCULATE_TAX_FROM_NET_AMOUNT

grace and a nice weekend

from the sunny Rhineland

Andreas

Read only

0 Likes
2,066

Ok, thanks for the reply.

How do I use this RFBIBL00?

Can't test it via SE37 + Shift + F8, because it's not a BAPI?

But we would be using the BAPI BAPI_ACC_DOCUMENT_POST to post all invoices (so for all other tax codes) and then for the Canadian tax code we would use this RFBIBL00? Hmm, that would be dangerous, not?

Or is this RFBIBL00 a better way to do all the invoice postings?

Reminder: this is invoice information that is coming from external (Access) system, therefore we use a BAPI.

And I am not a real programmer, the most ABAP I know is filling in a BAPI & test it via SE37 + Shift + F8

Thanks & nice weekend

Read only

0 Likes
2,066

Hi,

RFBIBL00 program can be used as standard ABAP report program which reads the external file (eg .TXT). But format of TXT file is bit tricky. (see below)

This Report will convert the data and will generate a Batch Session which you have to execute using TCode sm35.

File format ..

Row 0: Value "0"

Row 1: Header (Choose the desired columns from BBKPF structure)

Row 2: Detail line item 1 (Choose the desired columns from BBSEG structure)

Row 3: Detail Tax Item 1(Choose the desired columns from BBSEG structure)

and so on repeating the header and detail/tax line item for each invoice (Row 1, 2, 3). Note Row 0 will appear only once.

Hope this helps your TAX update

Regards,

Rohit

Read only

Former Member
0 Likes
2,067

Please try using RFBIBL00 Program.

Use structure BBTAX for both lines of TAX.

I is a workaround.

Read only

Former Member
0 Likes
2,066

Boiler, I am also using VST tax type and am having problems posting with the same BAPI you are using. The problem I am having is that the Bapi thinks the document is out of balance by the VST tax amount. This is happening in Form 'DETER_BALANCE'.

You don't seem to be having this problem. Would you tell me if your T007B entries for VST are as follows?

Ktosl VST

Stgrp 2

Stazf ‘space’

Stbkz 2

Stnsk ‘space’