SAP K_COSSA_GET_PERIOD_VALUE Function Module for









K_COSSA_GET_PERIOD_VALUE is a standard k cossa get period value SAP function module available within SAP R/3 or S/4 Hana systems, depending on your version and release level. It is used to perform a specific ABAP function and below is the pattern details, showing its interface including any import and export parameters, exceptions etc. there is also a full "cut and paste" ABAP pattern code example, along with implementation ABAP coding, documentation and contribution comments specific to this or related objects.


See here to view full function module documentation and code listing for k cossa get period value FM, simply by entering the name K_COSSA_GET_PERIOD_VALUE into the relevant SAP transaction such as SE37 or SE38.

Function Group: KPTL
Program Name: SAPLKPTL
Main Program: SAPLKPTL
Appliation area: K
Release date: N/A
Mode(Normal, Remote etc): Normal Function Module
Update:



Function K_COSSA_GET_PERIOD_VALUE pattern details

In-order to call this FM within your sap programs, simply using the below ABAP pattern details to trigger the function call...or see the full ABAP code listing at the end of this article. You can simply cut and paste this code into your ABAP progrom as it is, including variable declarations.
CALL FUNCTION 'K_COSSA_GET_PERIOD_VALUE'"
EXPORTING
* LEDNR = '00' "
* TWAER = ' ' "
OBJNR = "
GJAHR = "
VERSN = "
PERIO = "
* WRTTP = '01' "
PAROB = "
* HRKFT = 'NOCHECK' "
* BEKNZ = ' ' "

IMPORTING
WKG = "
WKF = "
WTG = "
WOG = "
MEG = "
MEF = "

EXCEPTIONS
NO_RECORD_FOUND = 1
.



IMPORTING Parameters details for K_COSSA_GET_PERIOD_VALUE

LEDNR -

Data type: COSPA-LEDNR
Default: '00'
Optional: Yes
Call by Reference: No ( called with pass by value option)

TWAER -

Data type: COSPA-TWAER
Default: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)

OBJNR -

Data type: COSPA-OBJNR
Optional: No
Call by Reference: No ( called with pass by value option)

GJAHR -

Data type: COSPA-GJAHR
Optional: No
Call by Reference: No ( called with pass by value option)

VERSN -

Data type: COSPA-VERSN
Optional: No
Call by Reference: No ( called with pass by value option)

PERIO -

Data type: PERIODS-BUPER
Optional: No
Call by Reference: No ( called with pass by value option)

WRTTP -

Data type: COSPA-WRTTP
Default: '01'
Optional: Yes
Call by Reference: No ( called with pass by value option)

PAROB -

Data type: COSSA-PAROB
Optional: No
Call by Reference: No ( called with pass by value option)

HRKFT -

Data type: COSPA-HRKFT
Default: 'NOCHECK'
Optional: Yes
Call by Reference: No ( called with pass by value option)

BEKNZ -

Data type: COSPA-BEKNZ
Default: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)

EXPORTING Parameters details for K_COSSA_GET_PERIOD_VALUE

WKG -

Data type:
Optional: No
Call by Reference: No ( called with pass by value option)

WKF -

Data type:
Optional: No
Call by Reference: No ( called with pass by value option)

WTG -

Data type:
Optional: No
Call by Reference: No ( called with pass by value option)

WOG -

Data type:
Optional: No
Call by Reference: No ( called with pass by value option)

MEG -

Data type:
Optional: No
Call by Reference: No ( called with pass by value option)

MEF -

Data type:
Optional: No
Call by Reference: No ( called with pass by value option)

EXCEPTIONS details

NO_RECORD_FOUND -

Data type:
Optional: No
Call by Reference: No ( called with pass by value option)

Copy and paste ABAP code example for K_COSSA_GET_PERIOD_VALUE Function Module

The ABAP code below is a full code listing to execute function module POPUP_TO_CONFIRM including all data declarations. The code uses the original data declarations rather than 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 newer method of declaring data variables on the fly. 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), which i why i have stuck to the origianl for this example.

DATA:
lv_wkg  TYPE STRING, "   
lv_lednr  TYPE COSPA-LEDNR, "   '00'
lv_no_record_found  TYPE COSPA, "   
lv_twaer  TYPE COSPA-TWAER, "   SPACE
lv_wkf  TYPE COSPA, "   
lv_objnr  TYPE COSPA-OBJNR, "   
lv_wtg  TYPE COSPA, "   
lv_gjahr  TYPE COSPA-GJAHR, "   
lv_wog  TYPE COSPA, "   
lv_versn  TYPE COSPA-VERSN, "   
lv_meg  TYPE COSPA, "   
lv_perio  TYPE PERIODS-BUPER, "   
lv_mef  TYPE PERIODS, "   
lv_wrttp  TYPE COSPA-WRTTP, "   '01'
lv_parob  TYPE COSSA-PAROB, "   
lv_hrkft  TYPE COSPA-HRKFT, "   'NOCHECK'
lv_beknz  TYPE COSPA-BEKNZ. "   SPACE

  CALL FUNCTION 'K_COSSA_GET_PERIOD_VALUE'  "
    EXPORTING
         LEDNR = lv_lednr
         TWAER = lv_twaer
         OBJNR = lv_objnr
         GJAHR = lv_gjahr
         VERSN = lv_versn
         PERIO = lv_perio
         WRTTP = lv_wrttp
         PAROB = lv_parob
         HRKFT = lv_hrkft
         BEKNZ = lv_beknz
    IMPORTING
         WKG = lv_wkg
         WKF = lv_wkf
         WTG = lv_wtg
         WOG = lv_wog
         MEG = lv_meg
         MEF = lv_mef
    EXCEPTIONS
        NO_RECORD_FOUND = 1
. " K_COSSA_GET_PERIOD_VALUE




ABAP code using 7.40 inline data declarations to call FM K_COSSA_GET_PERIOD_VALUE

The below ABAP code uses the newer in-line data declarations. This allows you to see the coding differences/benefits of the later inline syntax. Please note some of the newer syntax below, such as the @DATA is not available until 4.70 EHP 8.

 
"SELECT single LEDNR FROM COSPA INTO @DATA(ld_lednr).
DATA(ld_lednr) = '00'.
 
 
"SELECT single TWAER FROM COSPA INTO @DATA(ld_twaer).
DATA(ld_twaer) = ' '.
 
 
"SELECT single OBJNR FROM COSPA INTO @DATA(ld_objnr).
 
 
"SELECT single GJAHR FROM COSPA INTO @DATA(ld_gjahr).
 
 
"SELECT single VERSN FROM COSPA INTO @DATA(ld_versn).
 
 
"SELECT single BUPER FROM PERIODS INTO @DATA(ld_perio).
 
 
"SELECT single WRTTP FROM COSPA INTO @DATA(ld_wrttp).
DATA(ld_wrttp) = '01'.
 
"SELECT single PAROB FROM COSSA INTO @DATA(ld_parob).
 
"SELECT single HRKFT FROM COSPA INTO @DATA(ld_hrkft).
DATA(ld_hrkft) = 'NOCHECK'.
 
"SELECT single BEKNZ FROM COSPA INTO @DATA(ld_beknz).
DATA(ld_beknz) = ' '.
 


Search for further information about these or an SAP related objects



Comments on this SAP object

What made you want to lookup this SAP object? Please tell us what you were looking for and anything you would like to be included on this page!