SAP Function Modules

RM_ALM_CONSTRUCT_POSITIONS SAP Function module - ALM: Generation of Simulated Positions (And Saving on Database)







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

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


Pattern for FM RM_ALM_CONSTRUCT_POSITIONS - RM ALM CONSTRUCT POSITIONS





CALL FUNCTION 'RM_ALM_CONSTRUCT_POSITIONS' "ALM: Generation of Simulated Positions (And Saving on Database)
  EXPORTING
    i_rsimlfnr =                " jbrdbrtbstd-rsimlfnr
    i_xtext =                   " jbrdbrtbstd-xtext  Text Field for a More Precise Description
  TABLES
    i_it_knotxsfgdt =           " rms_knotxsfgdt_tab
    e_it_xsfgdt =               " rms_sfgdt_tab
    e_it_bstd =                 " jbrdbrtbstd
    e_it_bstd_ii =              " jbrdbrtbstdii  RM: Position of Extended Risk Objecs; Additional Data
    e_it_bstdpo =               " jbrdbrtbstdpo
    e_it_onr00 =                " onr00
    e_it_zuord =                " rms_knotbstd_tab
    error_itab =                " bapierr
  EXCEPTIONS
    NO_INPUT = 1                "
    INTERNAL_ERROR = 2          "
    .  "  RM_ALM_CONSTRUCT_POSITIONS

ABAP code example for Function Module RM_ALM_CONSTRUCT_POSITIONS





The ABAP code below is a full code listing to execute function module RM_ALM_CONSTRUCT_POSITIONS 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_i_it_knotxsfgdt  TYPE STANDARD TABLE OF RMS_KNOTXSFGDT_TAB,"TABLES PARAM
wa_i_it_knotxsfgdt  LIKE LINE OF it_i_it_knotxsfgdt ,
it_e_it_xsfgdt  TYPE STANDARD TABLE OF RMS_SFGDT_TAB,"TABLES PARAM
wa_e_it_xsfgdt  LIKE LINE OF it_e_it_xsfgdt ,
it_e_it_bstd  TYPE STANDARD TABLE OF JBRDBRTBSTD,"TABLES PARAM
wa_e_it_bstd  LIKE LINE OF it_e_it_bstd ,
it_e_it_bstd_ii  TYPE STANDARD TABLE OF JBRDBRTBSTDII,"TABLES PARAM
wa_e_it_bstd_ii  LIKE LINE OF it_e_it_bstd_ii ,
it_e_it_bstdpo  TYPE STANDARD TABLE OF JBRDBRTBSTDPO,"TABLES PARAM
wa_e_it_bstdpo  LIKE LINE OF it_e_it_bstdpo ,
it_e_it_onr00  TYPE STANDARD TABLE OF ONR00,"TABLES PARAM
wa_e_it_onr00  LIKE LINE OF it_e_it_onr00 ,
it_e_it_zuord  TYPE STANDARD TABLE OF RMS_KNOTBSTD_TAB,"TABLES PARAM
wa_e_it_zuord  LIKE LINE OF it_e_it_zuord ,
it_error_itab  TYPE STANDARD TABLE OF BAPIERR,"TABLES PARAM
wa_error_itab  LIKE LINE OF it_error_itab .


SELECT single RSIMLFNR
FROM JBRDBRTBSTD
INTO @DATA(ld_i_rsimlfnr).


SELECT single XTEXT
FROM JBRDBRTBSTD
INTO @DATA(ld_i_xtext).


"populate fields of struture and append to itab
append wa_i_it_knotxsfgdt to it_i_it_knotxsfgdt.

"populate fields of struture and append to itab
append wa_e_it_xsfgdt to it_e_it_xsfgdt.

"populate fields of struture and append to itab
append wa_e_it_bstd to it_e_it_bstd.

"populate fields of struture and append to itab
append wa_e_it_bstd_ii to it_e_it_bstd_ii.

"populate fields of struture and append to itab
append wa_e_it_bstdpo to it_e_it_bstdpo.

"populate fields of struture and append to itab
append wa_e_it_onr00 to it_e_it_onr00.

"populate fields of struture and append to itab
append wa_e_it_zuord to it_e_it_zuord.

"populate fields of struture and append to itab
append wa_error_itab to it_error_itab. . CALL FUNCTION 'RM_ALM_CONSTRUCT_POSITIONS' EXPORTING i_rsimlfnr = ld_i_rsimlfnr i_xtext = ld_i_xtext TABLES i_it_knotxsfgdt = it_i_it_knotxsfgdt e_it_xsfgdt = it_e_it_xsfgdt e_it_bstd = it_e_it_bstd e_it_bstd_ii = it_e_it_bstd_ii e_it_bstdpo = it_e_it_bstdpo e_it_onr00 = it_e_it_onr00 e_it_zuord = it_e_it_zuord error_itab = it_error_itab EXCEPTIONS NO_INPUT = 1 INTERNAL_ERROR = 2 . " RM_ALM_CONSTRUCT_POSITIONS
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_i_rsimlfnr  TYPE JBRDBRTBSTD-RSIMLFNR ,
it_i_it_knotxsfgdt  TYPE STANDARD TABLE OF RMS_KNOTXSFGDT_TAB ,
wa_i_it_knotxsfgdt  LIKE LINE OF it_i_it_knotxsfgdt,
ld_i_xtext  TYPE JBRDBRTBSTD-XTEXT ,
it_e_it_xsfgdt  TYPE STANDARD TABLE OF RMS_SFGDT_TAB ,
wa_e_it_xsfgdt  LIKE LINE OF it_e_it_xsfgdt,
it_e_it_bstd  TYPE STANDARD TABLE OF JBRDBRTBSTD ,
wa_e_it_bstd  LIKE LINE OF it_e_it_bstd,
it_e_it_bstd_ii  TYPE STANDARD TABLE OF JBRDBRTBSTDII ,
wa_e_it_bstd_ii  LIKE LINE OF it_e_it_bstd_ii,
it_e_it_bstdpo  TYPE STANDARD TABLE OF JBRDBRTBSTDPO ,
wa_e_it_bstdpo  LIKE LINE OF it_e_it_bstdpo,
it_e_it_onr00  TYPE STANDARD TABLE OF ONR00 ,
wa_e_it_onr00  LIKE LINE OF it_e_it_onr00,
it_e_it_zuord  TYPE STANDARD TABLE OF RMS_KNOTBSTD_TAB ,
wa_e_it_zuord  LIKE LINE OF it_e_it_zuord,
it_error_itab  TYPE STANDARD TABLE OF BAPIERR ,
wa_error_itab  LIKE LINE OF it_error_itab.


SELECT single RSIMLFNR
FROM JBRDBRTBSTD
INTO ld_i_rsimlfnr.


"populate fields of struture and append to itab
append wa_i_it_knotxsfgdt to it_i_it_knotxsfgdt.

SELECT single XTEXT
FROM JBRDBRTBSTD
INTO ld_i_xtext.


"populate fields of struture and append to itab
append wa_e_it_xsfgdt to it_e_it_xsfgdt.

"populate fields of struture and append to itab
append wa_e_it_bstd to it_e_it_bstd.

"populate fields of struture and append to itab
append wa_e_it_bstd_ii to it_e_it_bstd_ii.

"populate fields of struture and append to itab
append wa_e_it_bstdpo to it_e_it_bstdpo.

"populate fields of struture and append to itab
append wa_e_it_onr00 to it_e_it_onr00.

"populate fields of struture and append to itab
append wa_e_it_zuord to it_e_it_zuord.

"populate fields of struture and append to itab
append wa_error_itab to it_error_itab.

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