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

help me to check this code !

Former Member
0 Likes
542

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?

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
509

clear ttvkggt

read table ttvkggt with key kdkgr = ttvkggt-kdkgr binary search.

I_TAB-vtext2 = ttvkggt-vtext.

write 😕 i_tab-vtext2

i_tab-kdkg1.

2 REPLIES 2
Read only

Former Member
0 Likes
510

clear ttvkggt

read table ttvkggt with key kdkgr = ttvkggt-kdkgr binary search.

I_TAB-vtext2 = ttvkggt-vtext.

write 😕 i_tab-vtext2

i_tab-kdkg1.

Read only

Former Member
0 Likes
509

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