ainulm
20th November 2014, 08:42
Hi guys,

I have some problem in output expression.
In detail 1 has the value for Document Date. tfacr200.docd
In detail 2 has the value for Last Update Date. tfgld108.date

What should i put in output expression when user choose Last Update Date selection and only detail 2 will be print out and same goes to detail 1 for document date.

Thank you

mark_h
20th November 2014, 17:21
I think we are going to need more information. Are you saying in the session script you set those variables and call the report? If so you can just check to make sure the dates are not empty in the output expression. What I have done in the past is use something like k.of.date in the session script before I do a report send. So I might set 1 and send tfacr200 record and then set it to 2 when I send the tfgld108 record. This only an example - never really done it with these tables.

Not really sure if that helps.

ainulm
21st November 2014, 02:49
Hai Mark,

Thank your for your reply.
Im still new in creating report script.
The value tfacr200.docd and tfgld018.date was set on layout editor.
When the user make a selection on Last Update Date, i only want the detail.2 to be display. How can i make a code for this problem?

Can refer for my screenshot for more detail.

sachinbaan
21st November 2014, 06:04
Hi,

what u can do is, take one Boolean as extern in program script, use this as input field in report, now u can set this value by checking last update date, if date is filled by user set this value to true and in output expr u can write value = true , so respective detail layout will print only when this value is true...

I hope this is what you want...

ainulm
21st November 2014, 06:28
Hi Sachin,

Thanks for your reply.
Sorry i cannot access on program script. since i dont have the developer license.
is there any idea i can run on report script?

i got do this on detail.2

detail.2:
before.layout:
if isspace(tfacr200.docd) then
lattr.print = true
else
lattr.print=false
endif

but the value didnt come out. it just showing the total without the details. please help

sachinbaan
21st November 2014, 09:10
hi,

this will skip the layout 2 , and you don't want to hide the layout, you want both layout but if tfacr200.dcod = 0 then other date's value should populate in both date, is it so?

bhushanchanda
21st November 2014, 10:26
Hi,

I will advice to use some other field on the layout as there is no logic to identify which date range has the user selected i.e. you cannot identify if both are given as full range.

Check what you have in other fields like receipt document number, invoice no etc. Based on that you can skip one of the layout while print the other one.

ainulm
21st November 2014, 11:31
Hi Mark and Bushan,

User claim that they need a new report. I tried to make a new one based on their requirement. They want to add 'Last Date Update' which is tfgld018.date. I tried to make the below code. But the amount is duplicate. Can somebody help me on this matter? This is urgent help.

select
tfacr200.itbp, | Business Partner
tfacr200.tdoc, | Transaction Type
tfacr200.docn, | Document Number
tfacr200.ttyp, | Transaction Type
tfacr200.ninv, | Document
tfacr200.schn, | Schedule Number
tfacr200.bppn, | BP Payment Number
tfacr200.docd, | Document Date
tfacr200.ccur, | Currency/Rate
tfacr200.amti, | Amount in Invoice Currency
tfacr200.amth(1), | Amount in Home Currency
tfacr200.balc, | Balance
tfacr200.balh(1), | Balance in Home Currency
tfacr200.trec, | Document Type
tfacr200.dued, | Due Date
tccom100.nama,
tccom112.seak,
tfacr200.line,
tfgld018.date, | Last Date of Update
tfacr600.amnt,
tfacr600.rect,
tfacr600.recd,
tfacr601.ityp,
tfacr601.idoc,
tfacr601.ilin

from
tfacr200, | Open Items (Sales Invoices & Receipts),
tccom100,
tccom112,
tfgld018,
tfacr600,
tfacr601

where
tfacr200.itbp >= tfacr200.itbp.f and
tfacr200.itbp <= tfacr200.itbp.t and
tfgld018.date >= tfgld018.date.f and
tfgld018.date <= tfgld018.date.t and
(tfacr200.trec = 2 or tfacr200.trec = 9) and
tfacr600.rect = 'CVR' and
tfacr200.itbp = tccom100.bpid and
tfacr200.itbp = tccom112.itbp and
tfacr200.docn = tfgld018.docn and
tfgld018.docn = tfacr600.recd and
tfacr200.ninv = tfacr601.idoc and
tfacr200.schn = tfacr601.ilin and
tfacr200.recl = tfacr601.recl and
tfacr600.recl = tfacr601.recl and
tfacr200.recl = tfacr600.recl





order by
tfacr200.docd,
tfacr200.tdoc,
tfacr200.itbp,
tfgld018.date

vamsi_gujjula
21st November 2014, 11:48
what i understand is you want to add a new field tfgld018.date on existing report

just added tfgld018.date in the rreport ,

and in the report script detail.1 ( assuming this its the data layout) select tfgld018 table

Regards,
Vamsi.

mark_h
21st November 2014, 19:53
Like vamsi mentioned above if you do not have the session script,you can try just adding the field to the report. Then put the field in the details section. Run the session and see if the field is filled from the session. Then if it is filled you can play with the report to get the out put the way you want it.

If the field is not filled, then what you can do is create a report script. In the report script you just declare the table you want and then in the details layout go fetch the data for the record currently being processed(or printed).

Sample would be like:


declaration:
table ttdexi315
extern domain tcbool exostar

detail.1:
before.layout:
select tdexi315.*
from tdexi315
where tdexi315._index1 = :tdpur041.orno
selectdo
exostar = true
selectempty
exostar = false
endselect

Hope I did not make any typo's. Now on the details.1 layout I could add a text field that says "Order is special" and put in it the print expression of exostar. Then this would only pop up for purchase orders that are in the table tdexi315. In your case you would find the tfgld018 record and get print the field - not need to change print condition on the field. Hope this helps.

ainulm
24th November 2014, 03:57
Hi Mark and Vamsi,
thank you for your kind feedback.

Ive got tried for your code Mark. But still the value is duplicate. please help :(
You may refer the code below in the report script:


detail.2:
before.layout:
select tfgld018.*
from tfgld018
where tfgld018._index1 = :tfacr200.ttyp
selectdo
tfgld018.date = true
selectempty
tfgld018.date = false
endselect

mark_h
24th November 2014, 14:57
I do not know about LN, but the very first thing I would do in 4c4 is not use a date table name as a boolean. I would add a declaration for something different - below I am assuming you print tfgld918.date and maybe you only print it when you find it. So on the report it would have a field tfgld918.date, with print expression found.gld918.


declaration:
external domain tcbool found.gld918

detail.2:
before.layout:
select tfgld018.*
from tfgld018
where tfgld018._index1 = :tfacr200.ttyp
selectdo
found.gld918 = true
selectempty
found.gld918 = false
tfgld918.date = 0
endselect


Second what do you mean the value is duplicate? From what I see everytime detail.2 is run this query will execute and set a new value. Is detail.2 getting run for every record passed to the report? In the above case the output expression for detail.2 would be 1.