‎2008 Mar 13 8:14 AM
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
‎2008 Mar 13 8:32 AM
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................
‎2008 Mar 13 8:41 AM