11-28-2009 10:57 AM
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
11-28-2009 11:05 AM
You need to implement below logic:
1. check if field_date = sy-datum. in this case do nothing.
2. else . move sy-datum to field_date .
3. modify your internal table with field_date .
4. populate final table to database table .
hope you get it.
11-28-2009 11:02 AM
11-28-2009 11:05 AM
You need to implement below logic:
1. check if field_date = sy-datum. in this case do nothing.
2. else . move sy-datum to field_date .
3. modify your internal table with field_date .
4. populate final table to database table .
hope you get it.
11-28-2009 11:18 AM
how to refresh the version if i am executing the program first time on tat day for example if the version is 50 for the previous date now the shd get modified with todays date and version as 1..
11-28-2009 12:17 PM
Hai,
Firstly check data For todays date, if does not Exist, then assign 1 to version, if date already Exist then update version.
Regards
shelly Malik
11-28-2009 5:08 PM
Its simple Ramya,
Put a check on date, if today date not equal to the date in field.
Just put version as 1 .
not modify the tables , as you are doing now.
hope you got it.