‎2007 Aug 09 5:13 PM
I am trying to extract data from CRMD_ORDERADM_H table (SRM) using the date contract was changed. On the selection screen I have contract change date. But the CHANGED_AT field is combination of date and time in the table. How should I extract the data. When I pass only date it gives me error 'pass time also'.
Please advice.
Thanks.
‎2007 Aug 09 7:03 PM
Hi,
Please try this.
RANGES: R_TSTAMPS FOR TZONREF-TSTAMPS.
DATA: WA_TSTAMPS1 TYPE TZONREF-TSTAMPS,
WA_TSTAMPS2 TYPE TZONREF-TSTAMPS.
CONSTANTS: C_TIME1 TYPE SY-TIMLO VALUE '000000',
C_TIME2 TYPE SY-TIMLO VALUE '235959'.
CONVERT DATE P_DATE TIME C_TIME1
INTO TIME STAMP WA_TSTAMPS1 TIME ZONE SY-ZONLO.
CONVERT DATE P_DATE TIME C_TIME2
INTO TIME STAMP WA_TSTAMPS2 TIME ZONE SY-ZONLO.
R_TSTAMPS-SIGN = 'I'.
R_TSTAMPS-OPTION = 'BT'.
R_TSTAMPS-LOW = WA_TSTAMPS1.
R_TSTAMPS-HIGH = WA_TSTAMPS2.
APPEND R_TSTAMPS.
Next, you can use the above range to select/extract the data from table.
Regards,
Ferry Lianto
‎2007 Aug 09 5:28 PM
Make it a range with one date, but the time from 00:00:00 to 23:59:59.
Rob
‎2007 Aug 09 5:33 PM
Rob-
I have a range (select option) for the date on the selection screen. Is there a function module to take care of this.
Thanks,
AP
‎2007 Aug 09 5:47 PM
‎2007 Aug 09 6:21 PM
hello friends,
I have a field in a table which is of data type dec 15 with a conversion exit TSTLC on the domain. So the values inserted will be converted into timestamp.
Now my problem is to select records from the table on the basis of this feild less then or greater then value inserted by user.
how can i do this? in the program.
Please help.
‎2007 Aug 09 6:31 PM
Hi,
You can use FM IB_CONVERT_INTO_TIMESTAMP to convert date and time to timestamp.
Also use FM IB_CONVERT_FROM_TIMESTAMP to convert timestamp to date and time.
Regards,
Ferry Lianto
‎2007 Aug 09 6:35 PM
Those function modules are not available in SRM.
I am trying to extract data from CRMD_ORDERADM_H table (SRM) using the date the contract was changed. On the selection screen I have contract change date. But the CHANGED_AT field is combination of date and time in the table. How should I extract the data. When I pass only date it gives me error 'pass time also'.
Please advice.
Thanks.
‎2007 Aug 09 7:03 PM
Hi,
Please try this.
RANGES: R_TSTAMPS FOR TZONREF-TSTAMPS.
DATA: WA_TSTAMPS1 TYPE TZONREF-TSTAMPS,
WA_TSTAMPS2 TYPE TZONREF-TSTAMPS.
CONSTANTS: C_TIME1 TYPE SY-TIMLO VALUE '000000',
C_TIME2 TYPE SY-TIMLO VALUE '235959'.
CONVERT DATE P_DATE TIME C_TIME1
INTO TIME STAMP WA_TSTAMPS1 TIME ZONE SY-ZONLO.
CONVERT DATE P_DATE TIME C_TIME2
INTO TIME STAMP WA_TSTAMPS2 TIME ZONE SY-ZONLO.
R_TSTAMPS-SIGN = 'I'.
R_TSTAMPS-OPTION = 'BT'.
R_TSTAMPS-LOW = WA_TSTAMPS1.
R_TSTAMPS-HIGH = WA_TSTAMPS2.
APPEND R_TSTAMPS.
Next, you can use the above range to select/extract the data from table.
Regards,
Ferry Lianto
‎2007 Aug 10 1:59 PM