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

smartforms

can anyone post me how to do smart forms with some example plzzzzzzzzz urgent

Add a comment
10|10000 characters needed characters exceeded

Related questions

10 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Jun 17, 2008 at 12:21 PM

    dear friend

    i am sending you a

    driver progrme that is for the PO.

    collect the data that is in final table and post that

    final table in the smartforms.

    rewards are expecting .

    vivek

    &----


    *& Report Y_PO_SSF_SPARES

    *&

    &----


    *&

    *&

    &----


    REPORT y_po_ssf_spares.

    TABLES : ekko, ekpo, eket, konv.

    TYPES : BEGIN OF i_final ,

    ebeln TYPE ekpo-ebeln,

    ebelp TYPE ekpo-ebelp,

    menge TYPE ekpo-menge,

    netpr TYPE ekpo-netpr,

    txz01 TYPE ekpo-txz01,

    matnr TYPE ekpo-matnr,

    meins TYPE ekpo-meins,

    bednr TYPE ekpo-bednr,

    kbetr TYPE konv-kbetr,

    kwert TYPE konv-kwert,

    no TYPE char3,

    END OF i_final.

    TYPES : BEGIN OF i_ekko,

    ebeln TYPE ekko-ebeln,

    knumv TYPE ekko-knumv,

    waers TYPE ekko-waers ,

    lifnr TYPE ekko-lifnr,

    END OF i_ekko.

    TYPES : BEGIN OF i_ekpo,

    ebeln TYPE ekpo-ebeln,

    ebelp TYPE ekpo-ebelp,

    menge TYPE ekpo-menge,

    netpr TYPE ekpo-netpr,

    txz01 TYPE ekpo-txz01,

    matnr TYPE ekpo-matnr,

    meins TYPE ekpo-meins,

    bednr TYPE ekpo-bednr,

    waers TYPE ekko-waers ,

    knumv TYPE ekko-knumv,

    lifnr TYPE ekko-lifnr,

    END OF i_ekpo.

    TYPES : BEGIN OF i_konv,

    knumv TYPE konv-knumv,

    kposn TYPE konv-kposn,

    kbetr TYPE konv-kbetr,

    kwert TYPE konv-kwert,

    kschl TYPE konv-kschl,

    waers TYPE konv-waers,

    END OF i_konv.

    DATA : it_final TYPE TABLE OF i_final,

    w_final TYPE i_final,

    it_ekpo TYPE TABLE OF i_ekpo,

    w_ekpo TYPE i_ekpo,

    it_ekko TYPE TABLE OF i_ekko,

    w_ekko TYPE i_ekko,

    it_konv TYPE TABLE OF i_konv,

    w_konv TYPE i_konv,

    num_days1 TYPE i,

    num_days2 TYPE i,

    num_daysr TYPE i,

    value TYPE p DECIMALS 3 ,

    val TYPE p ,

    flag.

    DATA: prog TYPE sy-repid,

    dynnr TYPE sy-dynnr,

    fnam TYPE rs38l_fnam,

    v_pono TYPE ekko-ebeln,

    v_knumv TYPE ekko-knumv,

    v_knumv1 TYPE ekko-knumv,

    v_ebeln TYPE ekko-ebeln,

    v_lifnr TYPE ekko-lifnr,

    idx TYPE i,

    cnt TYPE i,

    v_amount TYPE konv-kwert,

    v_amount1 TYPE konv-kwert,

    v_amount2 TYPE konv-kwert,

    v_waers TYPE konv-waers.

    ************************************************************************

    DATA: it_otf TYPE STANDARD TABLE OF itcoo,

    it_docs TYPE STANDARD TABLE OF docs,

    it_lines TYPE STANDARD TABLE OF tline,

    st_job_output_info TYPE ssfcrescl,

    st_document_output_info TYPE ssfcrespd,

    st_job_output_options TYPE ssfcresop,

    st_output_options TYPE ssfcompop,

    st_control_parameters TYPE ssfctrlop,

    v_len_in TYPE so_obj_len,

    v_language TYPE sflangu VALUE 'E',

    v_e_devtype TYPE rspoptype,

    v_bin_filesize TYPE i,

    v_name TYPE string,

    v_path TYPE string,

    v_fullpath TYPE string,

    v_filter TYPE string,

    v_uact TYPE i,

    v_guiobj TYPE REF TO cl_gui_frontend_services,

    v_filename TYPE string.

    DATA : BEGIN OF is_ekko OCCURS 0,

    ebeln TYPE ekko-ebeln,

    END OF is_ekko.

    **********************************************************************

    ******USER INTERACTION OPTION FOR THE INVOICE NO

    **********************************************************************

    SELECTION-SCREEN : BEGIN OF BLOCK b1 WITH FRAME TITLE r.

    PARAMETERS: ponum LIKE ekko-ebeln OBLIGATORY.

    SELECTION-SCREEN : END OF BLOCK b1.

    SELECTION-SCREEN : BEGIN OF BLOCK b2 WITH FRAME TITLE rt.

    *SELECTION-SCREEN COMMENT /1(30) comm1.

    PARAMETERS: r1 RADIOBUTTON GROUP rad1,

    r2 RADIOBUTTON GROUP rad1.

    *SELECTION-SCREEN COMMENT /1(30) comm2.

    SELECTION-SCREEN COMMENT /1(30) comm12.

    SELECTION-SCREEN : END OF BLOCK b2.

    SELECTION-SCREEN : BEGIN OF BLOCK b4 WITH FRAME TITLE t4 .

    SELECTION-SCREEN COMMENT /5(75) comm11.

    SELECTION-SCREEN COMMENT /5(75) comm21.

    SELECTION-SCREEN : END OF BLOCK b4.

    *-> At selection screen Output.

    AT SELECTION-SCREEN OUTPUT.

    • Rt = 'Yet To Receive'.

    t4 = 'Note'.

    • comm2 = 'Rport For Receive'.

    • comm3 = 'Rport For Under Collection'.

    comm12 = ' '.

    comm11 = '1)Select this option when line items is of one page'.

    comm21 = '2)Select this option when line items are more then one page'.

    *********************************************************************

    *********************************************************************

    AT SELECTION-SCREEN ON VALUE-REQUEST FOR ponum.

    REFRESH is_ekko.

    SELECT ebeln FROM ekko INTO TABLE is_ekko.

    IF sy-subrc IS INITIAL.

    prog = sy-repid.

    dynnr = sy-dynnr.

    CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'

    EXPORTING

    • DDIC_STRUCTURE = ' '

    retfield = 'ebeln'

    dynpprog = prog

    dynpnr = dynnr

    dynprofield = 'ponum'

    value_org = 'S'

    TABLES

    value_tab = is_ekko.

    • FIELD_TAB =

    • RETURN_TAB =

    • DYNPFLD_MAPPING =

    • exceptions

    • parameter_error = 1

    • no_values_found = 2

    • others = 3

    IF sy-subrc <> 0.

    • MESSAGE ID SY-MSGID TYPE SY-MSGTY

    • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

    ENDIF.

    ENDIF.

    ************************************************************************

    *

    AT SELECTION-SCREEN ON ponum.

    IF ponum IS NOT INITIAL.

    CLEAR v_pono.

    SELECT SINGLE ebeln FROM ekko INTO v_pono WHERE ebeln = ponum

    AND bsart IN ('NB', 'NBS')

    AND ekgrp = 'CLS'.

    IF sy-subrc IS NOT INITIAL.

    MESSAGE 'Enter a Valid SPARES PO Num' TYPE 'E'.

    ENDIF.

    ENDIF.

    ************************************************************************

    *

    START-OF-SELECTION.

    CALL FUNCTION 'SAPGUI_PROGRESS_INDICATOR'

    EXPORTING

    percentage = '99'

    text = 'Processing ....'.

    IF r1 = 'X'.

    PERFORM get_data.

    PERFORM process_data.

    ENDIF.

    IF r2 = 'X'.

    PERFORM get_data.

    PERFORM process_data1.

    ENDIF.

    &----


    *& Form get_data

    &----


    • text

    ----


    • --> p1 text

    • <-- p2 text

    ----


    FORM get_data .

    SELECT a~ebeln

    b~ebelp

    b~menge

    b~netpr

    b~txz01

    b~matnr

    b~meins

    b~bednr

    a~waers

    a~knumv

    a~lifnr

    FROM ekko AS a INNER JOIN ekpo AS b

    ON aebeln = bebeln

    INTO TABLE it_ekpo

    WHERE a~ebeln = ponum .

    break sildev01.

    LOOP AT it_ekpo INTO w_ekpo .

    w_final-no = sy-tabix.

    w_final-ebeln = w_ekpo-ebeln.

    w_final-ebelp = w_ekpo-ebelp.

    w_final-menge = w_ekpo-menge.

    w_final-netpr = w_ekpo-netpr.

    w_final-txz01 = w_ekpo-txz01.

    w_final-matnr = w_ekpo-matnr.

    w_final-meins = w_ekpo-meins.

    w_final-bednr = w_ekpo-bednr.

    APPEND w_final TO it_final.

    CLEAR w_final.

    ENDLOOP.

    ENDFORM. "get_data

    &----


    *& Form process_data

    &----


    • text

    ----


    • --> p1 text

    • <-- p2 text

    ----


    FORM process_data .

    CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'

    EXPORTING

    formname = 'Y_QC_SSF_PO_SPARES'

    IMPORTING

    fm_name = fnam

    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.

    • IF fnam IS NOT INITIAL.

    SORT it_final BY ebeln ebelp.

    CALL FUNCTION fnam

    EXPORTING

    control_parameters = st_control_parameters

    output_options = st_output_options

    IMPORTING

    document_output_info = st_document_output_info

    job_output_info = st_job_output_info

    job_output_options = st_job_output_options

    TABLES

    itab = it_final

    i_ekpo = it_ekpo

    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.

    ENDFORM. " process_dataENDFORM.

    FORM process_data1.

    CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'

    EXPORTING

    formname = 'Y_QC_SSF_PO_SPARES2'

    IMPORTING

    fm_name = fnam

    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.

    • IF fnam IS NOT INITIAL.

    SORT it_final BY ebeln ebelp.

    CALL FUNCTION fnam

    EXPORTING

    control_parameters = st_control_parameters

    output_options = st_output_options

    IMPORTING

    document_output_info = st_document_output_info

    job_output_info = st_job_output_info

    job_output_options = st_job_output_options

    TABLES

    itab = it_final

    i_ekpo = it_ekpo

    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.

    ENDFORM. " process_dataENDFORM.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jun 17, 2008 at 12:20 PM

    Hi,

    Go through the below link.you will find examples with screen shots.

    http://www.saptechnical.com/Tutorials/Smartforms/SFMain.htm

    Reward if useful.

    Regards,

    Swetha.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jun 17, 2008 at 12:21 PM
    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jun 17, 2008 at 12:21 PM

    You would find a million links on smartform materials on the forum. Search for it mate...

    Nayan

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Jun 17, 2008 at 12:21 PM
  • author's profile photo Former Member
    Former Member
    Posted on Jun 17, 2008 at 12:22 PM
    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jun 17, 2008 at 12:22 PM
    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jun 17, 2008 at 12:24 PM

    hi,

    go to SMARTFORMS transaction and give form name as SF* and press F4 u can find so many examples.

    Rgds.,

    subash

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jun 17, 2008 at 12:39 PM

    Hi

    For Smart Form example, go through the link given below :

    http://saptechnical.com/Tutorials/Smartforms/SFMain.htm

    http://www.sap-img.com/smartforms/sap-smart-forms.htm

    It will useful to you.

    With Regards

    Nikunj Shah

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jun 17, 2008 at 12:40 PM

    SAP help

    http://help.sap.com/saphelp_47x200/helpdata/en/a9/de6838abce021ae10000009b38f842/frameset.htm

    and also u can see

    SF_example_01,

    SF_example_02

    SF_example_03

    example programs and smartforms in any sap system

    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.