SAP Reading Sets - GS01 - GS02 - GS03

作者:郑德鼎 约 2 分钟阅读 更新日期:2024-02-22 2 年前更新 标签:ABAP, CO, Data Engineering, FI, SD, 开发, 数据工程, 财务, 销售分销
目录

Reading Sets - GS01 - GS02 - GS03

Skip to end of metadata

Created by Anonymous, last modified by Former Member on Nov 09, 2013

Go to start of metadata

Introduction

Many a times there is a need to access the values maintained in a set. These values may be maintained directly through transactions GS01 or GS02 and viewed through GS03. The values in the Set are stored in db table SETLEAF.

Sets are also used for

Cost Center Group

Cost Element Group

Order Group

Statistical Key Figure Group

Activity Type Group

Profit Center Group

Business Process Group

Cost Object Group

Account Group

WBS Element Group

Fund Group

Functional Area Group

Grant Group

Business Entities Set

Real Estate Set

Buildings Set

Rental Units Set

Rental Agreements Set

Management Contracts Set

Settlement Units Set

General Contracts Set

... and many more....

For the set class the table SETCLS is to be checked.

Here we will be seeing an example of how to read the contents of a particular profit centre group. The set class for profit centre is 0106.

Code

The internal table *l_i_set_lines_basic* will contain the data .. the internal tale *l_wa_hdr* will contain the header details.

Next part on .. How to update/create Sets...

Also check https://www.sdn.sap.com/irj/sdn/weblogs?blog=/pub/wlg/5541

1

2

3

4

5

6

7

8

9

46 | REPORT ytest_grp .

• -- Constant for the Set Class

CONSTANTS: c_cls_0106 TYPE rgsbs-class VALUE '0106'.
DATA: l_wa_set_lines_basic TYPE rgsbv,

l_wa_hdr             TYPE rgsbs,

l_i_for_lin          TYPE STANDARD TABLE OF rgsbf,

l_i_set_lines_basic  TYPE STANDARD TABLE OF rgsbv,

l_i_set_lines_data   TYPE STANDARD TABLE OF rgsb3,

l_i_set_lines_multi  TYPE STANDARD TABLE OF rgsb2,

l_i_set_lines_single TYPE STANDARD TABLE OF rgsb1.

DATA: l_v_setnr TYPE char50.
PARAMETERS: p_pcgrp TYPE pcgrp,      " Profit Centre Group

p_kokrs TYPE kokrs.      " Controlling Area

CONCATENATE p_kokrs p_pcgrp INTO l_v_setnr.

*-- Get the Set description

CALL FUNCTION 'G_SET_FETCH'

EXPORTING

class            = c_cls_0106

setnr            = l_v_setnr

IMPORTING

set_header       = l_wa_hdr

TABLES

formula_lines    = l_i_for_lin

set_lines_basic  = l_i_set_lines_basic

set_lines_data   = l_i_set_lines_data

set_lines_multi  = l_i_set_lines_multi

set_lines_single = l_i_set_lines_single

EXCEPTIONS

no_authority     = 1

set_is_broken    = 2

set_not_found    = 3

OTHERS           = 4.

*-- handle your exceptions here

LOOP AT l_i_set_lines_basic INTO l_wa_set_lines_basic.

WRITE :/ l_wa_set_lines_basic-from,

l_wa_set_lines_basic-to,

l_wa_set_lines_basic-title.

ENDLOOP.
郑德鼎

关于作者:郑德鼎

企业信息化与 SAP 技术顾问,长期专注 SAP ABAP、FI/CO、MM、SD 等模块的技术分享与实战经验总结。查看更多介绍

来源说明:本文内容由「SAP Reading Sets - GS01 - GS02 - GS03.docx」整理生成,仅用于内部技术分享与学习交流。