后台运行的报表不能完全显示,怎么办捏?

[复制链接]
查看11 | 回复1 | 2007-4-14 04:01:02 | 显示全部楼层 |阅读模式
有一些abap报表列数都在255列以上,有些多达500+列,而且都是一些大表。由于建议用户后台运行这些报表,但是查看这些后台运行的报表时却只能显示到255列。
求助前辈们,怎么才能完全显示这些大型的报表呢?
谢谢
回复

使用道具 举报

千问 | 2007-4-14 04:01:02 | 显示全部楼层
report zrsposhowlist line-size 80.
parameters: rqident like tsp01-rqident,
firstl type i default 0,
lastl type i default 0.
* global data from LSPOXTOP
data: rc(10) type c,
errmsg(100) type c,
status like sy-subrc,
dsn_type(8) type c.
data: begin of data_set_line,
data_length(5),
precol(1),
* DATA_LINE(1000),
data_line(5000), "MODAB
end of data_set_line,
data_set_length(5) type c.
tables: tsp01, tst05, tspoptions.
data: temse_name like tst01-dname,
temse_client like tst01-dclient,
temse_handle like rststype-handle,
temse_part like tst01-dpart,
temse_objtyp like tst01-dtype,
temse_rectyp like rststype-rectyp,
temse_charco like tst01-dcharcod.
data: is_otf.
* global data from LSPOCTOP
data: begin of spoc,
*escape
*prtctrl
first_bytes(4), " collection of the first bytes of the
" escape sequences, which I am searching for.
prtctrl_start_length type i,
prtctrl_total_length type i,
prtctrl_start(10),
symbol_low_start(10),
symbol_hgh_start(10),
symbol_start_length type i,
icon_start(10),
icon_start_length type i,
icon_sel type i value 1,
frame_start(10),
frame_start_length type i,
end of spoc.
field-symbols:type c,

type c,

type c,

type c,

type c.
* copied from RSPO_DISPLAY_ABAP_SPOOLJOB
data: buffer like data_set_line occurs 1000.
tables: tsp02l.
select single * from tsp01 where rqident = rqident.
if sy-subrc0.
write: / 'Spool request does not exist:'(001), rqident.
exit.
endif.
call function 'RSPO_CHECK_JOB_PERMISSION'
exporting

access= 'DISP'

spoolreq= tsp01
exceptions

no_permission = 1

others= 2.
if sy-subrc0.
write: / 'No authorization to display'(002).
exit.
endif.
perform read_data tables buffer
using tsp01 firstl lastl.
if sy-subrc0.
write: / 'Error reading spoolo request'(003).
exit.
endif.
if is_otf = 'X'.
write: / 'This spool request is not an ABAP list'(004).
exit.
endif.
perform display_data tables buffer using tsp01-rqpaper tsp01-rqident.
******************************************
form get_spool_line.
do.
if temse_rectyp+1(1) = 'Y'.
call 'C_RSTS_READ'
id 'HANDLE' field temse_handle
id 'BUFF' field data_set_line
* ID 'BUFFLG' FIELD 1006
id 'BUFFLG' field 5006 "MODAB
id 'ALLINE' field 'X'
id 'BINARY' field ' '
id 'SHOWLG' field 'X'
id 'RC' field rc
id 'ERRMSG' field errmsg.
status = sy-subrc.
else.
call 'C_RSTS_READ'
id 'HANDLE' field temse_handle
id 'BUFF' field data_set_line+1
* ID 'BUFFLG' FIELD 1005
id 'BUFFLG' field 5005 "MODAB
id 'ALLINE' field 'X'
id 'BINARY' field ' '
id 'SHOWLG' field 'X'
id 'RC' field rc
id 'ERRMSG' field errmsg.
status = sy-subrc.
data_set_line(5) = data_set_line+1(5).
data_set_line-precol = ' '.
add 1 to data_set_line-data_length.
endif.
status = sy-subrc.
if status6. " EOF, error condition, or got data
exit.
endif.
* end of this part, try to open next part
add 1 to temse_part.
call 'C_RSTS_CLOSE'
id 'HANDLE' field temse_handle
id 'RC' field rc
id 'ERRMSG' field errmsg.
status = sy-subrc.
if status = 0.
call function 'RSTS_GET_ATTRIBUTES'
exporting
authority = 'SP01'
client = temse_client "hjl
name = temse_name
part = temse_part
importing
charco = temse_charco
* CREATER =
* CREDATE =
* DELDATE =
* MAX_CREDATE =
* MAX_DELDATE =
* NON_UNIQ =
* NOOF_PARTS =
rectyp = temse_rectyp
* SIZE =
* STOTYP =
* type =
objtype = temse_objtyp
exceptions
fb_error = 1
fb_rsts_other = 2
no_object = 3
no_permission = 4
others = 5.
status = sy-subrc.
endif.
if status = 0.
call 'C_RSTS_OPEN_READ'
id 'HANDLE' field temse_handle
id 'CLIENT' field temse_client "hjl
id 'NAME' field temse_name
id 'PART' field temse_part
id 'TYPE' field temse_objtyp
id 'CONV' field ' '
id 'ALLINE' field 'X'
id 'BINARY' field ' '
id 'RECTYP' field temse_rectyp
id 'CHARCO' field temse_charco
id 'PROM' field 'I'
id 'RC' field rc
id 'ERRMSG' field errmsg.
status = sy-subrc.
endif.
enddo.
if status = 4.
status = 12. "EOF
endif.
if status = 8.
status = 40. "Line too long
endif.
data_set_length = data_set_line-data_length.
endform.

