Print directly to the printer

Hi Guys
Could anyone correct me how can I print directly to the printer from this program ,I am getting short dump error when I select the radio button printer and execute it.
Rgds
PE

oops sorry here it is below
REPORT  Z_ESLP_ZTCODE LINE-SIZE 132 .
*TABLES
TABLES : AGR_TCODES,
AGR_USERS,
TSTCT,
T16FW,
T16FD.
type-pools: slis.                                 "ALV Declarations
CONSTANTS MARK VALUE 'X'.
TYPES: BEGIN OF  T_DISP,
AGR_TCODES TYPE AGR_TCODES-TCODE ,             " Transaction code A
AGR_NAME   TYPE AGR_TCODES-AGR_NAME,           " Role Name B
AGR_UNAME  TYPE AGR_USERS-UNAME,               " Short User Name B
TTEXT      TYPE TSTCT-TTEXT,                   " Description Name C
TEXTC      TYPE USER_ADDR-NAME_TEXTC,          " Long User Name
SPRSL      TYPE TSTCT-SPRSL ,                  " Language c
TEL_EXTENS  TYPE USER_ADDR-TEL_EXTENS ,          " Extension
DEPARTMENT  TYPE USER_ADDR-DEPARTMENT  ,         " Department Name B
FRGGR      TYPE T16FW-FRGGR,
FRGCO      TYPE T16FD-FRGCO,
OBJID      TYPE T16FW-OBJID,
FRGCT      TYPE T16FD-FRGCT,
SPRAS      TYPE T16FD-SPRAS,
END OF t_disp.
DATA: it_disp TYPE STANDARD TABLE OF t_disp INITIAL SIZE 0,
      wa_disp TYPE t_disp.
DATA: params like pri_params,
    days(1) type n value 2,
    count(3) type n value 1,
    valid type c.
*ALV data declarations
data: fieldcatalog type slis_t_fieldcat_alv with header line,
      gd_tab_group type slis_t_sp_group_alv,
      gd_layout    type slis_layout_alv,
      gd_repid     like sy-repid,
      gt_events     type slis_t_event,
      gd_prntparams type slis_print_alv.
parameter: p_trigr type c default space.
SELECTION PARAMETER CRITERIA
SELECTION-SCREEN BEGIN OF BLOCK BLK WITH FRAME.
SELECTION-SCREEN BEGIN OF BLOCK BLK1 WITH FRAME TITLE TEXT-001.
SELECT-OPTIONS:
P_TCODE FOR AGR_TCODES-TCODE  , "OBLIGATORY, "no-extension no intervals,
U_NAME FOR AGR_USERS-UNAME,
R_NAME FOR AGR_USERS-AGR_NAME .
SELECTION-SCREEN END OF BLOCK BLK1.
SELECTION-SCREEN BEGIN OF BLOCK BLK2 WITH FRAME TITLE TEXT-002.
SELECTION-SCREEN END OF BLOCK BLK2.
SELECTION-SCREEN END OF BLOCK BLK.
SELECTION-SCREEN BEGIN OF BLOCK radio WITH FRAME.
  PARAMETERS :
  scr   RADIOBUTTON GROUP rbg1 ,
              Pr   RADIOBUTTON GROUP rbg1 .
  SELECTION-SCREEN END OF BLOCK radio.
*Start-of-selection.
START-OF-SELECTION.
perform data_retrieval.
perform build_fieldcatalog.
perform build_layout.
perform build_events.
perform build_print_params.
perform display_alv_report.
*&      Form  BUILD_FIELDCATALOG
      Build Fieldcatalog for ALV Report
form build_fieldcatalog.
  fieldcatalog-fieldname   = 'AGR_UNAME'.
  fieldcatalog-seltext_m   = 'User'.
  fieldcatalog-col_pos     = 0.
  fieldcatalog-outputlen   = 10.
  fieldcatalog-emphasize   = 'X'.
  fieldcatalog-key         = 'X'.
