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.. i found out this FM RSPO_OPEN_SPOOLREQUEST which could create spool request but i'm not sure on how to use this function. Is there any example code ?

Thanks

2 REPLIES 2

Former Member
0 Kudos

HI,

Refer std program - LSCSPU04/ FM RSPO_SX_OUTPUT_TEXTDATA.

Check how ur FM has been used.

Hope this helps.

Manish

Message was edited by:

Manish Kumar

Former Member
0 Kudos

Hi

Below code can give you some idea for creating spool request and generating output:

DATA: PRIPAR TYPE PRI_PARAMS,
      ARCPAR TYPE ARC_PARAMS,
      LAY    TYPE PRI_PARAMS-PAART,
      LINES  TYPE PRI_PARAMS-LINCT,
      ROWS   TYPE PRI_PARAMS-LINSZ.
DATA: val(1).

CALL FUNCTION 'GET_PRINT_PARAMETERS'
  EXPORTING
    destination            = 'LOCL'
    no_dialog              = 'X'
    immediately            = ' '
  IMPORTING
    out_archive_parameters = arcpar
    out_parameters         = pripar
    valid                  = val
  EXCEPTIONS
    archive_info_not_found = 1
    invalid_print_params   = 2
    invalid_archive_params = 3
    OTHERS                 = 4.
IF sy-subrc <> 0.
*     MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*             WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.

pripar-prdsn = 'DSN'.
CALL FUNCTION 'GET_PRINT_PARAMETERS'
  EXPORTING
    in_archive_parameters  = arcpar
    in_parameters          = pripar
    no_dialog              = 'X'
*      list_name              = 'Testing Purpose Only' "l_list
  IMPORTING
    out_archive_parameters = arcpar
    out_parameters         = pripar
    valid                  = val
  EXCEPTIONS
    archive_info_not_found = 1
    invalid_print_params   = 2
    invalid_archive_params = 3
    OTHERS                 = 4.

IF sy-subrc EQ 0.
  NEW-PAGE PRINT ON
  NEW-SECTION
  PARAMETERS pripar
  ARCHIVE PARAMETERS arcpar
  NO DIALOG.
ELSE.
  write:/ 'Unable to create spool'.
ENDIF.

write:/ 'First Line'.
write:/ 'Second Line'.

NEW-PAGE PRINT OFF.

Kind Regards

Eswar