SAP Function Modules

J_3RFCNT_SAVE_RECORD SAP Function module - Inserts or updates single record in contracts







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

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


Pattern for FM J_3RFCNT_SAVE_RECORD - J 3RFCNT SAVE RECORD





CALL FUNCTION 'J_3RFCNT_SAVE_RECORD' "Inserts or updates single record in contracts
  EXPORTING
    i_j3rfcnt =                 " j_3rfcnt      Maintain Internal Contract Numbers
    i_force =                   " abap_bool     Force overwrite
    i_test =                    " abap_bool
*   i_up_cnttype =              " abap_bool     Update contract type, too
  IMPORTING
    e_j3rfcnt =                 " j_3rfcnt      Maintain Internal Contract Numbers
    e_res =                     " j_3rf_dboper  Operation type: I for insert, U for update
  EXCEPTIONS
    SRC_CONFLICT = 1            "               Source types are different on update (MM/SD/DMS)
    DB_ERROR = 2                "               Cannot update database
    INVALID_KEY = 3             "               Cannot read database: invalid key
    NOT_IDENTICAL = 4           "               Data are not identical in DB and record
    .  "  J_3RFCNT_SAVE_RECORD

ABAP code example for Function Module J_3RFCNT_SAVE_RECORD





The ABAP code below is a full code listing to execute function module J_3RFCNT_SAVE_RECORD 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_j3rfcnt  TYPE J_3RFCNT ,
ld_e_res  TYPE J_3RF_DBOPER .

DATA(ld_i_j3rfcnt) = 'Check type of data required'.
DATA(ld_i_force) = 'Check type of data required'.
DATA(ld_i_test) = 'Check type of data required'.
DATA(ld_i_up_cnttype) = 'Check type of data required'. . CALL FUNCTION 'J_3RFCNT_SAVE_RECORD' EXPORTING i_j3rfcnt = ld_i_j3rfcnt i_force = ld_i_force i_test = ld_i_test * i_up_cnttype = ld_i_up_cnttype IMPORTING e_j3rfcnt = ld_e_j3rfcnt e_res = ld_e_res EXCEPTIONS SRC_CONFLICT = 1 DB_ERROR = 2 INVALID_KEY = 3 NOT_IDENTICAL = 4 . " J_3RFCNT_SAVE_RECORD
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 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_j3rfcnt  TYPE J_3RFCNT ,
ld_i_j3rfcnt  TYPE J_3RFCNT ,
ld_e_res  TYPE J_3RF_DBOPER ,
ld_i_force  TYPE ABAP_BOOL ,
ld_i_test  TYPE ABAP_BOOL ,
ld_i_up_cnttype  TYPE ABAP_BOOL .

ld_i_j3rfcnt = 'Check type of data required'.
ld_i_force = 'Check type of data required'.
ld_i_test = 'Check type of data required'.
ld_i_up_cnttype = 'Check type of data required'.

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