SapMaterial.com
Costelement groups


Tables:

SETCLST           Set Class Descriptions
SETHEADER     Set Header and Directory
SETHEADERT  Short Description of Sets
T800S                 FI-SL Set Table (before Release 4.0)



Note: The SETCLASS for Costelement groups = 0102



1. Create SETID  

The setid is a concatenation from SETCLASS + Chart of accounts + Setname
Setname is the name of the costelement group.

You can either make the concatenation yourself or use function module G_SET_ENCRYPT_SETID


G_SET_ENCRYPT_SETID
EXPORTING                                    

SETCLASS          = '0102'
SHORTNAME     =  'CA705_MAT'
KOKRS                =  '1000'
KTOPL                = 'INT'

Returns setid: 0102INT CA705_MAT

Note that SETID can be decrypted again using functionmodule DECRYPT_SETID

2. Read accounst

CALL FUNCTION 'G_SET_TREE_IMPORT'                               
EXPORTING                                                  
CLIENT                                             = '800'
SETID                                                =  '0102INT CA705_MAT'

NO_VARIABLE_REPLACEMENT   = 'X'
NO_TABLE_BUFFERING                =  'X'


Example

REPORT z_test.


data:
li_SET_VALUES like setvalues occurs 0,
l_SET_VALUES like setvalues.

DATA:
l_setid LIKE sethier-setid.

PARAMETERS:
p_ktopl    LIKE sethier-ktopl DEFAULT 'INT',                            "Chart of accounts
p_kokrs   LIKE sethier-kokrs DEFAULT '1000',                         "Controlling area
p_setcls LIKE sethier-setclass DEFAULT '0102',                      "Set class
p_setnam LIKE setheader-setname DEFAULT 'CA705_MAT'.  "Setname - Costelement group

START-OF-SELECTION.

* Create SETID

CALL FUNCTION 'G_SET_ENCRYPT_SETID'
EXPORTING
setclass                   = p_setcls
shortname               = p_setnam
kokrs                       = p_kokrs
ktopl                        = p_ktopl
IMPORTING
setid                        = l_setid.
.
* Read accounts


CALL FUNCTION 'G_SET_TREE_IMPORT'
EXPORTING
SETID                                               = l_setid
TABNAME                                         = ' '

NO_VARIABLE_REPLACEMENT   = 'X'
MAX_HIER_LEVEL                           = 99
TABLES
SET_VALUES                      = li_SET_VALUES.



END-OF-SELECTION.

loop at li_SET_VALUES into l_SET_VALUES.
write: /
l_SET_VALUES-from,
l_SET_VALUES-to.
endloop.
All of the  product names here are trademarks of their respective companies.  The site
www.allsaplinks.com no way affiliated with SAP AG. We have made every effort for the content
integrity.  Information used on this site is at your own risk.
ABAP TECHNICAL

SAP Introduction

sap abap faq

sap Tables

SAP Transaction codes

Internal tables

data dictionary

performance tuning

transports & Requests

Sap scripts

Smartforms

lsmw

reports

sap Workflow

module pool/ dialog
programming

table control

user exits

sap memory

abap memory

alv reports

ABAP ADVANCED

IDOC

ALE

BAPI

BADI

RFC


FUNCTIONAL SIDE

Materials Management

FICO

Human Resources

BIW / BW / SEM


Free Documentation
Abap Material

Ale Material

BAPI Material

BC Material

IDOC Material

R/3 Database Management

SAP material

RFC

Transport

Sales & Distribution Material

Basic Data and Function
Material

Basis (BC) Material

Billing Material

CA Material

CATT : Computer Aided Test
Tool

Capacity Evaluation and
leveling Material

Capacity Planning Material

Cross Application Material

Countries

Customer Service Material

Enterpise  Material

Financial / Controlling (FICO)

Internet Time Sheet

Inspection Material

HR Material

Material Management
Material

Payments Material

Payroll Material

Pension Fund

Production Planning and
Control

Plant Maintenance

Quality Management Material

Real Estate Material

SAP material

Wage Types