Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

submit rstxpdft4

Former Member
0 Likes
1,893

i am using rstxpdft4 to convert the smartform to pdf. it is working fine. when i am giviing test-> print the spool id is been created. only one id has been created so all the next forms are appended to the same spool id. so for every run i want to have one spool id and i want to pass this spool id to the selection screen of the rstxpdft4. how this can be solved. waiting for ur replies.

instead i want to delete the previous spool id and generate new. can this is be possible thru this procedure

Message was edited by: Ateeq K

14 REPLIES 14
Read only

Vinod_Chandran
Active Contributor
0 Likes
1,758

Hi Ateeq,

Did you select the 'New spool request' check box?

Also give different name of each print in the field 'Spool request name'. E.g 1,2,3 etc.

Pls let me know from where you are printing?

Thanks

Vinod

Read only

0 Likes
1,758

hai vinod,

thanks for the reply.

first of all i am going to the print preview. i am clicking test-> print and after that i am selecting f3 button (or) back button. here the spool prog rstxpdft4 has been called. now i am giving the generated spool id in this selection screen and executing.

previously i haven't given the new spool req. now i had given that.

including this i want to send the spool id to the selection screen of rstxpdf4, how to do this.

Message was edited by: Ateeq K

Read only

0 Likes
1,758

Hi Ateeq,

Check whether it is creating new spool request for each print out? Because now you have selected the 'New spool request'. Was this your problem?

If it is generating new spool request, then the program rstxpdft4 will generate pdf file for each print out.

Thanks

Vinod

Read only

0 Likes
1,758

thanx for ur reply.

it is working fine now.

how to catch the generated spoolid in a variable programatically. plz respond its urgent

also without giving the spoolid can we send the otf to pdf and save it in the system.

Message was edited by: Ateeq K

Read only

0 Likes
1,758

Hi,

Use FM 'CONVERT_OTF'.

call function 'CONVERT_OTF'

EXPORTING

FORMAT = 'PDF'

MAX_LINEWIDTH = 132

IMPORTING

BIN_FILESIZE = NUMBYTES

TABLES

OTF = ZOFTDATA

LINES = ZPDF

EXCEPTIONS

ERR_MAX_LINEWIDTH = 1

ERR_FORMAT = 2

ERR_CONV_NOT_POSSIBLE = 3.

CALL FUNCTION 'WS_DOWNLOAD'

EXPORTING

BIN_FILESIZE = NUMBYTES

FILENAME = FILEPDF

FILETYPE = 'BIN'

IMPORTING

  • ACT_FILENAME = FILEPDF

FILESIZE = NUMBYTES

TABLES

DATA_TAB = ZPDF

EXCEPTIONS

OTHERS = 9.

Svetlin

Read only

0 Likes
1,758

hai Rusev,

i had used this code but it is not working.

when i debug, the zoftdata and zpdf including the numbtypes is also zero when the func. module is returned.

so these null values are passed to the download func, so it is not working. any suggestions regarding this are welcome.

Read only

0 Likes
1,758

Hi Ateeq,

What technique are you using for the ouput generation?

SAPScript or Smartform?

Follow these steps if you are using SAPScript.

1. Mark 'X' in the field TDGETOTF of the structure ITCPO of the FM: OPEN_FORM.

2. You will get the OTF data of the form in tables parameter of the FM: CLOSE_FORM.

3. The OTF data may be converted to PDF data by FM: CONVERT_OTF_2_PDF.

4. This PDF data may be downloaded by Function module GUI_DOWNLOAD.

For Smartforms

-


s_control_parameters-no_dialog = 'X'.

s_control_parameters-getotf = 'X'.

CALL FUNCTION v_func_name

EXPORTING

output_options = s_output_options

control_parameters = s_control_parameters

IMPORTING

job_output_info = s_job_output_info

......

......

call function 'CONVERT_OTF_2_PDF'

tables

otf = s_job_output_info-otfdata

lines = t_pdf

Thanks

Vinod

Message was edited by: Vinod C

Read only

0 Likes
1,758

Hi,

This is part of my code.

data: fm_name type rs38l_fnam,

I_SSFCTRLOP type SSFCTRLOP,

I_ssfcompop type ssfcompop,

E_ssfcrescl TYPE ssfcrescl.

if EPDF = 'X'.

I_SSFCTRLOP-getotf = 'X'.

I_SSFCTRLOP-no_dialog = 'X'.

I_ssfcompop-tdnoprev = 'X'.

