cancel
Showing results for 
Search instead for 
Did you mean: 

Format date received from BAPI

Former Member
0 Kudos

Hi,

My BAPI return some date field in output port.

When I test the data service I can see that date values return correctly:

Tue Aug 19 00:00:00 IDT 2008

etc

But,

when I try to display this values in some plan text field the date value is 01.01.2000.

I try to format this dates:

DSTR(@my_date, 'DD/MM/YYYY') but it still 01/01/2000

I work with SP15

Thanks,

Ola

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Did you try the following using DSTR Function?

Code

Format

Sample Result

DATE

DD/MM/YYYY

31/01/2001

SHORT_DATE

D/M/Y

31/1/1

LONG_DATE

Long date format

Wed Jan 31 2001

XML_DATE

YYYY-MM-DD

2001-01-31

LOCALE_DATE

Local date format

Jan 31, 2001

TIME

HH:NN:SS

02:39:40

SHORT_TIME

H:NN

2:39

LONG_TIME

Long time format

02:39:40 UTC+0200

XML_TIME

THH:NN:SS

02:39:40

LOCAL_TIME

Local time format

2:39:40

DATETIME

DD/MM/YYYY HH:NN:SS

31/01/2001 02:39:40

SHORT_DATETIME

D/M/Y H:NN

31/1/1 2:39

LONG_DATETIME

Long date/time format

Wed Jan 31 2001 02:39:40 UTC+0200

XML_DATETIME

YYYY-MM-DDTHH:NN:SS

2001-01-31T02:39:40

LOCALE_DATETIME

Local date/time format

2:39:40, Jan 31, 2001

Former Member
0 Kudos

Hi,

I tried all this:

DVAL(DSTR(NOW(),'DD.MM.YYYY'))

DATE(DSTR(NOW(),'YYYY'),DSTR(NOW(),'MM'),DSTR(NOW(),'DD'))

DVAL(DSTR(DATE(MID(NOW(),6,2),MID(NOW(),4,2),MID(NOW(),0,4)),'DD-MM'))

and some more...

I need to use some function that converts the final data to Date type, because my field is defined as date type in the Bapi. Anyway, the final format is still the long one which is not recognized by R/3. I also look at the debuging and I confirmed that the long time is what I'm sending to the Bapi.

I'm not sure if DVAL() function acepts a second parameter, I found some docs with one and some with two parameters. VC does not recognized none of those parameters as second parameter of DVAL().

Any help, would be very apreciated.

Thanks a lot

Demis

Former Member
0 Kudos

Hi Ola Agiv

Just tell me 2 things

What format you are getting from R3 system

what format of data you want to display

Regards

Krishan Kumar Yadav

Former Member
0 Kudos

Hi

When I test the data service I can see dates:

Tue Aug 19 00:00:00 IDT 2008

I want to display this date as 19/08/2008 as plain text and also put this value as default value of date picker.

How can I do it???

Thanks,

Ola

Former Member
0 Kudos

I have the same problem. It looks like we have to write a SAP Note.

NOW() function should consider a way to specify the format to show the date. It's specially important to have a R/3 format, like 30.08.2008.

Nobody knows how to fix this?

I also tried converting the date to string and number many times, but did not work.

Thanks.

Demis E.

Former Member
0 Kudos

Anybody?

It's should be very common scenario - to get date from r3 and display it to user in text field or label...

May be it should be some special date type in r3?

Thanks,

Ola