*---------------------------------------------------------------------*
* FORM READ_DATA
*
*---------------------------------------------------------------------*
* ........
*
*---------------------------------------------------------------------*
*-->BUFFER
*
*-->TSP01
*
*-->VALUE(FIRST)
*
*-->VALUE(LAST)
*
*---------------------------------------------------------------------*
form read_data tables buffer
using tsp01 like tsp01 value(first) type i
value(last) type i.
data: lines type i.
refresh buffer.
clear is_otf.
temse_client = tsp01-rqclient.
temse_name = tsp01-rqo1name.
temse_part = 1.
call function 'RSTS_GET_ATTRIBUTES'
exporting
authority = 'SP01'
client = temse_client
name = temse_name
part = temse_part
importing
charco = temse_charco
* CREATER =
* CREDATE =
* DELDATE =
* MAX_CREDATE =
* MAX_DELDATE =
* NON_UNIQ =
* NOOF_PARTS =
rectyp = temse_rectyp
* SIZE =
* STOTYP =
* type =
objtype = temse_objtyp
exceptions
fb_error = 1
fb_rsts_other = 2
no_object = 3
no_permission = 4
others = 5.
if sy-subrc = 0.
if temse_objtyp(3) = 'OTF'.
is_otf = 'X'.
endif.
else.
exit.
endif.
clear temse_handle.
call 'C_RSTS_OPEN_READ'
id 'HANDLE' field temse_handle
id 'CLIENT' field temse_client "hjl
id 'NAME' field temse_name
id 'PART' field temse_part
id 'TYPE' field temse_objtyp
id 'CONV' field ' '
id 'ALLINE' field 'X'
id 'BINARY' field ' '
id 'RECTYP' field temse_rectyp
id 'CHARCO' field temse_charco
id 'PROM' field 'I'
id 'RC' field rc
id 'ERRMSG' field errmsg.
status = sy-subrc.
if status = 0.
do.
perform get_spool_line.
if status0 and status40 and status12.
perform close_job.
exit.
endif.
if status12.
" 12 = End
if not ( data_set_length is initial ).

data_set_line-data_length = data_set_length - 1.
endif.
add 1 to lines.
if lines >= first.

append data_set_line to buffer.
endif.
if ( not last is initial ) and ( lines >= last ).

exit.
endif.
else.
if lines = 0.

perform close_job.

