loop at s_s_if-t_select into l_s_select where fieldnm = 'TSTAMPS'.
tstamp = l_s_select-low.
convert time stamp tstamp time zone sy-zonlo
into date startdate time starttime.
l_r_date-low = startdate.
l_r_date-sign = 'I'.
l_r_date-option = 'EQ'.
clear l_r_date-high.
append l_r_date.
l_r_time-low = starttime.
l_r_time-sign = 'I'.
l_r_time-option = 'GE'.
clear l_r_time-high.
append l_r_time.
endloop.
* Select statement from table STXH with conditions
open cursor with hold s_cursor for
select (s_s_if-t_fields)
from stxh
where
tdobject in l_r_tdobject
and tdname in l_r_tdname
and tdfdate in l_r_tdfdate
and (
( tdfdate in l_r_date and tdftime in l_r_time ) or ( tdfdate > startdate )
or
( tdldate in l_r_date and tdltime in l_r_time ) or ( tdldate > startdate )
).
endif. "First data package ?
* Fetch records into interface table.
* named E_T_'Name of extract structure'.
fetch next cursor s_cursor
appending corresponding fields
of table it_stxh
package size s_s_if-maxsize.
if sy-subrc <> 0.
close cursor s_cursor.
raise no_more_data.
endif.
if it_stxh[] is not initial.
unassign <fs_stxh>.
clear w_t_data.
* Populating final value in E_T_DATA
*Getting all lines of text for each Text ID, Name and Texts: application object and putting it into the READ_TEXT function Module to read from the STXL table.
loop at it_stxh assigning <fs_stxh>.
clear textheader.
clear ztext.
*data: text type ztext.
call function 'READ_TEXT'
exporting
object = <fs_stxh>-tdobject
id = <fs_stxh>-tdid
language = <fs_stxh>-tdspras
name = <fs_stxh>-tdname
importing
header = textheader
tables
lines = textlines
exceptions
id = 1
language = 2
name = 3
not_found = 4
object = 5
reference_check = 6
wrong_access_to_archive = 7
others = 8.
clear lv_lines.
loop at textlines assigning <fs_lines>.
lv_lines = lv_lines + 1.
* Concatenating date and time into timestamp
concatenate <fs_stxh>-tdfdate <fs_stxh>-tdftime into tstamp1.
concatenate <fs_stxh>-tdldate <fs_stxh>-tdltime into tstamp2.
* When changed date is not present use the created date for Delta(TSTAMPS).
if ( tstamp2 is initial or tstamp2 eq '00000000' ) .
move tstamp1 to w_t_data-tstamps.
else.
move tstamp2 to w_t_data-tstamps.
endif.
move : <fs_stxh>-mandt to w_t_data-mandt,
<fs_stxh>-tdobject to w_t_data-tdobject,
<fs_stxh>-tdname to w_t_data-tdname,
<fs_stxh>-tdid to w_t_data-tdid,
<fs_stxh>-tdspras to w_t_data-tdspras,
<fs_lines>-tdline to w_t_data-ztext,
<fs_stxh>-tdfdate to w_t_data-tdfdate,
<fs_stxh>-tdftime to w_t_data-tdftime,
<fs_stxh>-tdldate to w_t_data-tdldate,
<fs_stxh>-tdltime to w_t_data-tdltime,
<fs_stxh>-tdtxtlines to w_t_data-tdtxtlines,
lv_lines to w_t_data-zline.
append w_t_data to e_t_data.
endloop.
endloop.
endif.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
8 | |
7 | |
5 | |
4 | |
4 | |
4 | |
4 | |
3 | |
3 | |
3 |