on 09-11-2014 10:43 AM
Hi everyone,
I have a requirement to count the number of open invoices for an account. I am using the Aggregation selection mode of a DBlookup expression to count the unique number of values in a date field. The Select statements looks like:
Select Count of <date Field> from <Database>
With Condition:
Conditions
Into <Number>
The issue I am facing is that I am unable to include a condition for a Amount/Currency field. I want to select only debit items, and exclude credits. The fields of type 'currency' are not shown in the list of elements while adding an include condition.
Is this by design and why are we not able to use such field types in the conditions.?
Alternatively, I was thinking of using a temporary table to list the items and using a Table operation to remove the credit items and count the items, but unable to do a unique count.
Thanks ,
Nihit
Hello Shah,
in my blog I wrote about currency fields whose currency key is not defined within the same table. You want to exclude/include rows in your sum depending of the sign.
Fields of type currency are not selectable. I think this is due to the currency representation in BRFplus. It’s a structure whose number component is of type decfloat34 and the currency component is of type char(5). This makes the equation difficult.
With CDS you are able to build a view representing your table. In this view you can convert the currency fields to a number (you remove the currency information). Now these converted fields are selectable as a filter criteria.
Take a look at the follwing CDS conversion:
cast( TSLVT as abap.dec(23,2)) as TSLVTN
This should work (I tested it ).
Cheers,
Daniel
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I recommend the blog of about CDS: http://scn.sap.com/community/abap/eclipse/blog/2014/02/04/new-data-modeling-features-in-abap-for-han...
Hi Nihit,
what does your system stack look like? To use CDS you need at least NW 7.40 with SP05.
If this is the case I would strongly reccommend to use the solution proposed by Tobias and Daniel, namely the CDS view.
The installation of ADT is usually not an issue: you just need to download eclipse (Kelper or Luna) and add the corresponding software site in eclipse. The one you need can be looked up on SAP Development Tools for Eclipse. You can find more information on that in ABAP in Eclipse space here in SCN ().
If however due to system requirements it is not possible to use CDS views a possible worksround might be to wrap the DB lookup (namely the SELECT statement itself) in an ABAP class i.e. in a static method of that class and call that method from BRF+ via a procedure call expression. A drawback of that workaround is that the selection itself is no longer available in BRF+.
BR
Christian
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
98 | |
11 | |
11 | |
10 | |
10 | |
8 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.