cancel
Showing results for 
Search instead for 
Did you mean: 

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

Former Member
0 Kudos

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

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

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

Answers (4)

Answers (4)

Former Member
0 Kudos

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.

0 Kudos

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

Former Member
0 Kudos

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.

christian_wohlfahrt
Active Contributor
0 Kudos

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

Former Member
0 Kudos

Thnx for sharing ur ideas

i hav solved some part by creating a structure .

Now i need to pass a Internal Table(few selected fields form table LIPS ) with multiple records , How do i do ? i cant use structure for the same since it can hold only one record .

I have given points 2 u people .

Plz help .

Moni

Former Member
0 Kudos

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