10-10-2007 2:11 PM
Hi All,
my requirement is users enters the data in the module pool program and clicks on the save and generate smartform button and the data is updates the database tables and updated data should be printed on smartform
Can anyone Please tell me How to link Smart Program with module pool program.
Regards,
Prasad.
10-10-2007 2:13 PM
The smartform will have a function module assigned to it. You need to execute this function module. The transaction SMARTFORMS will tell the the function name. Its on the menu path somewhere.
10-10-2007 2:16 PM
In smartforms , right click any window and create->flow logic->program lines, then the screen for program logic appears. In the left most corner there a icon named statement struct.
Click the statement struct icon, it will show the screen for pattern, there give the function module name that you want to include in smartforms
***********************
case okcode.
when 'SAVE'.
CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
EXPORTING FORMNAME = P_FORM "Your form name
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.
EXIT.
ENDIF.
calling the generated function module
CALL FUNCTION FM_NAME
EXPORTING
ARCHIVE_INDEX =
ARCHIVE_INDEX_TAB =
ARCHIVE_PARAMETERS =
CONTROL_PARAMETERS = CPARAM
OUTPUT_OPTIONS = OUTOP
USER_SETTINGS = SPACE
MAIL_APPL_OBJ =
MAIL_RECIPIENT =
MAIL_SENDER =
IMPORTING
JOB_OUTPUT_INFO = TAB_OTF_DATA
DOCUMENT_OUTPUT_INFO =
JOB_OUTPUT_OPTIONS =
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.
endcase.
endform.
endcase.