" In a SAP system, the work process play a very important role. It is seen that a majority of the processing is done by work processes. Work processes execute dialog steps in user transactions, updates, lock administration can display the status of the work process running on your application server after logon. To display the status choose Administration --> System Administration ---> Monitor ---> System Monitoring ----> Process over view or Execute transaction SM50. To get the updated information, the display must be refreshed regularly. The administrator must regularly monitor the system processes for checking the appropriateness of the number and configuration. Generally possesses are monitored to obtain information. The information obtained can be used for many purposes. It can be used to determine, whether the number of work processes in your system is adequate to assess if the instance is working to its ultimate capacity and to gather information for troubleshooting or for tuning. The SAP work processes correspond to operating system processes, these processes can be monitored through other operating systems also. Or it can be said that process ID (PID) of the SAP system is the same as PID of the other operating systems. SAP has a runtime directory /usr/sap//SYS/exe/run. Some programs are present in this runtime directory for monitoring. You can monitor some of the work processes and the dispatcher from the operating system with the help of these monitoring programs. To display the overview of SAP application server choose System Monitoring ---> Servers. You can also display the overview of the work process running on this particular server in the SAP system. To display the overview of the work process first click on the desired server name. "
"SAP has provided two different types of methods for BDC to do its work. Among these the first one is called the classical method. This method is also called as the session method. Through this method the data can be read by the BDC program from a sequential dataset file. This sequential dataset file is stored in batch-input sessions. In order to run the transaction in this session, What you need is to execute the session. For this follow these few steps. YOu an start and subsequently monitor the sessions firstly from System----> Service---->Batch input or have the sessions run in the background."
SAP ABAP Function module to calculate the difference between 2 dates.
The function module HR_HK_DIFF_BT_2_DATES in SAP ABAP can be used to calculate the difference between 2 dates.
HR_HK_DIFF_BT_2_DATES
Please check the following program. Experiment with the OUTPUT FORMAT (Example '01', '02', '03', '04', 05'). Make sure that Date1 is greater than Date2
REPORT ZEX_DIFFBETW2DATES .
Data: d_date1 like P0001-BEGDA, d_date2 like P0001-BEGDA, d_yrs like P0347-SCRYY, d_months like P0347-SCRMM, d_days like P0347-SCRDD.
* Date1 should be greater than date 2 d_date1 = '20050101'. d_date2 = '20000104'.
* This function calculates the diference between date 1 and date 2 CALL FUNCTION 'HR_HK_DIFF_BT_2_DATES' EXPORTING DATE1 = d_date1 DATE2 = d_date2 OUTPUT_FORMAT = '05' IMPORTING YEARS = d_yrs MONTHS = d_months DAYS = d_days EXCEPTIONS INVALID_DATES_SPECIFIED = 1 OTHERS = 2. IF SY-SUBRC <> 0. * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO * WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4. ENDIF.
The output of the the above program is as follows.
Difference Between 2 dates Years = 4.0000 Months = 11.0000 Days = 29
1 comment:
Anonymous
said...
This function is very useful, but you have to be careful, because every month is calculated there with 31 days. As we all know, February has 28 or 29 days and April, June etc. have 30 days, so you have to make some extra lines in the source code: If month (something like date+4(2) ) is equal to 04 or 06 or 09 or 11, then you have to substract one from your result in days. If month is equal to 02, then you have to substract two or three from you result in days.
Always specify your conditions in the Where-clause instead of checking
them yourself with check statements. The database system can then use an index
(if possible) and the network load is considerably less.
Always use Pretty Printer and Extended Program Check before releasing the code.
Do not leave unused code in the program. Comment the code thoroughly. Align the comments and the Code. Follow the SAP Standards and SAP Best Practices guidelines. It’s a good practice to take a dump of the code on your local drive.
1 comment:
This function is very useful, but you have to be careful, because every month is calculated there with 31 days. As we all know, February has 28 or 29 days and April, June etc. have 30 days, so you have to make some extra lines in the source code:
If month (something like date+4(2) ) is equal to 04 or 06 or 09 or 11, then you have to substract one from your result in days.
If month is equal to 02, then you have to substract two or three from you result in days.
Post a Comment