728x90
반응형
FORM PRINT_LABEL1 USING PV_TABNAME "출력데이터 내용 담고있는 int
PV_FNAME "스마트폼 이름
PV_PRINT_CNT. "발행매수
DATA : LV_FM_NAME TYPE RS38L_FNAM,
LS_CONTROL_PARAMETERS TYPE SSFCTRLOP,
LS_OUTPUT_OPTIONS TYPE SSFCOMPOP,
LS_JOB_OUTPUT_INFO TYPE SSFCRESCL.
FIELD-SYMBOLS : <LFS_TAB> TYPE STANDARD TABLE,
<LFS_ANY> TYPE ANY.
DATA: LV_TABNAME TYPE TABNAME.
LV_TABNAME = PV_TABNAME.
ASSIGN (LV_TABNAME) TO <LFS_TAB>.
LS_CONTROL_PARAMETERS-NO_OPEN = 'X'.
LS_CONTROL_PARAMETERS-NO_CLOSE = 'X'.
LS_CONTROL_PARAMETERS-PREVIEW = 'X'.
LS_CONTROL_PARAMETERS-LANGU = SY-LANGU.
LS_OUTPUT_OPTIONS-TDCOPIES = GV_PRINT_CNT.
CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
EXPORTING
FORMNAME = PV_FNAME
IMPORTING
FM_NAME = LV_FM_NAME
EXCEPTIONS
NO_FORM = 1
NO_FUNCTION_MODULE = 2
OTHERS = 3.
CALL FUNCTION 'SSF_OPEN'
EXPORTING
OUTPUT_OPTIONS = LS_OUTPUT_OPTIONS
CONTROL_PARAMETERS = LS_CONTROL_PARAMETERS.
* IMPORTING
* JOB_OUTPUT_OPTIONS = LS_JOB_OUTPUT_INFO.
LOOP AT <LFS_TAB> ASSIGNING <LFS_ANY>.
CALL FUNCTION LV_FM_NAME
EXPORTING
CONTROL_PARAMETERS = LS_CONTROL_PARAMETERS
OUTPUT_OPTIONS = LS_OUTPUT_OPTIONS
IS_LABEL = <LFS_ANY>
IMPORTING
JOB_OUTPUT_INFO = LS_JOB_OUTPUT_INFO
EXCEPTIONS
FORMATTING_ERROR = 1
INTERNAL_ERROR = 2
SEND_ERROR = 3
USER_CANCELED = 4
OTHERS = 5.
CASE SY-SUBRC.
WHEN 1.
MESSAGE E000 WITH 'FORMATTING_ERROR'.
WHEN 2.
MESSAGE E000 WITH 'INTERNAL_ERROR'.
WHEN 3.
MESSAGE E000 WITH 'SEND_ERROR'.
WHEN 4.
MESSAGE E000 WITH '인쇄 취소'.
WHEN 5.
MESSAGE E000 WITH 'OTHERS'.
ENDCASE.
ENDLOOP.
CALL FUNCTION 'SSF_CLOSE'
EXCEPTIONS
FORMATTING_ERROR = 1
SEND_ERROR = 2
INTERNAL_ERROR = 3
OTHERS = 4.
ENDFORM.
728x90
반응형
'ABAP' 카테고리의 다른 글
[SD] Sales Order Update/Delete BAPI (0) | 2023.03.01 |
---|---|
Pop-up Message (POPUP_TO_CONFIRM) (0) | 2023.03.01 |
데이터 갱신시 특수문자 제거 (0) | 2023.03.01 |
파라미터에서 엔터안쳐도 입력된값 불러오는 펑션 (0) | 2023.03.01 |
ALV 특정 필드 폰트 변경 (0) | 2023.03.01 |
댓글