Application Development 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: 

Please help me to modify the following code !

Former Member
0 Kudos

SELECT VTEXT FROM TVKGGT

INTO CORRESPONDING FIELDS OF TABLE t_tvkggt

WHERE KDKGR = itab-kdkg1.

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

itab-vtext2 = t_tvkggt-vtext.

I am getting corresponding values of vtext where itab has

values of kdkgr and also doesnt have any values of kakgr.

how to remove those values of vtext which doesnt have any value for kdkgr.

5 REPLIES 5

Former Member
0 Kudos

How about using DELETE statement before the READ.


DELETE t_tvkggt WHERE kakgr IS INITIAL.

READ TABLE....

Kind Regards

Eswar

0 Kudos

Its not working. Because no values of vtext is comming

0 Kudos

Have few doubts on your statement:


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

How is t_tvkggt-kdkgr populated, if it is populated is it only the value of this field populated or the whole structure populated.

When using BINARY SEARCH addition with READ statement, make sure the internal table is sorted.

Regards

Eswar

dev_parbutteea
Active Contributor
0 Kudos

Hi,

SELECT VTEXT FROM TVKGGT

INTO CORRESPONDING FIELDS OF TABLE t_tvkggt

WHERE KDKGR = itab-kdkg1.

if sy-subrc = 0.

delete t_tvkggt where vtext is initial.

sort t_tvkggt by kdkgr.

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

itab-vtext2 = t_tvkggt-vtext.

endif.

Regards,

Sooness

Former Member
0 Kudos

Hi,

select * from mara

into table i_tab

where matnr = 'ACC CABLE'.

loop at i_tab where bstme NE ' ' .

endloop.

Check out with this one and inside loop ,

you can transfer only those records which have bstme value.

Apply for you case.

Reward if helpful/.

Thanks,

Madhura

Edited by: Madhura Nadgauda on Jan 17, 2008 7:19 AM