Skip to Content
avatar image
Former Member

Print Programm

Waht is print program for smartform. what is it significance?

Thanks.

Khan

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

3 Answers

  • Best Answer
    avatar image
    Former Member
    Jul 09, 2007 at 06:39 AM

    Hi Khan,

    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.

    <b>Reward pts, when u found this answered ur question :)</b>

    Regards,

    Sathish

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Jul 09, 2007 at 06:33 AM

    hi khan,

    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...

    hope this may help u out...

    please reward in case usefull....

    regards,

    prashant

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Jul 09, 2007 at 06:38 AM

    hi,

    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.

    regards,

    Ashok Reddy

    Add comment
    10|10000 characters needed characters exceeded