0% found this document useful (0 votes)
110 views2 pages

Programa de Impresion Smartforms

This document summarizes a form processing procedure in ABAP that: 1) Clears a return code and sets screen and processing variables. 2) Performs processing that includes getting data, setting print parameters, and determining a smart form name and function module. 3) Calls the smart form function module, handling any errors, and stores output.

Uploaded by

otracuentaaux5
Copyright
© © All Rights Reserved
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
Download as doc, pdf, or txt
0% found this document useful (0 votes)
110 views2 pages

Programa de Impresion Smartforms

This document summarizes a form processing procedure in ABAP that: 1) Clears a return code and sets screen and processing variables. 2) Performs processing that includes getting data, setting print parameters, and determining a smart form name and function module. 3) Calls the smart form function module, handling any errors, and stores output.

Uploaded by

otracuentaaux5
Copyright
© © All Rights Reserved
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
Download as doc, pdf, or txt
Download as doc, pdf, or txt
You are on page 1/ 2

FORM ENTRY USING RETURN_CODE US_SCREEN.

CLEAR RETCODE.
XSCREEN = US_SCREEN.
PERFORM PROCESSING.
IF RETCODE NE 0.
RETURN_CODE = 1.
ELSE.
RETURN_CODE = 0.
ENDIF.

ENDFORM. "entry

*---------------------------------------------------------------------*
* FORM PROCESSING *
*---------------------------------------------------------------------*
* ........ *
*---------------------------------------------------------------------*
FORM PROCESSING.

DATA: LF_FM_NAME TYPE RS38L_FNAM.


DATA: LS_CONTROL_PARAM TYPE SSFCTRLOP.
DATA: LS_COMPOSER_PARAM TYPE SSFCOMPOP.
DATA: LS_RECIPIENT TYPE SWOTOBJID.
DATA: LS_SENDER TYPE SWOTOBJID.
DATA: LF_FORMNAME TYPE TDSFNAME.
DATA: LS_ADDR_KEY LIKE ADDR_KEY.
DATA: DOCUMENT_OUTPUT_INFO TYPE SSFCRESPD,
JOB_OUTPUT_INFO TYPE SSFCRESCL,
JOB_OUTPUT_OPTIONS TYPE SSFCRESOP.
PERFORM GET_DATA.
CHECK RETCODE = 0.
PERFORM SET_PRINT_PARAM USING ADDR_KEY
CHANGING LS_CONTROL_PARAM
LS_COMPOSER_PARAM
LS_RECIPIENT
LS_SENDER
RETCODE.
*Get the Smart Form name.
IF NOT TNAPR-SFORM IS INITIAL.
LF_FORMNAME = TNAPR-SFORM.
ELSE.
MESSAGE E001(/SMB40/SSFCOMPOSER).
ENDIF.

* determine smartform function module for invoice


CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
EXPORTING
FORMNAME = LF_FORMNAME
IMPORTING
FM_NAME = LF_FM_NAME
EXCEPTIONS
NO_FORM =1
NO_FUNCTION_MODULE = 2
OTHERS = 3.
IF SY-SUBRC <> 0.
* error handling
RETCODE = SY-SUBRC.
IF SY-SUBRC = 1.
MESSAGE E001(/SMB40/SSFCOMPOSER).
ENDIF.
IF SY-SUBRC = 2.
MESSAGE E002(/SMB40/SSFCOMPOSER) WITH LF_FORMNAME.
ENDIF.
PERFORM PROTOCOL_UPDATE.
ENDIF.

CALL FUNCTION LF_FM_NAME


EXPORTING
ARCHIVE_INDEX = TOA_DARA
ARCHIVE_PARAMETERS = ARC_PARAMS
CONTROL_PARAMETERS = LS_CONTROL_PARAM
MAIL_RECIPIENT = LS_RECIPIENT
MAIL_SENDER = LS_SENDER
OUTPUT_OPTIONS = LS_COMPOSER_PARAM
USER_SETTINGS =''
IS_NAST = NAST
IS_VBDKA = VBDKA
IS_ADDRES = ADDR_KEY
IMPORTING
DOCUMENT_OUTPUT_INFO = DOCUMENT_OUTPUT_INFO
JOB_OUTPUT_INFO = JOB_OUTPUT_INFO
JOB_OUTPUT_OPTIONS = JOB_OUTPUT_OPTIONS
TABLES
IT_VBDPA = TVBDPA "Item information
IT_VBDPAU = TVBDPAU "Subitem numbers
IT_VEDPA = TKOMSERVP "Contract Item Validity
IT_VEDKA = TKOMSERVH "Contract Header Validity
IT_VEDPN = TKOMSERVPN "Contract Item Cancellation Data
IT_VEDKN = TKOMSERVHN "Contract Header Cancellation DA
EXCEPTIONS
FORMATTING_ERROR =1
INTERNAL_ERROR =2
SEND_ERROR =3
USER_CANCELED =4
OTHERS = 5.

IF SY-SUBRC <> 0.
RETCODE = SY-SUBRC.
PERFORM PROTOCOL_UPDATE.

* get SmartForm protocoll and store it in the NAST protocoll


PERFORM ADD_SMFRM_PROT.
ENDIF.

ENDFORM. "processing

You might also like