SAP R/3 форум ABAP консультантов
Russian ABAP Developer's Club

Home - FAQ - Search - Memberlist - Usergroups - Profile - Log in to check your private messages - Register - Log in - English
Blogs - Weblogs News

Get FI Cost Element group hierarchy



 
Post new topic   Reply to topic    Russian ABAP Developer's Club Forum Index -> CO
View previous topic :: View next topic  
Author Message
admin
Администратор
Администратор



Joined: 01 Sep 2007
Posts: 1640

PostPosted: Sat Oct 13, 2007 1:36 pm    Post subject: Get FI Cost Element group hierarchy Reply with quote

The following code demonstrates how to retreive the cost element group hierarchy, as seen via cost element group structure
transaction KAH3.

Code:
*&---------------------------------------------------------------------*
*& Report  ZCE_GROUPS                                               *
*&                                                                     *
*&---------------------------------------------------------------------*
*&                                                                     *
*&                                                                     *
*&---------------------------------------------------------------------*
REPORT ZCE_GROUPS.

* GSETC type pool stores codes for differenct group classes
*    i.e. gsetc_costelement_setclass = '0102'.
TYPE-POOLS: gsetc.

TYPES: gseth_node_line    LIKE grpobjects,
       gseth_node_tab     TYPE gseth_node_line OCCURS 0.
TYPES: gseth_val_line     LIKE grpvalues,
       gseth_val_tab      TYPE gseth_val_line OCCURS 0.
TYPES: GSETH_MD_LINE      LIKE GRPMDLINE,
       GSETH_MD_TAB       TYPE GSETH_MD_LINE OCCURS 0.
DATA: it_nodes            TYPE  gseth_node_tab,
      it_values           TYPE  gseth_val_tab,
      it_mdtab            type gseth_md_tab,
      wa_mdtab            type GSETH_MD_LINE.

DATA: ld_setid            TYPE sethier-setid,
      ld_info             LIKE grphinfo,
      ld_overwrite        LIKE sy-datar.

PARAMETERS: p_cele        LIKE GRPDYNP-NAME_COALL,
            p_burks       TYPE bseg-BUKRS.

 CONCATENATE gsetc_costelement_setclass 'UNIV' p_cele INTO ld_setid.
  CALL FUNCTION 'K_HIERARCHY_TABLES_READ'
    EXPORTING
      e_class                           = gsetc_costelement_setclass
                           "from gsetc type-pool = '0102'
      e_setid                           = ld_setid
      e_kokrs                           = 'UNIV'
      E_MANDT                           = sy-mandt
      E_MASTER_DATA                     = 'XXX'  "retrieve master data into mdtab

* displays popup to confirm if a large amount of data is to be retrieved
    E_STRUCTURE                       = 'X  X0200'  "displays popup to confirm

*     E_REPLACE_CLASS                   =
*     E_REPLACE_UNIT                    =
*     E_REPLACE_TABLE                   = ' '
*     E_REPLACE_FIELD                   = ' '
*     E_SUFFIX                          =
*     E_OLD_LINE_LEVEL                  = 0
*   IMPORTING
*     I_DOUBLE_CHECK                    =
*     I_MASTER_DATA                     =
    TABLES
      t_nodes                           = it_nodes
      t_values                          = it_values
      T_MASTER_DATA                     = it_mdtab
*     T_FORMULA                         =
*     T_FIELD_INFO                      =
*     T_NODE_LIST_OVERWRITE             =
    CHANGING
      c_info                            = ld_info
      c_overwrite                       = ld_overwrite
   EXCEPTIONS
     no_controlling_area               = 1
     no_chart_of_account               = 2
     different_controlling_areas       = 3
     different_chart_of_accounts       = 4
     set_not_found                     = 5
     illegal_field_replacement         = 6
     illegal_table_replacement         = 7
     fm_raise                          = 8
     convert_error                     = 9
     no_overwrite_standard_hier        = 10
     no_bukrs_for_kokrs                = 11
     OTHERS                            = 12.

Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Russian ABAP Developer's Club Forum Index -> CO All times are GMT + 4 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum


All product names are trademarks of their respective companies. SAPNET.RU websites are in no way affiliated with SAP AG.
SAP, SAP R/3, R/3 software, mySAP, ABAP, BAPI, xApps, SAP NetWeaver and any other are registered trademarks of SAP AG.
Every effort is made to ensure content integrity. Use information on this site at your own risk.