01-19-2007 8:06 AM
Hi,
i am getting the date from input file in YYYYMMDD format. But i have to map the date into vk11 Tcode as MM/DD/YYYY. If i am assigning it directly it is taking the YYYYMMDD format and it is telling invalid date. So, how can i convert it and how can i map it in MM/DD/YYYY format. Can anybody tell me. If any body having code can send it to me. Very Urgent......
Thanks.........
01-19-2007 9:35 AM
Hi,
I did in the same way, i concatenate MM DD YYYY seperated by '/' in the required format. then it is becoming 10 char lengh. As the recording field accepting only 8 characters it is taking only MM/DD/YY only. But i need to record it as MM/DD/YYYY. Can any body give the suggession please.
Thanks.......
01-19-2007 8:09 AM
check the Fm conversion_exit_pdate_output
to convert it from yyyymmdd to internal format
regards,
vijay.
01-19-2007 8:15 AM
REPORT zforum12 message-id vij.
Check the code
data : date like sy-datum.
data : odate(10) type c.
date = sy-datum. " in format YYYYMMDD
CALL FUNCTION 'CONVERSION_EXIT_PDATE_OUTPUT'
EXPORTING
input = date
IMPORTING
OUTPUT = odate .
write:/ odate.
"in ur format 'MM/DD/YYYY
1.
In ur itab make a field for date as 10 characters and use this Fm to store the date .
2. Pass the date as the charcter field to the screen and now check .
This will do .
vijay
01-19-2007 8:14 AM
Hi,
<b>before passing date into BDC coding</b> write this statement
PERFORM convertdate USING itab1-f2
CHANGING w_date..
FORM convertdate USING p_itab_f2
CHANGING p_w_date.
DATA : w_day(2) ,
w_month(2),
w_year(4).
w_day = p_itab_f2+6(2).
w_month = p_itab_f2+4(2).
w_year = p_itab_f2+0(4).
CONCATENATE w_month '/' w_day '/' w_year INTO p_w_date.
ENDFORM. " convertdate
01-19-2007 8:20 AM
Hi Anil,
Do like this: Declare three variables & one internal table having same structure you have used for uploadding. assign values of date field like this.
loop at itable.
v1 = date+0(4).
v2 = date+4(2).
v3 = date+6(2).
Concatenate v2 '/' v3 '/' v1 into date.
append itable to new_table.
endloop.
Ashven
01-19-2007 8:44 AM
Just use the code below to conert the date:
DATA: lv_date(10) TYPE c
*------------Date Conversion---------------------------*
CONCATENATE sy-datum+4(2)
sy-datum+6(2)
sy-datum(4) INTO lv_date SEPARATED BY '/'.
Regards
01-19-2007 9:35 AM
Hi,
I did in the same way, i concatenate MM DD YYYY seperated by '/' in the required format. then it is becoming 10 char lengh. As the recording field accepting only 8 characters it is taking only MM/DD/YY only. But i need to record it as MM/DD/YYYY. Can any body give the suggession please.
Thanks.......
01-19-2007 9:46 AM
You can process the screen field with 10 char also in VK11 .
may be your date field is 8 chars so it is giving you the problem .
convert it to 10 char field and check the same.
regards,
vijay
01-19-2007 9:47 AM
Take a field whose length is 10.
<b>data : w_date(10).
PERFORM convertdate USING itab1-f2
CHANGING w_date.
PERFORM bdc_field USING 'RV45A-ETDAT'
w_date.
</b>
if itab1-f2 is the field which contains u r date dont pass that pass u variable w_date
01-19-2007 9:49 AM
Hi anil,
1. take one new variable of type c
data : sdate(10) type c.
write itab-datum to sdate.
yyyymmdd -
> mm/ddyyyy (automatic as per current users format)
2. Now pass this SDATE
into bdc table.
regards,
amit m.
01-19-2007 10:01 AM
hi,
use this function module.
DATA :texts1 TYPE gsudisp OCCURS 0 WITH HEADER LINE,
l_date TYPE anla-aktiv.
CALL FUNCTION 'PDOT_DATE_CONVERT'
EXPORTING
OTYPE =
field = yyyymmdd
INFOTYPE =
BEGDA =
ENDDA =
TABLES
texts = texts1.
texts1-gtext field will have date in ddmmyyyy.
02-16-2007 2:32 PM
I used the built-in SAP Function:
CALL FUNCTION 'CONVERT_DATE_TO_EXTERNAL'
EXPORTING
date_internal = '<u>your internal date'</u>
IMPORTING
date_external = <u>'your external date'</u>
EXCEPTIONS
date_internal_is_invalid = 1
OTHERS = 2.