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

get_print_parameters error

Former Member
0 Likes
1,552

gst_print TYPE slis_print_alv.

IMPORTING

out_parameters = gst_print.

I'm getting GST_PRINT is the correct type, its length is incorrect.

Any idea why this dump?

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,460

CALL FUNCTION 'GET_PRINT_PARAMETERS'

11 REPLIES 11
Read only

Former Member
0 Likes
1,460

which FM?

Read only

Former Member
0 Likes
1,461

CALL FUNCTION 'GET_PRINT_PARAMETERS'

Read only

0 Likes
1,460

Hi,

Change the declaration like this and check


gst_print TYPE pri_params.

Regards,

Vikranth

Read only

0 Likes
1,460

Hi,

Please have a look at the sample code

CONSTANTS : c_linsz LIKE sy-linsz VALUE '132',  "Constant for line size
* Declaration of local constants
  CONSTANTS :  lc_paart LIKE sy-paart VALUE 'X_65_132',  " Paper Format
               lc_locl  TYPE sypdest VALUE 'LOCL'.       " Destination

* If print option is selected.
  IF p_print IS NOT INITIAL.
    MOVE c_x TO v_print.
  ELSE.
    CLEAR v_print.
  ENDIF.

* Setup the Print Parmaters
  CALL FUNCTION 'GET_PRINT_PARAMETERS'
    EXPORTING
      authority              = space
      immediately            = v_print
      new_list_id            = c_x
      no_dialog              = c_x
      user                   = sy-uname
    IMPORTING
      out_parameters         = v_print_parms
    EXCEPTIONS
      archive_info_not_found = 1
      invalid_print_params   = 2
      invalid_archive_params = 3
      OTHERS                 = 4.

  IF sy-subrc NE 0.
    CLEAR : v_print_parms.
  ENDIF.

* The printer destination has to be  set up
  IF v_print_parms-pdest = space.
    v_print_parms-pdest = lc_locl.
  ENDIF.
* Explicitly set line width, and output format so that
* the PDF conversion comes out OK
  v_print_parms-linsz = c_linsz.
  v_print_parms-paart = lc_paart.

Regards,

Nagaraj

Edited by: Julius Bussche on Sep 25, 2009 1:16 PM

Code tags added...

Read only

0 Likes
1,460

Hi, Kumar

Sorry, we were not expecting code from you like this, you don't know ?

Faisal

Read only

0 Likes
1,460

v_print_parms

how did u declare it?

Read only

0 Likes
1,460

Hi,

data : v_print_parms LIKE pri_params, "Structure for Passing

"Print Parameters

Regards,

Nagaraj

Read only

faisalatsap
Active Contributor
0 Likes
1,460

Hi,

I think the following way,

DATA: v_print_parms LIKE PRI_PARAMS.

Faisal

Read only

0 Likes
1,460

Hi Faisal,

Sorry is not needed friend..I didn't know or see how to post the code thread..Thanks for notifying me.

Regards,

Nagaraj

Read only

Former Member
0 Likes
1,460

v_print_parms LIKE PRI_PARAMS is not a valid structure for

CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'

EXPORTING

i_callback_program = sy-repid

is_layout = gst_layout

it_fieldcat = gt_excelfieldcat[]

i_default = 'X'

i_save = 'A'

is_print = v_print_parms

thsi is creating a dump.

Read only

0 Likes
1,460

Hi,

Yes it will as the paramter u r passing is of different structure... u need pass is_print as SLIS_PRINT_ALV .Now declare a internal table with this structre and fill the option u want for printing.

The code which i gave u is for print output with Write statement.

Regards,

Nagaraj