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

Problem in date format

Former Member
0 Likes
743

Hi All,

I have FM in which there is a submit which calls the

report say X in background . Selection screen of Report X has various fields say

filed 1 type ***

field 2 type ****

field 3 type sy-datum.

when in the submit if fied 3 has no value which is send to the repot takes the value of date as 00.00.0000 and the report failsin background . if i take the values in the foreground for all the fields it shows in the screen that DATE FORMAT IS WRONG .

Now if i am checking for the value and sending the value in to the program it is OK . But if the value is not there i am

not sending it . BUT the problem here is still the value

. . is send to the program which is also wrong . as it also shows rong date format .

Please suggest how can i proceed forward.

7 REPLIES 7
Read only

Former Member
0 Likes
709

Hi Arun ,

In Debug u can find out which date format it is taking , FM requires Date should me in YYYYMMDD format.

so check ur i/p to that FM , and values of that field in thta FM as well.

Regards

Prabhu .

Read only

0 Likes
709

Hi Prabhu ,

while debugging i have seen that it is taking the value

in dd mm yyyy format . the field 3 date is calculated

from some logic and format declared in the FM is sy-datum only . The problem here is not with the filed 3 with normal input it is with blank entry . when i am sending the blank entry to report it is not going as blank Rather it is

going as dot dot ( . . )format Please suggest how to handle this .

Regards

Arun.

Read only

0 Likes
709

Arun,

can you not make date field as mandatory?

if so than try to look at FM to solve only formate problem.

there are pleanty of FM you can search by just giving dateconversion* in SE37.

Amit.

Read only

0 Likes
709

i dont y its carring ( . .), may be some where u are they are changing the format, bcos in any case date will be YYYYMMDD format only for FM i/P.

try smoke thing like this

if s_date is not initial.

do something.

endif.

Read only

0 Likes
709

Hi All,

I can not make the date field as mandatory because it is

used by many other programs . In the FM i am calculateing the DATE in the field wf_date which is field

SY-DATUM then through submit i am calling the report

no where the date format is changed from sy-datum .

Regards

Arun.

Read only

Former Member
0 Likes
709

Hello arun,

it seems your function module is using a date field of differnt type than sy-datum .So declare field3 with that type..go to se37,write the function module name & check what type is it..

Hope it will help u.

Regards,.

Bhumika

Read only

bpawanchand
Active Contributor
0 Likes
709

Instead of taking the type of field3 as sy-datum y don't you declare it as D type field because when you declare it as sy-datum internal representation is different from external representation .I think (. .) is taking internally. Try this I hope this works.

Regards

Pavan