Professional Documents
Culture Documents
13
Welcome, Guest
Login
Store
Register
Products
About SCN
Downloads
Industries
Partnership
Developer Center
Lines of Business
University Alliances
Innovation
Activity
Communications
Actions
Brow se
Version 1
created by Rajesh Balakrishnan on Jan 14, 2013 7:27 PM, last modified by Rajesh Balakrishnan on Jan 14, 2013 7:55 PM
Share
Tw eet
Like
This is an updated version of Code Snippet #3 which had been posted by Pankaj Patil in his excellent post pertaining
to useful ABAP Codes for BPC 7.x which can be found here :
http://scn.sap.com/docs/DOC-28777
The below mentioned code will apply only to BPC 10, and for prior versions of BPC, the link posted above should be
referred.
As mentioned by Pankaj in his post, the gist of what the below mentioned code will achieve is as follows:
To save the extra time overhead in read of application data whenever QUERY is set to ON in
START_BADI... END_BADI construct, this parameter can be set to OFF and an equivalent ABAP
logic can then fetch the application data. This way the code executes much faster.
To elaborate, in a START_BADIEND_BADI syntax, we generally keep QUERY=ON and WRITE = ON.
eg.
*START_BADI (insert filter name here)
QUERY=ON
WRITE=ON
*END_BADI
QUERY = ON helps to populate the CT_DATA table so that the logic can be executed on the records populated as per
the scope file. However, the ABAP code below helps fetch the data records directly into ct_data [] in the BAdI itself.
Since the BAdI fetches the data records, we can keep QUERY = OFF, and save the time involved in querying data from
BPC. The LGF file will now look this:
*START_BADI (insert filter name here)
QUERY=OFF
WRITE=ON
*END_BADI
scn.sap.com/docs/DOC-35054
account_p
audittrail
flow
legal_entity
measures
plant
product
profit_center
rptcurrency
1/4
23.10.13
= i_appset_id
i_application_id = i_appl_id.
*---- 3. Use this ob ject to read the dimension for the i_appl_id & Append ' Measures ' to the
dimension table -----*
REFRESH lt_appl_dim.
lo_appl->get_appl_dim(
EXPORTING
i_appl_id
= i_appl_id
IMPORTING
et_appl_dim = lt_appl_dim ).Dimension table
REFRESH lt_dim_name.
**Populate dimension table 'lt_dim_name'.
LOOP AT lt_appl_dim INTO ls_appl_dim.
ls_dim_name = ls_appl_dim-dimension.
APPEND ls_dim_name TO lt_dim_name.
CLEAR ls_dim_name.
ENDLOOP.
* Include ' Measures ' as dimension table *
ls_dim_name = 'MEASURES'.
APPEND ls_dim_name TO lt_dim_name.
SORT lt_dim_name.
*--4. Prepare Selection range table say for ex : 'lt_sel ' for each dimension passing values to
fields Dimension ,Attrib ute, Option ,Sign , low ----*.
scn.sap.com/docs/DOC-35054
2/4
23.10.13
it_range
lt_sel
if_check_security = ABAP_FALSE
IMPORTING
et_data
= <lt_tx_data>
et_message
).
= lt_message
Things to Remember:
Ensure that your scope file also includes the MEASURES dimension. eg. *XDIM_MEMBERSET MEASURES =
PERIODIC.
Without this, the two internal tables end up being incompatible and we get a dump.
The CT_DATA fails to populate for some reasion if the CURRENCY dimension is scoped as <ALL>. We were
forced to individually specify every currency in our Scope file as *XDIM_MEMBERSET RPTCURRENCY =
INR,USD,GBP,EUR (If any of the experts here can explain the reason for the same, it would be very helpful)
The code pasted above can be used in any BPC 10 implementation but it might need slight modifications from
project to project (eg. list of dimensions etc)
We request all BPC experts to pitch in and correct us or help us improve our code, if a possibility to do so exists.
Hope this is helpful to everyone.
3228 View s
Share
Tw eet
Like
1 Comment
scn.sap.com/docs/DOC-35054
3/4
23.10.13
Dear Rajesh
I would like to regards your ABAP code, i implemented it and worked
I'm quite new on this but i want tou know if you could help me with some thing
1.- How can include information at other model, example OWNERSHIP, to do some special
calculations
2.- How can I include Master Data information from dimensin to extract the entity intercomany and
group currency
3.- Witch part of eh code line i have to include my code to do the calculation
For example in this part:
Site Index
Privacy
Contact Us
Terms of Use
scn.sap.com/docs/DOC-35054
Copyright
Follow SCN
4/4