‎2008 Jun 24 5:55 PM
hello,
I have a requirement where I need to get the data from the field kschl in komv table but when I write the select statement it says that
"KOMV" is not defined in the ABAP Dictionary as a table, projection:
even though I declared the table and its internal table...
prior to this situation I have used two function modules.....
RV_price_print_head and RV_price_print_refresh
Anik
‎2008 Jun 24 6:01 PM
Hi KOMV is a cluster table so you cannot join this table with other tables.. you can also get condition records kschl in KONV as well...
‎2008 Jun 24 6:33 PM
what does this run time error mean: "too few fiels in into clause"
‎2008 Jun 24 6:35 PM
the fields and the structure into which you are placing data in select statement might be different..
use into corresponding field of table..in select or make sure you follow the order of fields as per ur internal table deceleration.
‎2008 Jun 24 6:53 PM
Can you pls tell where the problem is???
if p_count = 'X'.
Get sales order header info
select vkvbeln vkkunnr vk~vbtyp
vkbukrs_vf vkvkorg vkvtweg vkspart
vknetwr vkwaerk vk~knumv
vkerdat vkernam
kn~name1
into table itabvbak
from vbak as vk
inner join kna1 as kn on knkunnr = vkkunnr
for all entries in itabsd2
where vk~vbeln = itabsd2-vbeln.
Get manual discounts.
clear komk.
call function 'RV_PRICE_PRINT_REFRESH'
TABLES
tkomv = tkomv.
komk-vbtyp = itabvbak-vbtyp. " Document category
komk-belnr = itabvbak-vbeln. " Sales document
komk-knumv = itabvbak-knumv. " Number of the document condition
komk-kalsm = 'ZMADIX'. " Pricing procedure
komk-kappl = pr_kappl. " Application 'V' = Sales & Dist
komk-waerk = itabvbak-waerk. " Document currency
komk-bukrs = itabvbak-bukrs. " Company code
komk-vkorg = itabvbak-vkorg. " Sales org
komk-vtweg = itabvbak-vtweg. " Distribution channel
komk-spart = itabvbak-spart. " Division
call function 'RV_PRICE_PRINT_HEAD'
EXPORTING
comm_head_i = komk
language = sy-langu
IMPORTING
comm_head_e = komk
comm_mwskz = print_mwskz
TABLES
tkomv = tkomv
tkomvd = tkomvd.
if sy-subrc = 0.
select kschl knumv
into CORRESPONDING FIELDS OF TABLE itab_konv
from konv
FOR ALL ENTRIES IN itabvbak
where knumv = itabvbak-knumv
AND kschl <> 'ZMAD'.
if sy-subrc = 0.
write: 'ZMAD is High'.
else.
DESCRIBE TABLE zvbap LINES count.
write: count to countn,
counti to counth.
write: / 'Number of Quotes to be converted: ', counth.
write: / 'Number of Quote Lines to be converted: ', countn.
Uline.
write: /10(25)'Sales Document',30(20)'Sales Document Item'.
Loop at zvbap.
write: /12(10) zvbap-vbeln,
36(10) zvbap-posnr.
endloop.
endif.
endif.
endif.
‎2008 Jun 24 6:58 PM
What are the fields in your Internal Table for itabvbak? The values that you have in your select cause must be in your internal table as Jay has mentioned above.
‎2008 Jun 24 7:07 PM
data: begin of itabvbak occurs 0,
vbeln like vbak-vbeln, " Sales doc #
kunnr like vbak-kunnr, " Sold-To
vbtyp like vbak-vbtyp, " Document category
bukrs like vbak-bukrs_vf, " Company code
vkorg like vbak-vkorg, " Sales org
vtweg like vbak-vtweg, " Distribution channel
spart like vbak-spart, " Division
netwr like vbak-netwr, " Net total
waerk like vbak-waerk, " Document currency
knumv like vbak-knumv, " # of the document condition
erdat like vbak-erdat, " Create date
ernam like vbak-ernam, " Created by
name1 like kna1-name1, " Sold-To customer name
end of itabvbak.
this is the internal table itabvbak
‎2008 Jun 24 7:15 PM
Hi did u give the table name on the top of the program like..
tables: vbak, vbap, komv, konv.
‎2008 Jun 24 7:21 PM
tables: vbak,
vbfa,
komk,
kna1,
konv.
data: begin of tkomv occurs 50.
include structure komv.
data: end of tkomv.
data: begin of tkomvd occurs 50.
include structure komvd.
data: end of tkomvd.
data: begin of itab_konv occurs 0,
kschl like konv-kschl,
knumv like konv-knumv,
end of itab_konv.
I did give that
‎2008 Jun 24 7:28 PM
Hi there.. check my past code.. it works fine.. interpret ur code to this..
TYPES: BEGIN OF gt_citm_z2,
knumv TYPE konv-knumv,
kposn TYPE konv-kposn,
kschl TYPE konv-kschl,
kbetr TYPE konv-kbetr,
END OF gt_citm_z2.
DATA: lt_citm_z2 TYPE STANDARD TABLE OF gt_citm_z2 WITH HEADER LINE,
wa_citm_z2 TYPE gt_citm_z2.
* Konv is an cluster table, so had to populate data seperately.
IF NOT lt_citm_z1[] IS INITIAL.
SELECT
knumv kposn kschl kbetr
INTO TABLE lt_citm_z2
FROM konv
FOR ALL ENTRIES IN lt_citm_z1
WHERE knumv EQ lt_citm_z1-knumv
AND kposn EQ lt_citm_z1-posnr.
ENDIF.