Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Convert Date

Former Member
0 Likes
812

Hi,

I have a date just with month and year. like this:

032006

what i want is to know if there is any function that inverts my date to stay like this:

200603

thanks,

ricardo

7 REPLIES 7
Read only

Former Member
0 Likes
781

data: date1(6) value '032006',

new_date(6).

concatenate date12(4) date10(2) into new_date.

write:/ new_date.

Regards,

Ravi

Read only

0 Likes
781

Hi,

I don't think there is any FM which converts that way. Use <b>Concatenate</b> Statement or <b>Offset</b> to achieve the same. Any wayz Try Using <b>CONVERSION_EXIT_PDATE_INPUT</b>

Read only

Former Member
0 Likes
781

data : var(6).

var = date+2(4)

var+4(2) = date(2)

Read only

Former Member
0 Likes
781

Hi,

Use offset.

say, var1 = '062003'.

var2 = var1+0(2).

var3 = var1+2(4).

concatenate var3 var2 into var1.

Thanks,

Aswin

Read only

Former Member
0 Likes
781

Hi ricardo,

concatenate date2(4) date0(2) into date.

regards,

keerthi.

Message was edited by: keerthi kiran varanasi

Read only

Former Member
0 Likes
781

hii

use this fm

<b>CONVERSION_EXIT_PDATE_INPUT</b>

CALL FUNCTION 'CONVERSION_EXIT_PDATE_INPUT'

EXPORTING

INPUT = p_date

IMPORTING

OUTPUT = v_date

.

using offset of p_date .

Regards

Naresh

Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
781

Yes, there is a function module. Check this conversion exit.



report zrich_0001.


data: input(6) type c value '032006'.
data: output(6) type c.

call function 'CONVERSION_EXIT_PERI_INPUT'
  exporting
    input            = input
*   NO_MESSAGE       =
 importing
   output           = output
*   RETURN           =
          .

write:/ output.

This is the standard conversion exit which is tied to the data element SPBUP which is a 6 character numeric field which is for posting period(YYYYMM)

Regards,

Rich Heilman