09-10-2008 8:53 AM
Hi,
I need to assign my date field in this format '09/09/2008'to a standard FM.But my current date format is '09092008'.
Note:My required date format has to be assigne to sy-datum which is of 8 char long.
09-10-2008 10:58 AM
>
> Hi,
> I need to assign my date field in this format '09/09/2008'to a standard FM.But my current date format is '09092008'.
>
> Note:My required date format has to be assigne to sy-datum which is of 8 char long.
Since you already using type Sy-datum than no need of any conversion system would automatically convert.
Reason:Type SYDATS is the domain of Sy-datum and its length is char8 but output characteristics is length is 10.
09-10-2008 9:05 AM
Hi!!
you can try with using EDIT MASK to move the field into another variable .
eg: data : v_date like sy-datum.
data : v_date1(10).
v_date = sy-datum.
write v_date using EDIT MASK '__/__/____' to v_date1.
and pass v_date1 to ur FM .
Hope this would help you .
09-10-2008 9:10 AM
Hi,
Hi,
Function module is there to handle this.
SLS_MISC_CONVERT_TO_DATE
09-10-2008 9:15 AM
hii
use following code
Data : wa_date type dats value '09092008',
wa_date1(10).
data : val(1) type c value '/'.
wa_date1 = wa_date.
concatenate wa_date+0(2) wa_date+2(2) wa_date+4(4) into wa_date1
separated by val.
Write : / wa_date1.
regards
twinkal
09-10-2008 9:15 AM
Hi,
Please try the below code
ld_curr_date = '09092008'.
concatenate ld_curr_date0(2) '/' ld_curr_date2(2) '/' ld_curr_date+4(4) into ld_date.
Now you can use this ld_date in ur FM.
say u get the output from ur FM in variable ld_date1 with format '09/09/2008'
convert it to sy-datum.
concatenate ld_date16(4) ld_date13(2) ld_date1+0(2) into ld_date2.
now ld_date is of char 8 length.
Note: ld_date and ld_date1 would be of length 10.
Regards,
Surinder
09-10-2008 9:17 AM
Hi,
HRGPBS_HESA_DATE_FORMAT
CONVERT_DATE_TO_INTERN_FORMAT
Use the above FMs.
Regards,
Harish
09-10-2008 9:20 AM
Hi,
DATA :
w_date TYPE sy-datum,
w_string(8) VALUE '20080909'.
w_date = w_string.
WRITE: w_date.
Regards
Adil
09-10-2008 10:58 AM
>
> Hi,
> I need to assign my date field in this format '09/09/2008'to a standard FM.But my current date format is '09092008'.
>
> Note:My required date format has to be assigne to sy-datum which is of 8 char long.
Since you already using type Sy-datum than no need of any conversion system would automatically convert.
Reason:Type SYDATS is the domain of Sy-datum and its length is char8 but output characteristics is length is 10.