Printing report list output in A4 paper
Hi!
Is it possible to fit the list output of a report having a line-size of 240 into an A4 paper ?...when I was trying to print the output is being cut. Some columns at the right were not printed since all columns do not fit on the paper even on landscape. The system defaults format is X_65_255 which has 65 rows and 255 lines. How can I make it fit an A4 paper?
Thanks in advance!
Hi Mervin,
To make printing possible on A4 paper you'll need to define a new output format.
For this use transaction SPAD.
Press the button "Full Administration" (F7).
Select the tab "Device Types".
Press the button "Page formats".
Set the screen in Change Mode (press Change button or F8).
Press the Create button (Shift+F1).
Give a name (starting with Z, like Z_LAND).
Select Orientation "Landscape".
Set papersize width/unit to 255 CH
Set papersize height/unit to 65 LN
Save your work.
Go back to tha SPAD tabpages.
Press the button "Format Types".
Set the screen in Change Mode (press Change button or F8).
Press the Create button (Shift+F1).
Enter in the screen a format name (starting with Z or Y).
Set the format type to type L (Format type for ABAP lists).
Set the page format to your created format (like Z_LAND).
Enter the number of lines that can be printed on A4 (e.g. 65)
Enter the number characters (columns) that can be printed on one row on A4 (e.g. 255).
Give a comprehensive comment.
Save your work.
Go back to tha SPAD tabpages.
Select tab "Devices / servers".
Press the button "Output devices".
Select your printer.
Set the screen in Change Mode (press Change button or F8).
Go to tabpage "Tray info".
Choose the right tray for your selected printer and fill in the previously created page format.
Save your work.
Leave transaction SPAD.
This format can be used to print your reports.
Remove your own printerdefault (Via menu System --> User profile --> Own data, tabpage Defaults).
When printing a dialog appears where you now can choose the modified printer (with modified page settings).
As you can see, this is more of a job the the admin guys.
As a remark: The default page formax X_65_255 should print 255 columns on paper (landscape). Most likely a small character set is used for this. The character size can also be modified (in the same transaction) to fit an entire row.
Hope this gives you a clue where you can influence the way lists are printed.
Regards,
Rob.
Similar Messages
-
Is there any way to set a default printer in the program for printing the list output?
Jyotsna loombaHi,
When you get the list output .
click on print button to print it. A dialog box will come.
In that dialog box, there will be settings button . when you click on this button, you will get many options and the value of those options that can be set defualt for that report output.
In that there is s option of printer , select that option and enter a value and then set that as default.
I hope this will solve your problem.
For any more help, please revert back.
Thanks and regards
Gurpreet Singh -
PRINTING A LIST OUTPUT WITHOUT USING SP01 TCODE
Dear All
I have developed an pf report which is of list output format i have used WRITE statements ...and i want to print this output ; like whenever i click print option on menu bar it should ask for print preview option and after confirmation i will print it without going to SP01 tcode .is there any way i could achieve this functionality .. kindly help me in this regard or suggest me a better way of doing it
Thanking youdo a F1 on NEW-PAGE statement its all there...
-
Printing the list output.
Hi All,
I want to print the output of the report. I am printing it using NEW-PAGE PRINT ON . and concluded by NEW-PAGE PRINT OFF. I am doing this under the usercommand. The problem is,, when I say print,(user command), I can print the output but the it is leading to the previous screen. I want to be in the same screen after my printing. I am pasting the code also. Can any one suggest me, where I am doing the mistake.
<b><REMOVED BY MODERATOR></b>
CASE P_UCOMM1.
WHEN 'PRINT11'.
CALL FUNCTION 'GET_PRINT_PARAMETERS'
EXPORTING
COPIES = '1'
DESTINATION = 'LOCL'
IMMEDIATELY = 'X'
LINE_COUNT = 25
LINE_SIZE = 132
NO_DIALOG = 'X'
USER = SY-UNAME
ABAP_LIST = 'X'
IMPORTING
OUT_PARAMETERS = L_PARAMS
VALID = L_VALID.
&--'REUSE_ALV_HIERSEQ_LIST_DISPLAY'--
DATA:FLAG(1).
CLEAR FLAG.
IF L_VALID <> SPACE.
NEW-PAGE PRINT ON PARAMETERS L_PARAMS NO DIALOG.
CALL FUNCTION 'REUSE_ALV_HIERSEQ_LIST_DISPLAY'
EXPORTING
I_CALLBACK_PROGRAM = GD_REPID
I_CALLBACK_PF_STATUS_SET = 'PF_STATUS_SET1'
I_CALLBACK_USER_COMMAND = 'EXEC'
IS_LAYOUT = M_LAYOUT
IT_FIELDCAT = I_FLDCATALOG
IT_EVENTS = I_EVENTS
I_TABNAME_HEADER = 'I_MHEAD'
I_TABNAME_ITEM = 'I_MITEM'
IS_KEYINFO = M_KEYINFO
TABLES
T_OUTTAB_HEADER = I_MHEAD
T_OUTTAB_ITEM = I_MITEM.
REFRESH I_FLDCATALOG.
CLEAR M_LAYOUT.
CLEAR M_KEYINFO.
NEW-PAGE PRINT OFF.
CLEAR L_PARAMS.
CLEAR L_VALID.
ENDIF.
LOOP AT I_HITEM INTO W_HITEM.
IF W_HITEM-CHECK = 'X'.
W_HITEM-PFLAG = 'PRINTED'.
MODIFY I_HITEM FROM W_HITEM INDEX SY-TABIX TRANSPORTING PFLAG
ENDIF.
ENDLOOP.
IF SY-SUBRC = 0.
LOOP AT I_PFLAG INTO W_PFLAG.
UPDATE RESB SET WEMPF = 'X'
WHERE AUFNR = W_PFLAG-AUFNR
AND MATNR = W_PFLAG-MATNR
AND DUMPS = 'X'.
COMMIT WORK.
WAIT UP TO 1 SECONDS.
ENDLOOP.
ENDIF.
ENDCASE.
Thanks
Ramesh.
Message was edited by:
Alvaro Tejada GalindoHi,
When you get the list output .
click on print button to print it. A dialog box will come.
In that dialog box, there will be settings button . when you click on this button, you will get many options and the value of those options that can be set defualt for that report output.
In that there is s option of printer , select that option and enter a value and then set that as default.
I hope this will solve your problem.
For any more help, please revert back.
Thanks and regards
Gurpreet Singh -
Regarding Downloading of Report[List] output into Excel Sheet
Hi All,
Hi i have written one Classical report. I got the output Correctly.
Now i want to download that data into Excel Sheet in excatly the way it displayed in List[Report] output.
I had followed the path <b>System->List->Save->LocalFile->Spread Sheet</b> and tried to download the same.
Though it is downloaded it has not come in exact format.
Now what i want is to add a button above that report & write a program in that to download that data into Excel Sheet.
Can anybody tell me how can solve this issue. If i follow above procedure will the data[List Output] be downloaded into exact format into excel.
If anybody knows other way please sujjest.
Thanks in advance.
Thanks & Regards,
Prasad.Hi Prasad,
I have done a program which downloads the output in the excel sheet in the correct format.
Just check the program. The code given in bold is what you have to use.
REPORT zexp MESSAGE-ID f4 LINE-SIZE 195.
Tables Used ***********************************
TABLES : bseg, bkpf, bsak, lfa1, payr .
Declaring Internal Tables **************************
DATA :
Internal table to hold header data *************
BEGIN OF header OCCURS 0,
ext_date(10) TYPE c,
delimit(1) TYPE c,
ext_time(8) TYPE c,
END OF header,
Internal table to hold detail info **************
BEGIN OF i_data OCCURS 0,
belnr LIKE bsak-belnr,
gjahr LIKE bsak-gjahr,
bukrs LIKE bsak-bukrs,
bldat LIKE bsak-bldat,
xblnr LIKE bsak-xblnr,
blart LIKE bsak-blart,
augdt LIKE bsak-augdt,
augbl LIKE bsak-augbl,
wrbtr LIKE bsak-wrbtr,
shkzg LIKE bsak-shkzg,
lifnr LIKE bsak-lifnr,
name1 LIKE lfa1-name1,
chect LIKE payr-chect,
status(1) TYPE c,
END OF i_data,
Internal table to to collect *****************
BEGIN OF i_data1 OCCURS 0,
belnr LIKE bsak-belnr,
gjahr LIKE bsak-gjahr,
bukrs LIKE bsak-bukrs,
bldat LIKE bsak-bldat,
xblnr LIKE bsak-xblnr,
blart LIKE bsak-blart,
augdt LIKE bsak-augdt,
augbl LIKE bsak-augbl,
wrbtr LIKE bsak-wrbtr,
shkzg LIKE bsak-shkzg,
lifnr LIKE bsak-lifnr,
name1 LIKE lfa1-name1,
sortl LIKE lfa1-sortl,
chect LIKE payr-chect,
status(1) TYPE c,
END OF i_data1,
String variables for formatting file data *************
fidoc_year TYPE string,
comp_code TYPE string,
check_numbr TYPE string,
vendor TYPE string,
inv_date TYPE string,
inv_nbr TYPE string,
paid_dat TYPE string,
inv_amt TYPE string,
status TYPE string,
ref_doc TYPE string,
************Internal table to store the file contents **************
BEGIN OF i_final_file OCCURS 0,
record(300) TYPE c,
END OF i_final_file,
Internal table to store the list of allowed document types ****
BEGIN OF i_doctype OCCURS 0,
blart LIKE bsak-blart,
END OF i_doctype,
Internal table to hold vendor information ************
BEGIN OF i_lfa1 OCCURS 0,
lifnr LIKE lfa1-lifnr,
name1 LIKE lfa1-name1,
sortl LIKE lfa1-sortl,
END OF i_lfa1,
Internal table to hold check information *************
BEGIN OF i_payr OCCURS 0,
chect LIKE payr-chect,
vblnr LIKE payr-vblnr,
gjahr LIKE payr-gjahr,
zbukr LIKE payr-zbukr,
END OF i_payr.
Data declarations **************************
DATA : ws_stblg TYPE bkpf-stblg,
todate TYPE bsak-augdt,
fromdate TYPE bsak-augdt,
w_day LIKE dtresr-weekday,
day LIKE scal-indicator,
d TYPE n,
e_date LIKE sy-datum,
e_time LIKE sy-uzeit,
dd(2) TYPE c,
mm(2) TYPE c,
yy(4) TYPE c,
hh(2) TYPE c,
min(2) TYPE c,
sec(2) TYPE c.
DATA : wa_filepath(50) TYPE c,
wa_filename(50) TYPE c,
wa_c_filename(100) TYPE c,
arch_path(50) TYPE c.
<b>* Data for downloading to list
DATA : list LIKE TABLE OF abaplist WITH HEADER LINE.
DATA : BEGIN OF list_asc OCCURS 0,
msg(300) TYPE c,
END OF list_asc.
DATA: BEGIN OF i_invoiceheader OCCURS 0,
name(30) TYPE c,
END OF i_invoiceheader.
RANGES dates FOR bkpf-budat.</b>
Selection Screen ************************
SELECTION-SCREEN SKIP 2.
SELECT-OPTIONS:
s_bukrs FOR bkpf-bukrs ,
s_blart FOR bkpf-blart ,
s_augdt FOR bsak-augdt. " memory id todat TO fromdat.
PARAMETERS :submit AS CHECKBOX DEFAULT ' ' .
<b>* Download list to file.
AT USER-COMMAND.
CASE sy-ucomm.
WHEN 'LIST'.
PERFORM download.
WHEN 'BACK'.
EXIT.
ENDCASE.</b>
<b>----
FORM download *
FORM download.
if s_augdt is initial.
dates-sign = 'I'.
dates-option = 'BT'.
dates-low = '20050901'.
dates-high = '20050920'.
APPEND dates.
else.
dates = s_augdt.
append dates.
endif.
/* Submit the same program .
SUBMIT zexp WITH s_augdt IN dates
EXPORTING LIST TO MEMORY
AND RETURN.
CALL FUNCTION 'LIST_FROM_MEMORY'
TABLES
listobject = list
EXCEPTIONS
not_found = 1.
CALL FUNCTION 'LIST_TO_ASCI'
EXPORTING
LIST_INDEX = -1 "LIST_INDEX SY-LSIND.
TABLES
listasci = list_asc
listobject = list.
PERFORM download_file.
ENDFORM.
FORM download_file *
FORM download_file.
DATA fname TYPE rlgrap-filename VALUE 'c:\audit_report.xls'.
DATA ftype TYPE rlgrap-filetype VALUE 'DAT'.
DATA numeric_data(10) TYPE c VALUE '0123456789'.
*Table structure should match with list output.
DATA : BEGIN OF i_data1 OCCURS 0,
belnr(12) TYPE c,
gjahr(6) TYPE c,
bukrs(8) TYPE c,
chect(13) TYPE c,
lifnr(12) TYPE c,
name1(37) TYPE c,
bldat(14) TYPE c,
xblnr(18) TYPE c,
augdt(14) TYPE c,
wrbtr(17) TYPE c,
status(4) TYPE c,
augbl(18) TYPE c,
sortl(17) TYPE c,
END OF i_data1.
Header record of the excel sheet.
PERFORM fill_header.
LOOP AT list_asc.
Reads lines starting from the first record in the report. All informatory statements in the report are not read.
IF list_asc+1(10) CO numeric_data.
i_data1 = list_asc .
APPEND i_data1.
ENDIF.
ENDLOOP.
Call the download function.
CALL FUNCTION 'DOWNLOAD'
EXPORTING
filename = fname
filetype = ftype
TABLES
data_tab = i_data1
FIELDNAMES = i_invoiceheader.
ENDFORM.
FORM fill_header *
FORM fill_header.
i_invoiceheader-name = 'Doc Number'.
APPEND i_invoiceheader.
i_invoiceheader-name = 'Fsc Year'.
APPEND i_invoiceheader.
i_invoiceheader-name = 'Cmp Code'.
APPEND i_invoiceheader.
i_invoiceheader-name = 'Check No'.
APPEND i_invoiceheader.
i_invoiceheader-name = 'Vendor No'.
APPEND i_invoiceheader.
i_invoiceheader-name = 'Entered by'.
APPEND i_invoiceheader.
i_invoiceheader-name = 'Doc Date'.
APPEND i_invoiceheader.
i_invoiceheader-name = 'Ref Doc No'.
APPEND i_invoiceheader.
i_invoiceheader-name = 'Clearing Date'.
APPEND i_invoiceheader.
i_invoiceheader-name = 'Amount'.
APPEND i_invoiceheader.
i_invoiceheader-name = 'Status'.
APPEND i_invoiceheader.
i_invoiceheader-name = 'Clearing Doc No'.
APPEND i_invoiceheader.
i_invoiceheader-name = 'Sort field'.
APPEND i_invoiceheader.
ENDFORM. " fill_header</b>
Initialization *************************
INITIALIZATION.
To initialize the date parameter on the selection screen.
The date by default ranges from previous Monday to Sunday.
todate = sy-datum.
CALL FUNCTION 'DATE_COMPUTE_DAY'
EXPORTING
date = todate
IMPORTING
day = day.
d = day.
if d < 4.
todate = sy-datum - d - 4 .
else.
todate = sy-datum - d + 3 .
endif.
fromdate = todate - 6.
MOVE: 'BT' TO s_augdt-option,
fromdate TO s_augdt-low,
todate TO s_augdt-high.
APPEND s_augdt.
Start of Selection **************************
START-OF-SELECTION.
Checking the validity of the inputted dates ****************
IF s_augdt-low > sy-datum OR s_augdt-high > sy-datum.
MESSAGE i999 WITH 'You cannot input future date'.
EXIT.
ENDIF.
IF NOT s_bukrs IS INITIAL.
MESSAGE i999 WITH 'Program will run with input parameters in screen!!'.
ENDIF.
Initialize the header data ***********************
e_time = sy-uzeit.
MOVE e_time+0(2) TO hh.
MOVE e_time+2(2) TO min.
MOVE e_time+4(2) TO sec.
CONCATENATE hh min sec INTO header-ext_time SEPARATED BY ':'.
e_date = sy-datum.
MOVE e_date+0(4) TO yy.
MOVE e_date+4(2) TO mm.
MOVE e_date+6(2) TO dd.
CONCATENATE mm dd yy INTO header-ext_date SEPARATED BY '/'.
header-delimit = '~'.
APPEND header.
List allowed document types **********************
PERFORM fill_doc_types.
**To select the documents within the range of week or as inputted **
IF s_augdt IS INITIAL.
MOVE: 'I' TO s_augdt-sign,
'BT' TO s_augdt-option,
fromdate TO s_augdt-low,
todate TO s_augdt-high.
APPEND s_augdt.
ENDIF.
Selecting the records from the database ****************
IF s_bukrs IS INITIAL AND s_blart IS INITIAL.
Select all documents of company code 1000, *********
4200 and 8000, and allowed document types *********
SELECT belnr gjahr augdt augbl bukrs
blart bldat xblnr lifnr wrbtr shkzg
FROM bsak INTO CORRESPONDING FIELDS OF TABLE i_data
FOR ALL ENTRIES IN i_doctype
WHERE blart EQ i_doctype-blart
AND augdt IN s_augdt
AND ( bukrs = '1000' OR bukrs ='4200' OR
( bukrs = '8000' AND blart NE 'ZP' ) ).
loop at i_data.
Exclude reversed documents
select single stblg into ws_stblg
from bkpf
where bukrs = i_data-bukrs
and gjahr = i_data-gjahr
and belnr = i_data-belnr.
if not ws_stblg is initial.
delete i_data.
endif.
endloop.
ELSEIF s_blart IS INITIAL.
Select all documents of allowed document types ******
and inputted company code ************
SELECT belnr gjahr augdt augbl bukrs
blart bldat xblnr lifnr wrbtr shkzg
FROM bsak INTO CORRESPONDING FIELDS OF TABLE i_data
FOR ALL ENTRIES IN i_doctype
WHERE blart EQ i_doctype-blart
AND augdt IN s_augdt
AND bukrs IN s_bukrs .
LOOP AT i_data.
Exclude documents of type ZP
for company code 8000.
IF i_data-bukrs = '8000' AND i_data-blart = 'ZP'.
DELETE i_data.
continue.
ENDIF.
Exclude reversed documents
select single stblg into ws_stblg
from bkpf
where bukrs = i_data-bukrs
and gjahr = i_data-gjahr
and belnr = i_data-belnr.
if not ws_stblg is initial.
delete i_data.
continue.
endif.
ENDLOOP.
READ TABLE i_data INDEX 1.
IF sy-subrc NE 0.
MESSAGE i999 WITH 'No records have been selected'.
EXIT.
ENDIF.
ELSE.
Select the documents matching the company codes *****
and document types inputted in the selection screen ****
SELECT belnr gjahr augdt augbl bukrs bldat xblnr
blart lifnr wrbtr shkzg
FROM bsak INTO CORRESPONDING FIELDS OF TABLE i_data
WHERE bukrs IN s_bukrs AND blart IN s_blart
AND augdt IN s_augdt.
SORT i_data BY blart.
LOOP AT i_data.
Filtering the records selected
based on the document type
READ TABLE i_doctype WITH KEY blart = i_data-blart.
IF sy-subrc NE 0.
DELETE i_data.
continue.
ENDIF.
Exclude documents of type ZP
for company code 8000.
IF i_data-bukrs = '8000' AND i_data-blart = 'ZP'.
DELETE i_data.
continue.
ENDIF.
Exclude reversed documents.
select single stblg into ws_stblg
from bkpf
where bukrs = i_data-bukrs
and gjahr = i_data-gjahr
and belnr = i_data-belnr.
if not ws_stblg is initial.
delete i_data.
continue.
endif.
ENDLOOP.
READ TABLE i_data INDEX 1.
IF sy-subrc NE 0.
MESSAGE i999 WITH 'No records have been selected'.
EXIT.
ENDIF.
ENDIF.
IF sy-subrc NE 0.
MESSAGE i999 WITH 'No records have been selected'.
EXIT.
ENDIF.
credit/debit identification ***********************
LOOP AT i_data.
IF i_data-shkzg EQ 'H'.
i_data-wrbtr = i_data-wrbtr * 1.
ELSEIF i_data-shkzg EQ 'S'.
i_data-wrbtr = i_data-wrbtr * -1.
ENDIF.
MODIFY i_data.
ENDLOOP.
for summarizing ******************************
LOOP AT i_data.
MOVE-CORRESPONDING i_data TO i_data1.
COLLECT i_data1.
ENDLOOP.
Vendor informations and Check Informations *****************
SELECT lifnr name1 sortl
FROM lfa1
APPENDING CORRESPONDING FIELDS OF TABLE i_lfa1
FOR ALL ENTRIES IN i_data1
WHERE lifnr = i_data1-lifnr.
SELECT chect vblnr gjahr zbukr FROM payr APPENDING CORRESPONDING
FIELDS OF TABLE i_payr FOR ALL ENTRIES
IN i_data1 WHERE vblnr = i_data1-augbl
AND gjahr = i_data1-augdt(4)
AND zbukr = i_data1-bukrs.
SORT i_data1 BY augbl gjahr bukrs lifnr.
SORT i_payr BY vblnr gjahr zbukr.
SORT i_lfa1 BY lifnr.
LOOP AT i_data1.
READ TABLE i_payr WITH KEY vblnr = i_data1-augbl
gjahr = i_data1-gjahr
zbukr = i_data1-bukrs.
IF sy-subrc EQ 0.
i_data1-chect = i_payr-chect.
ENDIF.
READ TABLE i_lfa1 WITH KEY lifnr = i_data1-lifnr.
IF sy-subrc EQ 0.
i_data1-name1 = i_lfa1-name1.
i_data1-sortl = i_lfa1-sortl.
ENDIF.
i_data1-status = 'X'.
MODIFY i_data1.
ENDLOOP.
**The records are sorted by clearing date, check number and doc type**
SORT i_data1 BY augdt chect blart.
**********The header record is outputted on the screen****************
PERFORM write_header.
********Data is moved to internal table in the file format *************
PERFORM move_data.
Line items are outputted on the screen *********************
PERFORM write_output.
*& Form write_header &*
*& This outputs the header information to screen &*
FORM write_header.
SKIP.
SET PF-STATUS 'LIST'.
Outputting the header information *********************
WRITE : / 'Extraction Date : ' , header-ext_date.
WRITE : / 'Extraction Time : ' , header-ext_time.
FORMAT COLOR 1." INTENSIFIED.
SKIP.
ULINE AT 0(190) NO-GAP.
Outputting line level information **********************
WRITE:/ sy-vline NO-GAP,
(10) 'DOC NUMBER',
sy-vline NO-GAP,
(4) 'F-YR',
sy-vline NO-GAP,
(6) 'C-CODE',
sy-vline NO-GAP,
(10) 'CHECK NUM',
sy-vline NO-GAP,
(10) 'VENDOR NUM',
sy-vline NO-GAP,
(35) 'VENDOR NAME',
sy-vline NO-GAP,
(12) 'INVOICE DATE',
sy-vline NO-GAP,
(16) 'INVOICE NUMBER',
sy-vline NO-GAP,
(12) 'PAID DATE',
sy-vline NO-GAP,
(15) 'INVOICE AMOUNT',
sy-vline NO-GAP,
(2) 'SC',
sy-vline NO-GAP,
(16) 'REFERENCE FI DOC',
sy-vline NO-GAP,
(15) 'SORT FIELD',
sy-vline NO-GAP.
ULINE AT 0(190) NO-GAP.
ENDFORM. " write_header
*& FORM MOVE_DATA &*
*& Formats data in internal table as is required in the file &*
FORM move_data.
LOOP AT i_data1.
Document number and fiscal year should be separted by '|' *****
CONCATENATE i_data1-belnr i_data1-gjahr INTO fidoc_year
SEPARATED BY '|'.
MOVE i_data1-bukrs TO comp_code.
MOVE i_data1-chect TO check_numbr.
Vendor number and vendor name should be separted by '|' *****
CONCATENATE i_data1-lifnr i_data1-name1 INTO vendor
SEPARATED BY '|'.
SHIFT vendor LEFT DELETING LEADING '0'.
SHIFT vendor RIGHT DELETING TRAILING space.
Date fields converted to MM/DD/YYYY format ****************
MOVE i_data1-bldat+0(4) TO yy.
MOVE i_data1-bldat+4(2) TO mm.
MOVE i_data1-bldat+6(2) TO dd.
CONCATENATE mm dd yy INTO inv_date SEPARATED BY '/'.
MOVE i_data1-xblnr TO inv_nbr.
SHIFT inv_nbr RIGHT DELETING TRAILING space.
MOVE i_data1-augdt+0(4) TO yy.
MOVE i_data1-augdt+4(2) TO mm.
MOVE i_data1-augdt+6(2) TO dd.
CONCATENATE mm dd yy INTO paid_dat SEPARATED BY '/'.
MOVE i_data1-wrbtr TO inv_amt.
CONDENSE inv_amt.
SHIFT inv_amt RIGHT DELETING TRAILING space.
MOVE i_data1-status TO status.
MOVE i_data1-augbl TO ref_doc.
CONCATENATE fidoc_year
comp_code
check_numbr
vendor
inv_date
inv_nbr
paid_dat
inv_amt
status
ref_doc
INTO i_final_file-record SEPARATED BY '~'.
APPEND i_final_file.
ENDLOOP.
ENDFORM. " MOVE_DATA
*& Form write_output &*
*& Outputs all data to screen &*
FORM write_output.
LOOP AT i_data1.
FORMAT COLOR 2 INTENSIFIED.
Outputting line level information *******************
WRITE : / sy-vline NO-GAP,
(10) i_data1-belnr,
sy-vline NO-GAP,
(4) i_data1-gjahr,
sy-vline NO-GAP,
(6) i_data1-bukrs,
sy-vline NO-GAP,
(10) i_data1-chect,
sy-vline NO-GAP,
(10) i_data1-lifnr,
sy-vline NO-GAP,
(35) i_data1-name1,
sy-vline NO-GAP,
(12) i_data1-bldat MM/DD/YYYY,
sy-vline NO-GAP,
(16) i_data1-xblnr,
sy-vline NO-GAP,
(12) i_data1-augdt MM/DD/YYYY,
sy-vline NO-GAP,
(15) i_data1-wrbtr,
sy-vline NO-GAP,
(2) i_data1-status,
sy-vline NO-GAP,
(16) i_data1-augbl,
sy-vline NO-GAP,
(15) i_data1-sortl,
sy-vline NO-GAP.
ENDLOOP.
ULINE AT 0(190) NO-GAP.
ENDFORM. " write_output
In the program, I am downloading only the list.. The description of report outputted in the beginning of the report is not downloaded to excel.
What has to be taken into consideration is that, the structure of the table i_data1 which contains the data to be downloaded to the table.
I hope that this will help you.
Regards,
Susmitha -
Simple report list output sent as attachment thru email
Hi All,
Here's my task : I need to schedule a bi-weekly report that obviously runs in the background and produces output. From that output, I want to capture (with no manual intervention) the list output to an attachment and email a recipient. I've looked over code snippets and understand most of the <b>LIST</b> functions, but most deal with uploading a file from the frontend, which I do not want. Any ideas? Thx in advance.
JimHi
see the sample report to send mail as attachement
modify it as per your requirement
Mailing with Attachment by ABAP Coding
Refer this link:
Mail with attachment.
FORM send_list_to_basis .
DATA: w_path LIKE rlgrap OCCURS 0 WITH HEADER LINE,
lt_index TYPE sy-tabix,
doc_type(3) TYPE c,
descr LIKE it_objpack_basis-obj_descr,
temp_data LIKE w_path,
temp1 TYPE string,
tab_lines TYPE i,
langu(15) TYPE c,
expirydate TYPE so_obj_edt,
L_FILE1(100).
CONCATENATE 'C:\' sy-repid '_' sy-datum '.XLS' INTO L_FILE1.
W_PATH-FILENAME = L_FILE1.
APPEND w_path.
CLEAR w_path.
wa_doc_chng-obj_descr = 'User List not logged on for 180 days'.
wa_doc_chng-obj_langu = 'E'.
wa_doc_chng-obj_expdat = sy-datum.
CLEAR w_subject.
CONCATENATE 'Please find attached document with list of users'
'not logged on for 180 days for client' sy-mandt
INTO w_subject SEPARATED BY space.
it_objtxt_basis-line = w_subject.
APPEND it_objtxt_basis.
CLEAR it_objtxt_basis.
it_objtxt_basis-line = text-004.
APPEND it_objtxt_basis.
CLEAR it_objtxt_basis.
CLEAR w_tab_line.
DESCRIBE TABLE it_objtxt_basis LINES w_tab_line.
READ TABLE it_objtxt_basis INDEX w_tab_line INTO l_cline.
wa_doc_chng-doc_size =
( w_tab_line - 1 ) * 255 + STRLEN( l_cline ).
CLEAR it_objpack_basis-transf_bin.
it_objpack_basis-head_start = 1.
it_objpack_basis-head_num = 0.
it_objpack_basis-body_start = 1.
it_objpack_basis-body_num = w_tab_line.
it_objpack_basis-doc_type = 'RAW'.
APPEND it_objpack_basis.
CLEAR it_objpack_basis.
LOOP AT w_path.
temp1 = w_path.
descr = w_path.
CALL FUNCTION 'STRING_REVERSE'
EXPORTING
string = descr
lang = 'E'
IMPORTING
rstring = descr.
CALL FUNCTION 'STRING_SPLIT'
EXPORTING
delimiter = '\'
string = descr
IMPORTING
head = descr
tail = temp_data.
CALL FUNCTION 'STRING_REVERSE'
EXPORTING
string = descr
lang = 'E'
IMPORTING
rstring = descr.
CALL FUNCTION 'STRING_SPLIT'
EXPORTING
delimiter = '.'
string = descr
IMPORTING
head = temp_data
tail = doc_type.
CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
filename = temp1
filetype = 'BIN'
header_length = 0
read_by_line = 'X'
replacement = '#'
TABLES
data_tab = it_upload.
DESCRIBE TABLE it_upload LINES tab_lines.
DESCRIBE TABLE it_objbin_basis LINES lt_index.
lt_index = lt_index + 1.
LOOP AT it_upload.
wa_objbin_basis-line = it_upload-line.
APPEND wa_objbin_basis TO it_objbin_basis.
CLEAR wa_objbin_basis.
ENDLOOP.
it_objpack_basis-transf_bin = 'X'.
it_objpack_basis-head_start = 0.
it_objpack_basis-head_num = 0.
it_objpack_basis-body_start = lt_index.
it_objpack_basis-body_num = tab_lines.
it_objpack_basis-doc_type = doc_type.
it_objpack_basis-obj_descr = descr.
it_objpack_basis-doc_size = tab_lines * 255.
APPEND it_objpack_basis.
CLEAR it_objpack_basis.
ENDLOOP.
it_reclist_basis-receiver = '[email protected]'.
it_reclist_basis-rec_type = 'U'.
APPEND it_reclist_basis.
CLEAR it_reclist_basis.
CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
EXPORTING
document_data = wa_doc_chng
put_in_outbox = 'X'
commit_work = 'X'
TABLES
packing_list = it_objpack_basis
contents_txt = it_objtxt_basis
contents_bin = it_objbin_basis
receivers = it_reclist_basis
EXCEPTIONS
too_many_receivers = 1
document_not_sent = 2
operation_no_authorization = 4
OTHERS = 99.
IF sy-subrc EQ 0.
SUBMIT rsconn01 WITH mode = 'INT' AND RETURN.
ENDIF.
ENDFORM. " send_list_to_basis
Reward points if useful
Regards
Anji -
Print ABAP List to Ledger size paper
Having a problem getting ALV to print to Ledger.
I've create a Page format ZLEDGER (11x17)
a Format Type ZLEDGERALV
Assigned this to my Device Type., and copied the Actions for 65x255 Format
I assigned my Device Type to an OUtput type where I;ve set my default paper tray to Tray 4, and Assigned ZLEDGER to Tray 4.
When I attempt to print, the printer asks for "Letter" on on Tray 4.
Any ideas.
MikeHowever, I've tried this before, and it did not work.. the only time I was able to get the the command &l6A recognized is if I put it in the First Page file.
enter PJL mode and switch to PCL language
\e%-12345X@PJL\r\n
Set Paper size 11x17
#\e&l6A
#\i<HPLJ4:ZLEDGER:SETUP>
#=================
Support Devices
imagePASS S1
#=================
Staple
#=================
Upper left in Portrait and Upper Right in Landscape(default)
#@PJL COMMENT CANPJL SET STAPLE = ONEUPLEFT\r\n
Upper right in Portrait and Lower Right in Landscape
#@PJL COMMENT CANPJL SET STAPLE = ONEUPRIGHT\r\n
Lower left in Portrait and Upper Left in Landscape
@PJL COMMENT CANPJL SET STAPLE = ONELOWLEFT\r\n
Lower right in Portrait and Lower Left in Landscape
#@PJL COMMENT CANPJL SET STAPLE = ONELOWRIGHT\r\n
Two left in Portrait and Two Top in Landscape
#@PJL COMMENT CANPJL SET STAPLE = TWOLEFT\r\n
Two right in Portrait and Two bottom in Landscape
#@PJL COMMENT CANPJL SET STAPLE = TWORIGHT\r\n
#=================
Hole Punch
#=================
Left in Portrait and Top in Landscape
#@PJL COMMENT CANPJL SET PUNCH = LEFT\r\n
Top in Portrait and Right in Landscape
#@PJL COMMENT CANPJL SET PUNCH = TOP\r\n
#================
Output Bin
#================
Upper tray
#@PJL COMMENT CANPJL SET OUTPUTBIN = FINISHER1\r\n
Lower tray
#@PJL COMMENT CANPJL SET OUTPUTBIN = FINISHER2\r\n
#===============end
@PJL ENTER LANGUAGE=PCL\r\n
\e&l6A
reset
\eE
Landscape mode
\e&l1O
ECMA-94 Latin 1 character set
\e(0N
Skip perforation region on
\e&l1L
set vertical spacing
#\e&l7.8C
set top margin
\e&l1E
set line spacing
\e&l8D
set bottom margin
\e&l65F
Define 2 macros: Macro 1 will select Normal font
Macro 2 will select Bold font
Start of MACRO 1:
\e&f1y0X
select pitch 12, height 8
\e(s0p12h8v0s0b3T
set horizontal spacing
\e&k12H
End of MACRO 1:
\e&f1y1X
Start of MACRO 2:
\e&f2y0X
select pitch 12, height 8
\e(s0p12h8v0s3b3T
set horizontal spacing
\e&k12H
End of MACRO 2:
\e&f2y1X
Execute Macro 1 to set normal font:
\e&f1Y\e&f2X
Macros for drawing of frames.
\e&f470y0X\e(10U\e&k5H\xC5\e(0N\e&k5H\e&f470y1X
\e&f460y0X\e(10U\e&k5H\xC4\e(0N\e&k5H\e&f460y1X
\e&f461y0X\e(10U\e&k5H\xB3\e(0N\e&k5H\e&f461y1X
\e&f462y0X\e(10U\e&k5H\xDA\e(0N\e&k5H\e&f462y1X
\e&f463y0X\e(10U\e&k5H\xBF\e(0N\e&k5H\e&f463y1X
\e&f464y0X\e(10U\e&k5H\xC0\e(0N\e&k5H\e&f464y1X
\e&f465y0X\e(10U\e&k5H\xD9\e(0N\e&k5H\e&f465y1X
\e&f466y0X\e(10U\e&k5H\xC3\e(0N\e&k5H\e&f466y1X
\e&f467y0X\e(10U\e&k5H\xB4\e(0N\e&k5H\e&f467y1X
\e&f468y0X\e(10U\e&k5H\xC2\e(0N\e&k5H\e&f468y1X
\e&f469y0X\e(10U\e&k5H\xC1\e(0N\e&k5H\e&f469y1X
#<RSPO0060 - end of gene -
In classical report list output checkbox is value is not changed
Hi Abapers,
I am developing one classical report program, out put list hast one check box.
I need to read wheather checkbox is checked or not dynamically .
but the check box value is not changed if I check or uncheck How can I
solve this problem.
Regards.
Shashikumar.GHi Abapers,
I codded as.
DATA: CHKBOX TYPE C.
WRITE: CHKBOX AS CHECKBOX INPUT ON.
it will be displayd on output list if click on it It will be ticked or unticked it is fine.
but the value of chkbox is not changed.
but I need to change the value of chkbox regarding to clicking on it(check, uncheck).
Regards,
Shashikumar.G -
Print report in the center of paper
Hello, I am using the Labview 8.2.1. and I am trying to print a "Standard Report" which contains only a JPEG image, in the center of the paper, but it is always printed at the left side of the paper A4.
How can I choose its orientation ? I also choosed the "Right Alignement" but is printed again on the left.
Here is my block diagram.
Thank you in advance.
Solved!
Go to Solution.Thank you. The "Set Report Margins" in "Report Layout" must be used indeed.
Here is the block diagram: -
How to print the form output in news paper format
Hi All,
How we will print the data in the output in newspaper format in SAP script?
Can any body give some idea on this.
Thanks&Regards
MaheshIf what I understand is correct..!!!!!!!!!
design the windows in required format. and make the window belongs to all required pages and just type the matter there itself. then run the form from ABAP editor.
Cheers. -
Front end printing from list report
Hi,
I want to print my list output report without creating spool.My requirement is to have print button on the output list and when user click on it it will open windows popup to print it instead of sap ones which create spool.
Regards,
Ankur
Moderator Message: Welcome to SCN. But looks like you have gathered the wrong impression about SCN. These forums are not here to do your work for you. But what you can do is, search for available information and post questions if you need some information which you did not find after searching. Either way, you cannot expect others to do your work for you.
Edited by: kishan P on Mar 2, 2011 11:07 AMHello,
You must configure the printer to use method (type G) for Windows Printing instead of LOCL (Type F).
Also you must set the following Reg Key for the users on the Citrix server for this to work.
HKEY_CURRENT_USER\Software\SAP\SAPlpd\SAPLPD
Type: String
Name: SwinDataType
Value: EMF
Please see the following link which helped us solve our issue.
http://community.citrix.com/display/adi/SAPGUI7.10onCitrixPresentationServer -
Print selection parameters en reports, lists
Hi gurus,
We need print reports, lists with selection parameters used in execution. For example, transaction VCUST. In this moment, system only prints the table with values.
Any idea???
Thank you!!!
I will reward points all answers!Hi daniel
May be these inputs will help you
SP01 - To generate the spool request
SPAD - Where Print parameters are set (here you can include network printer into SAP system)
VSHP1 - to maintain print parameters
Regards
Srinath -
Regarding List output selection
Hi Friends,
My query is iam having 100 fields in report(list) output and my client needs only 20 fields information from that o/p how can i get
that selected fields from list output dynamically?
Regards,
Kishorewhich report are u printing can u tell me the tcode.
see if this is a standard report most likely it will be an ALV report so in that case you can create a layout and hide unwanted fields, then save the layout, and set it as a default layout. Then whenever you will print next time it will only display the selected colums.
reward points if helpful.
regards,
khusro habib -
Printing scripi on both side of paper
Hi All,
I want to print script on both side of paper.
my observations.
the output device they are using it prints report on both side of paper.
in script , processing mode selected D and i am printing dunning letters.
in main program used NEW-PAGE. that should not make any difference.
let me know from script side what i have to do and also from my device type what else i have to check.
urgent
Regards
Gopalhi,
We can print both sides of the paper
<b>You switch to duplex or tumble duplex mode with a form page for which one of these modes is specified. To continue printing in the current mode, for follow-on pages you must define another page in which the Print mode field is empty. Otherwise, the following pages after the mode switch will continue to be printed only on the front sides of new sheets of paper.
The reason: When SAPscript sends a page with Print mode D or T to the printer, it not only sets the print mode accordingly. To ensure that the first page in the new mode is correctly output, SAPscript also instructs the printer to output the page on the front side of a sheet. If SAPscript sends a sequence of D or T pages to the printer, the output is printed only on the front side of each sheet.
You define a first page named FIRST for a form to be printed in duplex mode. You therefore set the Print mode in FIRST to D.
To make the duplex printing work correctly, you must define a second page FOLLOWER in which Print mode is left empty. In the form definition, you specify FOLLOWER as the follow-on page for FIRST and for itself as well.
Your text is then printed in duplex mode. FIRST switches the printer to duplex mode and forces printing of the first page on the front side of a new sheet. FOLLOWER accepts the duplex mode and sends no further mode print controls to the printer. The printer therefore alternately prints FOLLOWER pages on the fronts and backs of sheets.</b>
The print controls that must be defined for a device type depend upon the SAPscript printer driver that is to be used with the device type.
set the followint print control.
<b>SPMDU</b>
Begin duplex printing (both sides of paper). (Needed only if supported by device.)
<u><b>follow this link it will help.</b></u>
http://solutions.brother.com/Library/pdf/SAP_install_latest.pdf
http://wiki.ittoolbox.com/index.php/HOWTO:Sap_script
regards,
AshokReddy.
Message was edited by:
Ashok Reddy -
Updating list output during execution.
Hi,
Is it possible to somehow update report list output during code execution ?
What I'm trying to do is to LOOP at all files in a certain directory, process them and return some output.
The process is time consuming. So I'd like the user not to wait all the time and see all the output at the very end of the process but rather to be able to refresh output as soon as single file withing the loop is processed.
i.e.
LOOP AT t_file.
PERFORM process_file using t_file.
PERFORM refresh_output.
ENDLOOP.
Is it possible to develop such a mechanism ?
Thanks in advance.Hi Bartosz
It is not possible.
Neha
Maybe you are looking for
-
How to watermark pictures in iPhoto
Hello, I cannot find such option as watermark in IPhoto on my mac, I will really appreciate if someone tells me how I can watermak my pictures
-
Dear All, I have created a Service PO and partial qty services done. I want to close this PO and how should be done. I want to see the open PO report where this PO should not appear. Please advice. Regards
-
How do you customize clip keyframe overlays?
I find the red color of the keyframes over audio tracks in the timeline very hard to see against the green of the clips. Is there a way to change the default color of the clip overlays for audio tracks in the timeline? THANKS!
-
Issues updating iOS7 to iOS8 (iPhone 5s)
Hi guys, I really have terrible problem regarding my iPhone 5s. When I started updating my OS from iOS7 to iOS8, things happened terribly: -Unresponsive Touch Screen -A vertical line sometimes appears in the screen which makes it unresponsive. Please
-
Creating several hundred playlists
Latest iTunes: I have a friend who has a need to create several hundred playlists for his music biz and jump around at will. That's a ton of scrolling and I don't see a way to create Sub Folders to put playlists in. Is there any good way to manage th