Skip to Content
0
Former Member
Nov 28, 2009 at 10:57 AM

how to put a check with the date

31 Views

Hi,

I have created a ztable with 3 fields .

clientcode(3),

date,--date geneated

version--- fileversion

i need to update this table everytime i execute the data. Every time version shd get incremented when i execute the program. When i excute the program next day version shd be updated by '1'.

i wrote the code for version updated i'm not getting the logic how to put a check with the date.

SELECT *

FROM zfi_enetflver

INTO TABLE gt_flver.

SORT gt_flver DESCENDING.

CLEAR: gv_dt, v_file.

CONCATENATE sy-datum6(2) sy-datum4(2) INTO gv_dt.

READ TABLE gt_flver WITH KEY client_code = gv_clcd.

IF sy-subrc = 0.

idx = sy-tabix.

IF gt_flver-zdate = ' '.

gt_flver-zdate = sy-datum.

ENDIF.

IF gt_flver-version = ' '.

gt_flver-version = '001'.

gv_filever = gt_flver-version.

MODIFY gt_flver INDEX idx TRANSPORTING zdate version.

MODIFY zfi_enetflver FROM TABLE gt_flver. "TRANSPORTING version.

CONCATENATE 'E:\' 'ENET\' gv_clcd gv_dt '.' gt_flver-version INTO v_file.

ELSE.

gt_flver-version = gt_flver-version + 1.

gv_filever = gt_flver-version.

MODIFY gt_flver INDEX idx TRANSPORTING version.

MODIFY zfi_enetflver FROM TABLE gt_flver .

CONCATENATE 'E:\' 'ENET\' gv_clcd gv_dt '.' gt_flver-version INTO v_file.

ENDIF.

ENDIF.

clientcode is the key field in ztable do i need to make date field key ??

please help me with the logic