10-16-2008 12:19 AM
Hi Gurus,
I have a req and need to write a ABAP prog. As soon as i excute ABAP program it should ask me enter a data source name, then my ABAP prog has excute teh code, in ABAP code i have to read a table with this data source as key, sort time stamp from table and should display the data source and time stamp as output.
As follows:
Enter Data Source Name:
Then user enters : 2lis_11_vahdr
Then out put should be "Data source :" 10-15-2008.
The time stamp format in table is 20,050,126,031,520 (YYYYMMDDhhmmss). I have to display as 05-26-2005. Any help would be apprciated.
Thanks,
Ram
10-16-2008 2:21 AM
Hi Jayanthi Babu Peruri,
I tried to extract YEAR, MONTH, DAY separately and using
EDIT MASK written it.
Definitely there will be some STANDARD CONVERSION ROUTINE will be there. But no idea about it.
DATA : V_TS TYPE TIMESTAMP,
V_TS_T TYPE CHAR16,
V_YYYY TYPE CHAR04,
V_MM TYPE CHAR02,
V_DD TYPE CHAR02.
START-OF-SELECTION.
GET TIME STAMP FIELD V_TS.
V_TS_T = V_TS.
CONDENSE V_TS_T.
V_YYYY = V_TS_T.
V_MM = V_TS_T+4(2).
V_DD = V_TS_T+6(2).
V_TS_T(2) = V_MM.
V_TS_T+2(2) = V_DD.
V_TS_T+4(4) = V_YYYY.
SKIP 10.
WRITE : /10 V_TS," USING EDIT MASK '____-__-________'.
/10 V_YYYY,
/10 V_MM,
/10 V_DD,
/10 V_TS_T USING EDIT MASK '__-__-__________'.
If you want DATE alone, just declare the length of V_TS_T as 10.
Regards,
R.Nagarajan.
-
We can -
10-16-2008 2:37 AM
Hi,
Use parameters on the selection screen for your data source.. Then read your relevant table using this data source...You can edit the output using edit-mask... type this and F1 for help...
eg..
parameters: data_sou type (relevant type).
select time_stamp from table into structure where data_source = data_sou..
You will have the time_stamp in structure.... edit this before output...
regds
madan..