SAP Function Modules

INSERT_DUMMY_RG1 SAP Function module - Inserts dummy stock balance record for RG1 with zero stocks







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

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


Pattern for FM INSERT_DUMMY_RG1 - INSERT DUMMY RG1





CALL FUNCTION 'INSERT_DUMMY_RG1' "Inserts dummy stock balance record for RG1 with zero stocks
  EXPORTING
    i_exgrp =                   " j_2irg1bal-exgrp
    i_datum =                   " j_2irg1bal-datum
    i_matnr =                   " j_2irg1bal-matnr
    i_form =                    " j_2irg1bal-form
*   i_werks =                   " j_2irg1bal-werks
  IMPORTING
    e_rg1bal =                  " j_2irg1bal
  EXCEPTIONS
    PARAMETER_ERROR = 1         "
    CREATE_FAILED = 2           "
    .  "  INSERT_DUMMY_RG1

ABAP code example for Function Module INSERT_DUMMY_RG1





The ABAP code below is a full code listing to execute function module INSERT_DUMMY_RG1 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_rg1bal  TYPE J_2IRG1BAL .


SELECT single EXGRP
FROM J_2IRG1BAL
INTO @DATA(ld_i_exgrp).


SELECT single DATUM
FROM J_2IRG1BAL
INTO @DATA(ld_i_datum).


SELECT single MATNR
FROM J_2IRG1BAL
INTO @DATA(ld_i_matnr).


SELECT single FORM
FROM J_2IRG1BAL
INTO @DATA(ld_i_form).


SELECT single WERKS
FROM J_2IRG1BAL
INTO @DATA(ld_i_werks).
. CALL FUNCTION 'INSERT_DUMMY_RG1' EXPORTING i_exgrp = ld_i_exgrp i_datum = ld_i_datum i_matnr = ld_i_matnr i_form = ld_i_form * i_werks = ld_i_werks IMPORTING e_rg1bal = ld_e_rg1bal EXCEPTIONS PARAMETER_ERROR = 1 CREATE_FAILED = 2 . " INSERT_DUMMY_RG1
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 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_rg1bal  TYPE J_2IRG1BAL ,
ld_i_exgrp  TYPE J_2IRG1BAL-EXGRP ,
ld_i_datum  TYPE J_2IRG1BAL-DATUM ,
ld_i_matnr  TYPE J_2IRG1BAL-MATNR ,
ld_i_form  TYPE J_2IRG1BAL-FORM ,
ld_i_werks  TYPE J_2IRG1BAL-WERKS .


SELECT single EXGRP
FROM J_2IRG1BAL
INTO ld_i_exgrp.


SELECT single DATUM
FROM J_2IRG1BAL
INTO ld_i_datum.


SELECT single MATNR
FROM J_2IRG1BAL
INTO ld_i_matnr.


SELECT single FORM
FROM J_2IRG1BAL
INTO ld_i_form.


SELECT single WERKS
FROM J_2IRG1BAL
INTO ld_i_werks.

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