SAP Function Modules

G_GENERATE_MULTI_SET SAP Function module







G_GENERATE_MULTI_SET is a standard SAP function module available within R/3 SAP systems depending on your version and release level. Below is the pattern details for this FM showing its interface including any import and export parameters, exceptions etc as well as any documentation contributions (Comments) specific to the object.

See here to view full function module documentation and code listing, simply by entering the name G_GENERATE_MULTI_SET into the relevant SAP transaction such as SE37 or SE80.

Associated Function Group: GSGF
Released Date: Not Released
Processing type: Normal fucntion module
Normal function module settings


Pattern for FM G_GENERATE_MULTI_SET - G GENERATE MULTI SET





CALL FUNCTION 'G_GENERATE_MULTI_SET' "
  EXPORTING
*   client = SPACE              " sy-mandt      Client in which set is to be created
*   langu = SY-LANGU            " sy-langu      Language of text
    set_header =                " rgsbs         Header of the M set
*   ref_set = SPACE             " rgsbs-setnr   Name of reference set
*   nothing_changed = SPACE     " sy-datar      Internal use only (set not changed)
*   flag_use_rgsbs_user = SPACE  " sy-datar     Internal use (take user from header)
* TABLES
*   set_lines =                 " rgsb2         Table with set lines
  EXCEPTIONS
    DOUBLE_FIELD = 1            "               Field is used repeatedly
    OLD_SET_HAS_WRONG_TYPE = 2  "               Set with same name but different type
    SUBSET_DOES_NOT_EXIST = 3   "               Subset used does not exist
    VARIABLE_DOES_NOT_EXIST = 4  "              Variable used does not exist
    VARIABLE_HAS_WRONG_TABLE = 5  "             Set variable belongs to wrong table
    VARIABLE_HAS_WRONG_TYPE = 6  "              Set variable has incorrect type (not 'S')
    SUBSET_HAS_WRONG_TYPE = 7   "               Subset used has incorrect type (M)
    SETNAME_TOO_LONG = 8        "               Set name is too long for a temporary set
    SUBSET_HAS_WRONG_TABLE = 9  "               Subset used belongs to wrong table
    TEMPORARY_IN_PERMANENT_SET = 10  "          Set contains temporary subset
    WRONG_SETCLASS = 11         "               Incorrect set class (only general sets allowed)
    .  "  G_GENERATE_MULTI_SET

ABAP code example for Function Module G_GENERATE_MULTI_SET





The ABAP code below is a full code listing to execute function module G_GENERATE_MULTI_SET including all data declarations. The code uses the latest in-line data DECLARATION SYNTAX but I have included an ABAP code snippet at the end to show how declarations would look using the original method of declaring data variables up front. This will allow you to compare and fully understand the new inline method. Please note some of the newer syntax such as the @DATA is not available until a later 4.70 service pack (SP8).

DATA:
it_set_lines  TYPE STANDARD TABLE OF RGSB2,"TABLES PARAM
wa_set_lines  LIKE LINE OF it_set_lines .

DATA(ld_client) = 'Check type of data required'.
DATA(ld_langu) = 'Check type of data required'.
DATA(ld_set_header) = 'Check type of data required'.

DATA(ld_ref_set) = some text here
DATA(ld_nothing_changed) = 'some text here'.
DATA(ld_flag_use_rgsbs_user) = 'some text here'.

"populate fields of struture and append to itab
append wa_set_lines to it_set_lines. . CALL FUNCTION 'G_GENERATE_MULTI_SET' EXPORTING * client = ld_client * langu = ld_langu set_header = ld_set_header * ref_set = ld_ref_set * nothing_changed = ld_nothing_changed * flag_use_rgsbs_user = ld_flag_use_rgsbs_user * TABLES * set_lines = it_set_lines EXCEPTIONS DOUBLE_FIELD = 1 OLD_SET_HAS_WRONG_TYPE = 2 SUBSET_DOES_NOT_EXIST = 3 VARIABLE_DOES_NOT_EXIST = 4 VARIABLE_HAS_WRONG_TABLE = 5 VARIABLE_HAS_WRONG_TYPE = 6 SUBSET_HAS_WRONG_TYPE = 7 SETNAME_TOO_LONG = 8 SUBSET_HAS_WRONG_TABLE = 9 TEMPORARY_IN_PERMANENT_SET = 10 WRONG_SETCLASS = 11 . " G_GENERATE_MULTI_SET
IF SY-SUBRC EQ 0. "All OK ELSEIF SY-SUBRC EQ 1. "Exception "Add code for exception here ELSEIF SY-SUBRC EQ 2. "Exception "Add code for exception here ELSEIF SY-SUBRC EQ 3. "Exception "Add code for exception here ELSEIF SY-SUBRC EQ 4. "Exception "Add code for exception here ELSEIF SY-SUBRC EQ 5. "Exception "Add code for exception here ELSEIF SY-SUBRC EQ 6. "Exception "Add code for exception here ELSEIF SY-SUBRC EQ 7. "Exception "Add code for exception here ELSEIF SY-SUBRC EQ 8. "Exception "Add code for exception here ELSEIF SY-SUBRC EQ 9. "Exception "Add code for exception here ELSEIF SY-SUBRC EQ 10. "Exception "Add code for exception here ELSEIF SY-SUBRC EQ 11. "Exception "Add code for exception here ENDIF.







ABAP code to compare 7.40 inline data declaration with original syntax

The below ABAP code uses the older none in-line data declarations. This allows you to see the coding differences/benefits of the later inline syntax. It may also be useful if you are using an older version of SAP as some of the newer syntax above, such as the @DATA is not available until 4.70 EHP 8.

DATA:
ld_client  TYPE SY-MANDT ,
it_set_lines  TYPE STANDARD TABLE OF RGSB2 ,
wa_set_lines  LIKE LINE OF it_set_lines,
ld_langu  TYPE SY-LANGU ,
ld_set_header  TYPE RGSBS ,
ld_ref_set  TYPE RGSBS-SETNR ,
ld_nothing_changed  TYPE SY-DATAR ,
ld_flag_use_rgsbs_user  TYPE SY-DATAR .

ld_client = 'Check type of data required'.

"populate fields of struture and append to itab
append wa_set_lines to it_set_lines.
ld_langu = 'Check type of data required'.
ld_set_header = 'Check type of data required'.

ld_ref_set = some text here
ld_nothing_changed = 'some text here'.
ld_flag_use_rgsbs_user = 'some text here'.

SAP Documentation for FM G_GENERATE_MULTI_SET


The function module G_GENERATE_MULTI_SET creates a multi set or changes an existing one. ...See here for full SAP fm documentation

Contribute (Add Comments)

Please help keep this info upto date and use the comments section below to add useful hints, tips and information specific to this SAP function. This will then be available for you and other users to easily find by simply searching on the object name G_GENERATE_MULTI_SET or its description.