fieldcatalog-do_sum      = 'X'.
fieldcatalog-no_zero     = 'X'.
  append fieldcatalog to fieldcatalog.
  clear  fieldcatalog.
  fieldcatalog-fieldname   = 'TEXTC'.
  fieldcatalog-seltext_m   = 'Name'.
  fieldcatalog-outputlen   = 60.
  fieldcatalog-col_pos     = 1.
  append fieldcatalog to fieldcatalog.
  clear  fieldcatalog.
  fieldcatalog-fieldname   = 'AGR_NAME'.
  fieldcatalog-seltext_m   = 'Role Name'.
  fieldcatalog-outputlen   = 15.
  fieldcatalog-col_pos     = 2.
  append fieldcatalog to fieldcatalog.
  clear  fieldcatalog.
  fieldcatalog-fieldname   = 'AGR_TCODES'.
  fieldcatalog-seltext_m   = 'Trans Code'.
  fieldcatalog-col_pos     = 3.
  fieldcatalog-outputlen   = 20.
  append fieldcatalog to fieldcatalog.
  clear  fieldcatalog.
  fieldcatalog-fieldname   = 'TTEXT'.
  fieldcatalog-seltext_m   = 'Description'.
  fieldcatalog-outputlen   = 70.
  fieldcatalog-col_pos     = 4.
  append fieldcatalog to fieldcatalog.
  clear  fieldcatalog.
endform.                    " BUILD_FIELDCATALOG
*&      Form  BUILD_LAYOUT  PRINTER SETUP
      PRINTER SETUP
form printer_setup.
  DATA:L_PARAMS TYPE PRI_PARAMS,
       L_VALID TYPE C.
    CALL FUNCTION 'GET_PRINT_PARAMETERS'
       EXPORTING
         IMMEDIATELY                  = ' '
       LINE_SIZE                    = 220
       RELEASE                      = 'X'
         MODE                         = 'CURRENT'
         NO_DIALOG                    = ' '
       IMPORTING
    OUT_ARCHIVE_PARAMETERS       =
         OUT_PARAMETERS               = L_PARAMS
         VALID                        = L_VALID
       EXCEPTIONS
         ARCHIVE_INFO_NOT_FOUND       = 1
         INVALID_PRINT_PARAMS         = 2
         INVALID_ARCHIVE_PARAMS       = 3
         OTHERS                       = 4.
      IF SY-SUBRC  eq 0.
      ENDIF.
"But it will take default printer from user settings
      NEW-PAGE PRINT ON   PARAMETERS L_PARAMS NO DIALOG.
       write : 'print is on'.
      NEW-PAGE PRINT OFF.
    DATA: PARAMS   LIKE PRI_PARAMS,
         ARPARAMS 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 = 'LOCL'
               COPIES                 = COUNT
               LIST_NAME              = 'Z_ESLP_ZTCODE'
               LIST_TEXT              = 'SUBMIT ... TO SAP-SPOOL'
               IMMEDIATELY            = 'X'
               RELEASE                = 'X'
               NEW_LIST_ID            = 'X'
               EXPIRATION             = DAYS
               LINE_SIZE              = 79
               LINE_COUNT             = 120
               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 = ARPARAMS
               VALID                  = VALID.
   IF VALID <> SPACE.
     SUBMIT RSTEST00 TO SAP-SPOOL
       SPOOL PARAMETERS PARAMS
       ARCHIVE PARAMETERS ARPARAMS
       WITHOUT SPOOL DYNPRO.
   ENDIF.
endform.                    " BUILD_LAYOUT
*&      Form  BUILD_LAYOUT
      Build layout for ALV grid report
form build_layout.
  gd_layout-no_input          = 'X'.
  gd_layout-colwidth_optimize = 'X'.
  gd_layout-totals_text       = 'Totals'(201).
gd_layout-totals_only        = 'X'.
gd_layout-f2code            = 'DISP'.  "Sets fcode for when double
                                        "click(press f2)
gd_layout-zebra             = 'X'.
gd_layout-group_change_edit = 'X'.
gd_layout-header_text       = 'helllllo'.
endform.                    " BUILD_LAYOUT
*&      Form  DISPLAY_ALV_REPORT
      Display report using ALV grid
