SAP Function Modules

SET_AMOUNTS SAP Function module







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

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


Pattern for FM SET_AMOUNTS - SET AMOUNTS





CALL FUNCTION 'SET_AMOUNTS' "
  EXPORTING
    i_beleg_waers =             " bkpf-waers    Transaction Currency
    i_btr_beleg_waers =         "               Amount in Transaction Currency
    i_haus_waers =              " bkpf-waers    Local Currency
    i_btr_haus_waers =          "               Amount in Local Currency
    i_buchungs_datum =          " bkpf-budat    Posting Date in the Document
    i_ldwrs =                   " bkpf-waers    Currency Key
*   i_soll_haben_kz = SPACE     " fmbp-shkzg    FM area currency
*   i_kurs_bukrs = '000000000'  " fmbk-kursf
*   i_bukrs =                   " bukrs         Company Code
*   i_curtp =                   " curtp
  IMPORTING
    e_trbtr =                   "               Amount in Transaction Currency
    e_ldbtr =                   "               Amount in FM Area Currency
    e_kurs_fikrs =              " fmepin-kursfikrs  Amount in FM Area Currency
    .  "  SET_AMOUNTS

ABAP code example for Function Module SET_AMOUNTS





The ABAP code below is a full code listing to execute function module SET_AMOUNTS 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_trbtr  TYPE STRING ,
ld_e_ldbtr  TYPE STRING ,
ld_e_kurs_fikrs  TYPE FMEPIN-KURSFIKRS .


SELECT single WAERS
FROM BKPF
INTO @DATA(ld_i_beleg_waers).

DATA(ld_i_btr_beleg_waers) = 'some text here'.

SELECT single WAERS
FROM BKPF
INTO @DATA(ld_i_haus_waers).

DATA(ld_i_btr_haus_waers) = 'some text here'.

SELECT single BUDAT
FROM BKPF
INTO @DATA(ld_i_buchungs_datum).


SELECT single WAERS
FROM BKPF
INTO @DATA(ld_i_ldwrs).


DATA(ld_i_soll_haben_kz) = some text here

DATA(ld_i_kurs_bukrs) = Check type of data required
DATA(ld_i_bukrs) = 'Check type of data required'.
DATA(ld_i_curtp) = 'Check type of data required'. . CALL FUNCTION 'SET_AMOUNTS' EXPORTING i_beleg_waers = ld_i_beleg_waers i_btr_beleg_waers = ld_i_btr_beleg_waers i_haus_waers = ld_i_haus_waers i_btr_haus_waers = ld_i_btr_haus_waers i_buchungs_datum = ld_i_buchungs_datum i_ldwrs = ld_i_ldwrs * i_soll_haben_kz = ld_i_soll_haben_kz * i_kurs_bukrs = ld_i_kurs_bukrs * i_bukrs = ld_i_bukrs * i_curtp = ld_i_curtp IMPORTING e_trbtr = ld_e_trbtr e_ldbtr = ld_e_ldbtr e_kurs_fikrs = ld_e_kurs_fikrs . " SET_AMOUNTS
IF SY-SUBRC EQ 0. "All OK 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_trbtr  TYPE STRING ,
ld_i_beleg_waers  TYPE BKPF-WAERS ,
ld_e_ldbtr  TYPE STRING ,
ld_i_btr_beleg_waers  TYPE STRING ,
ld_e_kurs_fikrs  TYPE FMEPIN-KURSFIKRS ,
ld_i_haus_waers  TYPE BKPF-WAERS ,
ld_i_btr_haus_waers  TYPE STRING ,
ld_i_buchungs_datum  TYPE BKPF-BUDAT ,
ld_i_ldwrs  TYPE BKPF-WAERS ,
ld_i_soll_haben_kz  TYPE FMBP-SHKZG ,
ld_i_kurs_bukrs  TYPE FMBK-KURSF ,
ld_i_bukrs  TYPE BUKRS ,
ld_i_curtp  TYPE CURTP .


SELECT single WAERS
FROM BKPF
INTO ld_i_beleg_waers.

ld_i_btr_beleg_waers = 'some text here'.

SELECT single WAERS
FROM BKPF
INTO ld_i_haus_waers.

ld_i_btr_haus_waers = 'some text here'.

SELECT single BUDAT
FROM BKPF
INTO ld_i_buchungs_datum.


SELECT single WAERS
FROM BKPF
INTO ld_i_ldwrs.


ld_i_soll_haben_kz = some text here

ld_i_kurs_bukrs = Check type of data required
ld_i_bukrs = 'Check type of data required'.
ld_i_curtp = '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 SET_AMOUNTS or its description.