Report output more than 255
Hi,
I want to print my report more than 255 characters..
i was taken line size more than 255 but it gives error.
Please give me the appropriate answer.
hI..
THIS FROM <b>SAP HELP</b>.
<b>REPORT <rep> LINE-SIZE <width>.</b>
This statement determines the width of the output list of program <rep> as <width> characters. If you set <width> to zero, the system uses the width of the standard list.
<b>The maximum line width is 1,023 characters.</b>
<b>A line can be up to 255 characters long</b>. However, if you intend to print the list, note that most printers cannot print lists wider than 132 characters. If you want to print the list directly while creating it, the page width must comply with one of the existing print formats. Otherwise, the system will not print the list (see Print Parameters). Make sure not to choose a list width exceeding 132 characters, unless you create the list for display only.
While creating the list, the system field SY-LINSZ contains the current line width. To adapt the list width to the current window width, see Lists with Several Pages.
Similar Messages
-
ALV report output more than 255
Hi All,
I have write alv list report
when i declare like
WRITE: / SY-ULINE(265).
it gave me error " Length specification "(265") exceeds fields length ("255").
i also write in report heading
"REPORT ZSIMPLE line-SIZE 500."
Where is the problem.
Thanks In Advance.
Regards,
SamThe field SY-ULINE is defined as 255 characters long (check via SE11 on SYST structure or read [ABAP System Fields |http://help.sap.com/abapdocu_70/en/ABENSYSTEM_FIELDS.htm]), so you cannot use the first 265 characters (that is what SY-ULINE(265) means), try to WRITE: SY-ULINE(255), SY-ULINE(10). (The maximum line size of a report is 1023 - [LINE-SIZE width|http://help.sap.com/abapdocu_70/en/ABAPREPORT_LIST_OPTIONS.htm#!ABAP_ADDITION_2@2@])
Regards,
Raymond -
Spool output more than 255 characters
Hi ,
i am running a ALV report in background whose output is more than 255 characters . but spool is showing only 255 charcters.
Do we have any setting to change to display all characters.
Or any OSS notes that can be applied.
Thanks & regards,
Sonika AhujaHi,
You need to change the Format Type through SPAD transaction. The Format Type decides the number of rows and columns per page. By creating a new format type as per your requirement would solve the probelm.
Also, in the Report declaration, change the Line-Size to 300 or as per the width of your output.
For further details pls. refer this thread :
Re: Spool List output display > 255 char when the rpt is run in Background
Best regards,
Prashant -
Want to display BEX report output more than 65000 rows
Hi all,
I want to run a report in BW which has more than 65000 lines. Currently it tells me there is no space. How can I solve the issue please?
user is using BW 3.5 excel 2007
GUI version is 7100.2.9.1039
patch level 9
please advise.
thanks
WHP123Hi,
Can you try to remove some of the columns of your query.
My doubt , is the no. rows is actually killing the report or the population of higher column also may cause the issue.
try to make a copy of you report, and then remove the charecteristics, keep 1-2 and all KFs. Then run and check for the o/p.
Is it getting over the 65k reows ?
Thank-You.
Regards,
Vinod -
Smartform - Field not outputting more than 255 characters in a loop - Help!
Hi,
I have the following problem with my Smartform:
I am looping from a table and into a structure (Loop function).
1 of those fields is 1000 characters long and will be filled usually at 500 characters inside.
However, when looping and outputting the field (text node) in the format &Tablename-Fieldname&, only up to 255 characters are output.
To give you a better idea - I have a Loop Node and there, I am looping from a table (type table of) into a header
(type).
Using LCHR does not help.
Why does this happen? How can I fix this? Are any symbols available in Smartforms, like they are in SAPscript?
Any possible solutions will help.
Please help this is very important and very urgent.
Best Regards,
JohnHi,
if you want to output a long string in a smartform putting it as &name& in a text will not help you. For printing such an information you use temp include texts you create an delete on the fly while processing the SF.
To Do so:
- define GV_SUFFIX type char2, GS_HEAD a structure with fields TDOBJECT type TDOBJECT, TDNAME type TDOBNAME, TDID type TDID, TDSPRAS type SPRAS
- define a code step importing the text, the language and the GV_SUFFIX, in the coding , you convert the string to itf and than use function module SAVE_TEXT to save the include text and put the information into GS_HEAD
- define an include text where you put out the newly created include text
- define a code step to delete the temporary text with function module DELETE_TEXT
Best Regards
Roman Weise -
Smartform - Field not outputting more than 255 characters in a loop
Hi,
I have the following problem with my Smartform:
I am looping from a table and into a structure (Loop function).
1 of those fields is 1000 characters long and will be filled usually at 500 characters inside.
However, when looping and outputting the field (text node) in the format &Tablename-Fieldname&, only up to 255 characters are output.
Why does this happen? How can I fix this? Are any symbols available in Smartforms, like they are in SAPscript?
Any possible solutions will help.
Please help this is very important and very urgent.
Best Regards,
John
Edited by: Alvaro Tejada Galindo on Mar 17, 2008 4:06 PMHi,
if you want to output a long string in a smartform putting it as &name& in a text will not help you. For printing such an information you use temp include texts you create an delete on the fly while processing the SF.
To Do so:
- define GV_SUFFIX type char2, GS_HEAD a structure with fields TDOBJECT type TDOBJECT, TDNAME type TDOBNAME, TDID type TDID, TDSPRAS type SPRAS
- define a code step importing the text, the language and the GV_SUFFIX, in the coding , you convert the string to itf and than use function module SAVE_TEXT to save the include text and put the information into GS_HEAD
- define an include text where you put out the newly created include text
- define a code step to delete the temporary text with function module DELETE_TEXT
Best Regards
Roman Weise -
SQ01 Output fields having more than 255 characters
Hello,
I need to show query output more than 255 charaters but system is not allowing
Here is the Error message:
List is wider than 255 characters (generation not possible)
I used SQ01 as t-code to create query.
How can i show my output more than 255 characters
ThanksRefer SAP Note 857823, ALV grid cannot display more than 128 characters per field and will truncate all the characters beyond if it's an ABAP program
From my experience it will not display the field at all in SQ01.
You need to write an abap program and split the field into two fields of length 128 and display side by side.
Work around: If you cannot write abap program uncheck (no display in query) that field in SQ02 and generate it. Execute your query and copy the key field use se16n to input in the key fields and use import to excel sheet function to get the required data. -
Extention of columns more than 255 in list display
hi,
i got a requirement that in a list we can print 250 columns,our requirement is in list to print more than 250 columns ,other than using grid.if any body know this answer pls let me know.its urgent
points r awarded to right answers.
thanks in advance.
kartheekHi,
You can check notes 186603 to display report with more than 255 charecters.
you will get the detailed notes. In the Attachments you have the Z program code.
After creation of the new format, run the job with the new format ie. attach the new format to your printer, and run the job. Now take the spool number and put it as a parameters to the Z program.
Hope it work fine.
Rewards points if useful
Regards,
Sonika Ahuja -
Problem printing more than 255 characters in report output and in the spool
Hi Guys,
I am trying to print one file in the report output and in the spool but it's priting till 255 characters only. If I try the samething while writing in application server and in peresentation server it is printing full content. I am giving the line size in the REPORT statement as more than 255 like 300 but even it is not printing. How can i print the full contents. Whether it is any basis related issue or in any settings can we do that. please advice.
Thanks in advance.If it is not showing in Spool, Basis people has to do some setting in SPAD Transaction.
-
More than 255 bytes in SO_NEW_DOCUMENT_ATT_SEND_API1
I know they are some posts about this topic already but I have read them all but I still don't have the solution. I hope someone could help me with this:
The problem is this: I have an internal table and I make an excell file of it which is mailed (sapmail) to the user who started the program. I all works fine except for the problem of the 255 limit. This happens because SOLISTI1 has an 255 limit. The excell attachment is mailed but it breaks after 255 characters (the total characters is about 500).
I know there are some solutions with TABLE_COMPRESS and TABLE_DECOMPRESS but I don't know on which moment you should compress or decompress which table! Below if my coding hope someone can help:
REPORT ZDTAFNAME_K.
tables: marc,
lips,
vbrp,
mara,
kna1,
vbak,
VBKD,
vbrk,
vbap,
vbep,
mvke,
mbew.
selection-screen: begin of block select with frame title text-f70.
select-options art for marc-matnr.
select-options abc for marc-abcin.
select-options fak for vbrp-vbeln default '20406070'.
Select-options dat for vbrp-erdat.
selection-screen: end of block select.
PARAMETERS: p_email TYPE somlreci1-receiver
DEFAULT '31dtg'.
data: rule(2) value '.,'.
data: begin of itab occurs 0,
deb like vbak-kunnr, "Debiteurennummer
debnaam like kna1-name1, "Naam debiteur
bestnr like vbkd-bstkd, "Bestelnr klant
artnr like marc-matnr, "Artikelnr
oms like lips-arktx, "Omschrijving
type like mara-groes, "Type
fab like lips-matkl, "Fabrikaat
faktuurdat like vbrp-erdat, "Faktuurdatum
faksrt like vbrk-fkart, "Faktuursoort
faktuur like vbrp-vbeln, "Faktuurnr
fakpos like vbrp-posnr, "Faktuurpositie
fakaantal(11) type c , "Faktuuraantal
fakeenh like vbrp-meins, "Faktuureenheid
fakwaarde(11) type c , "Faktuurwaarde
orddat like vbap-erdat, "Orderdatum
ordsrt like vbak-auart, "Ordersoort
verkoper like vbak-ernam, "Verkoper
ordnr like lips-vgbel, "Ordernr
ordnrpos like lips-vgpos, "Order positie
artklant like vbap-kdmat, "Artikelnr klant
ordaant(11) type c, "Order aantal
ordeenh like vbap-meins, "Order eenheid
ordwaarde(11) type c, "Nettowaarde orderpositie
postype like vbap-pstyv, "Positietype
gevlevdat like vbep-edatu, "Gevraagde leverdatum
levdat like lips-erdat, "Werkelijke leverdatum
levnr like lips-vbeln, "Leveringsnr
levpos like lips-posnr, "Levering positie
levaant(11) type c, "Leveringsaantal
leveenh like lips-meins, "Leveringseenheid
min(11) type c, "Bestelpunt
max(11) type c, "Max vrd
basiseenh like mara-meins, "Basiseenheid
abc like marc-abcin, "ABC Classificatie
artsoort like mara-mtart, "Artikelsoort
vkstatus(2) type c, "Verkoopstatus
ikstatus(2) type c, "Inkoopstatus
minlev(11) type c, "Min levereenheid
afrd(11) type c, "Afrondingswaarde
vprs(11) type c, "VPRS
vprseenh(11) type c, "VPRS eenheid
end of itab.
DATA: it_message TYPE STANDARD TABLE OF solisti1 INITIAL SIZE 0
WITH HEADER LINE.
DATA: it_attach TYPE STANDARD TABLE OF solisti1 INITIAL SIZE 0
WITH HEADER LINE.
DATA: t_packing_list LIKE sopcklsti1 OCCURS 0 WITH HEADER LINE,
t_contents LIKE solisti1 OCCURS 0 WITH HEADER LINE,
t_receivers LIKE somlreci1 OCCURS 0 WITH HEADER LINE,
t_attachment LIKE solisti1 OCCURS 0 WITH HEADER LINE,
t_object_header LIKE solisti1 OCCURS 0 WITH HEADER LINE,
w_cnt TYPE i,
w_sent_all(1) TYPE c,
w_doc_data LIKE sodocchgi1,
gd_error TYPE sy-subrc,
gd_reciever TYPE sy-subrc.
*START_OF_SELECTION
START-OF-SELECTION.
Retrieve sample data from table ekpo
PERFORM data_retrieval.
Populate table with detaisl to be entered into .xls file
PERFORM build_xls_data_table.
*END-OF-SELECTION
END-OF-SELECTION.
Populate message body text
perform populate_email_message_body.
Send file by email as .xls speadsheet
PERFORM send_file_as_email_attachment
tables it_message
it_attach
using p_email
'Example .xls documnet attachment'
'XLS'
'filename'
changing gd_error
gd_reciever.
Instructs mail send program for SAPCONNECT to send email(rsconn01)
PERFORM initiate_mail_execute_program.
*& Form DATA_RETRIEVAL
Retrieve data form EKPO table and populate itab it_ekko
FORM data_retrieval.
select * from vbrk client specified where
mandt = sy-mandt and
vbeln in fak and
erdat in dat and
fkart = 'F2'.
select * from vbrp client specified where
mandt = sy-mandt and
vbeln = vbrk-vbeln and
erdat in dat and
matnr in art.
select single * from marc client specified where
mandt = sy-mandt and
werks = 610 and
matnr = vbrp-matnr and
abcin in abc.
if sy-subrc = 0.
itab-levnr = vbrp-vgbel.
itab-levpos = vbrp-vgpos.
itab-faksrt = vbrk-fkart.
select single * from mara client specified where
mandt = sy-mandt and
matnr = marc-matnr.
if sy-subrc = 0.
itab-type = mara-groes.
itab-basiseenh = mara-meins.
endif.
select single * from mvke client specified where
mandt = sy-mandt and
matnr = marc-matnr.
if sy-subrc = 0.
itab-vkstatus = mvke-vmsta.
itab-minlev = mvke-scmng.
endif.
select single * from mbew client specified where
mandt = sy-mandt and
matnr = marc-matnr and
bwkey = 610.
if sy-subrc = 0.
itab-vprs = mbew-verpr.
itab-vprseenh = mbew-peinh.
endif.
select single * from vbak client specified where
mandt = sy-mandt and
vbeln = vbrp-aubel.
if sy-subrc = 0.
itab-deb = vbak-kunnr.
itab-ordsrt = vbak-auart.
endif.
select single * from vbap client specified where
mandt = sy-mandt and
vbeln = vbrp-aubel and
posnr = vbrp-aupos.
if sy-subrc = 0.
itab-verkoper = vbap-ernam.
itab-orddat = vbap-erdat.
itab-artklant = vbap-kdmat.
itab-ordaant := vbap-kwmeng.
itab-ordeenh = vbap-meins.
itab-ordwaarde := vbap-netwr.
itab-postype = vbap-pstyv.
endif.
select single * from vbep client specified where
mandt = sy-mandt and
vbeln = vbap-vbeln and
posnr = vbap-posnr and
etenr = '0001'.
if sy-subrc = 0.
itab-gevlevdat = vbep-edatu.
endif.
select single * from vbkd client specified where
mandt = sy-mandt and
vbeln = vbak-vbeln.
if sy-subrc = 0.
itab-bestnr = vbkd-bstkd.
endif.
select single * from lips client specified where
mandt = sy-mandt and
vbeln = vbrp-vgbel and
posnr = vbrp-vgpos.
if sy-subrc = 0.
itab-levdat = lips-erdat.
itab-levaant = lips-lfimg.
itab-leveenh = lips-meins.
else.
clear itab-levnr.
clear itab-levpos.
clear itab-levaant.
clear itab-levdat.
endif.
select single * from kna1 client specified where
mandt = sy-mandt and
kunnr = vbak-kunnr.
if sy-subrc = 0.
itab-debnaam = kna1-name1.
endif.
itab-artnr = marc-matnr.
itab-oms = vbrp-arktx.
itab-fab = vbrp-matkl.
itab-abc = marc-abcin.
itab-artsoort = mara-mtart.
itab-min = marc-minbe.
itab-max = marc-mabst.
itab-afrd = marc-bstrf.
itab-ikstatus = marc-mmsta.
itab-faktuur = vbrp-vbeln.
itab-fakpos = vbrp-posnr.
*UNPACK VBRP-FKIMG TO ITAB-FAKAANTAL.
*shift itab-fakaantal right by 3 places.
itab-fakaantal = vbrp-fkimg.
translate itab-fakaantal using rule.
itab-fakeenh = vbrp-meins.
itab-faktuurdat = vbrp-erdat.
*UNPACK VBRP-NETWR TO ITAB-FAKWAARDE.
*shift itab-FAKWAARDE right by 2 places.
itab-FAKWAARDE = vbrp-netwr.
Translate van velden
translate itab-fakwaarde using rule.
translate itab-fakaantal using rule.
translate itab-ordaant using rule.
translate itab-ordwaarde using rule.
translate itab-min using rule.
translate itab-max using rule.
translate itab-vkstatus using rule.
translate itab-ikstatus using rule.
itab-ordnr = vbrp-aubel.
itab-ordnrpos = vbrp-aupos.
append itab.
endif.
endselect. " Select * from vbrp.
endselect.
endform.
*& Form BUILD_XLS_DATA_TABLE
Build data table for .xls document
FORM build_xls_data_table.
CONSTANTS: con_cret TYPE x VALUE '0D', "OK for non Unicode
con_tab TYPE x VALUE '09'. "OK for non Unicode
*If you have Unicode check active in program attributes thnen you will
*need to declare constants as follows
*class cl_abap_char_utilities definition load.
*constants:
con_tab type c value cl_abap_char_utilities=>HORIZONTAL_TAB,
con_cret type c value cl_abap_char_utilities=>CR_LF.
CONCATENATE 'DEBNR' 'NAAM' 'BESTELNR'
'ARTNR' 'OMSCHRIJVING' 'TYPE'
'FABRIKAAT' 'FAKTUURDATUM' 'FAKSRT'
'FAKTUURNR' 'FAK.POS.' 'FAK.AANTAL'
'FAK.EENH' 'FAKTUUR WAARDE' 'ORDER DATUM'
'ORDSRT' 'VERKOPER' 'ORDERNR.' 'ORDER.POS.'
'ARTNR KLANT' 'ORDER AANTAL' 'ORDER EENH'
'ORDERWAARDE' 'POS.TYPE' 'GEVRAAGDE LEVDAT'
'WERKELIJKE LEVDAT' 'LEVERINGSNR' 'LEV.POS'
'LEV.AANTAL' 'LEV.EENH' 'BESTELPUNT'
'MAX VRD' 'BASISEENH' 'ABC' 'ARTSRT.'
'VK.STATUS' 'IK.STATUS' 'MIN.LEVEENH.'
'AFDRONDINGSWAARDE' 'VPRS' 'PER'
INTO it_attach SEPARATED BY con_tab.
CONCATENATE con_cret it_attach INTO it_attach.
APPEND it_attach.
LOOP AT ITAB.
CONCATENATE itab-deb itab-debnaam itab-bestnr itab-artnr
itab-oms itab-type itab-fab itab-faktuurdat
itab-faksrt itab-faktuur itab-fakpos
itab-fakaantal itab-fakeenh itab-fakwaarde
itab-orddat itab-ordsrt itab-verkoper itab-ordnr
itab-ordnrpos itab-artklant itab-ordaant
itab-ordeenh itab-ordwaarde itab-postype
itab-gevlevdat itab-levdat itab-levnr itab-levpos
itab-levaant itab-leveenh itab-min itab-max
itab-basiseenh itab-abc itab-artsoort itab-vkstatus
itab-ikstatus itab-minlev itab-afrd itab-vprs
itab-vprseenh
INTO it_attach SEPARATED BY con_tab.
CONCATENATE con_cret it_attach INTO it_attach.
APPEND it_attach.
ENDLOOP.
ENDFORM. " BUILD_XLS_DATA_TABLE
*& Form SEND_FILE_AS_EMAIL_ATTACHMENT
Send email
FORM send_file_as_email_attachment tables pit_message
pit_attach
using p_email
p_mtitle
p_format
p_filename
p_attdescription
p_sender_address
p_sender_addres_type
changing p_error
p_reciever.
DATA: ld_error TYPE sy-subrc,
ld_reciever TYPE sy-subrc,
ld_mtitle LIKE sodocchgi1-obj_descr,
ld_email LIKE somlreci1-receiver,
ld_format TYPE so_obj_tp ,
ld_attdescription TYPE so_obj_nam ,
ld_attfilename TYPE so_obj_des ,
ld_sender_address LIKE soextreci1-receiver,
ld_sender_address_type LIKE soextreci1-adr_typ,
ld_receiver LIKE sy-subrc.
ld_email = p_email.
ld_mtitle = p_mtitle.
ld_format = p_format.
ld_attdescription = p_attdescription.
ld_attfilename = p_filename.
ld_sender_address = p_sender_address.
ld_sender_address_type = p_sender_addres_type.
Fill the document data.
w_doc_data-doc_size = 1.
Populate the subject/generic message attributes
w_doc_data-obj_langu = sy-langu.
w_doc_data-obj_name = 'SAPRPT'.
w_doc_data-obj_descr = ld_mtitle .
w_doc_data-sensitivty = 'F'.
Fill the document data and get size of attachment
CLEAR w_doc_data.
READ TABLE it_attach INDEX w_cnt.
w_doc_data-doc_size =
( w_cnt - 1 ) * 255 + STRLEN( it_attach ).
w_doc_data-obj_langu = sy-langu.
w_doc_data-obj_name = 'SAPRPT'.
w_doc_data-obj_descr = ld_mtitle.
w_doc_data-sensitivty = 'F'.
CLEAR t_attachment.
REFRESH t_attachment.
t_attachment[] = pit_attach[].
Describe the body of the message
CLEAR t_packing_list.
REFRESH t_packing_list.
t_packing_list-transf_bin = space.
t_packing_list-head_start = 1.
t_packing_list-head_num = 0.
t_packing_list-body_start = 1.
DESCRIBE TABLE it_message LINES t_packing_list-body_num.
t_packing_list-doc_type = 'RAW'.
APPEND t_packing_list.
Create attachment notification
t_packing_list-transf_bin = 'X'.
t_packing_list-head_start = 1.
t_packing_list-head_num = 1.
t_packing_list-body_start = 1.
DESCRIBE TABLE t_attachment LINES t_packing_list-body_num.
t_packing_list-doc_type = ld_format.
t_packing_list-obj_descr = ld_attdescription.
t_packing_list-obj_name = ld_attfilename.
t_packing_list-doc_size = t_packing_list-body_num * 255.
APPEND t_packing_list.
Add the recipients email address
CLEAR t_receivers.
REFRESH t_receivers.
MOVE: SY-UNAME TO t_RECEIVERs-RECEIVER,
'X' TO t_RECEIVERs-EXPRESS,
'B' TO t_RECEIVERs-REC_TYPE.
APPEND t_RECEIVERs.
CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
EXPORTING
document_data = w_doc_data
put_in_outbox = 'X'
sender_address = ld_sender_address
sender_address_type = ld_sender_address_type
commit_work = 'X'
IMPORTING
sent_to_all = w_sent_all
TABLES
packing_list = t_packing_list
contents_bin = t_attachment
contents_txt = it_message
receivers = t_receivers
EXCEPTIONS
too_many_receivers = 1
document_not_sent = 2
document_type_not_exist = 3
operation_no_authorization = 4
parameter_error = 5
x_error = 6
enqueue_error = 7
OTHERS = 8.
Populate zerror return code
ld_error = sy-subrc.
Populate zreceiver return code
LOOP AT t_receivers.
ld_receiver = t_receivers-retrn_code.
ENDLOOP.
ENDFORM.
*& Form INITIATE_MAIL_EXECUTE_PROGRAM
Instructs mail send program for SAPCONNECT to send email.
FORM initiate_mail_execute_program.
WAIT UP TO 2 SECONDS.
SUBMIT rsconn01 WITH mode = 'INT'
WITH output = 'X'
AND RETURN.
ENDFORM. " INITIATE_MAIL_EXECUTE_PROGRAM
*& Form POPULATE_EMAIL_MESSAGE_BODY
Populate message body text
form populate_email_message_body.
REFRESH it_message.
it_message = 'Please find attached a list test ekpo records'.
APPEND it_message.
endform. " POPULATE_EMAIL_MESSAGE_BODYThanks Kunal Ghosh for your replies. I did try to condense it but it was still more than 255 characters.
I solved it by using chunks! I spend more than a week to solve this problem! The solution is so simple. Here's the new code for everybody who has the same problem:
REPORT ZDTAFNAME_K_ART no standard page heading line-size 250.
tables: marc,
lips,
vbrp,
mara,
kna1,
vbak,
VBKD,
vbrk,
vbap,
vbep,
mvke,
mbew.
selection-screen: begin of block select with frame title text-f70.
select-options art for marc-matnr.
select-options abc for marc-abcin.
select-options fak for vbrp-vbeln.
Select-options dat for vbrp-erdat.
select-options fsoort for vbrk-fkart.
select-options vest for marc-werks.
selection-screen: end of block select.
*parameters: p_email type somlreci1-receiver
DEFAULT '31dtg'.
data: p_email like somlreci1-receiver.
data: rule(2) value '.,'.
data: begin of itab occurs 0,
deb like vbak-kunnr, "Debiteurennummer
debnaam like kna1-name1, "Naam debiteur
bestnr like vbkd-bstkd, "Bestelnr klant
artnr like marc-matnr, "Artikelnr
oms like lips-arktx, "Omschrijving
type like mara-groes, "Type
fab like lips-matkl, "Fabrikaat
faktuurdat like vbrp-erdat, "Faktuurdatum
faksrt like vbrk-fkart, "Faktuursoort
faktuur like vbrp-vbeln, "Faktuurnr
fakpos like vbrp-posnr, "Faktuurpositie
fakaantal(11) type c , "Faktuuraantal
fakeenh like vbrp-meins, "Faktuureenheid
fakwaarde(11) type c , "Faktuurwaarde
orddat like vbap-erdat, "Orderdatum
ordsrt like vbak-auart, "Ordersoort
verkoper like vbak-ernam, "Verkoper
ordnr like lips-vgbel, "Ordernr
ordnrpos like lips-vgpos, "Order positie
artklant like vbap-kdmat, "Artikelnr klant
ordaant(11) type c, "Order aantal
ordeenh like vbap-meins, "Order eenheid
ordwaarde(11) type c, "Nettowaarde orderpositie
postype like vbap-pstyv, "Positietype
gevlevdat like vbep-edatu, "Gevraagde leverdatum
levdat like lips-erdat, "Werkelijke leverdatum
levnr like lips-vbeln, "Leveringsnr
levpos like lips-posnr, "Levering positie
levaant(11) type c, "Leveringsaantal
leveenh like lips-meins, "Leveringseenheid
min(11) type c, "Bestelpunt
max(11) type c, "Max vrd
basiseenh like mara-meins, "Basiseenheid
abc like marc-abcin, "ABC Classificatie
artsoort like mara-mtart, "Artikelsoort
vkstatus(2) type c, "Verkoopstatus
ikstatus(2) type c, "Inkoopstatus
minlev(11) type c, "Min levereenheid
afrd(11) type c, "Afrondingswaarde
vprs(11) type c, "VPRS
vprseenh(11) type c, "VPRS eenheid
end of itab.
DATA: it_message TYPE STANDARD TABLE OF solisti1 INITIAL SIZE 0
WITH HEADER LINE.
DATA: it_attach TYPE STANDARD TABLE OF solisti1 INITIAL SIZE 0
WITH HEADER LINE.
DATA: t_packing_list LIKE sopcklsti1 OCCURS 0 WITH HEADER LINE,
t_contents LIKE solisti1 OCCURS 0 WITH HEADER LINE,
t_receivers LIKE somlreci1 OCCURS 0 WITH HEADER LINE,
t_attachment LIKE solisti1 OCCURS 0 WITH HEADER LINE,
t_object_header LIKE solisti1 OCCURS 0 WITH HEADER LINE,
w_cnt TYPE i,
w_sent_all(1) TYPE c,
w_doc_data LIKE sodocchgi1,
gd_error TYPE sy-subrc,
gd_reciever TYPE sy-subrc.
*START_OF_SELECTION
START-OF-SELECTION.
Retrieve sample data from table ekpo
PERFORM data_retrieval.
Populate table with detaisl to be entered into .xls file
PERFORM build_xls_data_table.
*END-OF-SELECTION
END-OF-SELECTION.
Populate message body text
perform populate_email_message_body.
Send file by email as .xls speadsheet
PERFORM send_file_as_email_attachment
tables it_message
it_attach
using p_email
'Xls bestand afname per artikelsoort'
'XLS'
'filename'
changing gd_error
gd_reciever.
Instructs mail send program for SAPCONNECT to send email(rsconn01)
PERFORM initiate_mail_execute_program.
*& Form DATA_RETRIEVAL
Retrieve data form EKPO table and populate itab it_ekko
FORM data_retrieval.
select * from vbrk client specified where
mandt = sy-mandt and
vbeln in fak and
erdat in dat and
fkart in fsoort.
select * from vbrp client specified where
mandt = sy-mandt and
vbeln = vbrk-vbeln and
matnr in art.
select single * from marc client specified where
mandt = sy-mandt and
werks in vest and
matnr = vbrp-matnr and
abcin in abc.
if sy-subrc = 0.
itab-levnr = vbrp-vgbel.
itab-levpos = vbrp-vgpos.
itab-faksrt = vbrk-fkart.
select single * from mara client specified where
mandt = sy-mandt and
matnr = marc-matnr.
if sy-subrc = 0.
itab-type = mara-groes.
itab-basiseenh = mara-meins.
endif.
select single * from mvke client specified where
mandt = sy-mandt and
matnr = marc-matnr.
if sy-subrc = 0.
itab-vkstatus = mvke-vmsta.
itab-minlev = mvke-scmng.
endif.
select single * from mbew client specified where
mandt = sy-mandt and
matnr = marc-matnr and
bwkey = 610.
if sy-subrc = 0.
itab-vprs = mbew-verpr.
itab-vprseenh = mbew-peinh.
endif.
select single * from vbak client specified where
mandt = sy-mandt and
vbeln = vbrp-aubel.
if sy-subrc = 0.
itab-deb = vbak-kunnr.
itab-ordsrt = vbak-auart.
endif.
select single * from vbap client specified where
mandt = sy-mandt and
vbeln = vbrp-aubel and
posnr = vbrp-aupos.
if sy-subrc = 0.
itab-verkoper = vbap-ernam.
itab-orddat = vbap-erdat.
itab-artklant = vbap-kdmat.
itab-ordaant := vbap-kwmeng.
itab-ordeenh = vbap-meins.
itab-ordwaarde := vbap-netwr.
itab-postype = vbap-pstyv.
endif.
select single * from vbep client specified where
mandt = sy-mandt and
vbeln = vbap-vbeln and
posnr = vbap-posnr and
etenr = '0001'.
if sy-subrc = 0.
itab-gevlevdat = vbep-edatu.
endif.
select single * from vbkd client specified where
mandt = sy-mandt and
vbeln = vbak-vbeln.
if sy-subrc = 0.
itab-bestnr = vbkd-bstkd.
endif.
select single * from lips client specified where
mandt = sy-mandt and
vbeln = vbrp-vgbel and
posnr = vbrp-vgpos.
if sy-subrc = 0.
itab-levdat = lips-erdat.
itab-levaant = lips-lfimg.
itab-leveenh = lips-meins.
else.
clear itab-levnr.
clear itab-levpos.
clear itab-levaant.
clear itab-levdat.
endif.
select single * from kna1 client specified where
mandt = sy-mandt and
kunnr = vbak-kunnr.
if sy-subrc = 0.
itab-debnaam = kna1-name1.
endif.
itab-artnr = marc-matnr.
itab-oms = vbrp-arktx.
itab-fab = vbrp-matkl.
itab-abc = marc-abcin.
itab-artsoort = mara-mtart.
itab-min = marc-minbe.
itab-max = marc-mabst.
itab-afrd = marc-bstrf.
itab-ikstatus = marc-mmsta.
itab-faktuur = vbrp-vbeln.
itab-fakpos = vbrp-posnr.
*UNPACK VBRP-FKIMG TO ITAB-FAKAANTAL.
*shift itab-fakaantal right by 3 places.
itab-fakaantal = vbrp-fkimg.
translate itab-fakaantal using rule.
itab-fakeenh = vbrp-meins.
itab-faktuurdat = vbrp-erdat.
*UNPACK VBRP-NETWR TO ITAB-FAKWAARDE.
*shift itab-FAKWAARDE right by 2 places.
itab-FAKWAARDE = vbrp-netwr.
Translate van velden
translate itab-fakwaarde using rule.
translate itab-fakaantal using rule.
translate itab-ordaant using rule.
translate itab-ordwaarde using rule.
translate itab-min using rule.
translate itab-max using rule.
translate itab-vkstatus using rule.
translate itab-ikstatus using rule.
translate itab-VPRS using rule.
translate itab-vprseenh using rule.
translate itab-levaant using rule.
translate itab-minlev using rule.
translate itab-afrd using rule.
itab-ordnr = vbrp-aubel.
itab-ordnrpos = vbrp-aupos.
append itab.
clear itab.
endif.
endselect. " Select * from vbrp.
endselect. " Select * from vbrk.
endform.
*& Form BUILD_XLS_DATA_TABLE
Build data table for .xls document
FORM build_xls_data_table.
CONSTANTS: con_cret TYPE x VALUE '0D', "OK for non Unicode
con_tab TYPE x VALUE '09'. "OK for non Unicode
*If you have Unicode check active in program attributes thnen you will
*need to declare constants as follows
*class cl_abap_char_utilities definition load.
*constants:
con_tab type c value cl_abap_char_utilities=>HORIZONTAL_TAB,
con_cret type c value cl_abap_char_utilities=>CR_LF.
<b>
CONCATENATE 'DEBNR' 'NAAM' 'BESTELNR'
'ARTNR' 'OMSCHRIJVING' 'TYPE'
'FABRIKAAT' 'FAKTUURDATUM' 'FAKSRT'
'FAKTUURNR' 'FAK.POS.' 'FAK.AANTAL'
'FAK.EENH' 'FAKTUUR WAARDE' 'ORDER DATUM'
'ORDSRT' 'VERKOPER' 'ORDERNR.' 'ORDER.POS.'
'ARTNR KLANT' 'ORDER AANTAL'
INTO it_attach SEPARATED BY con_tab.
CONCATENATE con_cret it_attach INTO it_attach.
APPEND it_attach.
CONCATENATE con_tab 'ORDER EENH' 'ORDERWAARDE'
'POS.TYPE' 'GEVRAAGDE LEVDAT'
'WERKELIJKE LEVDAT' 'LEVERINGSNR' 'LEV.POS'
'LEV.AANTAL' 'LEV.EENH' 'BESTELPUNT'
'MAX VRD' 'BASISEENH' 'ABC' 'ARTSRT.'
'VK.STATUS' 'IK.STATUS' 'MIN.LEVEENH.'
'AFDRONDINGSWAARDE' 'VPRS' 'PER'
INTO it_attach SEPARATED BY con_tab.
APPEND it_attach.
LOOP AT ITAB.
CONCATENATE itab-deb itab-debnaam itab-bestnr itab-artnr
itab-oms itab-type itab-fab itab-faktuurdat
itab-faksrt itab-faktuur itab-fakpos
itab-fakaantal itab-fakeenh itab-fakwaarde
itab-orddat itab-ordsrt itab-verkoper itab-ordnr
itab-ordnrpos itab-artklant itab-ordaant
INTO it_attach SEPARATED BY con_tab.
CONCATENATE Con_cret it_attach INTO it_attach.
APPEND it_attach.
CONCATENATE con_tab itab-ordeenh itab-ordwaarde itab-postype
itab-gevlevdat itab-levdat itab-levnr itab-levpos
itab-levaant itab-leveenh itab-min itab-max
itab-basiseenh itab-abc itab-artsoort itab-vkstatus
itab-ikstatus itab-minlev itab-afrd itab-vprs
itab-vprseenh
INTO it_attach SEPARATED BY con_tab.
APPEND it_attach.
ENDLOOP.</b>
ENDFORM. " BUILD_XLS_DATA_TABLE
*& Form SEND_FILE_AS_EMAIL_ATTACHMENT
Send email
FORM send_file_as_email_attachment tables pit_message
pit_attach
using p_email
p_mtitle
p_format
p_filename
p_attdescription
p_sender_address
p_sender_addres_type
changing p_error
p_reciever.
DATA: ld_error TYPE sy-subrc,
ld_reciever TYPE sy-subrc,
ld_mtitle LIKE sodocchgi1-obj_descr,
ld_email LIKE somlreci1-receiver,
ld_format TYPE so_obj_tp ,
ld_attdescription TYPE so_obj_nam ,
ld_attfilename TYPE so_obj_des ,
ld_sender_address LIKE soextreci1-receiver,
ld_sender_address_type LIKE soextreci1-adr_typ,
ld_receiver LIKE sy-subrc.
ld_email = p_email.
ld_mtitle = p_mtitle.
ld_format = p_format.
ld_attdescription = p_attdescription.
ld_attfilename = p_filename.
ld_sender_address = p_sender_address.
ld_sender_address_type = p_sender_addres_type.
Fill the document data.
w_doc_data-doc_size = 1.
Populate the subject/generic message attributes
w_doc_data-obj_langu = sy-langu.
w_doc_data-obj_name = 'SAPRPT'.
w_doc_data-obj_descr = ld_mtitle .
w_doc_data-sensitivty = 'F'.
Fill the document data and get size of attachment
CLEAR w_doc_data.
READ TABLE it_attach INDEX w_cnt.
w_doc_data-doc_size =
( w_cnt - 1 ) * 255 + STRLEN( it_attach ).
w_doc_data-obj_langu = sy-langu.
w_doc_data-obj_name = 'SAPRPT'.
w_doc_data-obj_descr = ld_mtitle.
w_doc_data-sensitivty = 'F'.
CLEAR t_attachment.
REFRESH t_attachment.
t_attachment[] = pit_attach[].
Describe the body of the message
CLEAR t_packing_list.
REFRESH t_packing_list.
t_packing_list-transf_bin = space.
t_packing_list-head_start = 1.
t_packing_list-head_num = 0.
t_packing_list-body_start = 1.
DESCRIBE TABLE it_message LINES t_packing_list-body_num.
t_packing_list-doc_type = 'RAW'.
APPEND t_packing_list.
Create attachment notification
t_packing_list-transf_bin = 'X'.
t_packing_list-head_start = 1.
t_packing_list-head_num = 1.
t_packing_list-body_start = 1.
DESCRIBE TABLE t_attachment LINES t_packing_list-body_num.
t_packing_list-doc_type = ld_format.
t_packing_list-obj_descr = ld_attdescription.
t_packing_list-obj_name = ld_attfilename.
t_packing_list-doc_size = t_packing_list-body_num * 255.
APPEND t_packing_list.
Add the recipients email address
CLEAR t_receivers.
REFRESH t_receivers.
MOVE: SY-UNAME TO t_RECEIVERs-RECEIVER,
'X' TO t_RECEIVERs-EXPRESS,
'B' TO t_RECEIVERs-REC_TYPE.
APPEND t_RECEIVERs.
CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
EXPORTING
document_data = w_doc_data
put_in_outbox = 'X'
sender_address = ld_sender_address
sender_address_type = ld_sender_address_type
commit_work = 'X'
IMPORTING
sent_to_all = w_sent_all
TABLES
packing_list = t_packing_list
contents_bin = t_attachment
contents_txt = it_message
receivers = t_receivers
EXCEPTIONS
too_many_receivers = 1
document_not_sent = 2
document_type_not_exist = 3
operation_no_authorization = 4
parameter_error = 5
x_error = 6
enqueue_error = 7
OTHERS = 8.
Populate zerror return code
ld_error = sy-subrc.
Populate zreceiver return code
LOOP AT t_receivers.
ld_receiver = t_receivers-retrn_code.
ENDLOOP.
ENDFORM.
*& Form INITIATE_MAIL_EXECUTE_PROGRAM
Instructs mail send program for SAPCONNECT to send email.
FORM initiate_mail_execute_program.
WAIT UP TO 2 SECONDS.
SUBMIT rsconn01 WITH mode = 'INT'
WITH output = 'X'
AND RETURN.
ENDFORM. " INITIATE_MAIL_EXECUTE_PROGRAM
*& Form POPULATE_EMAIL_MESSAGE_BODY
Populate message body text
form populate_email_message_body.
REFRESH it_message.
it_message = 'Deze mail is automatisch gemaakt door transactie ZAKA'.
APPEND it_message.
endform. " POPULATE_EMAIL_MESSAGE_BODY -
How to display more than 255 chars in background job with ALV Grid ????
Hi All,
I am using ALV grid with OO.
I have used call screen for ALV grid display. I have to display more than 255 characters in width. While running it, I can see the list perfectly.
But in background mode, the list is truncated after 255 chars.
Can anybody help how to send complete list(width more than 255 chars) to spool.
Thanks and Regards,
NehaHi SAP fan,
<b>YES you can run the ALV report in background mode.
To run the report in background do F9 instead of F8, then give immediate and save.
Now goto Sm35 goto job overview and view the job listed
Choose the job and press the spool button. It will show the list created on the next page. When u clcik the list u can see the ALV output.
To see this the job should be in the finished status.
How to define Periodic Jobs
1.Execute transaction SM36
2.Define Job name, Job class, Target server
3.Click on 'START CONDITION' button
4.Click on 'Date/Time' button
5.Enter Scheduled start DATE & TIME. Check mark 'Periodic Job' field. Click on 'Period values' button and select 'Hourly' or 'Dialy' or 'Weekly' or 'Monthly' or Other period and SAVE. Go back to main screen.
6.Click on 'STEPS' button and enter Program name and Variant under box 'ABAP Program'. Click on 'Print Specification' button and enter Printer name under 'Output device' and SAVE
7.Click on SAVE button until you get message on bottom of the screen that describes 'Job XYZ saved with status: Scheduled'.
8.Click on 'Job overview' button or execute SM37 transaction.
9.Select the appropriate 'Job name', 'User name', 'Job Status' & Schedule date under 'Job start condition' and click on 'Execute' button or press F8.
10.You will now see all your scheduled JOBS.
<b>Case: 2</b>
You can Run in Background but make sure it is alv list, not alv Grid FM. if you are uisng alv list not problem , but if you are using alv grid then you can code like this..
if sy-batch = ' '.
call 'REUSE_ALV_GRID_DISPLAY'.
else.
call 'REUSE_ALV_LIST_DISPLAY'.
endif.
if you are using OO alv then write this code..
CALL METHOD cl_gui_alv_grid=>offline
RECEIVING e_offline = off.
IF off IS INITIAL.
CREATE OBJECT g_custom_container
EXPORTING container_name = g_container.
ENDIF.
<b>Case: 3</b>
if you are using OO ALV.
Just before creating the custom container check for the following condition.
Batch or Web Reporting
IF cl_gui_alv_grid=>offline( ) IS INITIAL.
CREATE OBJECT o_custcontainer
EXPORTING
container_name = lc_custcontrol
EXCEPTIONS
cntl_error = 1
cntl_system_error = 2
create_error = 3
lifetime_error = 4
lifetime_dynpro_dynpro_link = 5
OTHERS = 6
ENDIF.
You can see the output in Spool in transaction SP01.</b>
Good Luck and thanks
AK -
ABAP Programming to display more than 255 characters in the screen
Hi
I want to display more than 255 characters in the screen after executing a report but i cant able to do that.
Please help me to find out the solution.
Thanks
Mrutyunjaya TrpathyHai tripathy,
when the output of a report contains columns extending more than 255 characters in length. In such cases, this set of ALV functions can help choose selected columns and arrange the different columns from a report output and also save different variants for report display. This is a very efficient tool for dynamically sorting and arranging the columns from a report output. The report output can contain upto 90 columns in the display with the wide array of display options.
The commonly used ALV functions used for this purpose are;
1.REUSE_ALV_VARIANT_DEFAULT_GET
2.REUSE_ALV_VARIANT_F4
3.REUSE_ALV_VARIANT_EXISTENCE
4.REUSE_ALV_EVENTS_GET
5.REUSE_ALV_COMMENTARY_WRITE
6.REUSE_ALV_FIELDCATALOG_MERGE
7.REUSE_ALV_LIST_DISPLAY
8.REUSE_ALV_GRID_DISPLAY
9.REUSE_ALV_POPUP_TO_SELECT
hope u can try in this way.
REGARDS,
PRABA. -
More than 255 characters in background
HI,
My report width is 275 which is displaying when run in front ground. but when run in background it truncates after the 255 characters.
We have created a format using 'SPAD' of width 300, area is showing but the data is not showing after 255.
I have mention line-size 275 in report, i tried this without mentioning line-size but the result is same. it gets truncates after 255, empty area is showing after 255 if we use width 300 format...
ThanksHi,
After creation of the new format, run the job with the new format ie. attach the new format to your printer, and run the job.
Now take the spool number and put it as a parameters to the following program .
Hope it work fine.
Rewards points if useful.
Here is the code:
Display spool list > 255 columns
This is a SAP utility report to allow display of
spool request lists with more than 255 columns in
releases 4.6B and 4.6C (4.6D kernel must be used)
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
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-SUBRC <> 0.
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-SUBRC <> 0.
WRITE: / 'No authorization to display'(002).
EXIT.
ENDIF.
PERFORM READ_DATA TABLES BUFFER
USING TSP01 FIRSTL LASTL.
IF SY-SUBRC <> 0.
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 STATUS <> 6. " 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 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 STATUS <> 0 AND STATUS <> 40 AND STATUS <> 12.
PERFORM CLOSE_JOB.
EXIT.
ENDIF.
IF STATUS <> 12. " 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 LINES < FIRST .
PERFORM CLOSE_JOB.
EXIT.
ENDIF.
EXIT.
ENDIF.
ENDDO.
PERFORM CLOSE_JOB.
ENDIF.
ENDFORM.
FORM CLOSE_JOB *
FORM CLOSE_JOB.
IF STATUS <> 0 AND STATUS <> 12.
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 STATUS <> 0.
MESSAGE E112(PO) WITH STATUS RC ERRMSG RAISING READ_ERROR.
ENDIF.
ENDFORM.
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 < 80 OR V IS INITIAL.
GCOL = 255.
ENDIF.
IF GLINES < 5 OR V2 IS INITIAL.
GLINES = 0.
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_POS < 2.
write at / ' ' no-gap.
NEW-LINE.
LPOS = 1.
ELSE.
LPOS = START_POS.
ENDIF.
REST_LEN = STRLEN( SPOOL_DATA ).
DESCRIBE FIELD SPOOL_DATA LENGTH AREA_LEN.
IF DATA_LENGTH = 0.
" fine.
ELSEIF DATA_LENGTH .
MODAB
PERFORM WRITE_BIGFIELD USING
NEXT_HOT
LPOS.
WRITE AT LPOS <PLAIN_TEXT> NO-GAP.
ADD NEXT_HOT TO LPOS.
SUBTRACT NEXT_HOT FROM REST_LEN.
ASSIGN +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 .
ELSE.
EXIT.
ENDIF.
ENDWHILE.
MODAB
IF REST_LEN > 0.
ASSIGN .
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. -
Spool request with more than 255 columns
Hi,
Please let me know what formatting type has to be used to have spool output with more than 255 lines.
X_24_80_JP L ANY 00024 00080 ABAP list HR Japan: At least 24 rows by 80 columns
X_44_120 L ANY 00044 00120 ABAP/4 list: At least 44 rows by 120 columns
X_51_140_JP L ANY 00051 00140 ABAP list HR Japan: At least 51 rows by 140 columns
X_58_170 L ANY 00058 00170 ABAP/4 list: At least 58 rows by 170 columns
X_60_80_JP L ANY 00060 00080 ABAP list HR Japan: At least 60 rows by 80 columns
X_65_1024/4 L ANY 00065 01024 ABAP List: At Least 65 Lines 4*256=1024 Columns Four-Sided (Only for SAPlpd)
X_65_132 L ANY 00065 00132 ABAP list: At least 65 rows by 132 columns
X_65_132-2 L ANY 00065 00132 ABAP List: 2-column 65 characters 132 columns (only for SAPLPD from 4.15)
X_65_200 L ANY 00065 00200 ABAP list: at least 65 lines with 200 columns (not for all device types)
X_65_255 L ANY 00065 00255 ABAP/4 list: At least 65 rows with a maximum number of columns
X_65_256/2 L ANY 00065 00256 ABAP list: At least 65 lines 2*128=256 double columns (SAPLPD only)
X_65_512/2 L ANY 00065 00512 ABAP List: At least 65 Lines 2*256=512 Columns 2-sided (Only for SAPlpd)
X_65_80 L ANY 00065 00080 ABAP/4 list: At least 65 rows by 80 columns
X_65_80-2 L ANY 00065 00080 ABAP List: 2-column 65 characters 80 columns (only for SAPLPD from 4.15)
X_65_80-4 L ANY 00065 00080 ABAP List: 4-column 65 characters 80 columns (only for SAPLPD from 4.15)
X_90_120 L ANY 00090 00120 ABAP list: At least 90 rows by 120 columns
X_PAPER L ANY 00010 00010 ABAP/4 list: Default list formatting
X_PAPER_NT L ANY 00001 00001 ABAP/4 list: Obsolete (do not use)
X_POSTSCRIPT L ANY 00001 00001 Pre-prepared PostScript
X_SPOOLERR L ANY 00001 00001 ABAP list: Spooler problem report
X_TELEX L TELEX 00001 00001 Telex: 69 characters wide, only as many lines as supported by TTU
ZABC_SAP L ANY 00065 00550 LCM Report Page Type
I have created a custom Format Type with 65*550 (ZABC_SAP) , but still the output gets truncated in the spool.
In sp01 . For the spool request ... If it displayed in Graphical layoout ... Output is getting truncated but when we see in Raw format .. i can see the entire output. But it is not at all formatted.
Thanks,
Tanuj
Message was edited by:
Tanuj Kumar BolisettyHello Tanuj,
You need to use a page format greater than 255 columns for sure. However still if it does not solve the issue then you may consider using the note 186603.
PS: I guess you are on a higher release than 4.6 C . For this release this note íIt has a text attachment for a report tat allows to display such spool requests.
Regards.
Ruchit. -
More than 255 characters need to be populated in text file of destination.
Dear experts,
i am having following scenario in which i am sending the file to a destination system through RFC connection which is having more than 255 characters, But it is not allowing me to enter more than 255
The code i have written is mentioned below,
lv_string = '///++++#####$$&&^%$%@$$@@(&@&@#%@&%#464(@)))(@&@&&@*&@)@(&@@%&%&@&@*@&@&&*@&*****^&&*&%$%$$#$##@#$@%%&&*******(((((((((((((((&!@#$$%%%&&(()))_(**&&&&&^^^^%%%%$$$$###'.
itab-l_string = lv_string.
CONCATENATE itab-l_string itab-l_string itab-l_string into itab-l_string.
CONDENSE itab-l_string.
Append Itab.
call function 'RFC_REMOTE_FILE'
DESTINATION 'BJRFC'
EXPORTING
FILE = 'D:\tmp\test_ster3.txt'
WRITE = 'X'
*FILETYPE = ''
TABLES
FILEDATA = itab
exceptions
system_failure = 1 message dg_ermsg
communication_failure = 2 message dg_ermsg.
Can anybody suggest me how to fetch the requireoutput.Dear alex,
With this output the the following cases appearing in system,
1) rfc connection is getting failed due to excess length, no file generated
2)Some times o/p file getting generated with 0KB, i mean there is no data in the output.
Once agian i am putting the code here
Kindl suggest
*& Report Z_ZIC_ZI001
REPORT Z_ZIC_ZI001 line-SIZE 250.
Data : lv_string type string,
dg_ermsg TYPE char120.
Types : begin of ty_itab,
l_string(2050) type c,
l_string type string,
end of ty_itab.
data : itab type ty_itab occurs 0 with HEADER LINE.
lv_string = 'I am having following scenario in which i am sending the file to a destination system through RFC connection which is having more than 255 characters, But it is not allowing to enter more than 255 XXXXXXXXXXXXXXFFAFFAGAGAGAGAGG'.
CONCATENATE lv_string lv_string lv_string into lv_string.
CONDENSE lv_string.
*while strlen( lv_string ) > 255.
itab-l_string = lv_string+0(255).
append itab.
lv_string = lv_string+255.
*endwhile.
itab-l_string = lv_string.
append itab.
call function 'RFC_REMOTE_FILE'
DESTINATION 'BJRFC'
EXPORTING
FILE = 'D:\tmp\test_ster5.txt'
WRITE = 'X'
*FILETYPE = ''
TABLES
FILEDATA = itab
exceptions
system_failure = 1 message dg_ermsg
communication_failure = 2 message dg_ermsg.
if sy-subrc = 0.
write : 'success'.
else .
write : dg_ermsg.
endif.
Maybe you are looking for
-
I have a problem with my Iphone 5 all sounds not working
sounds not working at all with my iphone 5.
-
Gebruik sinds kort Imovie 10.0.4. Kan in deze versie geen clips meer versneld of vertraagd weergeven. In het menu blijven de waardes grijs. Zie bijgevoegde schermafbeelding.
-
Rounding minutes to nearest five.
Hi, I have tried the various methods suggested on other forum messages but to no avail. I have a GUI that acts as the client for a reminder system i am making for some coursework. It contains a combo box with values for the user to select a time from
-
We use iPads to access PDF prints in a manufacturing environment. We now can't access a version of the app that is compatible with ourhardware. Is there an access point to get the older apps?
-
Help I just got and Ipad 3 went through the process of connecting to icloud my wife then got a iphone 4 I was told that we can sych the 2 devices so that calandars contacts etc are common on both devices. I have an account id for the ipad on icloud d