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: 

problem during submit

former_member404244
Active Contributor
0 Kudos

hi folks,

Actually my requirement is to convert the list output to PDF format..

First iam submitiing to spool and then using CONVERT_ABAPSPOOLJOB_2_PDF to convert to PDF.but when i do the below code

SUBMIT (sy-repid) TO SAP-SPOOL WITHOUT SPOOL DYNPRO

SPOOL PARAMETERS v_print_parms

VIA SELECTION-SCREEN

AND RETURN.

iam facing some problem in displaying the o/p.when i enter values in selection screen and execute all the values are disappearing and when i press back button its showing the o/p...plz sugest me where i was wrong.I tried with import and export but not working...I have one mandatory field in the selection screen.I tried to use that instead of selection screen but not working.tell me how can i sent list o/p to spool.Its urgent..

regards,

nagaraj

6 REPLIES 6

Former Member
0 Kudos

HI,

Check this link:

http://help.sap.com/saphelp_47x200/helpdata/en/85/54c73cee4fb55be10000000a114084/frameset.htm

This web log covers all possibilities:

/people/sap.user72/blog/2004/11/10/bsphowto-generate-pdf-output-from-a-bsp

Other options:

U've to create a spool and then convert it to pdf by report RSTXPDFT4.

or

use this function module to convert to pdf.

call function 'CONVERT_OTF'

EXPORTING

format = 'PDF'

max_linewidth = 132

IMPORTING

bin_filesize = v_len_in

TABLES

otf = i_otf

lines = i_tline

EXCEPTIONS

err_max_linewidth = 1

err_format = 2

err_conv_not_possible = 3

others = 4.

  • Fehlerhandling

if sy-subrc <> 0.

endif.

Reward points if this Helps.

Manish

Former Member
0 Kudos

Hello,

Try like this...

SUBMIT (sy-repid) TO SAP-SPOOL WITHOUT SPOOL DYNPRO

SPOOL PARAMETERS v_print_parms

<b>EXPORTING LIST TO MEMORY</b>VIA SELECTION-SCREEN

AND RETURN.

If useful reward.

Vasanth

Former Member
0 Kudos

Hi nagaraj,

1. In your ZREPORT1,

u are using the statement,

SUBMIT (sy-repid) TO

2. This may be causing to

execute the report ONCE AGAIN (bcos of submit statement),

and the selection screen is coming once again.

3. SUBMIT (sy-repid) <----


THIS SY-REPID

should not be used in the same program.

4. Instead we should create one more program ZREPORT2

where we should submit the original program.

In zreport2,

we should write

submit zreport1

WITHOUT SPOOL DYNPRO

SPOOL PARAMETERS v_print_parms

VIA SELECTION-SCREEN

AND RETURN.

regards,

amit m.

former_member404244
Active Contributor
0 Kudos

Hi amit,

yes you are correct iam using the submit in the sameprogram tahs why it s calling number of times.i wil try as u said and get back to u..thanks for ur help

Cheers

nagaraj.

former_member404244
Active Contributor
0 Kudos

Hi amit,

still not getting.Plz check the code earlier i have written.

CONCATENATE 'c:\'

sy-repid

'.pdf'

INTO lv_filename.

*-- Setup the Print Parmaters

CALL FUNCTION 'GET_PRINT_PARAMETERS'

EXPORTING

authority = space

copies = '1'

cover_page = space

data_set = space

department = space

destination = space

expiration = '1'

immediately = space

in_archive_parameters = space

in_parameters = space

layout = space

mode = space

new_list_id = 'X'

no_dialog = 'X'

user = sy-uname

IMPORTING

out_parameters = v_print_parms

valid = lv_valid

EXCEPTIONS

archive_info_not_found = 1

invalid_print_params = 2

invalid_archive_params = 3

OTHERS = 4.

*-- Make sure that a printer destination has been set up

*-- If this is not done the PDF function module ABENDS

IF v_print_parms-pdest = space.

v_print_parms-pdest = 'LOCL'.

ENDIF.

*-- Explicitly set line width, and output format so that

*-- the PDF conversion comes out OK

v_print_parms-linsz = lc_linsz.

v_print_parms-paart = lc_paart.

SUBMIT (sy-repid) TO SAP-SPOOL WITHOUT SPOOL DYNPRO

SPOOL PARAMETERS v_print_parms

VIA SELECTION-SCREEN

AND RETURN.

  • To get the spool number

PERFORM get_spool_number.

ENDFORM. " print

*&----


*

*& Form get_spool_number

*&----


*

  • Subroutine to get the spool number

*----


*

FORM get_spool_number .

DATA:

lv_rq2name LIKE tsp01-rq2name.

CONCATENATE sy-repid+0(8)

sy-uname+0(3)

INTO lv_rq2name SEPARATED BY '_'.

SELECT * FROM tsp01 WHERE rq2name = lv_rq2name

ORDER BY rqcretime DESCENDING.

v_rqident = tsp01-rqident.

EXIT.

ENDSELECT.

IF sy-subrc NE 0.

CLEAR v_rqident.

ENDIF.

ENDFORM. " get_spool_number

Please suggest me how to go further....

Kind regards,

nagaraj

0 Kudos

Hi again,

1. we should not use sy-repid

SUBMIT <b>(sy-repid)</b> TO SAP-SPOOL WITHOUT SPOOL DYNPRO

2. Instead create another program zreport2,

and inside this zreport2,

submit zreport1.....

regards,

amit m.