form display_alv_report.
  gd_repid = sy-repid.
  call function 'REUSE_ALV_GRID_DISPLAY'
       exporting
            i_callback_program      = gd_repid
            i_callback_top_of_page   = 'TOP-OF-PAGE'  "see FORM
            i_callback_user_command = 'USER_COMMAND'
           i_grid_title           = outtext
            is_layout               = gd_layout
            it_fieldcat             = fieldcatalog[]
           it_special_groups       = gd_tabgroup
            it_events               = gt_events
            is_print                = gd_prntparams
            i_save                  = 'X'
           is_variant              = z_template
       tables
            t_outtab                = it_disp
       exceptions
            program_error           = 1
            others                  = 2.
  if sy-subrc  EQ 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
  endif.
endform.                    " DISPLAY_ALV_REPORT
*&      Form  DATA_RETRIEVAL
      Retrieve data form lfa1 table and populate itab it_lfa1
form data_retrieval.
CASE MARK.
     WHEN scr.
   SELECT AGR_TCODESTCODE AGR_TCODESAGR_NAME AGR_USERSUNAME TSTCTTTEXT USER_ADDR~NAME_TEXTC
  INTO TABLE IT_DISP
  FROM AGR_TCODES
  INNER JOIN AGR_USERS
  ON  AGR_TCODESAGR_NAME = AGR_USERSAGR_NAME
  INNER JOIN USER_ADDR
  ON AGR_USERSUNAME = USER_ADDRBNAME
  INNER JOIN TSTCT
  ON AGR_TCODESTCODE = TSTCTTCODE
  where
  agr_tcodes~tcode in p_tcode
  and
  agr_users~uname in u_name
  and
  agr_tcodes~agr_name in r_name
  and
  TSTCT~SPRSL EQ 'E'.
  WHEN pr.
perform printer_setup.
ENDCASE.
*lifnr
*between '0000100001' AND '0000150000'.
endform.                    " DATA_RETRIEVAL
Release memory no longer required.
free: it_lfa1 .
Form  TOP-OF-PAGE                                                 *
ALV Report Header                                                 *
Form top-of-page.
*ALV Header declarations
data: t_header type slis_t_listheader,
      wa_header type slis_listheader,
      t_line like wa_header-info,
      ld_lines type i,
      ld_linesc(10) type c.
Title
  wa_header-typ  = 'H'.
  wa_header-info = 'Transaction codes by User and Role Name ' .
  append wa_header to t_header.
  clear wa_header.
Date
  wa_header-typ  = 'S'.
  wa_header-key = 'Date: '.
  CONCATENATE  sy-datum+6(2) '.'
               sy-datum+4(2) '.'
               sy-datum(4) INTO wa_header-info.   "todays date
  append wa_header to t_header.
  clear: wa_header.
Total No. of Records Selected
  describe table it_disp lines ld_lines.
  ld_linesc = ld_lines.
  concatenate 'Total No. of Transaction Records Selected: ' ld_linesc
                    into t_line separated by space.
  wa_header-typ  = 'A'.
  wa_header-info = t_line.
  append wa_header to t_header.
  clear: wa_header, t_line.
  call function 'REUSE_ALV_COMMENTARY_WRITE'
       exporting
            it_list_commentary = t_header.
           i_logo             = 'Z_LOGO'.
endform.
      FORM USER_COMMAND                                          *
      --> R_UCOMM                                                *
      --> RS_SELFIELD                                            *
FORM user_command USING r_ucomm LIKE sy-ucomm
                  rs_selfield TYPE slis_selfield.
Check function code
  CASE r_ucomm.
    WHEN '&IC1'.
  Check field clicked on within ALVgrid report
    IF rs_selfield-fieldname = 'TCODES'.
    Read data table, using index of row user clicked on
      READ TABLE it_disp INTO wa_disp INDEX rs_selfield-tabindex.
    Set parameter ID for transaction screen field
     SET PARAMETER ID 'BES' FIELD wa_disp-tcode.
    Sxecute transaction zven, and skip initial data entry screen
     CALL TRANSACTION 'Z' AND SKIP FIRST SCREEN.
    ENDIF.
  ENDCASE.
