SAP CHOOSE_YEAR_OF_DOCUMENT Function Module for









CHOOSE_YEAR_OF_DOCUMENT is a standard choose year of document 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 choose year of document FM, simply by entering the name CHOOSE_YEAR_OF_DOCUMENT into the relevant SAP transaction such as SE37 or SE38.

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



Function CHOOSE_YEAR_OF_DOCUMENT 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 'CHOOSE_YEAR_OF_DOCUMENT'"
EXPORTING
I_BELNR = "
I_BUKRS = "
* I_XBSTV = ' ' "
* I_XBSTD = ' ' "
* I_XBSTM = ' ' "
* I_XARCH = 'X' "
* I_BSTAT = "

IMPORTING
E_GJAHR = "
E_AINFO = "
E_ANZAHL = "

EXCEPTIONS
NOTHING_FOUND = 1 NOTHING_SELECTED = 2
.



IMPORTING Parameters details for CHOOSE_YEAR_OF_DOCUMENT

I_BELNR -

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

I_BUKRS -

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

I_XBSTV -

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

I_XBSTD -

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

I_XBSTM -

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

I_XARCH -

Data type: T020-DYNCL
Default: 'X'
Optional: Yes
Call by Reference: No ( called with pass by value option)

I_BSTAT -

Data type: BKPF-BSTAT
Optional: Yes
Call by Reference: No ( called with pass by value option)

EXPORTING Parameters details for CHOOSE_YEAR_OF_DOCUMENT

E_GJAHR -

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

E_AINFO -

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

E_ANZAHL -

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

EXCEPTIONS details

NOTHING_FOUND -

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

NOTHING_SELECTED -

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

Copy and paste ABAP code example for CHOOSE_YEAR_OF_DOCUMENT 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_e_gjahr  TYPE BKPF-GJAHR, "   
lv_i_belnr  TYPE BKPF-BELNR, "   
lv_nothing_found  TYPE BKPF, "   
lv_e_ainfo  TYPE ARIX_BKPF, "   
lv_i_bukrs  TYPE BKPF-BUKRS, "   
lv_nothing_selected  TYPE BKPF, "   
lv_i_xbstv  TYPE T020-DYNCL, "   SPACE
lv_e_anzahl  TYPE NUMERIC, "   
lv_i_xbstd  TYPE T020-DYNCL, "   SPACE
lv_i_xbstm  TYPE T020-DYNCL, "   SPACE
lv_i_xarch  TYPE T020-DYNCL, "   'X'
lv_i_bstat  TYPE BKPF-BSTAT. "   

  CALL FUNCTION 'CHOOSE_YEAR_OF_DOCUMENT'  "
    EXPORTING
         I_BELNR = lv_i_belnr
         I_BUKRS = lv_i_bukrs
         I_XBSTV = lv_i_xbstv
         I_XBSTD = lv_i_xbstd
         I_XBSTM = lv_i_xbstm
         I_XARCH = lv_i_xarch
         I_BSTAT = lv_i_bstat
    IMPORTING
         E_GJAHR = lv_e_gjahr
         E_AINFO = lv_e_ainfo
         E_ANZAHL = lv_e_anzahl
    EXCEPTIONS
        NOTHING_FOUND = 1
        NOTHING_SELECTED = 2
. " CHOOSE_YEAR_OF_DOCUMENT




ABAP code using 7.40 inline data declarations to call FM CHOOSE_YEAR_OF_DOCUMENT

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 GJAHR FROM BKPF INTO @DATA(ld_e_gjahr).
 
"SELECT single BELNR FROM BKPF INTO @DATA(ld_i_belnr).
 
 
 
"SELECT single BUKRS FROM BKPF INTO @DATA(ld_i_bukrs).
 
 
"SELECT single DYNCL FROM T020 INTO @DATA(ld_i_xbstv).
DATA(ld_i_xbstv) = ' '.
 
 
"SELECT single DYNCL FROM T020 INTO @DATA(ld_i_xbstd).
DATA(ld_i_xbstd) = ' '.
 
"SELECT single DYNCL FROM T020 INTO @DATA(ld_i_xbstm).
DATA(ld_i_xbstm) = ' '.
 
"SELECT single DYNCL FROM T020 INTO @DATA(ld_i_xarch).
DATA(ld_i_xarch) = 'X'.
 
"SELECT single BSTAT FROM BKPF INTO @DATA(ld_i_bstat).
 


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!