[57997] in SAPr3-news
=?iso-8859-1?q?Re:_Verdichten_mehrerer_Spoolauftr=E4ge_zu_einem?=
daemon@ATHENA.MIT.EDU (gs_dev0@nexgo.de)
Fri Sep 1 04:39:38 2006
To: sapr3-news@mit.edu
Date: 1 Sep 2006 01:39:30 -0700
From: gs_dev0@nexgo.de
Message-ID: <1157099970.897917.47620@i42g2000cwa.googlegroups.com>
Kalle Grabowski schrieb:
> wir erstellen =FCber TA RSNAST00 h=E4ufiger Spoolauftr=E4ge. Nun haben wir
> als Aufgabestellung, dass die dort erzeugten Spoolauftr=E4ge selektiert
> und zu einem Spoolauftrag zusammengefasst werden soll, da dieser von
> einem externen Dienstleister ausgedruckt werden soll
> ...
Hallo Kalle,
f=FCr ABAP-Listen sollte u.a. Programm ztest01 funktionieren.
Die aus RSNAST00 erzeugten OTF-Auftr=E4ge k=F6nnntest du mittels FB
CONVERT_OTF
in PDF-Dateien umwandeln, siehe Beispielprogramm ztest02.
Als weiteres Beispiel kannst du dir auch das SAP-Programm RSTXPDFT4
ansehen, mit dem man einen einzelnen Spoolauftrag in eine PDF-Datei
konvertieren kann.
Gru=DF
Georg
---schnipp---
* mehrere Spoolauftr=E4ge zu einem zusammenfassen
REPORT ztest01 LINE-SIZE 78.
TABLES: tsp01sys.
SELECT-OPTIONS: spoolid FOR tsp01sys-rqident NO INTERVALS.
START-OF-SELECTION.
LOOP AT spoolid.
CALL FUNCTION 'RSPO_DISPLAY_SPOOLJOB'
EXPORTING
rqident =3D spoolid-low
EXCEPTIONS
no_such_job =3D 1
job_contains_no_data =3D 2
selection_empty =3D 3
no_permission =3D 4
can_not_access =3D 5
read_error =3D 6
OTHERS =3D 7.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
ENDLOOP.
---schnapp---
---schnipp---
REPORT ztest02 LINE-SIZE 80.
TABLES: tsp01.
SELECT-OPTIONS: s_ident FOR tsp01-rqident.
PARAMETERS: p_file LIKE rlgrap-filename DEFAULT 'C:\temp\test.pdf'.
DATA: it_buf_ges TYPE TABLE OF soli.
DATA: it_pdf TYPE TABLE OF tline.
DATA: g_filesize TYPE i.
START-OF-SELECTION.
SELECT * FROM tsp01 WHERE rqident IN s_ident.
PERFORM read_otf USING tsp01-rqident.
ENDSELECT.
PERFORM convert_otf.
PERFORM download.
*&---------------------------------------------------------------------*
*& Form read_otf
*&---------------------------------------------------------------------*
* Spoolauftrag als OTF zur=FCckliefern und in Tabelle it_buf_ges
* sammeln
*----------------------------------------------------------------------*
FORM read_otf USING i_spnr.
DATA: l_spoolnr TYPE tsp01-rqident,
l_type TYPE soodk-objtp.
DATA: it_bufpdf TYPE TABLE OF tline,
wa_bufpdf TYPE tline.
DATA: it_buf TYPE TABLE OF soli,
wa_buf TYPE soli.
l_spoolnr =3D i_spnr.
CALL FUNCTION 'RSPO_RETURN_SPOOLJOB'
EXPORTING
rqident =3D l_spoolnr
desired_type =3D 'OTF'
IMPORTING
real_type =3D l_type
TABLES
buffer =3D it_buf
buffer_pdf =3D it_bufpdf.
APPEND LINES OF it_buf TO it_buf_ges.
ENDFORM. "read_otf
*&---------------------------------------------------------------------*
*& Form convert_otf
*&---------------------------------------------------------------------*
* Konvertierung OTF -> PDF
*----------------------------------------------------------------------*
FORM convert_otf.
CALL FUNCTION 'CONVERT_OTF'
EXPORTING
format =3D 'PDF'
IMPORTING
bin_filesize =3D g_filesize
TABLES
otf =3D it_buf_ges
lines =3D it_pdf.
ENDFORM. "convert_otf
*&---------------------------------------------------------------------*
*& Form download
*&---------------------------------------------------------------------*
* Download der PDF-Datei
*----------------------------------------------------------------------*
FORM download.
DATA: l_file TYPE string.
l_file =3D p_file.
CALL FUNCTION 'GUI_DOWNLOAD'
EXPORTING
bin_filesize =3D g_filesize
filename =3D l_file
filetype =3D 'BIN'
TABLES
data_tab =3D it_pdf.
ENDFORM. "download
---schnapp---