Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Custom table issues - Date field created with character data type

Hi Experts,


I have a custom table (Z-table) that was created long ago without any data elements and all the fields are of data type character, including the date fields. This table has got huge amount of data.

My task is to fetch the data based on posting date (BUDAT - one of the fields in this table) and delete the data from the table permenantly.


I am not able to fetch the accurate data from the table since the fields of are character data type and the entered date value is considered as a string and not of type date. Since the data is huge, deleting the data based on date is the best possible way to go about this task.

Any sugestions on how to get the data from the table based on date field are most welcome.




First you fetch the records from Z table., now assign date to zdate(say).,

zdate = wa-date.

replace all occurrences of '/' in zdate.

(now u will get ddmmyyyy) ., change this to yyyymmdd., using string operations.

like d = zdate+0(2).

m = zdate+2(2).

y = zdate+4(4).

concatenate d m y into zdate1.

now assign zdate1 to date( which is of type sy-datum ).

date = zdate1.

now u can compare with the required table data you want.,

hope this helps u.,

Thanks & Regards


0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question