Declaring an internal table in smartform

hi,
   can anyone tell how to declare   internal table in smartform.
   the internal table contains fields from 2 or more data dictionary tables(eg.kna1 
   and adrc). after this from the print program(internal table containing data in print
   program) internal table should be passed to the smartform.
thanks.

hi laxya,
if u want to pass the data from internal table in print program to Smartform.. there is only way.. that is using form interface..
1. goto se11, create a structure same as the itab in the print program.ex. <b>z_itab</b>
2. create line type... se11>select radio button-DATA type><b>z_it_itab</b> >press create>then select>TABLE Type> then entrer some text--> in the line type Field in giveth Str name u have created in STEP 1. activate it.
3. got SMARTFORMS-> form inteface>tables tabe--> give some name ex <b>IT_tab type z_it_itab</b>.
then acivate it.. then in the driver progam pass this table data.
Exapmpel
CALL FUNCTION fp_v_fm_name
    EXPORTING
      archive_index      = toa_dara
      archive_parameters = arc_params
      control_parameters = fp_st_control_parameters
      user_settings      = space
      output_options     = fp_st_output_options
      wa_vbdkr           = fp_st_vbdkr
    IMPORTING
      job_output_info    = l_it_ssfcrescl
      job_output_options = l_it_ssfcresop
    TABLES
<b>      IT_tab  = z_it_itab (or table in driver program)</b>
  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.
Another way is cteate a type in Globaldifination-->types tab..
ex:
types: begin of ty_itab,
   matnr type matnr,
   meins type meins
   vrkme  type vrkme,
end of ty_itab,
ty_it_itab type standard table of ty_itab.
then GLOBAL DIFINATION>GLOBAL DATA TAB>IT)ITAB TYPE TY_IT_ITAB.
BUT In this u can't pass the data from the print Program.. if u want to populate data in to this table... u have to write the Select query in the GLOBAL DIFINATIONS-->INITILIZATIONS TAB.
Please Close this thread.. when u r problem is solved
Reward if Helpful
Regards
Naresh Reddy K
Message was edited by:
        Naresh Reddy

