shanmukhi
2nd September 2008, 12:54
In Detail layout in a report,data is repeating twice.how to stop repeating..

zardoz
2nd September 2008, 15:39
There are 2 possible cases:

- Data is send to report two times (check the session script).

- Layout is repeated by means of report script (check the report script - if there isn't report script there is only the first case).

shanmukhi
3rd September 2008, 08:04
Report script is there. Where can i see the logic?i didnt write any logic for this.

zardoz
4th September 2008, 11:32
In the report script must be be a layout.again() instruction.
If isn't the case, maybe in the script you select data havent the same cardinality you expect (select 2 records that in the report layout you cannot distinguish one from the other).

Can you post the script or almost the part on which there is the data selection?

shanmukhi
5th September 2008, 12:44
Actually i didnt write any code for specific lines.
am just taking a avariable and saving the text data in tht variable.
have a look..

detail.1:
before.layout:

| * For Item
select tcibd100.*
from tcibd100
where tcibd100.item = :whinh312.item
selectdo
endselect
|* For Item Description
select tcibd001.*
from tcibd001
where tcibd001.item = :whinh312.item
selectdo
endselect

|*For Indent No
select tdpur402.rqno
from tdpur402
where tdpur402.orno = :tdpur401.orno and tdpur402.pono =:tdpur401.pono
selectdo
|* For empty Value displays "Null"
selectempty
tdpur402.rqno="No Data"
endselect

if isspace(whinh312.clot)then whinh312.clot="No Data"
endif

|*To print line/header text


select whinh312.*
from whinh312
where whinh312.orno = :tdpur401.orno
and whinh312.pono = :tdpur401.pono
selectdo

counter = counter + 1 |* COunter is a variable
seq_no(counter) = whinh312.rcln
ins_txt(counter) =whinh312.itxt
store_txt(counter) = whinh312.txtn

endselect

|*Cost center
select tcmcs003.comp
from tcmcs003
where tcmcs003.cwar =:whinh310.cwar
selectdo
endselect

zardoz
5th September 2008, 14:29
The problem is in the session script, I think. Check the way you select the data, maybe debugging the script and check all the times you do a brp_send() instruction...

mark_h
5th September 2008, 14:33
Put the report in debug mode and see if it runs the before layout twice for detail.1 for the same whinh312.item. This will let you know that the session script is sending the data twice. Not sure about LN and windows, but in 4c4 on UNIX I can put the report in debug mode, let it pause(or hit break point), and then go to the $BSE/tmp directory and look at the input file for the report.

shah_bs
7th September 2008, 20:01
How many times in the script is the rprt_send() command?

If it is only once, then what exactly is repeating? If it is the values in one of the before.field layouts, you do not have much control over this, since sometimes, at the end of a page, the before.layout will repeat at the top of the next page due to the report processing logic.

If repeating is for a detail layout, you can control it by more conditions in the layout print expression, by building distinguishing flags in the program script first.

shanmukhi
8th September 2008, 08:34
Yes..In detail layout print expression,i have written a condition so that it can control the detail layout..

Now it woks fine...thankq for all replies...

but its not always works i think.
sometimes i need to look after session script and sometimes report script.
Is it not defined to any specific?

zardoz
8th September 2008, 11:31
Just an advice... if possible (and a lot of times it is) avoid using report script... things are more clear when you have only to look at the session script, because debugging the report is always a nightmare.

kiran kumar
8th September 2008, 11:36
hi
if u r using any before.field layout then simply give detail print expression as 0 and copy the same into after.field. then data will not repeat. check it once.

all the best

shanmukhi
8th September 2008, 12:37
Hi Kiran,
i didnt understand your logic here..
If i have before.layout and detail sections,how can i put 0 in print expressin of detail layout while i hav a different data in two layouts??

plz explain..