SAP PERIOD_AND_DATE_CONVERT_OUTPUT Function Module for Conversion of a date with period specification with output









PERIOD_AND_DATE_CONVERT_OUTPUT is a standard period and date convert output SAP function module available within SAP R/3 or S/4 Hana systems, depending on your version and release level. It is used for Conversion of a date with period specification with output processing and below is the pattern details for this FM, 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 period and date convert output FM, simply by entering the name PERIOD_AND_DATE_CONVERT_OUTPUT into the relevant SAP transaction such as SE37 or SE38.

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



Function PERIOD_AND_DATE_CONVERT_OUTPUT 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 'PERIOD_AND_DATE_CONVERT_OUTPUT'"Conversion of a date with period specification with output
EXPORTING
* COUNTRY = ' ' "
INTERNAL_DATE = "Date in Internal Format
INTERNAL_PERIOD = "Period indicator in internal forma
* LANGUAGE = SYST-LANGU "
* I_PERIV = "
* I_WERKS = "
* I_MRPPP = "

IMPORTING
EXTERNAL_DATE = "Date in External Format
EXTERNAL_PERIOD = "Period indicator in external forma
EXTERNAL_PRINTTEXT = "Period name for printout

EXCEPTIONS
DATE_INVALID = 1 PERIODE_INVALID = 2
.



IMPORTING Parameters details for PERIOD_AND_DATE_CONVERT_OUTPUT

COUNTRY -

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

INTERNAL_DATE - Date in Internal Format

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

INTERNAL_PERIOD - Period indicator in internal forma

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

LANGUAGE -

Data type: SY-LANGU
Default: SYST-LANGU
Optional: Yes
Call by Reference: No ( called with pass by value option)

I_PERIV -

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

I_WERKS -

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

I_MRPPP -

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

EXPORTING Parameters details for PERIOD_AND_DATE_CONVERT_OUTPUT

EXTERNAL_DATE - Date in External Format

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

EXTERNAL_PERIOD - Period indicator in external forma

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

EXTERNAL_PRINTTEXT - Period name for printout

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

EXCEPTIONS details

DATE_INVALID - Invalid Date

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

PERIODE_INVALID - Internal period is invalid as not

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

Copy and paste ABAP code example for PERIOD_AND_DATE_CONVERT_OUTPUT 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_country  TYPE T005-LAND1, "   SPACE
lv_date_invalid  TYPE T005, "   
lv_external_date  TYPE RVDAT-EXTDATUM, "   
lv_internal_date  TYPE SYST-DATUM, "   
lv_external_period  TYPE TPRG-PRGBZ, "   
lv_periode_invalid  TYPE TPRG, "   
lv_internal_period  TYPE TPRG-PRGRS, "   
lv_external_printtext  TYPE TPRG-PRITX, "   
lv_language  TYPE SY-LANGU, "   SYST-LANGU
lv_i_periv  TYPE MT61D-PERIV, "   
lv_i_werks  TYPE T439I-WERKS, "   
lv_i_mrppp  TYPE T439I-MRPPP. "   

  CALL FUNCTION 'PERIOD_AND_DATE_CONVERT_OUTPUT'  "Conversion of a date with period specification with output
    EXPORTING
         COUNTRY = lv_country
         INTERNAL_DATE = lv_internal_date
         INTERNAL_PERIOD = lv_internal_period
         LANGUAGE = lv_language
         I_PERIV = lv_i_periv
         I_WERKS = lv_i_werks
         I_MRPPP = lv_i_mrppp
    IMPORTING
         EXTERNAL_DATE = lv_external_date
         EXTERNAL_PERIOD = lv_external_period
         EXTERNAL_PRINTTEXT = lv_external_printtext
    EXCEPTIONS
        DATE_INVALID = 1
        PERIODE_INVALID = 2
. " PERIOD_AND_DATE_CONVERT_OUTPUT




ABAP code using 7.40 inline data declarations to call FM PERIOD_AND_DATE_CONVERT_OUTPUT

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 LAND1 FROM T005 INTO @DATA(ld_country).
DATA(ld_country) = ' '.
 
 
"SELECT single EXTDATUM FROM RVDAT INTO @DATA(ld_external_date).
 
"SELECT single DATUM FROM SYST INTO @DATA(ld_internal_date).
 
"SELECT single PRGBZ FROM TPRG INTO @DATA(ld_external_period).
 
 
"SELECT single PRGRS FROM TPRG INTO @DATA(ld_internal_period).
 
"SELECT single PRITX FROM TPRG INTO @DATA(ld_external_printtext).
 
"SELECT single LANGU FROM SY INTO @DATA(ld_language).
DATA(ld_language) = SYST-LANGU.
 
"SELECT single PERIV FROM MT61D INTO @DATA(ld_i_periv).
 
"SELECT single WERKS FROM T439I INTO @DATA(ld_i_werks).
 
"SELECT single MRPPP FROM T439I INTO @DATA(ld_i_mrppp).
 


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!