SAP Function Modules

OIUHS_GENERATE_SYS_NO SAP Function module - Generate a RZ sys no when no E&P sys no exists







OIUHS_GENERATE_SYS_NO 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 OIUHS_GENERATE_SYS_NO into the relevant SAP transaction such as SE37 or SE80.

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


Pattern for FM OIUHS_GENERATE_SYS_NO - OIUHS GENERATE SYS NO





CALL FUNCTION 'OIUHS_GENERATE_SYS_NO' "Generate a RZ sys no when no E&P sys no exists
  EXPORTING
    i_dbaction =                "
*   i_tabname =                 " dd03l-tabname  Table name
*   i_field1 =                  "
*   i_field2 =                  "
*   i_field3 =                  "
*   i_field4 =                  "
*   i_field5 =                  "
*   i_field6 =                  "
*   i_field7 =                  "
*   i_field8 =                  "
*   i_field9 =                  "
*   i_field10 =                 "
*   i_field11 =                 "
*   i_field12 =                 "
*   i_field13 =                 "
*   i_field14 =                 "
*   i_field15 =                 "
  IMPORTING
    e_number_rz =               "               Dummy sequence field
  EXCEPTIONS
    REDFLAG = 1                 "               function number_get_next failed
    INVALID_ACTION = 2          "               DB action must be  I, U or D
    NOTFOUND = 3                "               Record not found
    .  "  OIUHS_GENERATE_SYS_NO

ABAP code example for Function Module OIUHS_GENERATE_SYS_NO





The ABAP code below is a full code listing to execute function module OIUHS_GENERATE_SYS_NO 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:
ld_e_number_rz  TYPE STRING .

DATA(ld_i_dbaction) = 'some text here'.

SELECT single TABNAME
FROM DD03L
INTO @DATA(ld_i_tabname).

DATA(ld_i_field1) = 'some text here'.
DATA(ld_i_field2) = 'some text here'.
DATA(ld_i_field3) = 'some text here'.
DATA(ld_i_field4) = 'some text here'.
DATA(ld_i_field5) = 'some text here'.
DATA(ld_i_field6) = 'some text here'.
DATA(ld_i_field7) = 'some text here'.
DATA(ld_i_field8) = 'some text here'.
DATA(ld_i_field9) = 'some text here'.
DATA(ld_i_field10) = 'some text here'.
DATA(ld_i_field11) = 'some text here'.
DATA(ld_i_field12) = 'some text here'.
DATA(ld_i_field13) = 'some text here'.
DATA(ld_i_field14) = 'some text here'.
DATA(ld_i_field15) = 'some text here'. . CALL FUNCTION 'OIUHS_GENERATE_SYS_NO' EXPORTING i_dbaction = ld_i_dbaction * i_tabname = ld_i_tabname * i_field1 = ld_i_field1 * i_field2 = ld_i_field2 * i_field3 = ld_i_field3 * i_field4 = ld_i_field4 * i_field5 = ld_i_field5 * i_field6 = ld_i_field6 * i_field7 = ld_i_field7 * i_field8 = ld_i_field8 * i_field9 = ld_i_field9 * i_field10 = ld_i_field10 * i_field11 = ld_i_field11 * i_field12 = ld_i_field12 * i_field13 = ld_i_field13 * i_field14 = ld_i_field14 * i_field15 = ld_i_field15 IMPORTING e_number_rz = ld_e_number_rz EXCEPTIONS REDFLAG = 1 INVALID_ACTION = 2 NOTFOUND = 3 . " OIUHS_GENERATE_SYS_NO
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 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_e_number_rz  TYPE STRING ,
ld_i_dbaction  TYPE STRING ,
ld_i_tabname  TYPE DD03L-TABNAME ,
ld_i_field1  TYPE STRING ,
ld_i_field2  TYPE STRING ,
ld_i_field3  TYPE STRING ,
ld_i_field4  TYPE STRING ,
ld_i_field5  TYPE STRING ,
ld_i_field6  TYPE STRING ,
ld_i_field7  TYPE STRING ,
ld_i_field8  TYPE STRING ,
ld_i_field9  TYPE STRING ,
ld_i_field10  TYPE STRING ,
ld_i_field11  TYPE STRING ,
ld_i_field12  TYPE STRING ,
ld_i_field13  TYPE STRING ,
ld_i_field14  TYPE STRING ,
ld_i_field15  TYPE STRING .

ld_i_dbaction = 'some text here'.

SELECT single TABNAME
FROM DD03L
INTO ld_i_tabname.

ld_i_field1 = 'some text here'.
ld_i_field2 = 'some text here'.
ld_i_field3 = 'some text here'.
ld_i_field4 = 'some text here'.
ld_i_field5 = 'some text here'.
ld_i_field6 = 'some text here'.
ld_i_field7 = 'some text here'.
ld_i_field8 = 'some text here'.
ld_i_field9 = 'some text here'.
ld_i_field10 = 'some text here'.
ld_i_field11 = 'some text here'.
ld_i_field12 = 'some text here'.
ld_i_field13 = 'some text here'.
ld_i_field14 = 'some text here'.
ld_i_field15 = 'some text here'.

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 OIUHS_GENERATE_SYS_NO or its description.