Similar Messages

  • How to declare global internal table in smartform

    Hi
    i need internal table in smart form with type of tline .. tline is structure and when i declare it in global definition as  lines like tline it creates a structre ... kindly help me out
    Regards
    Ammad

    This error is coming becasue u have not created an work area which is of same type as tdline.
    Just double click on the error and copy paste the code here.Error now is nin ur code.
    Secondly lets my internal table is GT_TLINE.
    I will declare a work are GWA_TLINE type TLINE.
    then i can have
    loop at gt_line into gwa_tline or
    read table gt_tline into gwa_tline with key etc.
    Regards,
    Nabheet Madan

  • How to define internal table in smartform(urgent)

    Hi all,
    How can i define a internal table <b>with header line </b> in global data ???
    i defined like
    In Types,
    TYPES : BEGIN OF T_XVBPLP2 ,
             VENUM(10),
             VEPOS(10),
             POSNR(6),
             VEMNG LIKE LIPS-LFIMG,
             MATNR LIKE LIPS-MATNR,
             CHARG LIKE LIPS-CHARG,
             ARKTX LIKE LIPS-ARKTX,
             END OF T_XVBPLP2.
    TYPES: T_XVBPLP TYPE TABLE OF T_XVBPLP2.
    In Global Data,
    T_XVBPLP TYPE T_XVBPLP.
    Still, i am getting error message that, Internal table is not with header line.
    can u plz give me some examples , to  define internal table with header line in smartform ???
    any correct answers will be rewarded??
    Regards
    pabitra

    Hi
    define WA_ITAB  in Global variables
    variable name          type assin      associated type
    t_text                      like                     zstc_text
    you cannot define a internal table with header line in SMART Forms. Declare a internal table and a work area separately both referring to the same structure.
    Then you can use the work area. So, in this case WA_ITAB is declared as a global variable of TYPE ZSTC_TEXT.
    Regards
    Pavan

  • PASSING INTERNAL TABLE IN SMARTFORM

    HI' I M NEW TO SMARTFORMS, MY PROBLEM IS =THAT
    I'VE CREATED A NEW TYPE(SAY TY_BKPF) IN THE DRIVER PROGRAM.
    THEN I'VE DECLARED AN INTERNAL TABLE OF THIS TYPE.
    TO PASS THIS INTERNAL TABLE INTO MY SMARTFORM I'VE PASSED THE INTERNAL TABLE'S NAME INTO THE FUNCTION MODULE UNDER THE TABLES PARAMETER.
    BUT I'M NOT ABLE TO UNDERSTAND AS TO WHAT TYPE SHOULD I GIVE IT IN THE FORM INTERFACE IN THE TABLES TAB.
    PLZ HELP.

    Define table in smartforms
    Global settings :
    Form interface
    Variable name    Type assignment   Reference type
    ITAB1               TYPE                  Table Structure
    Global definitions
    Variable name    Type assignment   Reference type
    ITAB2               TYPE                  Table Structure
    Also have a look at below sample code. It will give you idea abt the same.
    REPORT ZSMARTFORM.
    Calling SMARTFORMS from your ABAP program.
    Collecting all the table data in your program, and pass once to SMARTFORMS
    SMARTFORMS
    Declare your table type in :-
    Global Settings -> Form Interface
    Global Definintions -> Global Data
    Main Window -> Table -> DATA
    TABLES: MKPF.
    DATA: FM_NAME TYPE RS38L_FNAM.
    DATA: BEGIN OF INT_MKPF OCCURS 0.
            INCLUDE STRUCTURE MKPF.
    DATA: END OF INT_MKPF.
    SELECT-OPTIONS S_MBLNR FOR MKPF-MBLNR MEMORY ID 001.
    SELECT * FROM MKPF WHERE MBLNR IN S_MBLNR.
       MOVE-CORRESPONDING MKPF TO INT_MKPF.
       APPEND INT_MKPF.
    ENDSELECT.
    At the end of your program.
    Passing data to SMARTFORMS
    call function 'SSF_FUNCTION_MODULE_NAME'
      exporting
        formname                 = 'ZSMARTFORM'
      VARIANT                  = ' '
      DIRECT_CALL              = ' '
      IMPORTING
        FM_NAME                  = FM_NAME
      EXCEPTIONS
        NO_FORM                  = 1
        NO_FUNCTION_MODULE       = 2
        OTHERS                   = 3.
    if sy-subrc <> 0.
       WRITE: / 'ERROR 1'.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    endif.
    call function FM_NAME
    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
        GS_MKPF                    = INT_MKPF
      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.
    Have a look at below link for more help on smart forms.
    http://sap.ionelburlacu.ro/sap0/sapsf001.htm
    http://help.sap.com/saphelp_erp2004/helpdata/en/a9/de6838abce021ae10000009b38f842/frameset.htm
    I hope it helps.
    Best Regards,
    Vibha
    *Please mark all the helpful answers

  • Internal table in smartform

    In driver program:
    TYPES: BEGIN OF ty_output,
           var1 TYPE c,
          var2 type c, 
    TYPES: END OF ty_output.
    DATA: gt_output TYPE TABLE OF ty_output.
    how to declare this in smartforms?
    Thanks

    Hi,
    You can do this in two ways....
    1. If you need the interal table to be accessed globally in the smartform, you can declare the internal    table in global definitions
    first you need to define TYPES for the internal table in Types tab.
    and this needs to be given as reference in Global Data tab for the internal table.
    2. You need the internal table to be local ,then you can create a program lines node and declare the internal table as you do in the ABAP program
    Hope this helps
    Regards,
    Sujatha

  • Internal Table in smartforms

    how can we declare an internal table for a standard sap table in smartforms in the 'Global Setting' part of smartforms?

    Hai,
    You can define the standard table in smartforms like this.
    In Global settings:
    variable name     type assignment      reference type
    it_ekpo                 type                        table structure
    In Global definitions:
    variable name     type assignment      reference type
    it_ekpo                 type                        table structure
    regards,
    kamala.

  • Issue in display format of a internal table in SMARTFORM

    I m printing an internal table in smartform.when a particular field exceeds the coloumn's length.the rest of the texts come down to the next line.It can be shown in the below example.i m printing "+ text to be printed" in that particular coloumn.
    Because of the size of the coloumn in table ,"ed." comes down as shown.
    +  text to be print
    ed.
    I dont want ed to come directly down '+'.I want it to start from where 't' of 'text'
    starts in the above line.
    Notice that the requirement is to print "ed"  after '4' spaces.
    Please suggest what i need to do to get the desired result...
    Regards
    Rudra

    Unfortunately there is no such way.

  • Issue in display format of internal table in smartform

    I m printing an internal table in smartform.when a particular field exceeds the coloumn's length.the rest of the texts come down to the next line.It can be shown in the below example.i m printing "+ text to be printed" in that particular coloumn.
    Because of the size of the coloumn in table ,"ed." comes down as shown.
    <b>+ text to be print
    ed. </b>
    its coming by default.
    I want it like  <b>+ text to be print
    ed</b>
    I dont want ed to come directly down '+'.I want it to start from where 't' of 'text'
    starts in the above line.
    Notice that the requirement is to print "ed" after '2' spaces.And we can not use the string length concept bcoz not of characters after which the line comes down is not fixed.May be some change of setting in smartform will do the trick.
    Please suggest what i need to do to get the desired result...
    Regards
    Rudra

    Unfortunately there is no such way.

  • How to Define Internal Table in Smartform

    Hello,
    I have some problem on define Internal Table in Smartform
    I define a Temp_IT_Gen Type LBBIL_IT_GEN in Global Definiations
    but i find that it is not available for me to append data into it,
    the error message is Temp_IT_Gen is not a Internal Table - the Occurs n Specification is missing
    so how can i solve it?
    i want to use the internal table in the hold program.
    Thanks a lot in advance.

    Hi,
    First U define the Table type in 'TYPES' tab of Global Definitions and then assing that table type to Internal table in 'Global Data' tab.
    Eg:
    define the Table Type like below in TYPES tab.
    TYPES:BEGIN OF ty_TEMP.
            INCLUDE STRUCTURE XXXXXXX.
    TYPES:END OF ty_TEMP.
    TYPES: g_t_temp TYPE STANDARD TABLE OF ty_TEMP .
    Now, define the Internal table in Global Data tab like below:
    Variable Name    Type assignment    Associated Type
    G_T_ITEM_1       TYPE                    G_T_TEMP
    NOTE: whatever U define in Global Definitions can be used only in SMARTFORM, if u want to use it in Program U must define in Form Interface.
    Hope it helps!!
    Rgds,
    Pavan

  • Declaring the internal table in ABAP objects

    Hi every1,
    Please any one let me know how to declare an internal table in class (ABAP objects). Bcos i am new to this classes.
    help me out.
    Regards,
    Madhavi

    Hi,
    Check this example..
    TYPES: BEGIN OF TYPE_DATA,
                   MATNR TYPE MATNR,
                   WERKS TYPE WERKS_D,
                 END OF TYPE_DATA.
    DATA: T_DATA TYPE STANDARD TABLE OF TYPE_DATA.
    DATA: WA_DATA TYPE TYPE_DATA.
    Adding rows to the internal table.
    WA_DATA-MATNR = 'AA'.
    APPEND WA_DATA TO T_DATA.
    Processing the interna table
    LOOP AT T_DATA INTO WA_DATA.
    ENDLOOP.
    Thanks,
    Naren

  • How to Import customized internal table to smartform from Print Program

    Hi Gurus,
    I want to Import customized internal table to smartform from print program, Can anybody tell me how it is possible.
    With regards,
    S.Saravanan

    There is no problem passing an internal table to a smarforms, smartforms have the same interface as a function module ([Defining the Form Interface|http://help.sap.com/saphelp_nw70/helpdata/en/1c/f40c5bddf311d3b574006094192fe3/frameset.htm] in [Smart Forms|http://help.sap.com/saphelp_nw70/helpdata/en/a5/de6838abce021ae10000009b38f842/frameset.htm]) so could you elaborate a little more on your requirement (is it a standard a custom forms, etc.)
    Regards,
    Raymond

  • Declare dynamic internal table during runtime error

    Hi Gurus,
    I have encounter a problem here. I would like to have several block of alv list output; for each customer open items details. Thus, i need to create dynamic internal table duirng runtime as i do not know how many customers that should be output before user enter from the selection screen field for customer code.
    I tried to search in the forums and found this website [Runtime Declaration of Internal Table;.
    But when i tried to execute it, i have an error. The field symbols that i passed into the call function REUSE_ALV_BLOCK_LIST_APPEND for parameter t_outtab does not match. May i know how do i go about it?
    Or are there any other solutions to display this kind of reports? I ever think of using hierarchy list alv. But it does not match the requirement. I would like to display the total amount for each customer. Can hierarchy list able to do so? Or it can only display as the grand total at the end of the report? I think it would be best to display as alv block output.
    Your help will be much appreciated. <offer removed by moderator>
    Thanks
    Edited by: Thomas Zloch on Oct 22, 2010 11:23 AM

    the problem comes up, when there are fields in the table which represent numbers with decimals (type p). Best is to reference the field directly what comes from SAP. Replace the LOOP At idetails ... ENDLOOP with:
    LOOP AT idetails INTO xdetails.
        CLEAR xfc.
        xfc-fieldname = xfc-ref_field = xdetails-name .
        xfc-ref_table   = p_table.
    *    xfc-datatype = xdetails-type_kind.
    *    xfc-inttype = xdetails-type_kind.
    *    xfc-intlen = xdetails-length.
    *    xfc-decimals = xdetails-decimals.
        APPEND xfc TO ifc.
      ENDLOOP.

  • Passing internal tables into smartforms

    Hi All,
    I am testing a smartform for PO. But the smartform is already designed and it has two internal tables of type EKKO and EKPO. When i run the smartform its displaying the layout correctly but with no data ,which is true as the two internal tables have no data. So i want to fill those two internal tables based on the purchase order number/ numbers. So that i can test the smartform with those purchase order numbers.
    I want to create a parameter / select option in smartform so that when we enter the PO number those internal tables will be filled. How to create those options in the smartform.
    If i have to create through an ABAP program then i want to know how to pass those two internal tables to smartform. (Shall i have to call the FM couple of times and then pass those two internal tables).
    Thanks in Advance

    You fill the tables in the print program and pass the tables to the SmartForm function module under the tables section.  See the FM call below (CALL FUNCTION lf_fm_name)  and note that I am only passing in one internal table.  If you wish you may pass in more than one table.
    *&      Form  smartform_print
    *       text
    *  -->  p1        text
    *  <--  p2        text
    FORM smartform_print .
      DATA: lf_fm_name            TYPE rs38l_fnam.
      DATA: ls_control_param      TYPE ssfctrlop.
      DATA: ls_composer_param     TYPE ssfcompop.
      DATA: ls_recipient          TYPE swotobjid.
      DATA: ls_sender             TYPE swotobjid.
      DATA: lf_formname           TYPE tdsfname.
      DATA: ls_addr_key           LIKE addr_key.
      PERFORM set_print_param USING      ls_addr_key
                                CHANGING ls_control_param
                                         ls_composer_param
                                         ls_recipient
                                         ls_sender
                                         retcode.
    *Get the Smart Form name.
      IF NOT tnapr-sform IS INITIAL.
        lf_formname = tnapr-sform.
      ELSE.
        MESSAGE e001(/smb40/ssfcomposer).
      ENDIF.
      IF vbdkr-vkorg = '0035'.
        IF w_regio = 'QC'.
          tnapr-fonam = 'ZPCC_INVOICE_FR'.
        ENDIF.
      ENDIF.
    *  IF NOT tnapr-sform IS INITIAL.
    *    lf_formname = tnapr-sform.
    *  ELSE.
    *    MESSAGE e001(/smb40/ssfcomposer).
    *  ENDIF.
    * determine smartform function module for invoice
      CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
           EXPORTING  formname           = lf_formname
    *                 variant            = ' '
    *                 direct_call        = ' '
           IMPORTING  fm_name            = lf_fm_name
           EXCEPTIONS no_form            = 1
                      no_function_module = 2
                      OTHERS             = 3.
      IF sy-subrc <> 0.
    *   error handling
        retcode = sy-subrc.
        IF sy-subrc = 1.
          MESSAGE e001(/smb40/ssfcomposer).
        ENDIF.
        IF sy-subrc = 2.
          MESSAGE e002(/smb40/ssfcomposer).
        ENDIF.
        PERFORM protocol_update.
      ENDIF.
      CALL FUNCTION lf_fm_name
        EXPORTING
           archive_index              = toa_dara
    *   ARCHIVE_INDEX_TAB          =
           archive_parameters         = arc_params
           control_parameters         = ls_control_param
    *   MAIL_APPL_OBJ              =
           mail_recipient             = ls_recipient
           mail_sender                = ls_sender
           output_options             = ls_composer_param
           user_settings              = ' '
           vbdkr                      = vbdkr
           temp_jmval                 = temp_jmval
           temp_agval                 = temp_agval
           w_ship                     = w_ship
           w_ktgrd                    = w_ktgrd
           likp                       = likp
           w_trlrnbr                  = w_trlrnbr
           w_sealnbr                  = w_sealnbr
           w_booknbr                  = w_booknbr
           w_lc                       = w_lc
           w_shippoint                = w_shippoint
           billto_fedid               = billto_fedid
           soldto_fedid               = soldto_fedid
           shipto_fedid               = shipto_fedid
           vbco3                      = vbco3
           w_z4_address               = w_z4_address
           w_stawn                    = w_stawn
           w_herkl                    = w_herkl
           new_rate                   = new_rate
           vblkp                      = vblkp
          TABLES
           vbdpr                      = tvbdpr
    *       t_containers               = t_containers
    *       tdomvd                     = tkomvd
    *       da_xfplt                   = da_xfplt
    *       payment_split              = payment_split
    *       komk                       = komk
    *       frt_conditions             = frt_conditions
    * IMPORTING
    *   DOCUMENT_OUTPUT_INFO       =
    *   JOB_OUTPUT_INFO            =
    *   JOB_OUTPUT_OPTIONS         =
    EXCEPTIONS
    formatting_error           = 1
    internal_error             = 2
    send_error                 = 3
    user_canceled              = 4
    OTHERS                     = 5
      IF sy-subrc <> 0.
        retcode = sy-subrc.
        PERFORM protocol_update.
    * get SmartForm protocoll and store it in the NAST protocoll
        PERFORM add_smfrm_prot.
      ENDIF.
    ENDFORM.                    " smartform_print
    Davis

  • Declare the internal table with only one 10 character  field and use

    Hi,
    I want to declare the internal table with only one 10 character  field and use.
    Jaya

    Hi,
    Go ahead. U can declare IT with only one field
    Example:
    data: begin of zcustlist occurs 1000,
                   custmer(10)  type c,
             end of zcustlist.
    Narendra Reddy.
    Edited by: Narendra Reddy C on Aug 8, 2008 11:39 AM

  • How to declare internal table in SMARTFORM

    Hi experts,
    I have an Internal table in my program and I want to declare in the smartform as well. How and where can I declare? Should I use global definitions and tpyes tab? How can I pass the content of the internal table to the smartform?

    Click Global Defiitions
    In TYPES :
    TYPES : BEGIN OF gty_add,
             name1      TYPE ad_name1,                          " name1
             city1      TYPE ad_city1,  " City
             country    TYPE adrc-country, "Coutnry
             post_code1 TYPE ad_pstcd1, " post code
             street     TYPE ad_street, " street
             house_num1 TYPE ad_hsnm1,  " house number
             tel_number TYPE ad_tlnmbr1," tele number
            END OF gty_add.
    In Global DATA
    GT_ADD     TYPE TABLE OF     GTY_ADD ( Internal table)
    WA_ADD     TYPE     GTY_ADD ( work area)

Maybe you are looking for

  • Itunes for windows 7 won't load?? Please Help

    I've tried loading iTunes after restarts and re-installations but for some reason it won't load. I've never had this problem before and can't seem to solve it. Any help would be much appreciated Thanks Trickster

  • Questions about resizing and uploading pictures ...

    I have set up a desktop folder, and can store my resized pictures there through the export function in iPhoto.  When I export though, there doesn't seem to be any way to export directly to that folder.  Instead, I have to export to the desktop, then

  • ME47 Error

    While maintaining the Quotation the system is not allowing me to maintain the item conditions pls suggest me how to solve this error.. This function not defined Message no. 06006 Diagnosis There is no entry for this function in Table 168F (system tab

  • Counting the number of selected Checkboxes in Numbers.

    I imagine this is very simple, however I can't seem to find a way to simply add up the number of checked check boxes in a row. Problem: I have a table with a number of objectives that I need to be able to mark as done. My rows are the objectives and

  • HT1414 what really is "other" yellow free space gobbling stuff ?

    yellow "other" burns up 1.5gb in 3 months. What is it ? No,really, what is it ?