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

Select statement

Former Member
0 Likes
434

Hi gurus,

I have a condition where I need to select the profit center from the table K9RAED1500001 for the sales group and then I need to pass that cost center into one of my statement, I hve written the following select statements, can you please help me how to write the read statement, I want to read table it_ccenter and pass the target1 i.e. cost center to one of my statement.

select vkgrp vkbur bzirk kunnr into table it_sales

from knvv

for all entries in it_tab01

where kunnr = it_tab01-custid.

select target1 into table it_ccenter

from K9RAED1500001

for all entries in it_sales

where SOUR1_FROM = it_sales-vkgrp.

Thanks

Rajeev gupta

3 REPLIES 3
Read only

Former Member
0 Likes
413

read table it_sales with key kunnr = it_tab01-custid.

read table it_ccenter with key SOUR1_FROM = it_sales-vkgrp.

Read only

0 Likes
413

If the internal tables are large, you should consider sorting them and adding the BINARY SEARCH addition to the READs.

Rob

Read only

Former Member
0 Likes
413

hi you may also have to select the cost center trom the table K9RAED1500001 apart from target1..

select costcent target1 into table it_ccenter fromK9RAED1500001 for all entries in it_sales where sour1_from = it_sales-vkgrp.

read table it_cccenter with key costcent = <ur cost center>.

Cheer's

Mahesh