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

problem in smartforms(urgent)

hi experts,

I have created one smartform and i have one driver program for that smartform.I want to know know how to pass the internal table data from driver program to smartform

thanks

regards,

Ashok.

Add a comment
10|10000 characters needed characters exceeded

Related questions

2 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Oct 23, 2006 at 11:00 AM

    Hi,

    Once you execute the smart form u obtain a function module which you have to call in your driver program.

    the internal table which u filled in the driver program can be then passed as 'tables' parameter in the function call.

    u get the function module name once u generate the form or under the environment menu.

    santhosh

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      hi ashok,

      check this sample code

      TABLES: KNA1,KNB1.

      DATA: BEGIN OF IT_KNA1 OCCURS 0,

      KUNNR LIKE KNA1-KUNNR,

      BUKRS LIKE KNB1-BUKRS,

      NAME1 LIKE KNA1-NAME1,

      REGIO LIKE KNA1-REGIO,

      LAND1 LIKE KNA1-LAND1,

      END OF IT_KNA1.

      DATA: V_FNAME TYPE RS38L_FNAM.

      selection-screen:begin of block blk1 with frame title text-001.

      select-options:s_KUNNR for KNA1-KUNNR.

      selection-screen:end of block blk1.

      SELECT A~kunNR

      B~BUKRS

      A~NAME1

      A~REGIO

      A~LAND1

      FROM KNA1 AS A

      INNER JOIN KNB1 AS B ON AKUNNR = BKUNNR

      INTO TABLE IT_KNA1

      WHERE A~KUNNR IN S_KUNNR.

      CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'

      EXPORTING

      formname = 'ZP_SMARTFORM1'

      • VARIANT = ' '

      • DIRECT_CALL = ' '

      IMPORTING

      FM_NAME = V_FNAME

      • 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/SF00000778'

      • 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

      T_KNA1 = IT_KNA1

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

      and in the smartform i hope u r displaying the contents by drag and drop rather than hard coding them and declaring ur internal table in Form Interface

      hope this helps,

      do reward if it helps,

      priya.

  • Posted on Oct 23, 2006 at 11:26 AM

    Hi,

    1. Create a Window of type Main.

    2. Create a table within this window.

    3. In the 'DATA' tab of this table give the name of your internal table and the corresponding work area.

    4. Declare the line types as per your internal table structure.

    5. In the 'Main Area' of this table you can call your item fields eg. wa_main-field1, wa_main-field2, wa_main-field3.

    When you execute your program the internal table will be looped at and will display your line item fields.

    Feel free to revert back.

    --Ragu

    Add a comment
    10|10000 characters needed characters exceeded

    • HI,

      1. Create the smartform 'ZZ_smartform'.

      2. Select the form interface, under global settings on the left hand side of the window.

      3. Click on the tables tab.

      4. Insert an entry saying, ITAB like PA0002.

      5. In the driver program, write the following code:

      data: i_pa0002 like pa0002 occurs 0.

      data: v_form TYPE RS38L_FNAM.

      select * from pa00002 into table i_pa0002.

      CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'

      EXPORTING

      formname = 'ZZ_SMARTFORM'

      ...

      ...

      IMPORTING

      FM_NAME = V_Form

      ...

      ...

      CALL FUNCTION v_form

      EXPORTING

      ...

      ...

      IMPORTING

      ...

      ...

      TABLES

      ITAB = i_pa0002

      ...

      ...

      Now you can use itab in your smartform, it will contain the values of internal table i_pa0002 of the driver program.

      Revert back if you need clarification.

      Hope it proves to be of some help.

      Thanks,

      Pulkit

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.