Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

About SET ID.

Former Member
0 Likes
3,199

Hi,

Could you please help me to know the use and importance of SET ID?Also how to use the TC GS01 to create one set id.

How do we use the SET ID in our programs?What is the real importance of it?

Thanks in advance for your help,

Sandeep.

Edited by: Sandeep Ram on Mar 13, 2008 1:58 PM

2 REPLIES 2
Read only

Former Member
0 Likes
1,684

The main purpose of Set id is to group G/L accounts. i.e represent the G/L a/cs in hierarchical format.

That means segregate the GL accounts into different category and assign GL account numbers to that particular category.

Eg: Current quarter details,

Open Items details.........

find the code below to retrieve Set data.

CALL FUNCTION 'G_SET_ENCRYPT_SETID'

EXPORTING

SETCLASS = GSETC_FISL_SETCLASS "Other classes: Type pool GSETC

SHORTNAME = G_SET "Set id

IMPORTING

SETID = P_SETID.

  • Check existence of set, send error message if set does not exist

CALL FUNCTION 'G_SET_GET_INFO'

EXPORTING

SETNAME = P_SETID.

*..... Constants ..................................................... *

CONSTANTS: CONTROL_BLOCK LIKE SY-TABIX VALUE 1.

*..... Information about the set ..................................... *

DATA: HEADER LIKE RGSMH.

*..... Set index for differentiation of concurrently processed sets . *

DATA: SETINDEX LIKE SY-TABIX.

..... Read set into the buffer of the set manager (library GSSM) ....

  • (repeated call of G_SET_INSERT for the same set

  • will not lead to repeated database access)

CALL FUNCTION 'G_SET_INSERT'

EXPORTING

SETNAME = U_SETID

IMPORTING

HEADER = HEADER

INDEX = SETINDEX.

*..... Make entry for root set in table SETTAB ....................... *

SETTAB-SETID = HEADER-SETNR.

SETTAB-SETNAME = HEADER-SHORTNAME.

SETTAB-LEVEL = 0.

SETTAB-POINTER = 0.

APPEND SETTAB.

*----


  • Processing according set type

*----


IF HEADER-TYPE CA 'BD'.

  • ... When basic or data sets => read values ........................ *

PERFORM INSERT_VALUES

USING HEADER-SETNR HEADER-SHORTNAME HEADER-SEQNR.

ELSE.

  • ... When single or multi set => read all subsets and values ........*

CALL FUNCTION 'G_SET_GET_NEXT'

EXPORTING

CONTROL_BLOCK = CONTROL_BLOCK

INDEX = SETINDEX

IMPORTING

HEADER = HEADER

EXCEPTIONS

END_OF_SETS = 1.

WHILE SY-SUBRC EQ 0. "Until all sets of hierarchy are read

  • ... Store subset of current line ................................. *

SETTAB-SETID = HEADER-SETNR.

SETTAB-SETNAME = HEADER-SHORTNAME.

SETTAB-LEVEL = HEADER-LEVEL.

SETTAB-POINTER = HEADER-PUP.

APPEND SETTAB.

  • ... Read values, if existing .....................................

IF HEADER-TYPE EQ 'B'.

PERFORM INSERT_VALUES

USING HEADER-SETNR HEADER-SHORTNAME HEADER-SEQNR.

ENDIF.

  • ... Retrieve next set ............................................

CALL FUNCTION 'G_SET_GET_NEXT'

EXPORTING

CONTROL_BLOCK = CONTROL_BLOCK

INDEX = SETINDEX

IMPORTING

HEADER = HEADER

EXCEPTIONS

END_OF_SETS = 1.

ENDWHILE.

ENDIF.

*..... reset this control block so the next call of this routine *

*..... will not get the exception 'END_OF_SETS' right away *

CALL FUNCTION 'G_CONTROL_BLOCK_RESET'

EXPORTING

CONTROL_BLOCK = CONTROL_BLOCK.

Reward points if helpful................

Read only

sreelatha_gullapalli
Active Participant
0 Likes
1,684

hi

check the following link

regards,

sreelatha gullapalli