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 mismatching in BDC

Former Member
0 Likes
3,960

displaying wrong date format

Hi,

I am uploading some price records, inthat input file i have MMDDYY format, but while uploading its giving error. Its geting stuckup there. i think i need to change the format before passing FVAL.

I declared the date field as RV13A-DATAB .

How resolve this...

Anyone having idea please help this out.

Mohana

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
2,104

hi,

BDC uses the data in the form of EXTERNAL.

Try to convert the date and use it.

ref FM: CONVERT_DATE_TO_EXTERNAL

displaying wrong date format

Hi,

I am uploading some price records, inthat input file i have MMDDYY format, but while uploading its giving error. Its geting stuckup there. i think i need to change the format before passing FVAL.

I declared the date field as RV13A-DATAB .

How resolve this...

Anyone having idea please help this out.

Mohana

9 REPLIES 9
Read only

Former Member
0 Likes
2,104

hi,

1) change the input format to YYYYMMDD

2) Use write source to target statement.

3) Use the target field to populate the screen field.

This is because, the screen data is with respect to User profile data, hence it changes everytime user changes the format.

It would better for you to change the text file data to above specified format and carry out the rest of the steps.

The write to statement converts the data to what so ever user format being used, hence no inconsistencies with respect screen field format, which is nothing but the user format.

Thanks

Sharath

Read only

Former Member
0 Likes
2,104

It depends on your system default date settings. In debug mode please change the format to DDMMYYYY to see if it works. Else try with other formats like YYYYDDMM .

I hope using this method you should be able to solve it in quick time.

Read only

Former Member
0 Likes
2,104

Dear Mohana.

Instead of MMDDYY u can use DDMMYY.

I Mean to say , i n ur file data date is like 022309 instead of this u can write that in format 230209.

and your internal table date field u can five as tezt means date(10) type C instead of RV13A-DATAB .

Issue exist revert back.

Read only

0 Likes
2,104

Hi,

Thnx for u peoples reply, but the problem is am not able to change the input file format. Even i am not able to change the user machine settings also.

Thy are going go maintain in MMDDYY format only, i need to correct in the program itself.

Pls help this issue.

Mohana V

Chennai

Read only

0 Likes
2,104

MMDDYY

Hi,

Data: var1 type sy-datum.

If file data was in Var2.

var1(2) = '20' " First 2 digits of the year - but it will work only till 2099 year.

var12(2) = file_data-date4(2).

var1+4(4) = file_data-date(4).

try this,

~Satya

Read only

Former Member
0 Likes
2,104

Mohan,

pass the value coming from source file to FM:

Convert_date_to_internal:

this will convert date from MM/DD/YYYY to YYYYMMDD.

Pass this intranla table to FM: Convert_date_to_extranal. This will convert the internal table to

the external user format.

Read only

Former Member
0 Likes
2,104

hi,

Check the following code

write fs_item-eeind to lw_date. " (1)
  concatenate 'RM06B-EEIND(' w_pos ')' into lw_line.
  perform bdc_field using lw_line lw_date.

" (2)

The above code ( 1 & 2 are of your interest) is with respect to ME51 transaction for table control and also populating screen. I had a similar issue with respect to date and that's how I could resolve it.

Thanks

Sharath

Read only

Former Member
0 Likes
2,104

Hi,

This is simple...

1.Declare the date field as Char rather than RV13A-DATAB .

2.when you get the data into internal table, simply use offset and concatenate mechanism that convert the date into the required filed.

Means extract the MM,DD and YYYY from the filedval in the intrenal table then finally concatenate the 2 variablr as MMDDYY into the final 4th variable and use that variable or overwrite the variable in the intrenal table and use it in BDC recording.

Hope this might help you out.

Pooja

Read only

Former Member
0 Likes
2,105

hi,

BDC uses the data in the form of EXTERNAL.

Try to convert the date and use it.

ref FM: CONVERT_DATE_TO_EXTERNAL