exit.
endif.
if lines0 and status12.
call 'C_RSTS_CLOSE'
id 'HANDLE' field temse_handle
id 'RC' field rc
id 'ERRMSG' field errmsg.
message e112(po) with status rc errmsg raising read_error.
endif.
call 'C_RSTS_CLOSE'
id 'HANDLE' field temse_handle
id 'RC' field rc
id 'ERRMSG' field errmsg.
status = sy-subrc.
if status0.
message e112(po) with status rc errmsg raising read_error.
endif.
endform.

*---------------------------------------------------------------------*
* FORM DISPLAY_DATA
*
*---------------------------------------------------------------------*
* ........
*
*---------------------------------------------------------------------*
*-->BUFFER
*
*-->RQPAPER
*
*-->RQID
*
*---------------------------------------------------------------------*
form display_data tables buffer using rqpaper like tsp01-rqpaper
rqid like tsp01-rqident.
data: line_length type i, gcol type i, glines type i,
line_length2 like rststype-linelength,
v, v2.
* CALL FUNCTION 'RSPO_SPOOLDATA_WRITE_INIT'.
perform spooldata_write_init. "MODAB
* select single * from tspoptions where spoption = 'REALWIDTH'.
* if sy-subrc = 0.
v = 'X'.
* endif.
* select single * from tspoptions where spoption = 'REALHEIGHT'.
* if sy-subrc = 0.
v2 = 'X'.
* endif.
if not v is initial or not v2 is initial.
gcol = 0.
glines = 0.
select single * from tsp02l where pjident = rqid
and pjnummer = 0.
if sy-subrc = 0.
gcol = tsp02l-columns.
glines = tsp02l-lines.
else.
call function 'RSPO_GET_SIZE_OF_LAYOUT'
exporting
layout = rqpaper
importing
* ANSWER =
columns = gcol
lines = glines
* PFORMAT =
.
endif.
endif.
if gcol = 1024. "MODAB
gcol = 1023.
endif.
new-page no-heading no-title line-size gcol
line-count glines. " make a wide list
set blank lines on.
loop at buffer.
data_set_line = buffer.
if data_set_line-precol = 'P'.
if data_set_line(1) = ' '. " Echter Vorschub ?"
new-page.
endif.
continue.
endif.
* Zeilenl?nge berechnen, falls unbekannt.
if data_set_line-data_length is initial.
line_length = strlen( data_set_line-data_line ).
else.
line_length = data_set_line-data_length.
endif.
if line_length > 0.
line_length2 = line_length.
perform spooldata_write using data_set_line-data_line "MODAB
line_length2
1.
else.
" Leerzeile
skip.
endif.
endloop.
endform.
* copied from RSPO_SPOOLDATA_WRITE
form spooldata_write using value(spool_data)
value(data_length) like rststype-linelength
value(start_pos) like sy-colno.
* function globals
data: lpos like sy-colno,
rest_len type i,
area_len type i,
next_hot type i, " offset of next special character
cols type i, " columns used by special character
bytes type i, " bytes used by special character
hot2,
hot3,
hot4,
hot5,
hot6,
hot7,
begin of escape_trick,
x1(1) type x,
end of escape_trick,
the_prtctrl(5) type c,
* Because of a problem within the ABAP listprocessing, I shall
* never output the same icon side by side with the same color
* and without a gap.
* As I don't know the data, I will use two different variables
* alternatively.
icon_id1 like icons-l4,
icon_id2 like icons-l4.
field-symbols:
,
,
,
,
,
,
.
if start_pos0.
assign spool_data(rest_len) to .
whileca spoc-first_bytes.
next_hot = sy-fdpos.
if next_hot > 0.
assign (next_hot) to .
* MODAB
perform write_bigfield using
next_hot
lpos.
* WRITE AT LPOSNO-GAP.
add next_hot to lpos.
subtract next_hot from rest_len.
assign +next_hot(rest_len) to .
endif.
if rest_len >= spoc-prtctrl_start_length.
assign (spoc-prtctrl_start_length) to .
else.
assign 'too_short' to .
endif.
if rest_len >= spoc-frame_start_length.
assign (spoc-frame_start_length) to .
else.
assign 'too_short' to .
endif.
if rest_len >= spoc-icon_start_length.
assign (spoc-icon_start_length) to .
else.
assign 'too_short' to .
endif.
if rest_len >= spoc-symbol_start_length.
assign (spoc-symbol_start_length) to .
else.
assign 'too_short' to .
endif.
if rest_len > 1.
hot2 = +1(1).
if rest_len > 2.
hot3 = +2(1).
if rest_len > 3.

