‎2007 Mar 20 5:06 AM
Hi Guys,
I have requirement where i've to upload date in format ddmmyyyy thru a BDC. The date what i get may be in format ddmmyyyy or yyyymmdd . So, i've to change dynamically the date format to ddmmyyyy , no matter what format i receive.
SLS_MISC_GET_USER_DATE_FORMAT or DATE_CHECK_PLAUSIBILITY & a select statement on the table USR01 cannot be used , as the requirement demands dynamic chnage based on the given date. Experts plz suggest me a go.
‎2007 Mar 20 5:17 AM
hi,
you can achieve it using WRITE TO command no matter whatever format of date taht you get..
for eg. WRITE sy-datum TO GD_DATE DD/MM/YYYY.
declare gd_date(10) as a character var...
if helpful, reward
Sathish. R
‎2007 Mar 20 5:51 AM
Amber,
parameters: p_date(10) type c.
data: date type datum.
CALL FUNCTION 'DATE_STRING_CONVERT'
EXPORTING
DATE_FORMAT = 'YYYY.MM.DD'
DATE_STRING = p_date
START_DATE = SY-DATUM
IMPORTING
RESULT_DATE = date.
Pls. rward if useful
‎2007 Mar 20 6:15 AM
hi
good
if you want to convert the date data dynamically before it upload into the table than you have to store the flat file data into a variable than convert it into the respective format using the if loop ,split statement and concatenate statement.
after converting the data into the respective format you save that into a varibale and upload it into the database table.
thanks
mrutyun^
‎2007 Mar 20 6:22 AM
Hi Kumar,
while uploading the data declare one variable for date and while looping move date into that variable. after that use write to command like following.
<b>data : v_date(8) type c.
data: v_date1(10) type c.</b>
while Prepare the BDCDATA internal table, before uplaod the screen which have the date value declare these validations.
<b>move itab-date to v_date.
WRITE v_date TO v_date1 DD/MM/YYYY.</b>
Now pass <b>v_date1</b> value to the BDCDATA internal table.
Hope this helps you. Reply for queries.
Regards,
Kumar.