SAP Tables

KR_USER_EXIT_ROUNDOFF SAP Function module - Round Off Tax Amounts




KR_USER_EXIT_ROUNDOFFis a standard SAP function module available within R/3 SAPsystems depending on your version and release level. Below is the pattern details for this FM showing its interface including any import/export parameters, exceptions etc as well as any documentation contributions specific to the object. See here to view full function module documentation and code listing, simply by entering the name KR_USER_EXIT_ROUNDOFF into the relevant SAP transaction such as SE37 or SE80.

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


Pattern for FM KR_USER_EXIT_ROUNDOFF - KR USER EXIT ROUNDOFF
Associated Function Group: KRGEU
Released Date: Not Released
CALL FUNCTION 'KR_USER_EXIT_ROUNDOFF' "Round Off Tax Amounts
  EXPORTING
*   ysn1op =                    "               Aggregated Invoices
*   ysta1 =                     "               Normal Invoices
    yprog_name =                " sy-cprog      Calling Program
*   yreprint =                  "               Reprint Option
*   sap =                       "               SAPscript Output
* TABLES
*   ygt_item_table =            "               RFUMSV49R
*   ydocument =                 "               RFUMSV45R
*   yausglop_itab =             "               RFIDKRTCR, RFIDKRTPR
    .  "  KR_USER_EXIT_ROUNDOFF

ABAP code example for Function Module KR_USER_EXIT_ROUNDOFF

The ABAP code below is a full code listing to execute function module KR_USER_EXIT_ROUNDOFF including all data declarations. The code uses the latest in-line data declaration syntax but I have included an abap code snipet 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_ygt_item_table   TYPE STANDARD TABLE OF STRING,"tables param
wa_ygt_item_table LIKE LINE OF it_ygt_item_table  ,
it_ydocument   TYPE STANDARD TABLE OF STRING,"tables param
wa_ydocument LIKE LINE OF it_ydocument  ,
it_yausglop_itab   TYPE STANDARD TABLE OF STRING,"tables param
wa_yausglop_itab LIKE LINE OF it_yausglop_itab  .

DATA(ld_ysn1op) = 'some text here'.
DATA(ld_ysta1) = 'some text here'.
DATA(ld_yprog_name) = 'some text here'.
DATA(ld_yreprint) = 'some text here'.
DATA(ld_sap) = 'some text here'.

"populate fields of struture and append to itab
append wa_ygt_item_table to it_ygt_item_table.

"populate fields of struture and append to itab
append wa_ydocument to it_ydocument.

"populate fields of struture and append to itab
append wa_yausglop_itab to it_yausglop_itab.. CALL FUNCTION 'KR_USER_EXIT_ROUNDOFF' EXPORTING * ysn1op = ld_ysn1op * ysta1 = ld_ysta1 yprog_name = ld_yprog_name * yreprint = ld_yreprint * sap = ld_sap * TABLES * ygt_item_table = it_ygt_item_table * ydocument = it_ydocument * yausglop_itab = it_yausglop_itab . " KR_USER_EXIT_ROUNDOFF
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_ysn1op TYPE STRING ,
it_ygt_item_table TYPE STANDARD TABLE OF STRING ,
wa_ygt_item_table LIKE LINE OF it_ygt_item_table,
ld_ysta1 TYPE STRING ,
it_ydocument TYPE STANDARD TABLE OF STRING ,
wa_ydocument LIKE LINE OF it_ydocument,
ld_yprog_name TYPE SY-CPROG ,
it_yausglop_itab TYPE STANDARD TABLE OF STRING ,
wa_yausglop_itab LIKE LINE OF it_yausglop_itab,
ld_yreprint TYPE STRING ,
ld_sap TYPE STRING .

ld_ysn1op = 'some text here'.

"populate fields of struture and append to itab
append wa_ygt_item_table to it_ygt_item_table.
ld_ysta1 = 'some text here'.

"populate fields of struture and append to itab
append wa_ydocument to it_ydocument.
ld_yprog_name = 'some text here'.

"populate fields of struture and append to itab
append wa_yausglop_itab to it_yausglop_itab.
ld_yreprint = 'some text here'.
ld_sap = 'some text here'..

SAP Documentation for FM KR_USER_EXIT_ROUNDOFF


This function module rounds off VAT amounts as per your requirements, for example, when you translate VAT amounts from foreign currencies. ...See here for full SAP fm documentation