hot4 = +3(1).
else.

hot4 = '?'.
endif.
else.
hot3 = '?'.
endif.
else.
hot2 = '?'.
endif.
if= .
cols = 1. " in most cases.
bytes = 2. " in most cases.
case hot2.
when '0'. write at lpos hot2 as line no-gap.
when '1'. write at lpos hot2 as line no-gap.
when '2'. write at lpos hot2 as line no-gap.
when '3'. write at lpos hot2 as line no-gap.
when '4'. write at lpos hot2 as line no-gap.
when '5'. write at lpos hot2 as line no-gap.
when '6'. write at lpos hot2 as line no-gap.
when '7'. write at lpos hot2 as line no-gap.
when '8'. write at lpos hot2 as line no-gap.
when '9'. write at lpos hot2 as line no-gap.
when ':'. write at lpos hot2 as line no-gap.
when ';'. " box_drawings_light_left

write at lpos '4' as line no-gap.
when ''. " box_drawings_light_down

write at lpos '5' as line no-gap.
when '?'. " drawings_checkbox_off

write at lpos ' ' as checkbox input off no-gap.
when '@'. " drawings_checkbox_on

write at lpos 'X' as checkbox input off no-gap.
when others.

bytes = 0.
endcase.
endif.
if= .
escape_trick = hot3.
subtract 32 from escape_trick-x1.
if hot4 = space.
write at lpos(2) escape_trick as symbol no-gap.
cols = 2.
bytes = 4.
else.
write at lpos(1) escape_trick as symbol no-gap.
bytes = 3.
endif.
endif.
if= .
escape_trick = hot3.
add 32 to escape_trick-x1.
if hot4 = space.
write at lpos(2) escape_trick as symbol no-gap.
cols = 2.
bytes = 4.
else.
write at lpos(1) escape_trick as symbol no-gap.
bytes = 3.
endif.
endif.
if= .
if spoc-icon_sel > 4.
hot5 = +4(1).
if rest_len > 5.

hot6 = +5(1).

if rest_len > 6.

hot7 = +6(1).

else.

hot7 = '?'.

endif.
else.

hot6 = '?'.
endif.
else.
hot5 = '?'.
endif.
if hot5 = space.
if hot6 = space.

if hot7 = space.

if spoc-icon_sel = 1.

write at lpos(4) icon_id1 as icon.
* write at lpos icon_id1 as icon no-gap.

else.

write at lpos(4) icon_id2 as icon.
* write at lpos icon_id2 as icon no-gap.

endif.

cols = 4.

bytes = 7.

else.

if spoc-icon_sel = 1.

write at lpos(3) icon_id1 as icon.
* write at lpos icon_id1 as icon no-gap.

else.

write at lpos(3) icon_id2 as icon.
* write at lpos icon_id2 as icon no-gap.

endif.

cols = 3.

bytes = 6.

endif.
else.

if spoc-icon_sel = 1.

write at lpos(2) icon_id1 as icon.
* write at lpos icon_id1 as icon no-gap.

else.

write at lpos(2) icon_id2 as icon.
* write at lpos icon_id2 as icon no-gap.

endif.

cols = 2.

bytes = 5.
endif.
else.
"rite at lpos(1) icon_id as icon.
write at lpos(1) '#' no-gap. " Not enough space for any icon.
cols = 1.
bytes = 4.
endif.
endif.
if= .
cols = 0. " in most cases.
bytes = 6. " in most cases.
if rest_len >= spoc-prtctrl_total_length.
the_prtctrl = +spoc-prtctrl_start_length(5).
if the_prtctrl = 'SABLD'.

