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

date format

Former Member
0 Likes
1,220

Hi,

I have date on my selection screen and updating fk02 using bdc.

date parameter has different format and date in fk02 has different format, which causing error while updating.

could you please let me know how to change date format, is there any settings need to be changed.

Thanks

rk

9 REPLIES 9
Read only

Manohar2u
Active Contributor
0 Likes
1,159

Normally date defualt settings will in user settings, you can go from menu system-utilities' users own data. or SU01 tcode.

There you set the detault date formats for a user.

Also irrespective of date format in bdc you can do by moving the date into char(10) field and then passing this into screen field in bdcdata table.

Regds

Manohar

Read only

abdul_hakim
Active Contributor
0 Likes
1,159

hi raj how ur date format looks currently and what is the expected format?

Cheers,

Abdul Hakim

Read only

Former Member
0 Likes
1,159

Just do the following

WRITE my_input_date TO my_bdc_field.

Read only

former_member181966
Active Contributor
0 Likes
1,159

In BDc you can read user date format like this ..it reads from TR.SU3 . I`m using for every BDC. we have written a custom FM . we pass date and it`ll retrun as per user format

  • RETRIEVE USER PROFILE DATE SETTING

select single datfm

into user_setting

from usr01

where bname = sy-uname.

and then reformat it ...

Hope this’ll give you idea!!

<b>P.S award the points.</b>

Good luck

Thanks

Saquib Khan

"Some are wise and some are otherwise"

Read only

Former Member
0 Likes
1,159

Make sure that the person running the program and the person running the BDC have the same date formats in their profiles.

Rob

Read only

0 Likes
1,159

I am hoping that this is not a batch input session processing. I am assuming that this is a call transaction, in which case the person who is executing the program will be the one who will be executing the transaction.

Read only

0 Likes
1,159

In that case, writing the date to the BDC field should work, but it sounds like the date on the selection screen has a different format from the transaction. That's why I'm thinking session processing by different people.

Rob

Read only

venkat_o
Active Contributor
0 Likes
1,159

Hi Raj,

<b>1</b>.

Assume P_begda is Selection-screen date.

<b>2</b>.

Declare one variable like this.

DATA :l_begda(10),

<b>3</b>.

Use the below statement before populating BDCDATA table

WRITE p_begda TO l_begda.

<b>4</b>.

Pass L_begda like this.

PERFORM bdc_field USING 'RP50G-BEGDA'

l_begda.

I think that this helps u .

<b>Thanks,

Venkat.O</b>

Read only

Former Member
0 Likes
1,159

you could try moving the field first to a variable with type datum or sy-datum and pass that field to the field in the BDC. Use "move" or "write" not "=".

we cannot ask the user to change his/her settings in SU01.