Skip to Content
author's profile photo Former Member
Former Member

How to Call smart form in Action

Hi All,

Could some one tell me how to call the smart form in action.

Eg. PB40 - Offer Contract Action.

Appreciate your respnse.

Regards

Raj

Add a comment
10|10000 characters needed characters exceeded

Related questions

1 Answer

  • author's profile photo Former Member
    Former Member
    Posted on Jul 22, 2011 at 08:33 AM

    Hi ,

    attached you find some abap code to call a smartform with some comments in it. Hope that helps:

    DATA: l_fn_name TYPE rs38l_fnam

    , l_devtype TYPE rspoptype

    , ls_output_options TYPE ssfcompop

    , ls_control_parameters TYPE ssfctrlop

    , ls_job_output_info TYPE ssfcrescl

    , l_pdf_fsize TYPE i "#EC NEEDED

    , lt_otf_tab TYPE tsfotf

    , lt_pdf_lines TYPE TABLE OF tline

    .

              • To do

            • The mapping from the UI structure to the Smortform structure has to be

            • implemented here or in a pirvate method.....

              • Call function module u201CSSF_FUNCTION_MODULE_NAMEu201D to get the name of the smartform.

              CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'

              EXPORTING

              formname = zh38tm_cl_zz_2gen_bl_constants=>c_smartforms_hipo

              IMPORTING

              fm_name = l_fn_name

              EXCEPTIONS

              no_form = 1

              no_function_module = 2

              OTHERS = 3.

              IF sy-subrc = 0.

              • Call function module u201CSSF_GET_DEVICE_TYPEu201D to get the print parameter

              CALL FUNCTION 'SSF_GET_DEVICE_TYPE'

              EXPORTING

              i_language = sy-langu

              IMPORTING

              e_devtype = l_devtype

              EXCEPTIONS

              no_language = 1

              language_not_installed = 2

              no_devtype_found = 3

              system_error = 4

              OTHERS = 5.

              IF sy-subrc = 0.

                • Fill label structure to smartform

              • ls_labels = zh38pm_cl_zz_bl_perf_plan=>set_sf_label( ).

                • Set output parameters u201CLANGUAGEu201D, u201CNO_DIALOGu201D and u201CGETOTFu201D

                ls_output_options-tdprinter = l_devtype.

                ls_control_parameters-no_dialog = abap_true.

                ls_control_parameters-getotf = abap_true.

                ls_control_parameters-langu = sy-langu.

                • Call smartform with the structures u201CIMP_S_PERF_PLANu201D, u201CCHG_S_PRINT_PLAN

                CALL FUNCTION l_fn_name

                EXPORTING

                control_parameters = ls_control_parameters

                output_options = ls_output_options

                s_doc_processing = gs_doc-s_doc_processing

                s_header_display = gs_doc-s_header_display

                s_header_texts = gs_doc-s_header_texts

                s_header_status = gs_doc-s_header_status

                t_header_appraiser = gs_doc-t_header_appraiser

                t_header_appraisee = gs_doc-t_header_appraisee

                t_header_part_appraiser = gs_doc-t_header_part_appraisers

                t_header_other = gs_doc-t_header_others

                s_header_dates = gs_doc-s_header_dates

                t_header_add_data = gs_doc-t_header_add_data

                t_body_columns = gs_doc-t_body_columns

                t_body_element_descr = gs_doc-t_body_element_descr

                t_body_elements = gs_doc-t_body_elements

                t_body_cells = gs_doc-t_body_cells

                t_body_cell_notes = gs_doc-t_body_cell_notes

                t_body_cell_val_values = gs_doc-t_body_cell_val_values

                t_body_cell_val_ranges = gs_doc-t_body_cell_val_ranges

                t_body_cell_val_c_like = gs_doc-t_body_cell_val_c_like

                t_body_cell_val_descr = gs_doc-t_body_cell_val_descr

                IMPORTING

                job_output_info = ls_job_output_info

                EXCEPTIONS

                formattinl_error = 1

                internal_error = 2

                send_error = 3

                user_canceled = 4.

                IF sy-subrc = 0.

                APPEND LINES OF ls_job_output_info-otfdata TO lt_otf_tab.

                exp_t_otf = lt_otf_tab.

                • Call function module u201CCONVERT_OTFu201D to convert the smartform data

                • to exporting parameter u201CEXP_PDF_XSTRING

                CALL FUNCTION 'CONVERT_OTF'

                EXPORTING

                format = 'PDF'

                IMPORTING

                bin_filesize = l_pdf_fsize

                bin_file = exp_pdf_xstring

                TABLES

                otf = lt_otf_tab

                lines = lt_pdf_lines

                EXCEPTIONS

                err_max_linewidth = 1

                err_format = 2

                err_conv_not_possible = 3

                OTHERS = 4.

                IF sy-subrc ne 0.

                CLEAR exp_pdf_xstring.

                ENDIF.

                ENDIF.

                ENDIF.

                ENDIF.

                First you have to determine the smartforms function modules name the wxecute it.

              Add a comment
              10|10000 characters needed characters exceeded

              Before answering

              You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
              You must be Logged in to submit an answer.

              Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.