Skip to Content

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

Updating TVARV table....

hello all,

My requirement is to load data to App. Server. After initial load, only deltas will be loaded. My parameters are: begin date, end date, begin time, end time. I have maintained these parameters in TVARV as well (I have initially entered values for all the variables in TVARV table)

I set up the variants for these parameters in my program.

After executing the program once, the end_date should move to begin_date and same thing for the begin/end time.

End_date and End_time should be set to sy-datum and sy-uzeit, respectively.

Following is the code, in which I have also included function module for change pointers to read the changes:

********************************************************

TABLES: TVARVC.

parameters: beg_date like CDHDR-UDATE obligatory, "Begin Date

end_date like CDHDR-UDATE obligatory, "End Date

beg_time like CDHDR-UTIME obligatory, "Begin Time

end_time like CDHDR-UTIME obligatory. "End Time

start-of-selection.

CALL FUNCTION 'CHANGEDOCUMENT_READ_HEADERS'

EXPORTING

DATE_OF_CHANGE = beg_date

OBJECTCLASS = 'material'

TIME_OF_CHANGE = beg_time

USERNAME = SY-UNAME

DATE_UNTIL = end_date

TIME_UNTIL = end_time

TABLES

I_CDHDR = pt_cdhdr

EXCEPTIONS

NO_POSITION_FOUND = 1

WRONG_ACCESS_TO_ARCHIVE = 2

TIME_ZONE_CONVERSION_ERROR = 3

OTHERS = 4.

*Update TVARV table to reflect changes done

Select single * from tvarvc

where name = 'Z_BEGIN_DATE'

and type = 'P'.

tvarvc-low = beg_date.

tvarvc-high = end_date.

move tvarvc-high to tvarvc-low.

update tvarvc.

commit work.

Select single * from tvarvc

where name = 'Z_END_DATE'

and type = 'P'.

tvarvc-low = sy-datum.

update tvarvc.

commit work.

Select single * from tvarvc

where name = 'Z_BEGIN_TIME'

and type = 'P'.

tvarvc-low = beg_time.

tvarvc-high = end_time.

move tvarvc-high to tvarvc-low.

update tvarvc.

commit work.

Select single * from tvarvc

where name = 'Z_END_TIME'

and type = 'P'.

tvarvc-low = sy-uzeit.

update tvarvc.

commit work.

*********************************************************

Apparently, it is not working. I am also confused about the high/low values for setting up date and time.

Your help is greatly appreciated.

Thanks.

Regards,

Fred.

Tags:
replied

If it is a parameter, and not a select-option, then you shouldn't be filling the HIGH, just the LOW. In order for you to use a range, it must be a SELECT-OPTION.

Regards,

Rich Heilman

0 View this answer in context

Helpful Answer

by
Not what you were looking for? View more on this topic or Ask a question