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

Conversion of DATE Format?

Former Member
0 Likes
637

Hi Experts,

Am importing the my_DATE value from front end as in the format of <b>MM/DD/YYYY</b>, but, my_bapi code needs to hv in the format of <i><b>YYYY/MM/DD</b></i>, then only my_bapi gives output!

I hv declared my_date as my_date LIKE RSPARAMS in my_bapi, under TABLES tabstrip.

So, How to convert from MM/DD/YYYY to YYYY/MM/DD? Wht is the FM?

thanq.

Message was edited by:

Srikhar

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
590

hi,

Chk this.

data : out_date(10) like char,
in_date(10) like char.
 
in_date = '10.02.2007'.
 
*take variables V1, V2, V3.
V1 = in_date+ 0(4).
V2 = in_date+ 5(2). 
V3 = in_date+ 7(2). 
 
Concatenate V1 V2 V3 into date separated by '/'.

Now, out_date will have DD/MM/YYYY

Regards

Hi Experts,

Am importing the my_DATE value from front end as in the format of <b>MM/DD/YYYY</b>, but, my_bapi code needs to hv in the format of <i><b>YYYY/MM/DD</b></i>, then only my_bapi gives output!

I hv declared my_date as my_date LIKE RSPARAMS in my_bapi, under TABLES tabstrip.

So, How to convert from MM/DD/YYYY to YYYY/MM/DD? Wht is the FM?

thanq.

Message was edited by:

Srikhar

3 REPLIES 3
Read only

Former Member
0 Likes
591

hi,

Chk this.

data : out_date(10) like char,
in_date(10) like char.
 
in_date = '10.02.2007'.
 
*take variables V1, V2, V3.
V1 = in_date+ 0(4).
V2 = in_date+ 5(2). 
V3 = in_date+ 7(2). 
 
Concatenate V1 V2 V3 into date separated by '/'.

Now, out_date will have DD/MM/YYYY

Regards

Read only

Former Member
0 Likes
590

No FM needed....


FORM GENERATE_DATE USING L_DATE CHANGING L_NEW_DATE.

  CONCATENATE L_DATE+6(2) L_DATE+4(2) L_DATE+0(4)
  INTO L_NEW_DATE.

ENDFORM.

Greetings,

Blag.

Read only

Former Member
0 Likes
590

use offset command to convert desired output

if u want date in dd.mm.yyyy format u can use FM CONVERSION_EXIT_PDATE_OUTPUT u will get ur required date format as u ask dd.mm.yyyy.

FM - CONVERSION_EXIT_PDATE_OUTPUT

data : out_date(10) like char,

in_date(10) like char.

in_date = '10.02.2007'.

*take variables V1, V2, V3.

V1 = in_date+ 0(4).

V2 = in_date+ 5(2).

V3 = in_date+ 7(2).

Concatenate V3 V2 V1 into date separated by '/'.

Now, out_date will have DD/MM/YYYY

Thanks

Seshu