Calculate/find number of working days between two dates in SAP
Page 1 of 1
Calculate/find number of working days between two dates in SAP
REPORT ZFIND_WORKING_DAYS.
SELECTION-SCREEN: BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-001.
PARAMETERS: P_INDAT TYPE SY-DATUM,
P_OUTDAT TYPE SY-DATUM.
SELECTION-SCREEN: END OF BLOCK B1.
DATA: BEGIN OF ETH_DATS OCCURS 0.
INCLUDE STRUCTURE RKE_DAT.
DATA: END OF ETH_DATS .
DATA: V_LINES TYPE I.
IF P_INDAT LE P_OUTDAT.
CALL FUNCTION 'RKE_SELECT_FACTDAYS_FOR_PERIOD'
EXPORTING
I_DATAB = P_INDAT
I_DATBI = P_OUTDAT
I_FACTID = 'US'
TABLES
ETH_DATS = ETH_DATS
EXCEPTIONS
DATE_CONVERSION_ERROR = 1
OTHERS = 2.
ELSE.
CALL FUNCTION 'RKE_SELECT_FACTDAYS_FOR_PERIOD'
EXPORTING
I_DATAB = P_OUTDAT
I_DATBI = P_INDAT
I_FACTID = 'US'
TABLES
ETH_DATS = ETH_DATS
EXCEPTIONS
DATE_CONVERSION_ERROR = 1
OTHERS = 2.
ENDIF.
DESCRIBE TABLE ETH_DATS LINES V_LINES.
WRITE:/ 'the no of working days is :' , V_LINES.
WRITE:/ .
WRITE:/ 'working days are:'.
LOOP AT ETH_DATS .
WRITE:/ ETH_DATS.
ENDLOOP.
SELECTION-SCREEN: BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-001.
PARAMETERS: P_INDAT TYPE SY-DATUM,
P_OUTDAT TYPE SY-DATUM.
SELECTION-SCREEN: END OF BLOCK B1.
DATA: BEGIN OF ETH_DATS OCCURS 0.
INCLUDE STRUCTURE RKE_DAT.
DATA: END OF ETH_DATS .
DATA: V_LINES TYPE I.
IF P_INDAT LE P_OUTDAT.
CALL FUNCTION 'RKE_SELECT_FACTDAYS_FOR_PERIOD'
EXPORTING
I_DATAB = P_INDAT
I_DATBI = P_OUTDAT
I_FACTID = 'US'
TABLES
ETH_DATS = ETH_DATS
EXCEPTIONS
DATE_CONVERSION_ERROR = 1
OTHERS = 2.
ELSE.
CALL FUNCTION 'RKE_SELECT_FACTDAYS_FOR_PERIOD'
EXPORTING
I_DATAB = P_OUTDAT
I_DATBI = P_INDAT
I_FACTID = 'US'
TABLES
ETH_DATS = ETH_DATS
EXCEPTIONS
DATE_CONVERSION_ERROR = 1
OTHERS = 2.
ENDIF.
DESCRIBE TABLE ETH_DATS LINES V_LINES.
WRITE:/ 'the no of working days is :' , V_LINES.
WRITE:/ .
WRITE:/ 'working days are:'.
LOOP AT ETH_DATS .
WRITE:/ ETH_DATS.
ENDLOOP.
Uma_ABAP- Posts : 56
Join date : 2012-03-31
Similar topics
» How to find a BAPI?
» What is the maximum number of structures that can be included in a table or structure?
» How do you calculate the cost for a By-product in SAP?
» Why does the system not calculate variance for the 500 kgs which has been delivered?
» How does SAP calculate Work in Process (WIP) in product cost by order?
» What is the maximum number of structures that can be included in a table or structure?
» How do you calculate the cost for a By-product in SAP?
» Why does the system not calculate variance for the 500 kgs which has been delivered?
» How does SAP calculate Work in Process (WIP) in product cost by order?
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum
|
|
Mon Aug 20, 2012 4:37 pm by Admin
» Difference between Type and Like
Thu Jun 07, 2012 2:40 pm by Admin
» How to handle table control fields in Module Pool program?
Wed May 09, 2012 2:41 am by govind
» Three tables inner join in SAP
Thu May 03, 2012 4:47 pm by Uma_ABAP
» Creating table type in ABAP
Sat Apr 28, 2012 9:03 pm by Uma_ABAP
» Creating user defined types and structures in ABAP
Sat Apr 28, 2012 8:55 pm by Uma_ABAP
» Creating Dynamic Internal Table and Dynamic Field catalog in SAP-ABAP
Fri Apr 27, 2012 11:00 am by Admin
» Copy Custom PF-Status from Standard program to Custom Program in ALV
Thu Apr 26, 2012 9:52 pm by Uma_ABAP
» Calculate/find number of working days between two dates in SAP
Tue Apr 24, 2012 2:06 pm by Uma_ABAP