on 07-11-2005 3:55 PM
Hello everybody,
i'am new at <b>SDN</b> and i'am searching one ore more tutorials which describe how to create a pdf file out of R/3.
I know that i have to define a interface between ABAP and Adobe PDF but i don't know how this stuff works in detail.
I'am an AZUBI and currently in my second department where i have to develop an tool which collects data from R/3 and converts it into PDF.
If anybody did this before or know where i can get an tutorial please help me.
Best regards
Fabian Eidner
Hi Fabian
you can use Smart Forms to do this, but from your initial question I take that you are referring to the Interactive Forms solution. How to proceed is described in the standard SAP documentation on the SAP Help Portal:
English: http://help.sap.com/saphelp_nw04/helpdata/en/d2/4a94696de6429cada345c12098b009/frameset.htm
German: http://help.sap.com/saphelp_nw04/helpdata/de/d2/4a94696de6429cada345c12098b009/frameset.htm
We will also soon have tutorials for Web Dynpro for Java that explain the principles of data retrieval in this environment. To get data from R/3, you would simply have to set up the backend connection from R/3 to the Java frontend using Adaptive RFC (check the tutorials on this in SDN).
Regards,
Markus Meisl
SAP NetWeaver Product Management
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
try this.
REPORT RSTXPDFT4 line-size 80.
TABLES: TSP01,ZSINFO.
DATA:BEGIN OF HTML OCCURS 0,
HTM LIKE RLGRAP-FILENAME,
SPOOLNO LIKE TSP01-RQIDENT,
END OF HTML.
DATA: SPOOLNO LIKE TSP01-RQIDENT,DOWNLOAD(1) VALUE 'X',
P_FILE LIKE RLGRAP-FILENAME VALUE '\MAILS$\'.
DATA otf like itcoo occurs 100 with header line.
DATA CANCEL.
DATA PDF LIKE TLINE OCCURS 100 WITH HEADER LINE.
DATA DOCTAB LIKE DOCS OCCURS 1 WITH HEADER LINE.
DATA: NUMBYTES TYPE I,
ARC_IDX LIKE TOA_DARA,
pdfspoolid like tsp01-rqident,
jobname like tbtcjob-jobname,
jobcount like tbtcjob-jobcount,
is_otf.
data: client like tst01-dclient,
name like tst01-dname,
objtype like rststype-type,
type like rststype-type.
*select single * from tsp01 where rqident = spoolno.
SELECT * FROM TSP01 WHERE RQOWNER = sy-uname
AND rq0name = 'SMART'
and RQ2NAME = sy-uname.
IF SY-SUBRC = 0.
CONCATENATE P_FILE sy-datum '.PDF' INTO P_FILE.
MOVE P_FILE TO HTML-HTM.
MOVE TSP01-RQIDENT TO HTML-SPOOLNO.
APPEND HTML.
CLEAR P_FILE.
*P_FILE = '
10.0.0.182\mails$\'.
ENDIF.
ENDSELECT.
if sy-subrc <> 0.
WRITE: / 'Spoolauftrag existiert nicht'(003)
COLOR COL_negative.
exit.
endif.
break bc01.
client = tsp01-rqclient.
name = tsp01-rqo1name.
CALL FUNCTION 'RSTS_GET_ATTRIBUTES'
EXPORTING
AUTHORITY = 'SP01'
CLIENT = client
NAME = name
PART = 1
IMPORTING
TYPE = type
OBJTYPE = objtype
EXCEPTIONS
FB_ERROR = 1
FB_RSTS_OTHER = 2
NO_OBJECT = 3
NO_PERMISSION = 4.
if objtype(3) = 'OTF'.
is_otf = 'X'.
else.
is_otf = space.
endif.
LOOP AT HTML.
if is_otf = 'X'.
CALL FUNCTION 'CONVERT_OTFSPOOLJOB_2_PDF'
EXPORTING
SRC_SPOOLID = HTML-SPOOLNO
NO_DIALOG = ' '
IMPORTING
PDF_BYTECOUNT = numbytes
PDF_SPOOLID = pdfspoolid
BTC_JOBNAME = jobname
BTC_JOBCOUNT = jobcount
TABLES
PDF = pdf
EXCEPTIONS
ERR_NO_OTF_SPOOLJOB = 1
ERR_NO_SPOOLJOB = 2
ERR_NO_PERMISSION = 3
ERR_CONV_NOT_POSSIBLE = 4
ERR_BAD_DSTDEVICE = 5
USER_CANCELLED = 6
ERR_SPOOLERROR = 7
ERR_TEMSEERROR = 8
ERR_BTCJOB_OPEN_FAILED = 9
ERR_BTCJOB_SUBMIT_FAILED = 10
ERR_BTCJOB_CLOSE_FAILED = 11.
case sy-subrc.
when 0.
WRITE: / 'Funktion CONVERT_OTFSPOOLJOB_2_PDF erfolgreich'(001)
COLOR COL_POSITIVE.
when 1.
WRITE: / 'Kein OTF- und kein ABAP-Spoolauftrag'(002)
COLOR COL_negative.
exit.
when 2.
WRITE: / 'Spoolauftrag existiert nicht'(003)
COLOR COL_negative.
exit.
when 3.
WRITE: / 'Keine Berechtigung zum Lesen Spoolauftrag'(004)
COLOR COL_negative.
exit.
when others.
WRITE: / 'Fehler bei Funktion CONVERT_OTFSPOOLJOB_2_PDF'(005)
COLOR COL_negative.
exit.
endcase.
else.
CALL FUNCTION 'CONVERT_ABAPSPOOLJOB_2_PDF'
EXPORTING
SRC_SPOOLID = HTML-SPOOLNO
NO_DIALOG = ' '
DST_DEVICE =
PDF_DESTINATION =
IMPORTING
PDF_BYTECOUNT = numbytes
PDF_SPOOLID = pdfspoolid
LIST_PAGECOUNT =
BTC_JOBNAME = jobname
BTC_JOBCOUNT = jobcount
TABLES
PDF = pdf
EXCEPTIONS
ERR_NO_ABAP_SPOOLJOB = 1
ERR_NO_SPOOLJOB = 2
ERR_NO_PERMISSION = 3
ERR_CONV_NOT_POSSIBLE = 4
ERR_BAD_DESTDEVICE = 5
USER_CANCELLED = 6
ERR_SPOOLERROR = 7
ERR_TEMSEERROR = 8
ERR_BTCJOB_OPEN_FAILED = 9
ERR_BTCJOB_SUBMIT_FAILED = 10
ERR_BTCJOB_CLOSE_FAILED = 11.
endif.
download PDF file ***********
check download = 'X'.
break bc01.
CALL FUNCTION 'WS_DOWNLOAD'
EXPORTING
BIN_FILESIZE = NUMBYTES
filename = p_file
FILENAME = HTML-HTM
FILETYPE = 'BIN'
IMPORTING
act_filename = p_file
ACT_FILENAME = HTML-HTM
FILESIZE = NUMBYTES
CANCEL = CANCEL
TABLES
DATA_TAB = PDF.
ENDLOOP.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
try this.
REPORT RSTXPDFT4 line-size 80.
TABLES: TSP01,ZSINFO.
DATA:BEGIN OF HTML OCCURS 0,
HTM LIKE RLGRAP-FILENAME,
SPOOLNO LIKE TSP01-RQIDENT,
END OF HTML.
DATA: SPOOLNO LIKE TSP01-RQIDENT,DOWNLOAD(1) VALUE 'X',
P_FILE LIKE RLGRAP-FILENAME VALUE '
10.0.0.182\MAILS$\'.
DATA otf like itcoo occurs 100 with header line.
DATA CANCEL.
DATA PDF LIKE TLINE OCCURS 100 WITH HEADER LINE.
DATA DOCTAB LIKE DOCS OCCURS 1 WITH HEADER LINE.
DATA: NUMBYTES TYPE I,
ARC_IDX LIKE TOA_DARA,
pdfspoolid like tsp01-rqident,
jobname like tbtcjob-jobname,
jobcount like tbtcjob-jobcount,
is_otf.
data: client like tst01-dclient,
name like tst01-dname,
objtype like rststype-type,
type like rststype-type.
*select single * from tsp01 where rqident = spoolno.
SELECT * FROM TSP01 WHERE RQOWNER = sy-uname
AND rq0name = 'SMART'
and RQ2NAME = sy-uname.
IF SY-SUBRC = 0.
CONCATENATE P_FILE sy-datum '.PDF' INTO P_FILE.
MOVE P_FILE TO HTML-HTM.
MOVE TSP01-RQIDENT TO HTML-SPOOLNO.
APPEND HTML.
CLEAR P_FILE.
*P_FILE = '
10.0.0.182\mails$\'.
ENDIF.
ENDSELECT.
if sy-subrc <> 0.
WRITE: / 'Spoolauftrag existiert nicht'(003)
COLOR COL_negative.
exit.
endif.
break bc01.
client = tsp01-rqclient.
name = tsp01-rqo1name.
CALL FUNCTION 'RSTS_GET_ATTRIBUTES'
EXPORTING
AUTHORITY = 'SP01'
CLIENT = client
NAME = name
PART = 1
IMPORTING
TYPE = type
OBJTYPE = objtype
EXCEPTIONS
FB_ERROR = 1
FB_RSTS_OTHER = 2
NO_OBJECT = 3
NO_PERMISSION = 4.
if objtype(3) = 'OTF'.
is_otf = 'X'.
else.
is_otf = space.
endif.
LOOP AT HTML.
if is_otf = 'X'.
CALL FUNCTION 'CONVERT_OTFSPOOLJOB_2_PDF'
EXPORTING
SRC_SPOOLID = HTML-SPOOLNO
NO_DIALOG = ' '
IMPORTING
PDF_BYTECOUNT = numbytes
PDF_SPOOLID = pdfspoolid
BTC_JOBNAME = jobname
BTC_JOBCOUNT = jobcount
TABLES
PDF = pdf
EXCEPTIONS
ERR_NO_OTF_SPOOLJOB = 1
ERR_NO_SPOOLJOB = 2
ERR_NO_PERMISSION = 3
ERR_CONV_NOT_POSSIBLE = 4
ERR_BAD_DSTDEVICE = 5
USER_CANCELLED = 6
ERR_SPOOLERROR = 7
ERR_TEMSEERROR = 8
ERR_BTCJOB_OPEN_FAILED = 9
ERR_BTCJOB_SUBMIT_FAILED = 10
ERR_BTCJOB_CLOSE_FAILED = 11.
case sy-subrc.
when 0.
WRITE: / 'Funktion CONVERT_OTFSPOOLJOB_2_PDF erfolgreich'(001)
COLOR COL_POSITIVE.
when 1.
WRITE: / 'Kein OTF- und kein ABAP-Spoolauftrag'(002)
COLOR COL_negative.
exit.
when 2.
WRITE: / 'Spoolauftrag existiert nicht'(003)
COLOR COL_negative.
exit.
when 3.
WRITE: / 'Keine Berechtigung zum Lesen Spoolauftrag'(004)
COLOR COL_negative.
exit.
when others.
WRITE: / 'Fehler bei Funktion CONVERT_OTFSPOOLJOB_2_PDF'(005)
COLOR COL_negative.
exit.
endcase.
else.
CALL FUNCTION 'CONVERT_ABAPSPOOLJOB_2_PDF'
EXPORTING
SRC_SPOOLID = HTML-SPOOLNO
NO_DIALOG = ' '
DST_DEVICE =
PDF_DESTINATION =
IMPORTING
PDF_BYTECOUNT = numbytes
PDF_SPOOLID = pdfspoolid
LIST_PAGECOUNT =
BTC_JOBNAME = jobname
BTC_JOBCOUNT = jobcount
TABLES
PDF = pdf
EXCEPTIONS
ERR_NO_ABAP_SPOOLJOB = 1
ERR_NO_SPOOLJOB = 2
ERR_NO_PERMISSION = 3
ERR_CONV_NOT_POSSIBLE = 4
ERR_BAD_DESTDEVICE = 5
USER_CANCELLED = 6
ERR_SPOOLERROR = 7
ERR_TEMSEERROR = 8
ERR_BTCJOB_OPEN_FAILED = 9
ERR_BTCJOB_SUBMIT_FAILED = 10
ERR_BTCJOB_CLOSE_FAILED = 11.
endif.
download PDF file ***********
check download = 'X'.
break bc01.
CALL FUNCTION 'WS_DOWNLOAD'
EXPORTING
BIN_FILESIZE = NUMBYTES
filename = p_file
FILENAME = HTML-HTM
FILETYPE = 'BIN'
IMPORTING
act_filename = p_file
ACT_FILENAME = HTML-HTM
FILESIZE = NUMBYTES
CANCEL = CANCEL
TABLES
DATA_TAB = PDF.
ENDLOOP.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello everybody,
so i found out that there is an example REPORT called: FP_EXAMPLE_01 this report works fine and is also an big help for beginners.
You can also check the system compatibility with the programm: FP_PDF_TEST_00
Up to date troubleshooting info can be found at: 717568
best regards
Fabian
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello,
first of all thank you very much for the information.
But know i'm trying to transport 2 Variables from a programm over the interface onto the form. In the given example they dont explain everything.
So it would be very hopeful if i could have a look at an report which transports variables onto an form.
Did you know if there are more examples ?
best regards
Fabian
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Were just talking about this in terms of BSP, have a look at this thread and all the references it has should help you resolve some of your questions.
Otherwise take a look at <a href="https://www.sdn.sap.com/sdn/search.sdn?contenttype=url&query=adobe%20smart%20forms&selected=9&content=http://www.sdn.sap.comhttp://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/pcd!3aportal_content!2fSDN!2fiViews!2fWCM!2fcom.sap.sdn..wcm.search.search_adv%3Fprttheme%3DCSIN%26QueryString=adobe%20smart%20forms%26SearchPluginName=sdn_weblog%26SelectedCustomProps=resourcetype(value=sdn_weblog)">these</a>
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
1 | |
1 | |
1 | |
1 | |
1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.