Skip to Content
0
Former Member
Nov 29, 2008 at 04:58 AM

Need to get a particular date from a hexadecimal numbered field

126 Views

Hi Friends,

I have a very peculiar problem.

I have program in which a date is derived from hexadecimal number.For information i am writing the part of code where this problem is occuring.

FORM user_substitution .

clear: readlog[], readlog_wa.

readlog_wa-obj = userSubstitionTable.

insert readlog_wa into table readlog.

clear readlog_wa.

DBReadFromDate = oFrDate.

DBReadFromTime = oFrTime.

DBReadToDate = oToDate.

DBReadToTime = oToTime.

  • Read changes history log (DB_LOG) for table HRUS_D2

CALL FUNCTION 'DBLOG_READ_WITH_STATISTIC'

EXPORTING

FROM_DAY = DBReadFromDate

FROM_TIME = DBReadFromTime

TO_DAY = DBReadToDate

TO_TIME = DBReadToTime

CHANGING

LOG_LIST = db_logs

OBJ_CNT_LIST = readlog

EXCEPTIONS

ARCHIVE_ACCESS_ERROR = 1

NO_ARCHIVES_FOUND = 2

OTHERS = 3.

  • Get table structure history for HRUS_D2

CALL FUNCTION 'DD_NTAB_HIST_GET'

EXPORTING

DATE_LOW = '01012001'

TIME_LOW = '000000'

DATE_HIGH = '31129999'

TIME_HIGH = '235959'

TABNAME = userSubstitionTable

TABLES

NTHIST = tabHistory

EXCEPTIONS

NOT_FOUND = 1

INVALID_PARAMETER = 2

OTHERS = 3.

  • Loop at all Data Change entries for Table

loop at db_logs into db_logs_wa where OPTYPE <> ''.

HRUS_D2line = db_logs_wa-LOGKEY.

  • Load data changes into HRUS_D2line table

ASSIGN textline to <value_x> casting.

assign db_logs_wa-LOGDATA to <field> casting.

<value_x> = <field>.

loop at tabHistory-FIELDS into fieldStruct.

clear textline.

case fieldStruct-FIELDNAME.

when 'MANDT' or 'US_NAME' or 'REP_NAME' or 'BEGDA'.

when 'ENDDA'.

ASSIGN HRUS_D2line-ENDDA to <value_x> CASTING.

ASSIGN db_logs_wa-LOGDATA+fieldStruct-OFFSET(fieldStruct-DBLENGTH) to <field> CASTING.

<value_x> = <field>.

when 'REPPR'. " Substitute Profile

ASSIGN HRUS_D2line-REPPR to <value_x> CASTING.

ASSIGN db_logs_wa-LOGDATA+fieldStruct-OFFSET(fieldStruct-DBLENGTH) to <field> CASTING.

<value_x> = <field>.

when 'ACTIVE'. " Indicator: Substitution Active

ASSIGN HRUS_D2line-ACTIVE to <value_x> CASTING.

ASSIGN db_logs_wa-LOGDATA+fieldStruct-OFFSET(fieldStruct-DBLENGTH) to <field> CASTING.

<value_x> = <field>.

endcase.

endloop.

In this code when the date comes in the field HRUS_D2line-ENDDA we get some encrypted hexadecimal number in db_logs_wa-LOGDATA from where the date is finally derived in HRUS_D2line-ENDDA .

Can you please help me so as how the date comes in headecimal format and how should i receive the normal date format.