CRM Smartforms questions
I'm currently developing a smartform for a quotation in CRM. Now in contrary to R/3, there is not such as a print program for getting data into the form. In the form there is already in the Form Interface definitions a lot of stuctures available to get your data from.
Unfortunately not all data we need is supplied in these stuctures. So we are using the Form Routines to get additional data into the form.
Only we have some problems to get the valid-from and the valid-to date from the quotation. We use the CRM_ORDER_READ function and get ET_APPOINTMENT. There we select on VALIDFROM and VALIDTO. Then the problem is that the output is shown in format eg. 24.09.2008 22:00
These dates are not yet ok, because the actual date is 25.09.2008.
How to convert this to only a date (I've read that there is something like SLIM_GET_START_END_DAY). But input from here is the date, without the time.
Now for me, I was just wondering if this the correct way to get the valid from and the valid to date? Is there a quicker way to get the correct dates, or is this what we have to do just for the dates?
Joost Stallaert replied
Normally CRM_ORDER_READ returns only timestamps in the ET_APPOINTMENT tables.
Timestamps are always stored as UTC (universal time) so you have to convert them to your timezone. (thats why the date 'appears' to be wrong but is actually correct )
You can use FM IB_CONVERT_FROM_TIMESTAMP, providing the timestamp acquired from ET_APPOINTMENT. The result of the FM is E_DATLO and the E_TIMLO field which contain the date and time.
This should solve your problem!