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

Please help me to modify the following code !

Former Member
0 Likes
895

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
Read only

Former Member
0 Likes
843

How about using DELETE statement before the READ.


DELETE t_tvkggt WHERE kakgr IS INITIAL.

READ TABLE....

Kind Regards

Eswar

Read only

0 Likes
843

Its not working. Because no values of vtext is comming

Read only

0 Likes
843

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

Read only

dev_parbutteea
Active Contributor
0 Likes
843

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

Read only

Former Member
0 Likes
843

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