‎2012 Jul 31 7:31 AM
I have to add the print button in application tool bar. When i am click the print button output directly goes to printer. but i have write the code but it is not working.
REPORT ZBOM.
if r_ucomm EQ '&PRINT'.
DATA: params LIKE PRI_PARAMS,
arcparams LIKE ARC_PARAMS,
DAYS(1) TYPE N VALUE 2,
COUNT(3) TYPE N VALUE 1,
VALID TYPE C.
CALL FUNCTION 'GET_PRINT_PARAMETERS'
EXPORTING
DESTINATION = 'LT50'
COPIES = COUNT
LIST_NAME = 'TEST'
LIST_TEXT = 'SUBMIT TO SAP-SPOOL'
IMMEDIATELY = 'X'
RELEASE = 'X'
NEW_LIST_ID = 'X'
EXPIRATION = DAYS
LINE_SIZE = 44
LINE_COUNT = 80
LAYOUT = 'X_44_120'
SAP_COVER_PAGE = 'X'
COVER_PAGE = 'X'
RECEIVER = 'SAP*'
DEPARTMENT = 'System'
SAP_OBJECT = 'RS'
AR_OBJECT = 'TEST'
ARCHIVE_ID = 'XX'
ARCHIVE_INFO = 'III'
ARCHIVE_TEXT = 'Description'
NO_DIALOG = ' '
IMPORTING
OUT_PARAMETERS = params
OUT_ARCHIVE_PARAMETERS = arcparams
VALID = VALID.
IF VALID <> SPACE.
SUBMIT ZBOM_VS_OFFER TO SAP-SPOOl
SPOOL PARAMETERS Params
ARCHIVE PARAMETERS arcparams
WITHOUT SPOOL DYNPRO
with p_matnr = p_matnr
with p_werks = p_werks
and return.
* NEW-PAGE PRINT ON PARAMETERS params NO DIALOG.
ENDIF.
endif.
ENDFORM.
‎2012 Jul 31 7:47 AM
If you want the dialog box, dont use WITHOUT SPOOL DYNPRO.
Thanks,
Shambu
‎2012 Jul 31 10:23 AM
‎2012 Jul 31 10:37 AM
Do you want the Output to directly go to the Printer or do you want a dialog box?
‎2012 Jul 31 11:12 AM
‎2012 Jul 31 11:13 AM
I want the output to directly go to the printer( in ABAP 4.7 Version).
‎2012 Aug 01 8:27 AM
Hello Mahesh ,
In our system there is a provision in which the output (smartform) is directly Printed using the local printer attached to the system. And the code which makes it possible is below check the same it may be helpful for you.
WA_COMPOP-TDNEWID = 'X'.
* WA_COMPOP-TDFINAL = 'X'.
wa_compop-TDARMOD = '1'.
WA_COMPOP-TDIMMED = 'X'.
WA_COMPOP-TDDELETE = 'X'.
WA_COMPOP-TDCOPIES = 1 .
WA_CTRLOP-DEVICE = 'PRINTER'. " Here we dont give printer name 'KX-P3696'.
WA_CTRLOP-NO_DIALOG = 'X'.
WA_CTRLOP-PREVIEW = ' '.
And this Parameters are passed as CONTROL_PARAMETERS and OUTPUT_OPTIONS while calling the smartform.
With reference to the above code you try to provide the Destination field with PRINTER instead of LT50 and then check.
‎2012 Aug 01 3:54 PM
‎2012 Aug 03 6:11 AM
‎2012 Aug 03 6:34 AM
‎2012 Aug 03 6:39 AM
I have to add the Download excel button in application tool bar. When i am click the excel button report output can be downloaded in EXCEL sheet. But i have design the layout in smartform & call the driver program but it can't be downloaded. If any one tell me.