Application Development 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: 

Smartforms help

Former Member
0 Kudos

Hi everyone,

Here I have to download pdf of selected pernrs time data into pdf in smartform format ,

problem,

1. when i am trying to download into pdf it downloads only one i.e last form repeatedly two time into pdf.

2. e.g i am giving the select option from 10866 to 10868 but it give the pdf of only 10866.

3. i am using convert_otf_2_pdf FM is there any fm than this and otf_convert please let me know.

and which otf should be passed to the fm and which table to the gui_download.

thank you,

Regards,

Jagrut BharatKumar Shukla

1 ACCEPTED SOLUTION

Former Member
0 Kudos

hi

try it like this

please change the select query like yhis..

select [field] form <database name] inot [itab] where

[field] IN [select-option field name]..

declaration ..

  • PDF CONVERSION DECLEARTIONS

DATA : it_tlines LIKE TABLE OF tline, "pdf FILE CONVERSITION

it_doc LIKE TABLE OF docs, "pdf FILE CONVERSITION

bin_size TYPE i,

joboutput TYPE ssfcrescl,

otf LIKE TABLE OF itcoo,

control TYPE ssfctrlop.

************************FORMdownload****************************

CALL FUNCTION 'CONVERT_OTF_2_PDF'

IMPORTING

bin_filesize = bin_size

TABLES

otf = joboutput-otfdata[]

doctab_archive = it_doc

lines = it_tlines.

CALL FUNCTION 'GUI_DOWNLOAD'

EXPORTING

bin_filesize = bin_size

filename = 'C:\JESUS\OUTPUT.PDF' --> specify your path here..

filetype = 'BIN'

TABLES

data_tab = it_tlines.

regards

baskaran

Message was edited by:

baskaran nagamanickam

3 REPLIES 3

Former Member
0 Kudos

hi

try it like this

please change the select query like yhis..

select [field] form <database name] inot [itab] where

[field] IN [select-option field name]..

declaration ..

  • PDF CONVERSION DECLEARTIONS

DATA : it_tlines LIKE TABLE OF tline, "pdf FILE CONVERSITION

it_doc LIKE TABLE OF docs, "pdf FILE CONVERSITION

bin_size TYPE i,

joboutput TYPE ssfcrescl,

otf LIKE TABLE OF itcoo,

control TYPE ssfctrlop.

************************FORMdownload****************************

CALL FUNCTION 'CONVERT_OTF_2_PDF'

IMPORTING

bin_filesize = bin_size

TABLES

otf = joboutput-otfdata[]

doctab_archive = it_doc

lines = it_tlines.

CALL FUNCTION 'GUI_DOWNLOAD'

EXPORTING

bin_filesize = bin_size

filename = 'C:\JESUS\OUTPUT.PDF' --> specify your path here..

filetype = 'BIN'

TABLES

data_tab = it_tlines.

regards

baskaran

Message was edited by:

baskaran nagamanickam

former_member189629
Active Contributor
0 Kudos

Jagrut,

Loop thru the table which contains PERNRs and write your fm_name and OTF & Download Function Modules from within the loop so that it creates a new file for each PERNR.

Reward if helpful,

Karthik

Former Member
0 Kudos

Is you smartform giving correct data before converting the report to PDF ?

if it is so, you can create a spool of the smartform in background and get a pdf of the spool by giving the spool no.on executing the program RSTXPDFT4.

but, if your smartform itself is not giving the correct output, you have to check the loop statements where PERNR is passed .

Thanks and Regards,

Anindita