2012 Sep 28 4:05 PM
Dear Abap ers,
i want to print preview by default with out displaying any pop up page and also i choose a printer name by default.....
CODE:
REPORT ZSMARTFORM_IMP1.
TABLES:vbak.
select-OPTIONS: s_vbeln for vbak-vbeln.
DATA: it_vbak TYPE STANDARD TABLE OF vbak INITIAL SIZE 0,
it_vbap TYPE STANDARD TABLE OF vbap INITIAL SIZE 0,
it_vbak_temp TYPE STANDARD TABLE OF vbak INITIAL SIZE 0,
it_vbap_temp TYPE STANDARD TABLE OF vbap INITIAL SIZE 0,
wa_vbak TYPE vbak,
FM_NAME TYPE rs38l_fnam.
data: output_options type ssfcompop.
DATA: CONTROL TYPE SSFCTRLOP.
SELECT * from vbak into TABLE it_vbak WHERE VBELN IN S_VBELN .
if sy-subrc EQ 0.
select * from vbap INTO TABLE it_vbap FOR ALL ENTRIES IN it_vbak
WHERE vbeln = it_vbak-vbeln.
endif.
output_options-tddest = 'LP01'. (LP01 = PRINTER NAME)
output_options-tdNOPRINT = 'X'.
CONTROL-DEVICE = 'PRINTER'.
CONTROL-NO_DIALOG = 'X'.
*** CONTROL-NO_OPEN = 'X'.
*** CONTROL-NO_CLOSE = 'X'.
CONTROL-PREVIEW = ' '.
CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
EXPORTING
FORMNAME = 'ZSMARTFORM_IMP1'
* VARIANT = ' '
* DIRECT_CALL = ' '
IMPORTING
FM_NAME = FM_NAME
* EXCEPTIONS
* NO_FORM = 1
* NO_FUNCTION_MODULE = 2
* OTHERS = 3
.
IF SY-SUBRC <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
loop at it_vbak into wa_vbak.
refresh:it_vbak_temp,
it_vbap_temp.
it_vbak_temp[] = it_vbak[].
it_vbap_temp[] = it_vbap[].
DELETE it_vbak_temp WHERE vbeln NE wa_vbak-vbeln.
DELETE it_vbap_temp WHERE vbeln NE wa_vbak-vbeln.
CALL FUNCTION FM_NAME
EXPORTING
* ARCHIVE_INDEX =
* ARCHIVE_INDEX_TAB =
* ARCHIVE_PARAMETERS =
CONTROL_PARAMETERS = CONTROL
* MAIL_APPL_OBJ =
* MAIL_RECIPIENT =
* MAIL_SENDER =
OUTPUT_OPTIONS = OUTPUT_OPTIONS
* USER_SETTINGS = ' '
* IMPORTING
* DOCUMENT_OUTPUT_INFO =
* JOB_OUTPUT_INFO =
* JOB_OUTPUT_OPTIONS =
TABLES
VBAK = it_vbak_temp[]
VBAP = it_vbap_temp[]
* EXCEPTIONS
* FORMATTING_ERROR = 1
* INTERNAL_ERROR = 2
* SEND_ERROR = 3
* USER_CANCELED = 4
* OTHERS = 5
.
IF SY-SUBRC <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
endlooP.
After execute this code a critical error message will display -
"Output device LOCL not defined".
i cant understand what is my problem..... please solve it and if any wrong in coding then please correct it.
Regards
Sabyasachi Karforma
2012 Sep 28 5:17 PM
output_options-tddest = '$LOCL'.
output_options-tdNOPRINT = 'X'.
CONTROL-NO_DIALOG = 'X'.
CONTROL-PREVIEW = ' '.
only this 4 are enough for my required output???
regards
Sabyasachi
Dear Abap ers,
i want to print preview by default with out displaying any pop up page and also i choose a printer name by default.....
CODE:
REPORT ZSMARTFORM_IMP1.
TABLES:vbak.
select-OPTIONS: s_vbeln for vbak-vbeln.
DATA: it_vbak TYPE STANDARD TABLE OF vbak INITIAL SIZE 0,
it_vbap TYPE STANDARD TABLE OF vbap INITIAL SIZE 0,
it_vbak_temp TYPE STANDARD TABLE OF vbak INITIAL SIZE 0,
it_vbap_temp TYPE STANDARD TABLE OF vbap INITIAL SIZE 0,
wa_vbak TYPE vbak,
FM_NAME TYPE rs38l_fnam.
data: output_options type ssfcompop.
DATA: CONTROL TYPE SSFCTRLOP.
SELECT * from vbak into TABLE it_vbak WHERE VBELN IN S_VBELN .
if sy-subrc EQ 0.
select * from vbap INTO TABLE it_vbap FOR ALL ENTRIES IN it_vbak
WHERE vbeln = it_vbak-vbeln.
endif.
output_options-tddest = 'LP01'. (LP01 = PRINTER NAME)
output_options-tdNOPRINT = 'X'.
CONTROL-DEVICE = 'PRINTER'.
CONTROL-NO_DIALOG = 'X'.
*** CONTROL-NO_OPEN = 'X'.
*** CONTROL-NO_CLOSE = 'X'.
CONTROL-PREVIEW = ' '.
CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
EXPORTING
FORMNAME = 'ZSMARTFORM_IMP1'
* VARIANT = ' '
* DIRECT_CALL = ' '
IMPORTING
FM_NAME = FM_NAME
* EXCEPTIONS
* NO_FORM = 1
* NO_FUNCTION_MODULE = 2
* OTHERS = 3
.
IF SY-SUBRC <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
loop at it_vbak into wa_vbak.
refresh:it_vbak_temp,
it_vbap_temp.
it_vbak_temp[] = it_vbak[].
it_vbap_temp[] = it_vbap[].
DELETE it_vbak_temp WHERE vbeln NE wa_vbak-vbeln.
DELETE it_vbap_temp WHERE vbeln NE wa_vbak-vbeln.
CALL FUNCTION FM_NAME
EXPORTING
* ARCHIVE_INDEX =
* ARCHIVE_INDEX_TAB =
* ARCHIVE_PARAMETERS =
CONTROL_PARAMETERS = CONTROL
* MAIL_APPL_OBJ =
* MAIL_RECIPIENT =
* MAIL_SENDER =
OUTPUT_OPTIONS = OUTPUT_OPTIONS
* USER_SETTINGS = ' '
* IMPORTING
* DOCUMENT_OUTPUT_INFO =
* JOB_OUTPUT_INFO =
* JOB_OUTPUT_OPTIONS =
TABLES
VBAK = it_vbak_temp[]
VBAP = it_vbap_temp[]
* EXCEPTIONS
* FORMATTING_ERROR = 1
* INTERNAL_ERROR = 2
* SEND_ERROR = 3
* USER_CANCELED = 4
* OTHERS = 5
.
IF SY-SUBRC <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
endlooP.
After execute this code a critical error message will display -
"Output device LOCL not defined".
i cant understand what is my problem..... please solve it and if any wrong in coding then please correct it.
Regards
Sabyasachi Karforma
2012 Sep 28 4:15 PM
HI,
change ur printer name from
output_options-tddest = 'LP01'. (LP01 = PRINTER NAME)
to
| output_options-tddest = 'LOCL'. | (LOCL = PRINTER NAME) |
I think your poutput is configured with locl printer check in nace also.
2012 Sep 28 4:42 PM
HI Geeta according to you i change output_options-tddest = 'LOCL'. But same problem.
Error = "Output device LOCL not defined" and it terminates the current transaction. please solve. output_options and control parameters which is defined in my code is it right and enough to get my required output?
2012 Sep 28 5:03 PM
CONTROL-DEVICE = 'PRINTER'.
try with commenting this type.
and debug the fm_name.
2012 Sep 28 5:17 PM
output_options-tddest = 'LOCL'.
output_options-tdNOPRINT = 'X'.
CONTROL-NO_DIALOG = 'X'.
CONTROL-PREVIEW = ' '.
only this 4 are enough for my required output???
regards
Sabyasachi
2012 Sep 28 5:18 PM
also try with removing comment. * USER_SETTINGS = ' ' to
USER_SETTINGS = ' '
in ur FM_NAME fm
2012 Sep 28 5:39 PM
HI GEETA,
output_options-tddest = 'LP01'.
output_options-tdNOPRINT = 'X'.
CONTROL-NO_DIALOG = 'X'.
CONTROL-PREVIEW = ' '.
CALL FUNCTION FM_NAME
EXPORTING
* ARCHIVE_INDEX =
* ARCHIVE_INDEX_TAB =
* ARCHIVE_PARAMETERS =
CONTROL_PARAMETERS = CONTROL
* MAIL_APPL_OBJ =
* MAIL_RECIPIENT =
* MAIL_SENDER =
OUTPUT_OPTIONS = OUTPUT_OPTIONS
USER_SETTINGS = ' '
* IMPORTING
* DOCUMENT_OUTPUT_INFO =
* JOB_OUTPUT_INFO =
* JOB_OUTPUT_OPTIONS =
TABLES
VBAK = it_vbak_temp[]
VBAP = it_vbap_temp[]
* EXCEPTIONS
* FORMATTING_ERROR = 1
* INTERNAL_ERROR = 2
* SEND_ERROR = 3
* USER_CANCELED = 4
* OTHERS = 5
.
IF SY-SUBRC <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
NOW IS IT CORRECT TO AVOID POP UP PAGE AND CHOOSE A PRINTER NAME BY DEFAULT???
2012 Sep 28 5:17 PM
output_options-tddest = '$LOCL'.
output_options-tdNOPRINT = 'X'.
CONTROL-NO_DIALOG = 'X'.
CONTROL-PREVIEW = ' '.
only this 4 are enough for my required output???
regards
Sabyasachi
2012 Sep 28 5:22 PM
control-preview = 'X'."Preview the output of Smartform
control-no_dialog = 'X'."Don't show Dialog
output_options-tddest = 'LOCL'."Spool: Output device
output_options-tdnoprint = 'X'."No printing from print preview
i think this much is enough to solve your issue
2012 Sep 28 5:27 PM
one more .
why are your defining ur FM_NAME inside loop endloop. loop at it_vbak into wa_vbak.endloop.
get all data first and call FM_NAME.
also uncomments USER_SETTING = '' fropm FM_NAME.
and try hope it wll work.
2012 Sep 28 5:45 PM
HI,
can you please try with this and let me know.
and also try with print_preview = 'X'
2012 Sep 28 5:49 PM
If you dont get then try with sample programs from below link.
2012 Sep 28 5:52 PM
hi geeta,
now this code does not produce any error but this code is not executed....
2012 Sep 28 5:55 PM
debug ur driver program and check if u r getting data in itab . and send me your updated code if you have no problem.
2012 Sep 28 6:41 PM
HI geeta,
i send my code to your gmail. please chek it and also some questions regarding this, please answer it....
2012 Sep 28 10:54 PM
HI Sabyasachi,
I have not received your email in my gmail. Good that your issue get solved. you can ask any question. I will try my best.
Regards,
Geeta
| User | Count |
|---|---|
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |