Skip to Content
author's profile photo Former Member
Former Member

Smartforms : ITAB 2 be passed 2 layout , plz see issue

Dear all

In print prog i have something like this

TYPES:BEGIN OF TYP_ADRS ,

NAME1 LIKE ADRC-NAME1,

STREET LIKE ADRC-STREET,

CITY1 LIKE ADRC-CITY1,

POST_CODE1 LIKE ADRC-POST_CODE1,

COUNTRY LIKE T005T-LANDX,

END OF TYP_ADRS.

DATA:T_ADRS TYPE TYP_ADRS OCCURS 0 WITH HEADER LINE.

AT SELECTION-SCREEN.

SELECT SINGLE BUKRS INTO VBRK-BUKRS FROM VBRK WHERE VBELN = P_INVNO.

SELECT SINGLE ADRNR

INTO T001-ADRNR

FROM T001

WHERE BUKRS = VBRK-BUKRS.

SELECT SINGLE NAME1 STREET CITY1 POST_CODE1 COUNTRY

INTO (T_ADRS-NAME1,T_ADRS-STREET,T_ADRS-CITY1,

T_ADRS-POST_CODE1, ADRC-COUNTRY)

FROM ADRC

WHERE ADDRNUMBER EQ T001-ADRNR.

SELECT SINGLE LANDX

INTO T_ADRS-COUNTRY

FROM T005T

WHERE SPRAS = 'EN'

AND LAND1 = ADRC-COUNTRY.

APPEND T_ADRS.

Now through Form Interface ,i want 2 pass this 2 my layout

How do i declare this under Table(TAB)in Form Interface

If i declare like this

T_ADRS LIKE TYP_ADRS. it throws error

"type TYP_ADRS desnt exist".

(even i used TYPE REF TO it throws "feature under developement by placing the following under TYPE in Global definition

TYPES:BEGIN OF TYP_ADRS ,

NAME1 LIKE ADRC-NAME1,

STREET LIKE ADRC-STREET,

CITY1 LIKE ADRC-CITY1,

POST_CODE1 LIKE ADRC-POST_CODE1,

COUNTRY LIKE T005T-LANDX,

END OF TYP_ADRS.

)

How do i proceed . plz help.

Any light on this will be rewarded .

Thnx

Moni

Add a comment
10|10000 characters needed characters exceeded

Related questions

5 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Feb 09, 2005 at 02:24 PM

    Hi,

    What I do is create a structure in the data dictionary and then define the table like the new structure on the tables tab.

    Hope this helps,

    Becky

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Feb 09, 2005 at 02:23 PM

    Hi Moni,

    you were on the right track:

    replace

     T_ADRS LIKE TYP_ADRS.

    with

     T_ADRS <b>TYPE</b> TYP_ADRS.

    and you can use t_adrs in form definition.

    form work using lt_adrs type t_adrs.
    ...

    Regards,

    Christian

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      In the forms interface section of the Smartform you need to define your table on the table tab:

      zint_table like z_structure

      In your print program:

      data: itab like z_structure occurs 0.

      call function fm_name

      exporting

      .

      .

      .

      tables

      zint_table = itab

      exceptions

      .

      .

      .

      Hope this helps,

      Becky

  • author's profile photo Former Member
    Former Member
    Posted on Feb 09, 2005 at 02:29 PM

    Declare this same TYP_ADDRESS, in global interface - Types tab.

    Do not use <b>LIKE</b>, use <b>TYPE</b>.

    If still doesn't work, create a structure in DDIC of ZTYP_ADDRESS and use it.

    Regards,

    Subramanian V.

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Feb 09, 2005 at 02:49 PM

    Hi Moni,

    I agree with Rebecca. If you want to use it in form interface it has to be a DDIC type or an ABAP type. You wont be able to use the type declared inside the form in Global defenition in the form interface.

    So please declare the type in the DDIC and try using that type in your table decleration in the form interface

    Regards,

    Vani

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Feb 09, 2005 at 03:09 PM

    The term LIKE should be followed by a data object. The term TYPE should be followed by a type definition which could be a data object that also can serve as a type definition.

    The use of the TABLES keyword is considered obsolete since you can now pass tables via the USING.. CHANGING.. keywords. Once you get into OO programming you will see that there is no TABLES option so I suggest you start using the latest techniques.

    Let us know how it goes.

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.