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,815

Hi,

I'm using Direct Input method to post documents for FB01.

The date fields in header BUDAT and BLDAT has format yyyymmdd

But FB01 transactions expects date field to be in format mm/dd/yyyy.

I'm not able to assign directly any date of format mm/dd/yyyy to these fields in field mapping.

Can you pls help me in this? BUDAT takes only 8 chars.

Thanks

8 REPLIES 8
Read only

Former Member
0 Likes
1,247

Hi!

Try like this:

DATA: lv_date(10) TYPE c.

CONCATENATE budat4(2) budat6(2) budat(4) INTO lv_date SEPARATED BY '/'.

Use the lv_date field during the BDC.

Regards

Tamá

Read only

Former Member
0 Likes
1,247

Hi,

Use the following FM

CONVERT_DATE_TO_EXTERNAL

Read only

0 Likes
1,247

Hi ,

When to call this FM. Whatever it is , BLDAT will accept only 8 chars.

Pls help when to call this in LSMW steps.?

Read only

0 Likes
1,247

Field mapping and conversions rules step for that particular field

Read only

0 Likes
1,247

Hi!

If BLDAT accepts only 8 characters, then you can't enter a formatted date into that field.

You have to enter a YYYYMMDD (20070518) format date.

If it is accepting longer text, you have to convert it yourself manually or using the given FM-s to internal format...

Regards

Tamá

Read only

0 Likes
1,247

Hi,

It accepts only 8 chars. So you mean I can't convert to different format of length 10 chars?

Read only

Former Member
0 Likes
1,247

hi,

<b>'6/7/2006'. -> 20060706</b>

data: datum_in(10) type c value '6/7/2006'.
data: datum(10) type c.
data: datum_out type sy-datum.
 
 CALL FUNCTION 'CONVERT_DATE_TO_INTERNAL'
      EXPORTING
           DATE_EXTERNAL            =  datum_in
      IMPORTING
           DATE_INTERNAL            =  datum_out
      EXCEPTIONS
           DATE_EXTERNAL_IS_INVALID = 1
           OTHERS                   = 2.

Regards

Reshma

Read only

Former Member
0 Likes
1,247

if you are using sap standard program then change the date format in user profile transaction = SU01 since you can not change the program..

if you are uisng custom program then just use simple query.

concatenate the fields into one field.

reward points if it is useful

Thanks

Seshu