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

BDC Date error

Former Member
0 Likes
2,035

Hello friends, I have written a BDC and it has 2 date fields,

Valied from and Valid to.

The valid from works good but the valid to has an issue. I need to hardcode the valid to to 12/31/9999

Below is the code.

DATA: g_date_begin(8), g_date_end(8).

g_date_end = '12319999'.

write g_date_end to g_date_end.

write sy-datum to g_date_begin.

PERFORM fill_bdc_table USING:

'X' 'SAPLMEOR' '0205',

' ' 'EORD-VDATU(1)' g_date_beg,

' ' 'EORD-BDATU(1)' g_date_end,

Any suggestions on how would I handle the VALID TO.

Bob

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,682

Declare both fields as char(10) and use '99991231'.

Rob

11 REPLIES 11
Read only

Former Member
0 Likes
1,682

You might be overflowing the date maximum capacity for your sap version. Try seting it around 2030.

Read only

0 Likes
1,682

for some users it works but not all. the error message is invalid date.

bob

Read only

former_member194669
Active Contributor
0 Likes
1,682

May be u can use

FM CONVERT_DATE_TO_EXTERNAL.

Read only

Former Member
0 Likes
1,682

Hi Bob,

Please try this.

DATA: w_date(10) .

WRITE sy-datum TO w_date USING EDIT MASK '__/__/____' .

and pass the w_date to your perform bdc_field.

Rgds

Raj.

Read only

Former Member
0 Likes
1,682

Hi Bob,

***get date format

select single datfm into g_datfm

from usr01

where bname = sy-uname.

case g_datfm.

when '1' .

concatenate l_day '.' l_month '.' l_year into l_date.

when '2' .

concatenate l_month '/' l_day '/' l_year into l_date.

when '3' .

concatenate l_month '-' l_day '-' l_year into l_date.

when '4'.

concatenate l_year '.' l_month '.' l_day into l_date.

when '5'.

concatenate l_year '/' l_month '/' l_day into l_date.

when '6'.

concatenate l_year '-' l_month '-' l_day into l_date..

endcase.

Regards

Jerry

Edited by: foxconn_jerry on Aug 11, 2009 4:00 AM

Edited by: foxconn_jerry on Aug 11, 2009 4:01 AM

Read only

0 Likes
1,682

Hello all,

I have tried all of the above and nothng seems to be working.

any FM to achieve this

Edited by: Bob Dan on Aug 12, 2009 3:31 PM

Read only

Former Member
0 Likes
1,682

Hi Bob,

You can offset the date and can make it however you want.

data :g_date_end1 type char10.

concatenate g_date_end(2) '/' g_date_end2(2) '/' g_date_end+4(4) into g_date_end1

now pass g_date_end1 inthe BDC screen field.

Hope this tip may help

Rgds,

Sripal

Read only

0 Likes
1,682

hello Sripaleshwar ,

nope this wont help because each user has a different date setting.

Bob

Read only

0 Likes
1,682

Hi Bab,

then declare the date variables of type sy-datum, this may help

Sripal

Read only

Former Member
0 Likes
1,683

Declare both fields as char(10) and use '99991231'.

Rob

Read only

Former Member
0 Likes
1,682

Hi,

What i feel is date will be taken in the input format YYYYMMDD. Now when you say 12139999 the actual date considered as 99.99.1213 if the external format of date is separated by . now the catch is 99 date doesn't exists may be thats the reason you are getting this error.

Or else check what date is going to the BDC while running online you will get a fair idea.