cancel
Showing results for 
Search instead for 
Did you mean: 

Internal Table declaration in SMARTFORMS

Former Member
0 Kudos

HI All,

I need to display the data in Smartforms.

That data comes from 2 tables. So i have to diclare the internal table its contains

both table's fields.

Ex : itab_1 having 4 fileds and itab_2 having 5 fileds,

i need to declare iatb_tot with both 4 and 5 fields.

How can i declare and where can i decalre....

please its urgent.

Thanks in advace.

Subbu

Accepted Solutions (1)

Accepted Solutions (1)

former_member225631
Active Contributor
0 Kudos

If you want declare inside smartforms, go to global definitions, in types tab declare using types statement. in global data tab you have to define the internal tables using the types you already define.

Answers (5)

Answers (5)

Former Member
0 Kudos

There are two ways to solve your problem:

1) You can populate internal tables in the Driver Program and pass them to your Smartform by declaring the same tables in the Import Option, under the Form Interface of Smartform.

2)If you want the tables to be populated in your Smartform itself, declare a internal table in the Type option of Global Parameters. Then you need to got Global Data section and declare tables there with Type Ref To option.

Regards,

Rohit

Former Member
0 Kudos

Hi Subbu,

Here is a sample program in which used two internal tables:


REPORT YPRINTPRG_SMARTFORM1 . 
DATA : ITKNA1 LIKE KNA1, 
             ITVBAK LIKE VBAK OCCURS 0 WITH HEADER LINE. 
PARAMETERS : PKUNNR LIKE KNA1-KUNNR. 

SELECT * FROM KNA1 INTO ITKNA1 
   WHERE KUNNR = PKUNNR. 
ENDSELECT. 

SELECT * FROM VBAK 
    INTO TABLE ITVBAK 
   WHERE KUNNR = PKUNNR. 

CALL FUNCTION '/1BCDWB/SF00000011' “THIS FUNCTION MODULE CALLS THE  
                                      SMART FORM WE WILL GET THIS AT MENU ENVIRONEMENT ” 
  EXPORTING 
  ITKNA1                     = ITKNA1 
  TABLES 
      ITVBAK                = ITVBAK. 

IN SMART FORM  
FORM INERFACE---------IMPORT (TAB)  
  Parameter name      Type assignment    Reference type      Default value  
  ITKNA1                     LIKE                      KNA1 

FORM INERFACE---------TABLES (TAB) 
  ITVBAK                     LIKE                       VBAK 

PAGES & WINDOWS----- MAIN WINDOW-----LOOP 1----DATA(TAB) 
  ITVBAK         INTO               ITVBAK 

PAGES & WINDOWS-------MAIN WINDOW------LOOP 1-----TEXT 3(EDITOR)  
  &ITVBAK-VBELN&   &ITVBAK-ERDAT&  &ITVBAK-ERNAM&  &ITVBAK-NETWR& 

PAGES & WINDOWS-------HEADER WINDOW-----TEXT 2(EDITOR) 
  Customer No. &itkna1-kunnr&        CustomerName :&itkna1-name1& 

Regards,

Raghav

jayanthi_jayaraman
Active Contributor
0 Kudos

Hi,

If the internal table are passed from programs,you should declare it in form interface->tables

itab1 like table1

If you are going to use the 3rd internal table only in smartform,declare a types in global definiiton->Types Declaration

and delcare the internal table in global definition->global data

amit_khare
Active Contributor
0 Kudos

GOTO GLOBAL DATA -> TYPES declare your table type here.

GOTO FORM INTERFACE->TABLES declare your internal table of that type.

Regards,

Amit

Former Member
0 Kudos

Hi,

If you are refering to getting the data from a driver program to smartform (smartform Interface) then you cannot use local internal table strcture to pass the values...instead copy the fields into a global structure and pass them

it will not b a probelm coz u can pass the other fields as blank

santhosh