SAP NW_GR_CALC_DATES Function Module for Calculate start and end time from start date and duration









NW_GR_CALC_DATES is a standard nw gr calc dates SAP function module available within SAP R/3 or S/4 Hana systems, depending on your version and release level. It is used for Calculate start and end time from start date and duration 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 nw gr calc dates FM, simply by entering the name NW_GR_CALC_DATES into the relevant SAP transaction such as SE37 or SE38.

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



Function NW_GR_CALC_DATES 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 'NW_GR_CALC_DATES'"Calculate start and end time from start date and duration
EXPORTING
ARBID = "Object ID of the resource
BEGINN = "SAP Graphics: Seconds since 30.12.1899
DAUER = "SAP Graphics: Seconds since 30.12.1899
EINHEIT = "Normal duration/unit
KALID = "Factory Calendar

IMPORTING
DAUER_OPR = "Normal duration of the activity
ENDE_DATUM = "Earliest scheduled start: Execution (date)
ENDE_ZEIT = "Earliest scheduled start: Execution (time)
START_DATUM = "Earliest scheduled start: Execution (date)
START_ZEIT = "Earliest scheduled start: Execution (time)
.




Customer Function user exits

Below is a list of CUSTOMER FUNCTION exit user exits that are available within this program and maybe relevant for this FM.
EXIT_SAPLNWGR_001 Network Maintenance: Fill Nodes with Other Information
EXIT_SAPLNWGR_002 Network Maintenance: Fill DIN field in Legend with Other Information
EXIT_SAPLNWGR_004 PS Info System: Fill Nodes in Network/Hierarchy and Structure with Info

IMPORTING Parameters details for NW_GR_CALC_DATES

ARBID - Object ID of the resource

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

BEGINN - SAP Graphics: Seconds since 30.12.1899

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

DAUER - SAP Graphics: Seconds since 30.12.1899

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

EINHEIT - Normal duration/unit

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

KALID - Factory Calendar

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

EXPORTING Parameters details for NW_GR_CALC_DATES

DAUER_OPR - Normal duration of the activity

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

ENDE_DATUM - Earliest scheduled start: Execution (date)

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

ENDE_ZEIT - Earliest scheduled start: Execution (time)

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

START_DATUM - Earliest scheduled start: Execution (date)

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

START_ZEIT - Earliest scheduled start: Execution (time)

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

Copy and paste ABAP code example for NW_GR_CALC_DATES 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_arbid  TYPE AFVGD-ARBID, "   
lv_dauer_opr  TYPE AFVGD-DAUNO, "   
lv_beginn  TYPE GGAEL-BEG, "   
lv_ende_datum  TYPE AFVGD-FSAVD, "   
lv_dauer  TYPE GGAEL-DUR, "   
lv_ende_zeit  TYPE AFVGD-FSAVZ, "   
lv_einheit  TYPE AFVGD-DAUNE, "   
lv_start_datum  TYPE AFVGD-FSAVD, "   
lv_kalid  TYPE AFVGD-KALID, "   
lv_start_zeit  TYPE AFVGD-FSAVZ. "   

  CALL FUNCTION 'NW_GR_CALC_DATES'  "Calculate start and end time from start date and duration
    EXPORTING
         ARBID = lv_arbid
         BEGINN = lv_beginn
         DAUER = lv_dauer
         EINHEIT = lv_einheit
         KALID = lv_kalid
    IMPORTING
         DAUER_OPR = lv_dauer_opr
         ENDE_DATUM = lv_ende_datum
         ENDE_ZEIT = lv_ende_zeit
         START_DATUM = lv_start_datum
         START_ZEIT = lv_start_zeit
. " NW_GR_CALC_DATES




ABAP code using 7.40 inline data declarations to call FM NW_GR_CALC_DATES

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 ARBID FROM AFVGD INTO @DATA(ld_arbid).
 
"SELECT single DAUNO FROM AFVGD INTO @DATA(ld_dauer_opr).
 
"SELECT single BEG FROM GGAEL INTO @DATA(ld_beginn).
 
"SELECT single FSAVD FROM AFVGD INTO @DATA(ld_ende_datum).
 
"SELECT single DUR FROM GGAEL INTO @DATA(ld_dauer).
 
"SELECT single FSAVZ FROM AFVGD INTO @DATA(ld_ende_zeit).
 
"SELECT single DAUNE FROM AFVGD INTO @DATA(ld_einheit).
 
"SELECT single FSAVD FROM AFVGD INTO @DATA(ld_start_datum).
 
"SELECT single KALID FROM AFVGD INTO @DATA(ld_kalid).
 
"SELECT single FSAVZ FROM AFVGD INTO @DATA(ld_start_zeit).
 


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!