ENDFORM.
*&      Form  BUILD_EVENTS
      Build events table
form build_events.
  data: ls_event type slis_alv_event.
  call function 'REUSE_ALV_EVENTS_GET'
       exporting
            i_list_type = 0
       importing
            et_events   = gt_events[].
  read table gt_events with key name =  slis_ev_end_of_page
                           into ls_event.
  if sy-subrc = 0.
    move 'END_OF_PAGE' to ls_event-form.
    append ls_event to gt_events.
  endif.
    read table gt_events with key name =  slis_ev_end_of_list
                           into ls_event.
  if sy-subrc = 0.
    move 'END_OF_LIST' to ls_event-form.
    append ls_event to gt_events.
  endif.
endform.                    " BUILD_EVENTS
*&      Form  BUILD_PRINT_PARAMS
      Setup print parameters
form build_print_params.
  gd_prntparams-reserve_lines = '3'.   "Lines reserved for footer
  gd_prntparams-no_coverpage = 'X'.
endform.                    " BUILD_PRINT_PARAMS
*&      Form  END_OF_PAGE
form END_OF_PAGE.
  data: listwidth type i,
        ld_pagepos(10) type c,
        ld_page(10)    type c.
  write: sy-uline(50).
  skip.
  write:/40 'Page:', sy-pagno .
endform.

