09-22-2006 5:49 PM
Hi All,
The data I am getting for Rate field from flat file for my sales order BDC is not correct. So I have to get the Rate based on material number on condition type PR00.
What is condition type PR00 and how to write select stmt on this. The Rate field I want to get from material num RV45A-MABNR is KOMV-KBETR.
Please help me.
Thanks
Veni.
09-22-2006 9:54 PM
Yes..KONV is a cluster table..You cannot do join on cluster tables..
You have to split SQLs into two..
one with VBAK and VBAP..
Then do a FOR ALL ENTRIES IN with the internal table got from the table VBAK & VBAP to get the values from KONV..
Thanks,
Naren
09-22-2006 6:00 PM
Hi,
If you want to get the sales order conditions..use the following method..
VBAK-KNUMV.
Use the KNUMV in the table KONV with the condition type = 'PR00' and then get the rate in the field KBETR.
If you want to get the condition rate from the condition tables.
ask your function consultant to get the table name..
Thanks,
Naren
09-22-2006 6:00 PM
I would assume that this code would give you want you need. Check the ikomv internal table after the function call. You will see the conditions there.
report zrich_0002 .
data: l_vbak type vbak.
data: l_komk type komk.
data: l_komp type komp.
data: ikomv type table of komv.
data: ikomvd type table of komvd.
parameters: p_vbeln type vbak-vbeln.
select single * from vbak
into l_vbak
where vbeln = p_vbeln.
check sy-subrc = 0.
l_komk-belnr = l_vbak-vbeln.
l_komk-kappl = 'V'.
l_komk-knumv = l_vbak-knumv.
call function 'RV_PRICE_PRINT_REFRESH'
tables
tkomv = ikomv.
call function 'RV_PRICE_PRINT_ITEM'
exporting
comm_head_i = l_komk
comm_item_i = l_komp
language = sy-langu
tables
tkomv = ikomv
tkomvd = ikomvd.
check sy-subrc = 0.
Regards,
Rich Heilman
09-22-2006 6:11 PM
Hi Naren& Rich,
Thankyou. But I need to get price based on Material Number RV45A-MABNR.
Please help me.
Thanks
Veni.
09-22-2006 6:31 PM
Take this program for example.
report zrich_0002 .
data: l_vbak type vbak.
data: l_vbap type vbap.
data: l_komk type komk.
data: l_komp type komp.
data: ikomv type table of komv.
data: xkomv type komv.
data: ikomvd type table of komvd.
parameters: p_vbeln type vbak-vbeln.
parameters: p_matnr type vbap-matnr.
select single * from vbak
into l_vbak
where vbeln = p_vbeln.
select single * from vbap
into l_vbap
where vbeln = p_vbeln
and matnr = p_matnr.
check sy-subrc = 0.
l_komk-belnr = l_vbak-vbeln.
l_komk-kappl = 'V'.
l_komk-knumv = l_vbak-knumv.
call function 'RV_PRICE_PRINT_REFRESH'
tables
tkomv = ikomv.
call function 'RV_PRICE_PRINT_ITEM'
exporting
comm_head_i = l_komk
comm_item_i = l_komp
language = sy-langu
tables
tkomv = ikomv
tkomvd = ikomvd.
* I believe that the POSNR is related to the KPOSN
* in the IKOMV table
loop at ikomv into xkomv where kposn = l_vbap-posnr.
write:/ xkomv.
endloop.
Regards,
Rich Heilman
09-22-2006 6:12 PM
Hi,
The material number will be available in the sales order line item table.
VBAP-MATNR..
Thanks,
Naren
09-22-2006 7:04 PM
Hi,
Is the BDC for sales order change?
You can get PR00 condition rate values from KONv table using VBAK-KNUMV.
Thanks,
ramakrishna
09-22-2006 7:24 PM
Hi All,
I came up with this,
Data: Begin of it_output occurs 0,
kbetr like komv-kbetr,
End of it_output.
select komv~kbetr from komv
into it_output
from komv
inner join vbak on vbakknumv = komvknumv
inner join vbap on vbakvbeln = vbapvbeln
where komv~kschl = 'PR00'
and vbap~matnr = lv_matnr.
Do you think this will work?
Please help me.
Thanks
Veni.
09-22-2006 7:30 PM
hi,
change lik this.
Data: Begin of it_output occurs 0,
kbetr like komv-kbetr,
End of it_output.
select komv~kbetr
into table it_output
from komv
inner join vbak
on vbakknumv = komvknumv
inner join vbap
on vbakvbeln = vbapvbeln
where komv~kschl = 'PR00'
and vbap~matnr = lv_matnr.
rgds
anver
09-22-2006 9:36 PM
Hi,
I gave the query and it is giving me syntax error saying '"KOMV" is not defined in the ABAP Dictionary as a table, projection view or database view.' because KOMV is a structure not a table.
What should I do now.
Thanks
Veni.
09-22-2006 9:43 PM
09-22-2006 9:50 PM
Thank you Naren,
Now I am getting this error.
You cannot use comparisons with column references in pool and cluster tables: "KONV~KNUMV".
select konv~kbetr
into table it_output
from konv
inner join vbak
on vbakknumv = konvknumv
inner join vbap
on vbakvbeln = vbapvbeln
where konv~kschl = 'PR00'
and vbap~matnr = gs_sdata-mabnr.
Thank you
Veni.
09-22-2006 9:54 PM
Yes..KONV is a cluster table..You cannot do join on cluster tables..
You have to split SQLs into two..
one with VBAK and VBAP..
Then do a FOR ALL ENTRIES IN with the internal table got from the table VBAK & VBAP to get the values from KONV..
Thanks,
Naren
09-22-2006 10:37 PM