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 with ACCOUNTTAX structure

Former Member
0 Likes
3,426

When I enter taxes values in BAPI_ACC_DOCUMENT_POST I need to fill out the ACCOUNTTAX structure. I’m not clear on two of the fields in the structure: COND_KEY – Condition Type and ACCT_KEY - Transaction Key. I’m posting an AR Customer Invoice (simulating FB70) with a DOC_TYPE = ‘DR’. I’m having trouble finding any equivalent sample code or documentation. Anyone know what I’m supposed to be using for COND_KEY (MWAS?) or ACCT_KEY (VST?) ??

Thanks for any help,

Karl

When I enter taxes values in BAPI_ACC_DOCUMENT_POST I need to fill out the ACCOUNTTAX structure. I’m not clear on two of the fields in the structure: COND_KEY – Condition Type and ACCT_KEY - Transaction Key. I’m posting an AR Customer Invoice (simulating FB70) with a DOC_TYPE = ‘DR’. I’m having trouble finding any equivalent sample code or documentation. Anyone know what I’m supposed to be using for COND_KEY (MWAS?) or ACCT_KEY (VST?) ??

Thanks for any help,

Karl

3 REPLIES 3
Read only

naimesh_patel
Active Contributor
0 Likes
1,809

COND_KEY must from the table T685.

You can check the table entries with the

KVEWE = 'A'

KAPPL = 'TX'

You need to pass COND_KEY = KSCHL value.

And the ACCT_KEY = 'VST'.

Check the program <b>ACC_BAPI_TEST_DOCUMENT</b>. It has one data filled in the Tax structure.

Regards,

Naimesh Patel

Read only

Former Member
0 Likes
1,809

Thanks for your help. When I looked up the Condition Types in Table T685 there were many available for AR taxes (AR1-4, JR1-4, UT01-6, XR1-6). I looked in the BSET table for some invoices I created via FB70 and was able to determine that the Condition Type JR1 through JR4 were used and they were the only ones with Access Sequence KOZGF=’TAXJ’. I ended up having to use Transaction Key / ACCT_KEY = ‘MW1’ to get BAPI_ACC_DOCUMENT_POST to work.

My follow up question: Are these Condition Types and Transaction Keys normally on SAP systems? Can I count on customer systems having KSCHL entries for JRn and Transaction Key/KTOSL=’MW1’ ?

Read only

0 Likes
1,809

I think yes. Because if the customer has created any taxcode or taxkey than it might be starting with "Y" or "Z". So, I think you will have them avaliable in your customer system.

Regards,

Naimesh Patel