10-31-2007 3:57 PM
Hello Friends, Please suggest how to Cocatenate the two fields ERDAT and ERZET in one field . in my ZTABLE.ERDAT IS DATE 8 and ERZET tims 6
so what should be the new ZCOMBO field length and type
Please give the ABAP Code to write that in Exit to Populate this Cocatenation of these two fields.
Thanks
Sincerely
Soniya Kapoor
10-31-2007 5:42 PM
hi soniya,
u can declare ZCOMBO as CHAR with LENGTH 14 with any seperator.
<b>Concatenate ERDAT ERZET into ZCOMBO.
In this case, output would be like yyyymmddhhmmss.</b>
If u want any seperator b/w date and time then declare it wiht LENGTH 15.
<b>CONSTANTS : c_s TYPE c VALUE '/'.
CONCATENATE erdat erzet INTO zcombo SEPERATED BY c_s.
In this case, output would be like yyyymmdd/hhmmss.</b>
reward me if useful.........
Harimanjesh AN
10-31-2007 4:03 PM
concatenate ERDAT ERZET into ZCOMBO.
ZCOMBO length can be 14 and type N.
Regards
Nishant
10-31-2007 5:42 PM
hi soniya,
u can declare ZCOMBO as CHAR with LENGTH 14 with any seperator.
<b>Concatenate ERDAT ERZET into ZCOMBO.
In this case, output would be like yyyymmddhhmmss.</b>
If u want any seperator b/w date and time then declare it wiht LENGTH 15.
<b>CONSTANTS : c_s TYPE c VALUE '/'.
CONCATENATE erdat erzet INTO zcombo SEPERATED BY c_s.
In this case, output would be like yyyymmdd/hhmmss.</b>
reward me if useful.........
Harimanjesh AN
10-31-2007 7:23 PM
Hi Soniya,
Declare the field as Timestamp and use Convert To timestamp statement for Concatenating Date and Time into a single field
CONVERT for Timestamps
Converts a timestamp into the correct date and time for the current time zone.
Syntax
CONVERT TIME STAMP <tst> TIME ZONE <tz> INTO DATE <d> TIME <t>.
CONVERT DATE <d> TIME <t> INTO TIME STAMP <tst> TIME ZONE <tz>.
As long as <tst> has type P(8) or P(11) with 7 decimal placed, and <tz> has type C(6), the time stamp <tst> will be converted to the correct date <d> and time <t> for the time zone <tz>.
Regards,
Abhishek