SAP PROGNOSE Function Module for Forecast methods









PROGNOSE is a standard prognose SAP function module available within SAP R/3 or S/4 Hana systems, depending on your version and release level. It is used for Forecast methods 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 prognose FM, simply by entering the name PROGNOSE into the relevant SAP transaction such as SE37 or SE38.

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



Function PROGNOSE 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 'PROGNOSE'"Forecast methods
EXPORTING
PROG_PARAMETER = "Forecast Parameters
* PROG_FLG_OUTLIER = "
* I_FLG_NEGATIVE = ' ' "

IMPORTING
PROG_ERGEBNIS = "Forecast Results - Parameters

TABLES
ABLAUF = "
MELDUNGEN = "Error messages
PROGNOSE = "Forecast Results - Values
VERGANGENHEIT = "Historical Values
* TREND_TAB = "
* I_WEIGHT_FACTOR = "Weighting Factors for the Forecast
* I_TREND_DAMPENING = "Weighting Factors for the Forecast

EXCEPTIONS
GWERT_NULL = 1 NE_PAST = 2 NO_PAST = 3
.



IMPORTING Parameters details for PROGNOSE

PROG_PARAMETER - Forecast Parameters

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

PROG_FLG_OUTLIER -

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

I_FLG_NEGATIVE -

Data type: C
Default: ' '
Optional: Yes
Call by Reference: Yes

EXPORTING Parameters details for PROGNOSE

PROG_ERGEBNIS - Forecast Results - Parameters

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

TABLES Parameters details for PROGNOSE

ABLAUF -

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

MELDUNGEN - Error messages

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

PROGNOSE - Forecast Results - Values

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

VERGANGENHEIT - Historical Values

Data type: VERGWERTE
Optional: No
Call by Reference: Yes

TREND_TAB -

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

I_WEIGHT_FACTOR - Weighting Factors for the Forecast

Data type: WEIGHTFACT
Optional: Yes
Call by Reference: Yes

I_TREND_DAMPENING - Weighting Factors for the Forecast

Data type: WEIGHTFACT
Optional: Yes
Call by Reference: Yes

EXCEPTIONS details

GWERT_NULL - Basic Value Becomes Zero.

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

NE_PAST -

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

NO_PAST -

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

Copy and paste ABAP code example for PROGNOSE 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:
lt_ablauf  TYPE STANDARD TABLE OF IMELD, "   
lv_gwert_null  TYPE IMELD, "   
lv_prog_ergebnis  TYPE IMELD, "   
lv_prog_parameter  TYPE PCOM, "   
lv_ne_past  TYPE PCOM, "   
lt_meldungen  TYPE STANDARD TABLE OF IMELD, "   
lv_prog_flg_outlier  TYPE IMELD, "   
lv_no_past  TYPE IMELD, "   
lt_prognose  TYPE STANDARD TABLE OF IPROG, "   
lv_i_flg_negative  TYPE C, "   ' '
lt_vergangenheit  TYPE STANDARD TABLE OF VERGWERTE, "   
lt_trend_tab  TYPE STANDARD TABLE OF IPROG, "   
lt_i_weight_factor  TYPE STANDARD TABLE OF WEIGHTFACT, "   
lt_i_trend_dampening  TYPE STANDARD TABLE OF WEIGHTFACT. "   

  CALL FUNCTION 'PROGNOSE'  "Forecast methods
    EXPORTING
         PROG_PARAMETER = lv_prog_parameter
         PROG_FLG_OUTLIER = lv_prog_flg_outlier
         I_FLG_NEGATIVE = lv_i_flg_negative
    IMPORTING
         PROG_ERGEBNIS = lv_prog_ergebnis
    TABLES
         ABLAUF = lt_ablauf
         MELDUNGEN = lt_meldungen
         PROGNOSE = lt_prognose
         VERGANGENHEIT = lt_vergangenheit
         TREND_TAB = lt_trend_tab
         I_WEIGHT_FACTOR = lt_i_weight_factor
         I_TREND_DAMPENING = lt_i_trend_dampening
    EXCEPTIONS
        GWERT_NULL = 1
        NE_PAST = 2
        NO_PAST = 3
. " PROGNOSE




ABAP code using 7.40 inline data declarations to call FM PROGNOSE

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.

 
 
 
 
 
 
 
 
 
DATA(ld_i_flg_negative) = ' '.
 
 
 
 
 


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!