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

Declaring a table in Smart Forms

Former Member
0 Likes
2,741

Hi Guyz,

Im having a hard time in using smartforms...actually..i have a structure table ZHPayroll

Which consists of basic,fix allow ,company etc.

My main problem is i cant declare or call my structure table in Smartforms under Forms->Tables..My command is <b> IT_GL type ZHPayroll</b>

It has an error message

"ONLY TABLE TYPES MAY BE USED AS REFERENCE TYPE FOR A TABLE PARAMETER".So i declare it under Form Interface->Import

Then I declare a GS_DATA under Global Definitions ->Global Data

Command is like this GS_DATA type TS_Data (which is my structure under TYPES tab same structure like ZHPayroll)

.Once I call it under Main Window->Table->Data

IT_GL is neither specified under tables nor it is defined as an internal table.

Please give some advice what to do about this.

I used this FM see below.

DATA: ly_formname TYPE rs38l_fnam.

CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'

EXPORTING

formname = 'ZSF_PAYROLL'

IMPORTING

fm_name = ly_formname

EXCEPTIONS

no_form = 1

no_function_module = 2

OTHERS = 3.

IF sy-subrc <> 0.

  • MESSAGE e001 WITH 'ZSF_PAYROLL'.

ENDIF.

CALL FUNCTION ly_formname

EXPORTING

<b> it_gl = gs_outtab</b>

exp_total_at_top = 'X'

  • prepared_by = p_prepb

  • approved_by = p_apprb

EXCEPTIONS

formatting_error = 1

internal_error = 2

send_error = 3

user_canceled = 4

OTHERS = 5.

Thanks in advance

aVaDuDz

9 REPLIES 9
Read only

Former Member
0 Likes
1,458

declare the structure in Se11 and use that structure in your table at smartform,

whatever structure you use in program and same structure should be in smartform.

Read only

Former Member
0 Likes
1,458

hi

declare IT_GL like ZHPayroll in tables parameter only in the smartforms...as teh error message, only if you have created a table type which is of line type zhpayroll, it will accept type reference (like this command IT_GL type ZHPayroll)

if helpful, reward

Sathish. R

Read only

Former Member
0 Likes
1,458

Hi,

If you want to declare the internal table...

create a table type in se11..

Go to SE11.

choose the data type radio button..

Create a table type for the structure..

This is like declaring the type which is of internal table in the ddic..

Then in the program..just give..

DATA: T_TYPE TYPE ZTABLE_TYPE.

For the function module interface you can use the table type..

T_TABLE TYPE ZTABLE_TYPE..

Thanks,

Naren

Read only

0 Likes
1,458

Hi Naren,

I appreciate your reply...Im ok in creating a structure...but the main error is in smartforms.

this is what i did..

1.Declare IT_GL type ZHPayroll (created structure) from Form Interface->Tables

2.Declare GS_Data type TS_DATA (types declare under Types Tab. This structre is the same with ZHPayroll)

3. Create a Table from Main Window->Table

4.Declare internal Table under Data Tab the IT_GL into GS_Data

5.I called FM in my program

DATA: ly_formname TYPE rs38l_fnam.

CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'

EXPORTING

formname = 'ZSF_PAYROLL'

IMPORTING

fm_name = ly_formname

EXCEPTIONS

no_form = 1

no_function_module = 2

OTHERS = 3.

CALL FUNCTION ly_formname

EXPORTING

IT_GL = gs_outtab

exp_total_at_top = 'X'

EXCEPTIONS

formatting_error = 1

internal_error = 2

send_error = 3

user_canceled = 4

OTHERS = 5.

But after activating my Smartforms this is the error

Only table types may be used as the reference type for a table parameter

but transfer the IT_GL to Import tab from Form Interface

Same error occur.

Please HELP.

Thanks

aVaDuDz

Read only

Former Member
0 Likes
1,458

hi,

Inplace of Declare IT_GL type ZHPayroll , you place Declare IT_GL <b>LIKE</b> ZHPayroll

Reward if usefull

Regards,

Naveen

Read only

0 Likes
1,458

pl check my reply

Sathish. R

Read only

0 Likes
1,458

Hi Sathish,

Thanks for your advice..but im having a hard time to understand it..can you please ellaborate your reply...for me coz im just new in abap..please...kindly explain more..

Thank you

Read only

0 Likes
1,458

hi

read into this get a good understanding of table types..you can also search the forum on this topic

http://help.sap.com/saphelp_nw2004s/helpdata/en/90/8d7304b1af11d194f600a0c929b3c3/frameset.htm

if helpful, reward

Sathish. R

Read only

Former Member
0 Likes
1,458

Hi,

As mentioned in my reply..Create a table type in SE11 and use it in your smart forms function module interface in your importing parameter and in your program..

This will solve your problem..

Check the steps to create a table type..

GOTO SE11

Choose the data type radio button..

GIVE ZHPayroll_t

Press create ...

Choose the radio button TABLE TYPE.

Give the row type give the structure name ZHPayroll

Save and activate the table type..

Then use it in your smartforms and in your program..

Thanks,

Naren