‎2008 Feb 20 6:10 PM
pls look below ,i hv to combine these 2 loops so that i need only 1 write statement to display all in 1 line.
itab2 structure is different from itab10.(itab10 and itab 11 are same)
1) loop at itab2.
g_menge = ITAB2-MENGE.
write : / g_menge.
endloop.
2)
loop at itab10.
read table itab11 .
*read table itab2. -
didnt work
G_days = ITAB10-ADAT - ITAB11-ADAT.
IF ITAB10-ABLESTYP = 01.
G_ESTIMATE = 'Y'.
else.
G_ESTIMATE = 'N'.
endif.
G_DAT = ITAB10-ADAT.
G_READ = ITAB10-V_ZWSTAND.
g_menge = ITAB2-MENGE.
write : / G_DAT,G_READ,G_ESTIMATE,G_days.
endloop.
Edited by: Sona on Feb 20, 2008 7:17 PM
‎2008 Feb 20 6:55 PM
You have to give the READ statement either a key or an index; otherwise, I think it will just read the first row of the table.
Rob
‎2008 Feb 20 6:55 PM
You have to give the READ statement either a key or an index; otherwise, I think it will just read the first row of the table.
Rob
‎2008 Feb 20 7:24 PM
read table itab2 INDEX 1. -
READS ONLY 1 RECORD
read table itab2 with key menge = itab2-menge -
gives zero values --- whats wrong here?
pls suggest how to use this read statement inside 2nd loop.
Or any other way of achieving my display.
pls suggest how to declare a new struc and the exact step to load these values that i want to display.
Thanks.
I SOLVED THIS by adding a counter to index....
Edited by: Sona on Feb 20, 2008 8:37 PM
‎2008 Feb 20 8:36 PM
‎2008 Feb 20 8:52 PM
Here is it.
g_cnt is 1.
read table itab2 index G_cnt.
G_cnt = G_cnt + 1.
I have another question,while subtracting two dats, is there anything wrong here?
G_days = ITAB10-ADAT - ITAB11-ADAT.
04/21/2008 - 11/05/2007 ouput is 54.
Any better way of doing this.
second value 11/05/2007 - 09/10/2007 ouput is 86
Any help?
Thanks in advance.
‎2008 Feb 20 9:15 PM
‎2008 Feb 20 9:49 PM
‎2008 Feb 20 10:01 PM
There aren't any loops in that code! Don't you want to combine two loops?
Rob
‎2008 Feb 20 10:05 PM
solved combining those 2 loop at . if thats clear.
any help on this?
I have another question,while subtracting two dats, is there anything wrong here?
G_days = ITAB10-ADAT - ITAB11-ADAT.
04/21/2008 - 11/05/2007 ouput is 54.
Any better way of doing this.
second value 11/05/2007 - 09/10/2007 ouput is 86
‎2008 Feb 20 11:09 PM
Well, the approach looks correct, but the numbers are wrong. I get 168 and 56.
Rob
‎2008 Feb 21 5:31 AM
Yes,that is wrong output .
Opened another thread for this,pls post any help.
Thanks.