2008 Mar 11 7:08 AM
Hi gurus...
How to give condition in ABAP query report....
We have ABAP query report for Exise and in that all credit amounts('H'),i want to add the symbol as '-ve' sign...means the amount has to be deducted with the debit amounts and give a consolidated figure.....
Pls advise, how to add or give conditions in ABAP query report.
thanks & regards
sankar.
2008 Mar 11 9:32 AM
Hi,
I am assuming, as you have given, if the amount type is H then its credit.
types: begin of tp_internal_table,
amount type table-amount,
end of tp_internal_table.
data: internal_table type standard table of tp_internal_table.
data: wa_internal_table type tp_internal_table.
Select amount
from table
into internal_table
where type = 'H'.
Loop at internal_table into wa_internal_table.
concatenate '-' wa_internal_table-amount to wa_internal_table-amount.
append wa_internal_table to internal_table.
endloop.
Now the internal_table will have the credit values with the -ve sign.
Reward if helpful.
Regards.
2008 Mar 11 7:21 AM
Hi,
You can use the Concatenate Statement for displaying the signs you want to display.
HTH
Regards,
Dhruv Shah
2008 Mar 11 7:37 AM
hi Dhruv,
thanks, but i want how to create a condition in the ABAP query for particular field and not the coding stmt help, i need.
Pls advise.
regards
sankar.
2008 Mar 11 7:53 AM
In The Infoset(SQ02)
Extras-->Code, Here you have provision to write the ABAP code.
Declare a constants '-' in Data declaration tab and concatenate it to the O/P field.
Hope this helps.
Regards
Vinayak
2008 Mar 11 9:20 AM
Hi Vinayak,
I've tried it in all code section with my coding...but its not working when im calling thru Query....
How to assign it....
I just want to assign -ve sign to the BSAD-WRBTR if BSAD-SHKZG eq 'H'.
Pls advise.
thanks & regards
sankar
2008 Mar 11 9:31 AM
Hi Sankar,
Put a Explicit break point in the Free coding section.
BREAK-POINT.
Don't forget to save and generate the Infoset.
Go to the Query and run it, the ctrl will stop at the Break-point.
Check the run-time parameters, try to populate Dynamic values.
Hope this helps.
Regards
Vinayak
2008 Mar 11 10:05 AM
Hi
In the "Record Processing" Code Section, add the following piece of code for the Node BSID as i have used BSID to get FI data.
if bsid-shkzg = 'H'.
bsid-dmbtr = bsid-dmbtr * -1.
endif.
I tried this and it worked for me.
Hope it helps for your too.
Thanks,
Balaji
2008 Mar 11 7:54 AM
Hi,
There are certain exit points available in the query, these can be accessed in SQ02 - Infoset editor. Click 'Extras', then the 'Coding' tab. There is a drop down to access different coding sections, e.g. DATA, GET, etc.
Hope this helps.
Thanks,
Balaji
2008 Mar 11 9:32 AM
Hi,
I am assuming, as you have given, if the amount type is H then its credit.
types: begin of tp_internal_table,
amount type table-amount,
end of tp_internal_table.
data: internal_table type standard table of tp_internal_table.
data: wa_internal_table type tp_internal_table.
Select amount
from table
into internal_table
where type = 'H'.
Loop at internal_table into wa_internal_table.
concatenate '-' wa_internal_table-amount to wa_internal_table-amount.
append wa_internal_table to internal_table.
endloop.
Now the internal_table will have the credit values with the -ve sign.
Reward if helpful.
Regards.
2008 Mar 11 11:53 AM
thanks a lot.
I've made a normal Zreport instead of Query for this post.(issue)
Anyway, I've worked the above helps and its working fine,thanks to all.
regards
sankar.