Similar Messages

  • Print a report directly to the printer

    I need to print a report directly to the printer in Oracle Forms and Report 11g without a preview in the browser

    Hello,
    <p>You can use this Java Bean</p>
    Francois

  • Print ALV report Directly - without the Print Parameter POPUP

    Hai All,
    I want to print a ALV directly to the printer without the Print Paramter POPUP.
    I passed on IS_PRINT parameters in the FM 'REUSE_ALV_LIST_DISPLAY'.
    But still i am getting the popup.
    How to do this.
    It is urgent .
    Kindly help me solving this.
    Vikki.

    Hi,
    i have passed IS_Print-Print = 'X'.
    But even after that i am getting the print parameter popup.
    IS there any other way to handle this. TO SUPPRESS THE PRINT PARAMETER POPUP.
    Please guide me.
    Waiting for ur replies.
    Vikki.

  • How to send a report DIRECTLY to the printer (Linux App. Svr.)?

    Here is the problem:
    -- We have Windows clients / Linux App Server / Forms 10g R2.
    -- Printers are attached to the Windows clients.
    -- When we want to send DIRECTLY to the printer, we have to write data into a text file (using TEXT_IO) &
    -- print the same using command HOST('lp -d '||<printer IP of logged in user>t||' '||<file name>,NO_SCREEN).
    -- Our normal reports are displayed as PDFs.
    Is there a way to directly send the PDF to the printer without having to re-write the report to a text file?? Then we can just use the PDF output and don't have to do any code changes (i.e. redo every report).
    Edited by: user12240205 on May 16, 2011 5:59 AM
    Edited by: user12240205 on May 16, 2011 5:59 AM

    InoL wrote:
    Use destype=printer.
    The printer on the Windows client has to be defined as a network printer and be known on the Linux server.
    Other options:
    - use the orarrp utility
    - if you call your Reports from Forms, you can use a Java bean
    http://forms.pjc.bean.over-blog.com/article-6621538.html
    Thank you for the quick response. Can u please tell us how to make the printer "known" as a Linux server?? Will a normal network admin know how to do this or is it an Oracle developer's task?

  • Report directly to the printer

    Hi
    i'm trying to run a report directly to the printer. Report is running but scaling is not happening. Following is the URL which i'm using to run the report. This will run not an issue if i try to increase or decrease the scaling, (start-->controlpanel-->printer-->printing preference-->advanced tab-->scaling)
    this will not work.
    http://<hostname>/reports/rwservlet?report=test.rdf&destype=printer&desformat=pdf&server=<servername>
    thanks in advance

    Check out the orarrp utility (Oracle Reports Remote Printing Utility) on Metalink, note 277431.1.
    It may be easier in the end to set up printers on the OAS. I guess that client PC's are using network printers, or are the really using printers connected directly to the PC?

  • Not able to take print a report directly to the printer

    Hi All,
    Can anyone help me to print a report directly to the printer?. Currently, I am viewing the reports in the screen and then taking print of that report. If anyone knows the solution for this, please give me the feedback immediately. It is very urgent.

    HI ALL
    i have the same problem plz tel me som solution 4 it
    thanx in advance

  • Can't print the report directly on the printer?

    Dear All,
    My client encounter a problem of printing a report directly to the printer. He is using developer 6i with OAS. His application is going to deploy on the web. He wants the report printed out directly on the "HP Laser Jet Printer" after the user has made the selection and clicked the "Print" button from the forms 6i. However, he got the error saying that
    "Oracle Report Server OWS Cartridge - Report Job has terminated with error
    Report Server Replies:
    Rep-0713: invalid printer name 'HP4050' specified by parameters DESNAME."
    And here is the parameter string passing into the report server:
    http://epmsdevs2.eway:9002/rwows/rwows60?report=epms1271.rdf+userid=epmsdev/epmsdev@dev+desformat=landscape+destype=printer+desname=HP4050+server=RepServer
    Is there anyone can show me some light on it?!
    Any help and idea is appreciated in advance!!!
    sheeta

    Hi!
    If reports are run in web env. then
    you can print reports directly on
    printer defined on m/c where report server
    is running, not on client m/c. If you want
    to print on client m/c then define that
    printer on report sever m/c and make sure
    report server can access that printer.
    Nirali

  • Print directly to the printer option in the Windows registry

    I need to find the location for the option to "Print directly to the printer" in the Windows registry.  I am trying to create a GPO to enable this option at login and I can't find the location for it.  Is this possible to do?  If not, is there another way to enable this at startup for all users?  We are running Adobe Acrobat X on Windows 7 Enterprise 32-bit.
    Thanks

    I guess that those of use responding don't know enough about the process you are trying to implement to be of help. Printing to network drives has been an issue for folks for a long time and a lot seems to depend on the network. That is probably of zero help and all I can suggest is just to hang on for someone who hopefully has an idea. If we can get a better handle on what you are trying to do, we might be able to make suggestions. However, I think our answers are not going to be there for the registry issue.

  • Print directly to the printer from Oracle 9I

    Please it is possible to print directly to the printer from Oracle 9i without having to show the report on the web.

    Please it is possible to print directly to the printer from Oracle 9i without having to show the report on the web.

  • Server created print ques printing directly to the printer

    I'm trying to enforce quotas as well as push out a global set of printers (i.e. not setup locally) I can do this no problem, but my managed macs always print directly to the printer, not via my server.
    I'm installing the printers locally on my server (printing directly to the I.P of the printer, then the corresponding ques appear automatically in the print service under server admin. I assumed that print jobs would be automatically parsed via the print service ques, and thus be able to enforce quotas.

    I'm attempting to setup the very same thing. I haven't gotten to try pushing the print ques to the managed clients via wgm yet, as I can't even seem to get the quota system working at all.
    I can get the que setup on the server, then add the printer to the client. When i pause the que on the server, the client print jobs are being held correctly, but there is no evidence that the quota system is even starting up or functioning correctly.
    I can find alot of people complaining about the quota system being broken in 10.3 and 10.4, but I can't find anyone talking about 10.5's printer quota system at all.

  • When send the report directly to the printer from Oracle IDS 9i

    Hi.....
    I m using Oracle IDS 9i, Oracle AS 9i and Database 9i for my new project.But i m facing a problem when i m trying to show a report from oracle IDS 9i.When i send the report directly to the printer without showing it,then the printer connected to the application server is working.But the printer connected to with PC(From where a send the command) is not working but printer connected with AS is working,but not that one which one i m wanting.....Why this problem is happening?Can anyone help me?
    KSI

    Note:It is always better to have network based printers rather then PC shared printers. What that means is your printer is not connected to a PC. It has a direct connection to the network via NIC. You would then setup the printer on your AS in the printers setup. If the AS is rebooted you do not need to authenticate the printer shares again with a network based printer.
    If I understand you correctly, you have a printer connected to your AS(application server) and a printer connected to your PC. You can submit a report direct to the printer connected to the AS but cannot send a report direct to your printer connected to your PC.
    From the symptoms you described, the problem is usually associated with the AS not being able to see the printer shared on your PC. You either have the address to your printer address defined wrong or your AS is trying to direct a job to your printer but doesn't have rights to do it.
    First, Try to print a notepad job to your printer attached to your PC from the AS. This will tell you if you have access to do so or not.
    - If it can't, you need to figure out why? This has nothing to do with oracle.
    Second, thing to check is your Oracle "Report Queue Manager" on the AS. Make sure that you can submit a report manually from the Report Queue Manager. If it fails the "Report Queue Manager" will give you useful errors as to why it failed. This will help you isolate the problem.
    Third, Once you can submit a job from the reports queue manager manually to your shared printer you should be able to submit from your application direct. If it still does not work your address to the printer is incorrect. Try submitting manually through the reports queue manager again. When selecting printer you will be given a list of accessible printers from the AS. Select the one connected to your PC. Once selected the full network address will appear. Copy and use this as the printer location in your job submission through your application.
    That's it... Where using this right now and it works great. Hope this helps.
    Eric.

  • Printing a report directly to the printer on the client machine

    Hi All,
    I am migrating reports from 6i to 10g, all these reports are called from menu and some from forms. There are some reports which are directly sent to the printer for printing. My question is when we run those reports that are sent directly to the printer from OAS, Can we make it refer to the printer set up on the client machine?. Can any one let me know regarding this?.
    Regards,
    Prasad.

    Check out the orarrp utility (Oracle Reports Remote Printing Utility) on Metalink, note 277431.1.
    It may be easier in the end to set up printers on the OAS. I guess that client PC's are using network printers, or are the really using printers connected directly to the PC?

  • How can I send a 10g report direct to the printer?

    Hi!
    I've got a form that calls n-times then same report, with different parameters.
    Actually, I generate a pdf and then, the user could print it.... but it is not a good idea, I want to send the output direct to the printer.
    do I have to register the printer name in any config file?
    If I run my report with then following URL:
    http://rx26201:7778/reports/rwservlet?report=test&DESTYPE=PRINTER&DESNAME=hplj_206
    I got the following error:
    REP-713: Invalid printer name 'hplj_206' specified by parameter DESNAME.
    Can anybody help me with this?
    Thanks a lot!
    Carolina

    Hi Carolina
    You should give a little more information for example the platform (O/S), application etc.
    Anyway, the printer should be configured and appear when "lpstat" is run assuming this is a unix like environment.
    Hope this helps
    Graeme

  • PDF + Print directly to the printer

    I need to have the print directly to the printer option enabled for a legacy app to print properly. However
    with this option on PDF's will not print. Even when enabling the print as image option, it still fails. Does anyone have a solution?
    *after testing, acrobat reader X seems to fix the issue. But i still don't know whats wrong. Does anyone know where i can find a changelog of the new version?

    Please check that when you print to PDF, the Save as dialog might goes in background. Watch for blinking icon in the taskbar at the bottom. Click the icon and give output PDF name.
    If this is the case then this is known problem at MS end. See http://support.microsoft.com/kb/2567869
    This problem comes when printing from 32bit apps on 64bit OS.

  • How do I import an image directly from the internet without printing and scanning it in first?

    How do I import an image directly from the internet without printing and scanning it in first?

    You can also Ctrl click on the image, save the image to your desktop and open it in Photoshop.
    1.
    2.
    3. Open in Photoshop by double-clicking on the saved image on your Desktop or Cmd o in Photoshop.
    I don't see any point to copying and pasting from a browser into a new file in Photoshop.
    If you want to put an image onto an already open image in Photoshop, use the File > Place... command and select your saved image.
    Gene

Maybe you are looking for