Application Development 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: 

Date format mmyyyy

Former Member
0 Kudos
120

hi,

I am writing a routine in BW.I am loading data from a flat file.

i have selected date format like 0calmonth.the format is yyyymm.

I want to change it to mmyyyy.how can i write a formula in routine'?

how can i do that?

Thanks in advance,

Yad

1 ACCEPTED SOLUTION

RichHeilman
Developer Advocate
Developer Advocate
0 Kudos
70

Here is a quick way....



  data: mmyyyy(6) type c ,
        yyyymm(6) type c value '200506'.


        mmyyyy+0(2) = yyyymm+4(2).
        mmyyyy+2(4) = yyyymm+0(4).

        check sy-subrc = 0.

Regards,

Rich Heilman

2 REPLIES 2

Former Member
0 Kudos
70

Hi,

let field date conytains your original date :

Data : date1(6),

concatenate date+4(2) date(4) into date1.

date = date1.

regards,

Gagan

RichHeilman
Developer Advocate
Developer Advocate
0 Kudos
71

Here is a quick way....



  data: mmyyyy(6) type c ,
        yyyymm(6) type c value '200506'.


        mmyyyy+0(2) = yyyymm+4(2).
        mmyyyy+2(4) = yyyymm+0(4).

        check sy-subrc = 0.

Regards,

Rich Heilman