SAP Function Modules

ADK0_RA_PERIOD_END_CLOSING SAP Function module







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

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


Pattern for FM ADK0_RA_PERIOD_END_CLOSING - ADK0 RA PERIOD END CLOSING





CALL FUNCTION 'ADK0_RA_PERIOD_END_CLOSING' "
  EXPORTING
    kokrs =                     " coep-kokrs
    bukrs =                     " coep-bukrs
    abgsl =                     " aufk-abgsl
    objnr =                     " coep-objnr
    perio =                     " coep-perio
    gjahr =                     " coep-gjahr
    commit_work =               " kkalkkag-commitwork
  TABLES
    it_dlia =                   " ad01dlia
    it_dliv2 =                  " ad01dliv2
    it_dlim =                   " ad01dlim
    it_dliv3 =                  " ad01dliv3
*   it_obj =                    " ad01obj       Communication: Objects to be Billed/Objects for Quotation
  EXCEPTIONS
    MESSAGE_TYPE_A = 1          "
    MESSAGE_TYPE_E = 2          "
    .  "  ADK0_RA_PERIOD_END_CLOSING

ABAP code example for Function Module ADK0_RA_PERIOD_END_CLOSING





The ABAP code below is a full code listing to execute function module ADK0_RA_PERIOD_END_CLOSING 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_it_dlia  TYPE STANDARD TABLE OF AD01DLIA,"TABLES PARAM
wa_it_dlia  LIKE LINE OF it_it_dlia ,
it_it_dliv2  TYPE STANDARD TABLE OF AD01DLIV2,"TABLES PARAM
wa_it_dliv2  LIKE LINE OF it_it_dliv2 ,
it_it_dlim  TYPE STANDARD TABLE OF AD01DLIM,"TABLES PARAM
wa_it_dlim  LIKE LINE OF it_it_dlim ,
it_it_dliv3  TYPE STANDARD TABLE OF AD01DLIV3,"TABLES PARAM
wa_it_dliv3  LIKE LINE OF it_it_dliv3 ,
it_it_obj  TYPE STANDARD TABLE OF AD01OBJ,"TABLES PARAM
wa_it_obj  LIKE LINE OF it_it_obj .


SELECT single KOKRS
FROM COEP
INTO @DATA(ld_kokrs).


SELECT single BUKRS
FROM COEP
INTO @DATA(ld_bukrs).


SELECT single ABGSL
FROM AUFK
INTO @DATA(ld_abgsl).


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


SELECT single PERIO
FROM COEP
INTO @DATA(ld_perio).


SELECT single GJAHR
FROM COEP
INTO @DATA(ld_gjahr).


DATA(ld_commit_work) = some text here

"populate fields of struture and append to itab
append wa_it_dlia to it_it_dlia.

"populate fields of struture and append to itab
append wa_it_dliv2 to it_it_dliv2.

"populate fields of struture and append to itab
append wa_it_dlim to it_it_dlim.

"populate fields of struture and append to itab
append wa_it_dliv3 to it_it_dliv3.

"populate fields of struture and append to itab
append wa_it_obj to it_it_obj. . CALL FUNCTION 'ADK0_RA_PERIOD_END_CLOSING' EXPORTING kokrs = ld_kokrs bukrs = ld_bukrs abgsl = ld_abgsl objnr = ld_objnr perio = ld_perio gjahr = ld_gjahr commit_work = ld_commit_work TABLES it_dlia = it_it_dlia it_dliv2 = it_it_dliv2 it_dlim = it_it_dlim it_dliv3 = it_it_dliv3 * it_obj = it_it_obj EXCEPTIONS MESSAGE_TYPE_A = 1 MESSAGE_TYPE_E = 2 . " ADK0_RA_PERIOD_END_CLOSING
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_kokrs  TYPE COEP-KOKRS ,
it_it_dlia  TYPE STANDARD TABLE OF AD01DLIA ,
wa_it_dlia  LIKE LINE OF it_it_dlia,
ld_bukrs  TYPE COEP-BUKRS ,
it_it_dliv2  TYPE STANDARD TABLE OF AD01DLIV2 ,
wa_it_dliv2  LIKE LINE OF it_it_dliv2,
ld_abgsl  TYPE AUFK-ABGSL ,
it_it_dlim  TYPE STANDARD TABLE OF AD01DLIM ,
wa_it_dlim  LIKE LINE OF it_it_dlim,
ld_objnr  TYPE COEP-OBJNR ,
it_it_dliv3  TYPE STANDARD TABLE OF AD01DLIV3 ,
wa_it_dliv3  LIKE LINE OF it_it_dliv3,
ld_perio  TYPE COEP-PERIO ,
it_it_obj  TYPE STANDARD TABLE OF AD01OBJ ,
wa_it_obj  LIKE LINE OF it_it_obj,
ld_gjahr  TYPE COEP-GJAHR ,
ld_commit_work  TYPE KKALKKAG-COMMITWORK .


SELECT single KOKRS
FROM COEP
INTO ld_kokrs.


"populate fields of struture and append to itab
append wa_it_dlia to it_it_dlia.

SELECT single BUKRS
FROM COEP
INTO ld_bukrs.


"populate fields of struture and append to itab
append wa_it_dliv2 to it_it_dliv2.

SELECT single ABGSL
FROM AUFK
INTO ld_abgsl.


"populate fields of struture and append to itab
append wa_it_dlim to it_it_dlim.

SELECT single OBJNR
FROM COEP
INTO ld_objnr.


"populate fields of struture and append to itab
append wa_it_dliv3 to it_it_dliv3.

SELECT single PERIO
FROM COEP
INTO ld_perio.


"populate fields of struture and append to itab
append wa_it_obj to it_it_obj.

SELECT single GJAHR
FROM COEP
INTO ld_gjahr.


ld_commit_work = some text here

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