05-04-2005 2:25 PM
In 4.7, transaction VA03 - Display Sales Order, I enter an order number, then hit enter. On the next screen, I use the button next to PO Date to display the document header details. Next, I select the tab Conditions. There is a tax item listed there with an amount. How can I retrieve this item in my ABAP program?
05-04-2005 5:03 PM
Hi Charles,
Against each item on the conditions tab there is a condition type associated with it. In order get the condition value, here is the link for header conditions
SELECT SINGLE KNUMV FROM VBAK WHERE VBELN = your order number.
SELECT * FROM KONV WHERE KNUMV = VBAK-KNUMV.
I didn't find any function modules that gives you this information.
Hope this helps,
Srinivas
05-04-2005 2:54 PM
Hi Charles,
field VBAK-MWSBP is missing
When tax amount is marked as printed on header level, then amount might be found in KONV, too.
Otherwise correct amount will be sum over VBAP-MWSBP. VAT is calculated on header level and then <i>distributed</i> to all lines. So afterwards summarization won't run into rounding problems.
Kind regards,
Christian
05-04-2005 5:03 PM
Hi Charles,
Against each item on the conditions tab there is a condition type associated with it. In order get the condition value, here is the link for header conditions
SELECT SINGLE KNUMV FROM VBAK WHERE VBELN = your order number.
SELECT * FROM KONV WHERE KNUMV = VBAK-KNUMV.
I didn't find any function modules that gives you this information.
Hope this helps,
Srinivas
05-04-2005 5:40 PM
Hi Charles,
Here is a sample code to get the conditions in all its details. This one is for header conditions, but if you have them at item level, you need to do the same but give an item number instead of '000000' that I have in here.
DATA: comm_head_i LIKE komk,
comm_head_e LIKE komk,
i_skomv LIKE komv OCCURS 0 WITH HEADER LINE,
i_tkomv LIKE komv OCCURS 0 WITH HEADER LINE,
i_skomp LIKE komp OCCURS 0 WITH HEADER LINE,
i_skonh LIKE konh OCCURS 0 WITH HEADER LINE,
i_skonp LIKE konp OCCURS 0 WITH HEADER LINE,
i_skonm LIKE konm OCCURS 0 WITH HEADER LINE,
i_skonw LIKE konw OCCURS 0 WITH HEADER LINE.
CALL FUNCTION 'SD_SALES_PRICING_INFORMATION'
EXPORTING
* I_POSNR = '000000'
i_read_doc = 'X'
i_vbeln = p_vbeln
IMPORTING
e_komk = comm_head_i
* E_KOMP =
* TABLES
* FXKONV =
* FTKOMV =
.
CALL FUNCTION 'PRICING_GET_CONDITIONS'
EXPORTING
comm_head_i = comm_head_i
read_conditions = 'X'
IMPORTING
comm_head_e = comm_head_e
TABLES
skomv = i_skomv
tkomv = i_tkomv
skomp = i_skomp
skonh = i_skonh
skonp = i_skonp
skonm = i_skonm
skonw = i_skonw.
05-05-2005 8:47 PM
Thanks Srinivas, that is exactly what I needed!
For other readers who are interested, I found the tax value that I was looking for in table i_tkomv, field KWERT. The other tables were not needed. The currency field for that value comes from comm_head_e-waers.