SAP Function Modules

OBJECT_ASSIGN_S SAP Function module







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

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


Pattern for FM OBJECT_ASSIGN_S - OBJECT ASSIGN S





CALL FUNCTION 'OBJECT_ASSIGN_S' "
  EXPORTING
*   flg_save_in_updt = SPACE    "
    function =                  "
    objnr =                     " sano1-objnr
*   sano1_new = SPACE           " sano1
*   sans1_new = SPACE           " sans1
  IMPORTING
    flg_first_load =            "
    sano1_old =                 " sano1
    sans1_old =                 " sans1
* TABLES
*   vzparus_tab =               " vzparus
  EXCEPTIONS
    ERROR = 1                   "
    OBJECT_NOT_FOUND = 2        "
    .  "  OBJECT_ASSIGN_S

ABAP code example for Function Module OBJECT_ASSIGN_S





The ABAP code below is a full code listing to execute function module OBJECT_ASSIGN_S 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_flg_first_load  TYPE STRING ,
ld_sano1_old  TYPE SANO1 ,
ld_sans1_old  TYPE SANS1 ,
it_vzparus_tab  TYPE STANDARD TABLE OF VZPARUS,"TABLES PARAM
wa_vzparus_tab  LIKE LINE OF it_vzparus_tab .

DATA(ld_flg_save_in_updt) = 'some text here'.
DATA(ld_function) = 'some text here'.

SELECT single OBJNR
FROM SANO1
INTO @DATA(ld_objnr).

DATA(ld_sano1_new) = 'Check type of data required'.
DATA(ld_sans1_new) = 'Check type of data required'.

"populate fields of struture and append to itab
append wa_vzparus_tab to it_vzparus_tab. . CALL FUNCTION 'OBJECT_ASSIGN_S' EXPORTING * flg_save_in_updt = ld_flg_save_in_updt function = ld_function objnr = ld_objnr * sano1_new = ld_sano1_new * sans1_new = ld_sans1_new IMPORTING flg_first_load = ld_flg_first_load sano1_old = ld_sano1_old sans1_old = ld_sans1_old * TABLES * vzparus_tab = it_vzparus_tab EXCEPTIONS ERROR = 1 OBJECT_NOT_FOUND = 2 . " OBJECT_ASSIGN_S
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_flg_first_load  TYPE STRING ,
ld_flg_save_in_updt  TYPE STRING ,
it_vzparus_tab  TYPE STANDARD TABLE OF VZPARUS ,
wa_vzparus_tab  LIKE LINE OF it_vzparus_tab,
ld_sano1_old  TYPE SANO1 ,
ld_function  TYPE STRING ,
ld_sans1_old  TYPE SANS1 ,
ld_objnr  TYPE SANO1-OBJNR ,
ld_sano1_new  TYPE SANO1 ,
ld_sans1_new  TYPE SANS1 .

ld_flg_save_in_updt = 'some text here'.

"populate fields of struture and append to itab
append wa_vzparus_tab to it_vzparus_tab.
ld_function = 'some text here'.

SELECT single OBJNR
FROM SANO1
INTO ld_objnr.

ld_sano1_new = 'Check type of data required'.
ld_sans1_new = '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 OBJECT_ASSIGN_S or its description.