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 problem

Former Member
0 Kudos

hi all,

suggest me some function module for date format( from dd.mm.yyyy to yyyymmdd).

when i am passing sy-datum through bdctable to f-53 transaction code screen.

in sy-datum i have <b>dd.mm.yyyy</b>. and when it goes to on screen (in document date,and in posting date field) it change into to <b>yyyymmdd</b>.

In the table(bkpf) that fields stored as yyyymmdd only. i think due to this ,its happen.

how do i sove that problem.

thank you.

5 REPLIES 5

RichHeilman
Developer Advocate
Developer Advocate
0 Kudos

Yes, you must covert to external format when using the date in BDC. So do this.



data: bdc_date(10) type c.

call function 'CONVERT_DATE_TO_EXTERNAL'
     exporting
          date_internal = sy-datum
     importing
          date_external = bdc_date.


Now pass the BDC_DATE field to the BDC PERFORM statement.

Regards,

Rich Heilman

former_member223537
Active Contributor
0 Kudos

concatenate l_docdate8(4) l_docdate4(2) l_docdate+0(2) into l_finaldate.

Former Member
0 Kudos

hi pavan,

u can convert the date format use EDIT MASK in write statement and then use that variable.

hope this will be usefull...

<b><REMOVED BY MODERATOR></b>

Regards,

prashant

Message was edited by:

Alvaro Tejada Galindo

Former Member
0 Kudos

hi

good

data : v_date like sy-datum.

write : v_date using edit mask '__/__/____'

call function 'CONVERT_DATE_TO_INTERNAL'

thanks

mrutyun^

Pawan_Kesari
Active Contributor
0 Kudos

While passing the date to BDC you cannot hardcode it.. you should take care of the user format..

simply use WRITE statement to format the date in user format..

data lv_date type char10 .

WRITE sy-datum to lv_date

then pass lv_date to BDC