SAP Function Modules

TB_REF_COMPENSATION_READ SAP Function module - Read a Netting (w/o Screen) and Fill All Structures for LIST







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

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


Pattern for FM TB_REF_COMPENSATION_READ - TB REF COMPENSATION READ





CALL FUNCTION 'TB_REF_COMPENSATION_READ' "Read a Netting (w/o Screen) and Fill All Structures for LIST
  EXPORTING
*   i_mode = 'DISP'             " sy-tcode      Modus (CREA/CHNG/DISP/RSET)
*   i_reftyp = 'KMP'            " refh-reftyp   Netting category
    i_refnr =                   " refh-refnr    Kompensation-Nr
  IMPORTING
    e_head =                    " vtb_ch        Header Structure
  TABLES
    t_crncy =                   " vtb_cc        Tabelle  der Komp.währungen  (VTB_CC)
    t_posit =                   " vtb_cp        Tabelle  der Komp.positionen (VTB_CP)
  EXCEPTIONS
    COMPENSATION_NOT_FOUND = 1  "               Kompensation mit I_REFTYP I_REFNR nicht gefunden
    NO_AUTHORITY = 2            "               No authorization
    COMPENSATION_LOCKED = 3     "               Kompensation ist gesperrt
    OBJECT_LOCKED = 4           "               Ein zur Komp. gehörendes Objekt ist gesperrt
    INTERNAL_ERROR = 5          "               Internal Error
    .  "  TB_REF_COMPENSATION_READ

ABAP code example for Function Module TB_REF_COMPENSATION_READ





The ABAP code below is a full code listing to execute function module TB_REF_COMPENSATION_READ 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_head  TYPE VTB_CH ,
it_t_crncy  TYPE STANDARD TABLE OF VTB_CC,"TABLES PARAM
wa_t_crncy  LIKE LINE OF it_t_crncy ,
it_t_posit  TYPE STANDARD TABLE OF VTB_CP,"TABLES PARAM
wa_t_posit  LIKE LINE OF it_t_posit .

DATA(ld_i_mode) = 'some text here'.

SELECT single REFTYP
FROM REFH
INTO @DATA(ld_i_reftyp).


SELECT single REFNR
FROM REFH
INTO @DATA(ld_i_refnr).


"populate fields of struture and append to itab
append wa_t_crncy to it_t_crncy.

"populate fields of struture and append to itab
append wa_t_posit to it_t_posit. . CALL FUNCTION 'TB_REF_COMPENSATION_READ' EXPORTING * i_mode = ld_i_mode * i_reftyp = ld_i_reftyp i_refnr = ld_i_refnr IMPORTING e_head = ld_e_head TABLES t_crncy = it_t_crncy t_posit = it_t_posit EXCEPTIONS COMPENSATION_NOT_FOUND = 1 NO_AUTHORITY = 2 COMPENSATION_LOCKED = 3 OBJECT_LOCKED = 4 INTERNAL_ERROR = 5 . " TB_REF_COMPENSATION_READ
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 ELSEIF SY-SUBRC EQ 5. "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_head  TYPE VTB_CH ,
ld_i_mode  TYPE SY-TCODE ,
it_t_crncy  TYPE STANDARD TABLE OF VTB_CC ,
wa_t_crncy  LIKE LINE OF it_t_crncy,
ld_i_reftyp  TYPE REFH-REFTYP ,
it_t_posit  TYPE STANDARD TABLE OF VTB_CP ,
wa_t_posit  LIKE LINE OF it_t_posit,
ld_i_refnr  TYPE REFH-REFNR .

ld_i_mode = 'some text here'.

"populate fields of struture and append to itab
append wa_t_crncy to it_t_crncy.

SELECT single REFTYP
FROM REFH
INTO ld_i_reftyp.


"populate fields of struture and append to itab
append wa_t_posit to it_t_posit.

SELECT single REFNR
FROM REFH
INTO ld_i_refnr.

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