format intensified on.

"no 3.0 'SAULN'.

"no 3.0 FORMAT UNDERSCORED ON.
elseif the_prtctrl = 'SAOFF'.

format intensified off.

"no 3.0 FORMAT UNDERSCORED OFF.
elseif the_prtctrl(3) = 'COL'.

case the_prtctrl+3(1).

when '0'.

format color off.

when '1'.

format color 1.

when '2'.

format color 2.

when '3'.

format color 3.

when '4'.

format color 4.

when '5'.

format color 5.

when '6'.

format color 6.

when '7'.

format color 7.

endcase.

case the_prtctrl+4(1).

when 'N'.

format intensified off inverse off.

when 'H'.

format intensified on inverse off.

when 'V'.

format intensified on inverse on.

endcase.
endif. "printcontrol
else. "??
endif.
endif.
if bytes = 0.
bytes = 1.
write at lpos(1) '#'.
cols = 1.
endif.
add cols to lpos.
subtract bytes from rest_len.
if rest_len > 0.
assign +bytes(rest_len) to .
else.
exit.
endif.
endwhile.
* MODAB
if rest_len > 0.
assign (rest_len) to .
perform write_bigfield using
rest_len
lpos.
endif.
endform.
*---------------------------------------------------------------------*
* FORM WRITE_BIGFIELD
*
*---------------------------------------------------------------------*
* ........
*
*---------------------------------------------------------------------*
*-->VALUE(FIELD)
*
*-->VALUE(LEN)
*
*-->VALUE(POS)
*
*---------------------------------------------------------------------*
form write_bigfield using value(field) type c
value(len)
value(pos).
field-symbols .
data: chunk type i.
while len > 0.
if len > 255.
chunk = 255.
else.
chunk = len.
endif.
write at pos field(chunk) no-gap.
add chunk to pos.
len = len - chunk.
if len > 0.
field = field+chunk.
endif.
endwhile.
endform.
*---------------------------------------------------------------------*
* FORM SPOOLDATA_WRITE_INIT
*
*---------------------------------------------------------------------*
* ........
*
*---------------------------------------------------------------------*
form spooldata_write_init.
data: begin of escape_trick,
x1(1) type x,
end of escape_trick.
field-symbols:
,
,
.
escape_trick-x1 = '1C'.
spoc-prtctrl_start = escape_trick.
spoc-prtctrl_start_length = 1.
spoc-prtctrl_total_length = spoc-prtctrl_start_length + 5.
assign spoc-prtctrl_start(spoc-prtctrl_start_length) to .

escape_trick-x1 = '1B'.
spoc-frame_start = escape_trick.
spoc-frame_start_length = 1.
assign spoc-frame_start(spoc-frame_start_length) to .
escape_trick-x1 = '1B'.
spoc-icon_start = escape_trick.
spoc-icon_start+1 = ','.
spoc-icon_start_length = 2.
assign spoc-icon_start(spoc-icon_start_length) to .
escape_trick-x1 = '1B'.
spoc-symbol_low_start = escape_trick.
spoc-symbol_low_start+1 = '('.
spoc-symbol_hgh_start = escape_trick.
spoc-symbol_hgh_start+1 = ')'.
spoc-symbol_start_length = 2.
assign spoc-symbol_low_start(spoc-symbol_start_length)
to .
assign spoc-symbol_hgh_start(spoc-symbol_start_length)
to .
spoc-first_bytes+0(1) = spoc-prtctrl_start(1).
spoc-first_bytes+1(1) = spoc-frame_start(1).
spoc-first_bytes+2(1) = spoc-icon_start(1).
spoc-first_bytes+3(1) = spoc-symbol_low_start(1).
endform.
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

主题

0

回帖

4882万

积分

论坛元老

Rank: 8Rank: 8

积分
48824836
热门排行