‎2008 May 06 12:13 PM
Hi friends
I have one invoice no which is having 2 line items
for eg
invoice no value
101 5556
101 6666
in o/p of report
while reading inside loop its taking only the first value
for both invoice no...
can any one give me solution..
points will rewarded for helpful ans
‎2008 May 06 12:16 PM
Hi,
use below code:
LOOP AT itab into wa.
write:
/ wa-invoice_no,
wa-value.
ENDLOOP.Regards,
Sunil.
‎2008 May 06 12:16 PM
Sort the internal table by invoice no and then ADJACENT DUPLICATES from internal table comparing internal table.
Effect
With these additions, the statement DELETE deletes all lines in certain groups of lines, except for the first line of the group. These are groups of lines that follow one another and have the same content in certain components. If the addition COMPARING is not specified, the groups are determined by the content of the key fields.
Lines are considered to be doubled if the content of neighboring lines is the same in the components examined. In the case of several double lines following one another, all the lines - except for the first - are deleted.
Addition
... COMPARING {comp1 comp2 ...}|{ALL FIELDS}
Effect
If the addition COMPARING is specified, the groups are determined either by the content of the specified components comp1 comp2 ... or the content of all components ALL FIELDS. The specification of individual components comp is made as described in the section Specification of Components. Access to class attributes is possible through the object component selector only as of Release 6.10.
Example
Deleting all multiple-occurring lines in the internal table connection_tab. The result of this exanple corresponds to the one in the example for the position specification for INSERT.
DATA: BEGIN OF connection,
cityfrom TYPE spfli-cityfrom,
cityto TYPE spfli-cityto,
distid TYPE spfli-distid,
distance TYPE spfli-distance,
END OF connection.
DATA connection_tab LIKE SORTED TABLE OF connection
WITH NON-UNIQUE KEY cityfrom cityto
distid distance.
SELECT cityfrom cityto distid distance
FROM spfli
INTO TABLE connection_tab.
DELETE ADJACENT DUPLICATES FROM connection_tab.
‎2008 May 06 12:23 PM
Hi friend,
its not duplicate enteries
one invoice no is haveing 2 line items both should display.
while reading its is taking first value .
as it reads only one value from itab index.
how to display both.
‎2008 May 06 12:18 PM
hi,
do this way ...
loop at itab.
write : itab-fld1,
itab-fld2.
endloop.
‎2008 May 06 12:19 PM
Hi,
Loop at itab.
Write .....
Endloop.
It reads all the values in that internal table and print it in o/p.
check once putting brack-point.
if posssible give tha code.
Regards,
Narasimha
‎2008 May 06 12:21 PM
Hi,
Check with item value .
Loop at itab where header = invoice header
item = invoice item
Endloop
‎2008 May 06 12:25 PM
Hi,
if you use READ stmt it'l pick only one record and display , if u want to display multiple records then go for loop ... endloop.
Regards,
Nisa
‎2008 May 06 12:33 PM
hello,
r u trying to display from loop with in loop? if yes then give condition for line item also
regards,
Nisa