‎2008 Jan 23 2:50 PM
I am fetching data from table tvkggt and putting in internal table
t_tvkggt.
itab is my internal table which contains the field kdkg1 with whic i am comparing kdkgr.
my code is given below
....
....
READ TABLE t_vbkd
WITH KEY vbeln = t_vbak-vbeln
posnr = t_vbak-posnr
BINARY SEARCH.
.....
......
SELECT VTEXT FROM TVKGGT
INTO CORRESPONDING FIELDS OF TABLE t_tvkggt
WHERE KDKGR = I_TAB-kdkg1.
read table ttvkggt with key kdkgr = ttvkggt-kdkgr binary search.
I_TAB-vtext2 = ttvkggt-vtext.
and finally i am printing the value of
write 😕 i_tab-vtext2
i_tab-kdkg1.
but in the output if there is any value for kdkg1 then i am getting corresponding value of vtext2 and also for which doesnt have value in the i_tab-kakg1....means if i_tab-kdkg1 is blank then also i_tab-vtext2 value is comming
why so?
what is the way out?
‎2008 Jan 23 3:03 PM
clear ttvkggt
read table ttvkggt with key kdkgr = ttvkggt-kdkgr binary search.
I_TAB-vtext2 = ttvkggt-vtext.
write 😕 i_tab-vtext2
i_tab-kdkg1.
‎2008 Jan 23 3:03 PM
clear ttvkggt
read table ttvkggt with key kdkgr = ttvkggt-kdkgr binary search.
I_TAB-vtext2 = ttvkggt-vtext.
write 😕 i_tab-vtext2
i_tab-kdkg1.
‎2008 Jan 23 3:07 PM
Hi,
If you are using internal table columns in where class of a select stmt then we should use FOR ALL ENTRIES IN i_tab addition for that select stmt. or we can use the select in the loop itself, but which is not suggested by sap.
Rgds,
Bujji