cancel
Showing results for 
Search instead for 
Did you mean: 

problem in smartforms(urgent)

Former Member
0 Kudos

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.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

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

Former Member
0 Kudos

hi santhosh,

I did what you said but it does not displays the internal table data.It displays only the hardcoded data.Kindly give me the better solution.

thanks,

regards,

Ashok

Former Member
0 Kudos

Hi Ashok,

You have to declare you internal table in the Form Interface.

Regards,

Manish

Former Member
0 Kudos

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.

Answers (1)

Answers (1)

raguraman_c
Active Contributor
0 Kudos

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

former_member215542
Active Participant
0 Kudos

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