Skip to Content
avatar image
Former Member

How to declare itab inside Smartform

hi guys,

my requirement is this. I am passing a value(p_empno) to SF from SE38 pgm through function. i want to fetch the records from 2 tbls based on this value. In global definition, under initialisation tab, i wrote the code:

data : itab type table of str,

wa_itab type str.

select aempno aname a~dob

bdept bloc b~sal into table itab

from zempmaster as a

inner join zempdetails as b on bempno = aempno

where a~empno = p_empno.

the error is : itab is neither specified under "TABLES" nor is it defined as an internal table.

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

3 Answers

  • avatar image
    Former Member
    Mar 07, 2008 at 01:05 PM

    Hi

    STR is not table it is a data element check it

    and use the table name for it or use begin of

    Regards

    Shiva

    Add comment
    10|10000 characters needed characters exceeded

  • Mar 07, 2008 at 01:10 PM

    Did you define the internal table in "Initialization" tab or "Global data" tab.

    If in "Initialization" tab, that should work.

    If in "Global data" tab, don't forget to fill the "Output parameters" with itab and the "Input parameter" with p_empno.

    Also str is only a data element of length 12. is it long enough ?

    Regards

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Mar 11, 2008 at 07:30 AM

    Hi,

    *Global Data*

    itab type str. -


    > itab type table of str [Try this]

    wa_itab type str.

    Types

    types:begin of str,

    empno like zempmaster-empno,

    name like zempmaster-name,

    dob like zempmaster-dob,

    dept like zempdetails-dept,

    loc like zempdetails-loc,

    sal like zempdetails-sal,

    end of str.

    Initialization

    code for fetching data from DB into itab.

    The ERROR is:

    Field itab is unknown

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      thanks to all.

      now it is working fine. I changed the code under GLOBAL DATA to "itab type str", previously it was "itab type table of str".

      thanks a lot.