‎2006 Jun 27 8:23 AM
Hi,
I have a Parameter of type date
ppdat LIKE sy-datum
which gets passed to a function, but when I pass it to the function, like this:
ftpost-fvalu = ppdat.
but when it does this the format gets mixed up, how can ensure it is in the format I want?
Thanks
‎2006 Jun 27 8:33 AM
Convert Useing <b>WRITE INTO</b>
<b>WRITE .... <f> <option>.</b>
Formatting options for all data types
Formatting options for date fields
Option
Function
DD/MM/YY
Separators as defined in users master record.
MM/DD/YY
Separators as defined in users master record.
DD/MM/YYYY
Separators as defined in users master record.
MM/DD/YYYY
Separators as defined in users master record.
DDMMYY
No separators.
MMDDYY
No separators.
YYMMDD
No separators.
WRITE: sy-datum,
/ sy-datum yymmdd.
27.06.1995
950627
regards
vinod
‎2006 Jun 27 8:27 AM
Hi sims,
1. Internally the dates are always stored and passed
in YYYYMMDD format only.
2. If your field ftpost-fvalu
is also of type DATE,
then no need to worry.
regards,
amit m.
‎2006 Jun 27 8:28 AM
check the fm which format (type char or date) it takes date .
change date parameter to that perticular format
‎2006 Jun 27 8:33 AM
Hi,
how have you declared the parameter in the function.
Make sure that the declaration is same in both the places.
Declare the parameter in the function of type like sy-datum.
Hope that helps.
Regards,
Tanveer.
<b>Please mark helpful answers</b>
‎2006 Jun 27 8:33 AM
Hi Sims,
Please ensure that the <b>ftpost-fvalu</b> is also of type sy-datum. If thats the case then there is no problem, else if it is of type char then the format will be changed and for using that particular value there will be some complications.
Regards,
Tushar
‎2006 Jun 27 8:33 AM
Hello Sims,
I assume that the interface parameter for your function module is of a character data type.
Also, it seems to me that you want the format (the separators) to be preserved when you pass the parameter to the function module.
you can do the following -
parameters ppdat like sy-datum.
data : lv_char_date(10).
start-of-selection.
write ppdat to lv_char_date.
call function '.....'
exporting
ftpost-fval = lv_char_date.The WRITE..TO statement ensures that the correct separators are put in place.
Regards,
Anand Mandalika.
‎2006 Jun 27 8:33 AM
Convert Useing <b>WRITE INTO</b>
<b>WRITE .... <f> <option>.</b>
Formatting options for all data types
Formatting options for date fields
Option
Function
DD/MM/YY
Separators as defined in users master record.
MM/DD/YY
Separators as defined in users master record.
DD/MM/YYYY
Separators as defined in users master record.
MM/DD/YYYY
Separators as defined in users master record.
DDMMYY
No separators.
MMDDYY
No separators.
YYMMDD
No separators.
WRITE: sy-datum,
/ sy-datum yymmdd.
27.06.1995
950627
regards
vinod
‎2006 Jun 27 8:40 AM
The parameter is going into a char32 type field, it's a BDC name and value field, and thats what the problem is.
What I need is to store it in the char as
310506 - to represent 31 may 2006
but it stores it in the reverse way.
‎2006 Jun 27 8:44 AM
Hi Sims,
Try as follows.
<b>WRITE PPDAT DDMMYY TO ftpost-fvalu.</b>
If your PPDAT as <b>20060531</b> then it will be stored in ftpost-fvalu as <b>310506.</b>
Thanks,
Vinay
‎2006 Jun 27 8:47 AM
Hello Sims,
Have you checked my answer above ? Did it not help?
Regards,
Anand Mandalika.