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

Spool request sp02

Former Member
0 Likes
2,118

Hi all,

I have a requirement where my data is in my internal table with that data i have to create a log in the spool sp02 t-code. Please help me to do this.

Thanks in advance.

1 ACCEPTED SOLUTION
Read only

Simha_
Product and Topic Expert
Product and Topic Expert
0 Likes
1,484

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.

Cheers,

Simha.

Reward all the helpful answers...

2 REPLIES 2
Read only

kiran_k8
Active Contributor
0 Likes
1,484

Praveena,

You want to send the data in the internal table to spool,right?

Then use GET_PRINT_PARAMETERS.

Just give internal table to spool in the search column of ABAP GENERAL forums,you will be able to see tons of info regarding this.

Thanks,

K.Kiran.

Read only

Simha_
Product and Topic Expert
Product and Topic Expert
0 Likes
1,485

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.

Cheers,

Simha.

Reward all the helpful answers...