endif.

.......

DESCRIBE TABLE T_BKPF LINES T_LINES.

loop at T_BKPF into S_BKPF.

....

if T_LINES > 1.

I_SSFCTRLOP-NO_OPEN = 'X'.

I_SSFCTRLOP-NO_CLOSE = 'X'.

at first.

I_SSFCTRLOP-NO_OPEN = SPACE.

I_SSFCTRLOP-NO_CLOSE = 'X'.

endat.

at last.

I_SSFCTRLOP-NO_OPEN = 'X'.

I_SSFCTRLOP-NO_CLOSE = SPACE.

endat.

endif.

...

CALL FUNCTION fm_name

EXPORTING

  • ARCHIVE_INDEX =

  • ARCHIVE_PARAMETERS =

CONTROL_PARAMETERS = I_SSFCTRLOP

  • MAIL_APPL_OBJ =

  • MAIL_RECIPIENT =

  • MAIL_SENDER =

OUTPUT_OPTIONS = I_ssfcompop

  • USER_SETTINGS = 'X'

S_BKPF = S_BKPF

S_FWBAS = S_FWBAS

S_FWSTE = S_FWSTE

S_FWTOT = S_FWTOT

S_WORDS = S_WORDS

S_PAYM = S_PAYM

V_BSEG = S_BSEG

P_TYPE = copy

I_USER = PUNAME

IMPORTING

  • DOCUMENT_OUTPUT_INFO =

JOB_OUTPUT_INFO = E_ssfcrescl

  • JOB_OUTPUT_OPTIONS =

TABLES

T_BSEG = T_BSEG

EXCEPTIONS

FORMATTING_ERROR = 1

INTERNAL_ERROR = 2

SEND_ERROR = 3

USER_CANCELED = 4

OTHERS = 5.

endloop.

if EPDF = 'X'.

PERFORM SAVE_TO_PDF TABLES E_ssfcrescl-OTFDATA.

endif.

FORM SAVE_TO_PDF TABLES ZOFTDATA STRUCTURE ITCOO.

data:

ZPDF LIKE TLINE OCCURS 100 WITH HEADER LINE,

NUMBYTES TYPE I.

call function 'CONVERT_OTF'

EXPORTING

FORMAT = 'PDF'

MAX_LINEWIDTH = 132

IMPORTING

BIN_FILESIZE = NUMBYTES

TABLES

OTF = ZOFTDATA

LINES = ZPDF

EXCEPTIONS

ERR_MAX_LINEWIDTH = 1

ERR_FORMAT = 2

ERR_CONV_NOT_POSSIBLE = 3.

CALL FUNCTION 'WS_DOWNLOAD'

EXPORTING

BIN_FILESIZE = NUMBYTES

FILENAME = FILEPDF

FILETYPE = 'BIN'

IMPORTING

  • ACT_FILENAME = FILEPDF

FILESIZE = NUMBYTES

TABLES

DATA_TAB = ZPDF

EXCEPTIONS

OTHERS = 9.

endform.

I hope it will help you.

Svetlin

Message was edited by: Svetlin Rusev

Message was edited by: Svetlin Rusev

Read only

0 Likes
1,758

rusev,

i had tried as u had defined but it didn;t work. the smartform is not convrrted to the pdf here.

i had defined as u had defined, is there any need to increase 132 to 255 maxlinewidth.

plz respond

Read only

0 Likes
1,758

Hi,

I added some new code. Try with it.

Svetlin

Read only

0 Likes
1,758

See this sample code. It partly covers the pdf coversion from smartform.

https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/webas/abap/abap-co... with code sample on smart forms.pdf

Svetlin

Read only

0 Likes
1,758

wasnt't that SY-SPONR?

Read only

Former Member
0 Likes
1,758

Hi Atteq

In my knowledge, we use Txn SCOT to do the same.

Right now, i'm not having access. I'm not sure for the program RSTXPDTT4, wheteher it is the same program behind SCOT. If different, try Txn SCOT for changing the format (default format for sending forms is OTF)

Regards

Ashish Jain

Read only

Former Member
0 Likes
1,758

Hi,

It's possible to create pdf files directly from the ABAP program,where you call the smartform. There are a lot of threads to this topic. You should fill the following structures ( input parameters 😞

SSFCOMPOP ( field TDNEWID - new spool request )

SSFCTRLOP ( fields NO_OPEN, NO_CLOSE, GETOTF )

Svetlin