Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

accessing user defined datatype in smartforms

Former Member
0 Likes
720

I have created type group named “zkttp”. In that I have created a data type named zkttp_ty_sflight. I did include that in my smartform “zrkt_sform_saplane”. But it is showing error. This I am trying because I don’t want to send all fields of sflight table in smartform. is this the right way? in smartform i have defined internal table with like as the the above datatype. still it is giving error as "TYPE ZKTTP_TY_SFLIGHT NOT ALLOWED IN THIS CONTEXT".

4 REPLIES 4
Read only

Former Member
0 Likes
492

Hi Ruby,

Whenever we use a Type Group in Report Program, we have to give <b>TYPE-POOLS</b> statement ( <b>TYPE-POOLS zkttp</b>, in your case ). Can we give such statement in SMARTFORM?

Regards,

Abdul

P.S: Mark Points, if useful!

Read only

Clemenss
Active Contributor
0 Likes
492

Ruby,

obviously there is no official way to use type-pools in SMARTFORMS, I assume what you created as type group is what you include in ABAP programs as TYPE-POOLS ZKTTP_TY_SFLIGHT.

If you put this statement inside a FORM, you can use the included types locally.

Yo don't need to define anything what is existing. In the SMARTFORMS TYPES section, you may define your own type as

TYPES:

begin of zkttp_ty_sflight,

...

end of zkttp_ty_sflight.

Then You can use it.

Regards,

Clemens

Read only

Abhijeet-K
Active Participant
0 Likes
492

Hi Clemens,

Regarding the 'If you put this statement inside a FORM, you can use the included types locally' , it is not syntactically possible.

The best trade off to circumvent this problem, without creating numerous customer dictionary data types (Z structures, et al), is to create a function module, that takes input of a select few parameters and delivers a processed output as an exporting parameter. Only these exporting and/or the importing parameters are required to be created in the Data Dictionary. The function module should be made in the same function group in which the type pool has been created.

-Abhijeet.

Edited by: Abhijeet Kulkarni on Feb 5, 2008 6:11 PM

Read only

Former Member
0 Likes
492

You cannot access TYPE_POOLS in the smart form parameters. So, create that data type as a strucutre in the dictionary (SE11) and your problem should be resolved.

Regards,

Ravi

Note - Please mark all the helpful answers