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: 

Creating Spool request

Former Member
0 Kudos

Hi friends,

as per the old message I am trying to create a spool request which further will be downloaded to PDF format. I am facing a problem, as per message when I try to do write in worte_perform I am receving ABAP dumps with Illegal page number

anyidea why is it so .

Thanks

Lakhbir

-


data: loc_dest like pri_params-pdest .

clear : wf_listname , loc_dest , wf_listtext .

move: 'List name' to wf_listname .

move: 'List header text' to wf_listtext .

select single spld into usr01-spld from usr01 where bname eq sy-uname .

if sy-subrc eq 0 .

move: usr01-spld to loc_dest .

endif .

call function 'GET_PRINT_PARAMETERS'

exporting

destination = loc_dest

copies = wf_copies

list_name = wf_listname

list_text = wf_listtext

immediately = ' '

release = ' '

new_list_id = 'X'

expiration = wf_days

line_size = 200

line_count = 65

layout = 'X_65_200'

sap_cover_page = 'X'

receiver = 'SAP*'

department = ''

no_dialog = 'X'

importing

out_parameters = wf_params

valid = wf_valid.

if wf_valid <> space.

new-page print on parameters wf_params no dialog.

perform write_summary .

new-page print off.

endif .

within the write_summary do a normal write operation.

loop at <itab> .

write:/

endloop .

-


1 REPLY 1

Former Member
0 Kudos

We encountered a similar problem on 4.6C using a custom BAPI to save invoices to PDF for an internal web app. We used a BDC/call transaction to access the output function from there. This was only supposed to be a temporary workaround but has been working and we probably won't revisit until our next upgrade. Hopefully this idea will help on your version, if so I am new here and need points!

*Generate Transaction

PERFORM dynpro USING :

'X' 'SAPMV60A' '0101' ,

' ' 'VBRK-VBELN' v_invoice ,

' ' 'BDC_OKCODE' '=DRCK' .

PERFORM dynpro USING :

'X' 'SAPLVMSG' '0110' ,

' ' 'DNAST-KSCHL' v_kschl,

' ' 'BDC_OKCODE' '=STAR' .

SELECT * UP TO 1 ROWS

FROM nast WHERE objky = v_invoice

AND vstat = '1'

AND kappl = 'V3'

AND kschl = v_kschl

AND aktiv = space.

ENDSELECT.

IF sy-subrc = 0.

PERFORM dynpro USING :

'X' 'SAPLSPO1' '0300' ,

' ' 'BDC_OKCODE' '=YES' .

ENDIF.

PERFORM dynpro USING :

'X' 'SAPLVMSG' '0100' ,

' ' 'NAST-LDEST' 'TD06',

' ' 'NAST-DIMME' space,

' ' 'NAST-TDOCOVER' space,

' ' 'NAST-TDRECEIVER' space,

' ' 'NAST-DELET' 'X',

' ' 'BDC_OKCODE' '=STAR' .

CALL TRANSACTION 'VF03'

USING i_bdcdata

MODE v_mode

UPDATE 'S'

MESSAGES INTO i_bdcmsgcoll.