‎2009 Feb 26 12:36 PM
i have defined a vriable CREATED_TIME(
DATA CREATED_TIME(14) type c.
and i have another variable
xdate which is of the format (YYYYMMDDhhmmssmmmuuun)
i want to fetch first 14 chars in the created_time variable
i have written
CREATED_TIME = xdate.
the data which is coming
xdate =20080923050145.1600000
CREATED_TIME = *50145.1600000
where as in created_time i want 20080923050145. how to do that
‎2009 Feb 26 12:38 PM
‎2009 Feb 26 12:46 PM
CREATED_TIME = xdate+0(14).
it is giving me error
saying field type "P" doesn't permit subfield access
‎2009 Feb 26 12:49 PM
Hi Vishal,
Move that type P into an character variable of the same length and use the offset.
it might work.
Regrds,
Phani.
‎2009 Feb 26 12:50 PM
Hi Vishal,
Move that type P into an character variable of the same length and use the offset.
it might work.
Regrds,
Phani.
‎2009 Feb 26 12:50 PM
hi, try to do this.
change type of ur variable to String and use move instead of =.
Regards.
‎2009 Feb 26 12:52 PM
Hi,
Try this way..
Data: l_string type char20.
DATA CREATED_TIME(14) type c.
l_string = xdate.
CREATED_TIME = l_string(14).
‎2009 Feb 26 12:58 PM
i can't change the data type of xdate it is being returned from standard bapi
what i did is i created
DATA CREATED_TIME1(21) type c.
CREATED_TIME1 = xdate.
CREATED_TIME = CREATED_TIME1+0(14).
but i got the following error
An exception occurred that is explained in detail below.
The exception, which is assigned to class 'CX_SY_CONVERSION_NO_NUMBER', was not
caught and
therefore caused a runtime error.
The reason for the exception is:
The program attempted to interpret the value "*080923050145." as a number, but
since the value contravenes the rules for correct number formats,
this was not possible.
There is probably an error in the program
"ZGET_WORKLIST_ALL_USERS".
‎2009 Feb 26 1:01 PM
Hi,
what is the type of xdate ?
Try this way,,
Data: l_string type char20.
DATA CREATED_TIME(14) type c.
CALL FUNCTION 'HR_99S_COPY_STRUC1_STRUC2'
EXPORTING
P_STRUCT1 = xdate
IMPORTING
P_STRUCT2 = l_string .
l_string = xdate.
CREATED_TIME = l_string(14).Edited by: Avinash Kodarapu on Feb 26, 2009 6:34 PM
‎2009 Feb 27 3:54 AM