cancel
Showing results for 
Search instead for 
Did you mean: 

Print program

Former Member
0 Kudos

Please explain about Print program in case of smartforms?

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

print program is nothing but an executable program..through this we can execute a smartform by passing the smartform name to FM 'SSF_FUNCTION_MODULE_NAME'

this FM will create a function module for that smartform....

the significance of PP is we can create a transaction for the SF...

66666666666666

we can create print program for smart form in SE38, in this program we declare all the declarations like..

1) daclare tables,if any tables we use for extracting data from data base.

2) creation of internal tables if necessary.

call the function module which was genarated while activating the smart form to passing data to smart form, while calling we pass the values to required fields of the function module..

the print program only prints the business data on form while executing the smart form through function module interface.

actually we pass data to the smart form through function module interface, function modules are not executed it self for that we must call these function module inside the print program.

666666666

Smart forms is very similar to SAP scripts . This is also a tool which is extensively used to creat layouts and then a separate print program is created. This print program is used to create the output internal table which ibn turn is thrown to the smart form where the field values are displayed .

In the print program mentioned below ...an output internal table is created by populating certain fields from database tables into it . Once the output internal table is ready , then the function module SSF_FUNCTION_MODULE_NAME is called . Here , in the import parameters , the name of the smartform is given . The output of this function module is the name of another function module .

This function module is again called , in this examplpe , the name of the function module is "/1BCDWB/SF00000007" .

The output of this function module is the output internal table that we have created earlier in the program i.e.. I_YCUSTOMER .

So , in case of smart forms , we use 2 function modules for the processing of the smartform. Once this internal table is thrown from the smart form , then in the layout , the required fields can be displayed .

This is how a smartform works.

REPORT YSMARTLOK .

TABLES: YCUSTOMER.

DATA : FM_NAME TYPE RS38L_FNAM.

TYPES : BEGIN OF T_YCUSTOMER,

YKUNNR LIKE YCUSTOMER-YKUNNR,

YLAND1 LIKE YCUSTOMER-YLAND1,

YNAME1 LIKE YCUSTOMER-YNAME1,

YNAME2 LIKE YCUSTOMER-YNAME2,

YORT01 LIKE YCUSTOMER-YORT01,

END OF T_YCUSTOMER.

DATA : I_YCUSTOMER TYPE STANDARD TABLE OF T_YCUSTOMER WITH HEADER LINE .

DATA : WA_YCUSTOMER TYPE T_YCUSTOMER.

SELECT * FROM YCUSTOMER INTO TABLE I_YCUSTOMER.

CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'

EXPORTING

FORMNAME = 'YSMARTLOK'

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.

CALL FUNCTION '/1BCDWB/SF00000007'

EXPORTING

ARCHIVE_INDEX =

ARCHIVE_INDEX_TAB =

ARCHIVE_PARAMETERS =

CONTROL_PARAMETERS =

MAIL_APPL_OBJ =

MAIL_RECIPIENT =

MAIL_SENDER =

OUTPUT_OPTIONS =

USER_SETTINGS = 'X'

IMPORTING

DOCUMENT_OUTPUT_INFO =

JOB_OUTPUT_INFO =

JOB_OUTPUT_OPTIONS =

TABLES

I_YCUSTOMER = I_YCUSTOMER

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.

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi

Application Data is fetched by the Print Program from the database depending upon the selection screen parameter.

Function module of a Layout Set is generated when the smartform is activated.

The output of application document is sent to printer or mail or fax.

Print Program :

Performs data selection based on selection criteria

Passes data to the smartform function module

Transaction to use : SE38 to develop a print program

Print program performs all required data selection depending upon the specified selection criteria. This program calls the function module of a smartform and passes the data to smartform function module. This function module then puts the data in a format defined by layout.