‎2006 Dec 15 4:05 AM
hai,
when iam entering all the required data into the fields and i need to display the required fields in the output in printer.here iam using the background jobscheduling to dislplay required fields .after entering all the data and when iam seeing in se37 for first functionmodule the fields selected are displayed in output.but where as in second functionmodule after selecting the required fields the values in the required fields are not displaying.what might be the error in the spool request.please giveme the reply.
‎2006 Dec 15 5:36 AM
Hope below code can give you some idea in creating a spool and writing to the same:
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.
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.Copy this code to a temporary program, execute and check the spool in SP01.
Kind Regards
Eswar