How to check set

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 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 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.
返回TECH参考资料列表