Quantcast
Channel: SCN : Discussion List - SAP Planning and Consolidation, version for SAP NetWeaver
Viewing all articles
Browse latest Browse all 5414

Read Dimension Data and store in Internal table BADI BPC 7.5

$
0
0

Hi,

 

I am writing a BADI to replace our Default logic in Script Logic and use the BADI to achieve the same logic. In this logic, I have to perform currency conversion, by looking up rate table and based on certain conditions, I have to perform the conversions.

 

To check the conditions, I have to read ACCOUNT master data in the BADI and reference the ACCOUNT master data and its corresponding properties.

I am not sure how to read the Dimension Master data in the BADI and write to an internal table for reference in the code.

 

Currently, this is the code I am using.

 

DATA:

* Structures needed to read Account Master Data and write to Internal tables

     lo_account      TYPE REF TO cl_uja_dim,

     lr_dim_data     TYPE REF TO if_uja_dim_data,

     lt_account_attr TYPE uja_t_attr_name,

     lr_account_data TYPE REF TO data,

     ls_acc          TYPE REF TO data.

FIELD_SYMBOLS:

<lt_acc>    TYPE STANDARD TABLE,

<ls_acc>    TYPE ANY.

 

 

* Select Account Dimension

REFRESH: lt_account_attr, lt_acc_sel.

CLEAR: ls_acc_sel.

 

TRY .

CREATE OBJECT lo_account

   EXPORTING

      i_appset_id = i_appset_id

      i_dimension = 'ACCOUNT'.

CATCH cx_uja_admin_error.

ENDTRY.

 

lr_dim_data = lo_account.

 

*Write the Account property names in the attribute name table

APPEND:

         'ID'              TO lt_account_attr,

         'ACCTYPE'         TO lt_account_attr,

         'ACCT_GRP'        TO lt_account_attr,

         'EVDESCRIPTION'   TO lt_account_attr,

         'FORMAT'          TO lt_account_attr,

         'FORMULA'         TO lt_account_attr,

         'IS_INPUT'        TO lt_account_attr,

         'IS_INPUT'        TO lt_account_attr,

         'LOGIC_GRP'       TO lt_account_attr,

         'PLAN'            TO lt_account_attr,

         'RATETYPE'        TO lt_account_attr,

         'SCALING'         TO lt_account_attr,

         'SOLVEORDER'      TO lt_account_attr,

         'STORED_CALC'     TO lt_account_attr,

         'STYLE'           TO lt_account_attr.

 

***** Selects only the BAS members of Account Master Data ***

ls_acc_sel-dimension = 'ACCOUNT'.

ls_acc_sel-attribute = 'CALC'.

ls_acc_sel-sign = 'EQ'.

ls_acc_sel-option = 'I'.

ls_acc_sel-low = 'N'.

APPEND ls_acc_sel TO lt_acc_sel.

**************************************************************

 

TRY.

   CALL METHOD lr_dim_data->read_mbr_data

     EXPORTING

       it_attr_list = lt_account_attr    "Attribute/Properties list of Account Dimension

       it_sel = lt_acc_sel               "Selection criteria for reading the Account members

     IMPORTING

       er_data = lr_account_data.        "Reference of Account Master Data

   CATCH cx_uja_admin_error.

ENDTRY.

 

ASSIGN lr_account_data->* TO <lt_acc>.

 

CREATE DATA ls_acc LIKE LINE OF <lt_acc>. "Now Account Master Data is available in <lt_acc>

ASSIGN ls_acc->* TO <lt_acc>.

 

 

I am not able to use the <lt_acc> field symbol table. When I try to use the <lt_acc>-RATETYPE property, I get an error when I check the code, which says ""<LT_ACC>" is a table without a header line and therefore has no component called RATETYPE".

 

Is there any other way, (may be simpler and shorter) way to read the master data in BADI?

 

Thanks,

Abhishek



Viewing all articles
Browse latest Browse all 5414

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>