Skip to Content
avatar image
Former Member

Internal Table declaration in SMARTFORMS

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

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

6 Answers

  • Best Answer
    Apr 25, 2007 at 09:01 AM

    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.

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Apr 25, 2007 at 09:02 AM

    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

    Add comment
    10|10000 characters needed characters exceeded

  • Apr 25, 2007 at 09:03 AM

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

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

    Regards,

    Amit

    Add comment
    10|10000 characters needed characters exceeded

  • Apr 25, 2007 at 09:19 AM

    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

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Apr 25, 2007 at 09:24 AM

    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

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Apr 25, 2007 at 09:28 AM

    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

    Add comment
    10|10000 characters needed characters exceeded