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

internal table (smartforms)

Former Member
0 Likes
1,574

Hello!

How can define an internal table within smartforms ?

Regards

ilhan

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,406

Hi,

is it not possible to say directly ?

LS_BWPOS_IT TYPE TABLE OF /DCA/P000_BWPOS

regards

ilhan

14 REPLIES 14
Read only

Former Member
0 Likes
1,406

Hi,

Go to global defination.

In TYPES tab ..create your user defined type for internal table.

that create as many internal table u want.

Hope this will help you out.

Rewards if helpful.

Thanks

Azad.

Read only

Former Member
0 Likes
1,406

Create a structure and table type in SE11...

Then In the form interface of the smartforms..

In the importing parameters

ITAB TYPE 'Your table type name'.

OR

Create a structure

In the form interface of the smartforms..

In the tables tab

ITAB LIKE 'Your structure name'.

<b>rewards point for useful answer....</b>

Thanks,

Read only

Former Member
0 Likes
1,406

In global declaration

Itab like table of ekko.

regards,

Prabhu

Read only

0 Likes
1,406

prabhu jayaraman

it is only possible to write

LIKE

TYPE

TYPE REF TO

How can I write it like your suggestion with

Itab like table of ekko.

reagards

Ilhan

Read only

Former Member
0 Likes
1,406

hi,

Yes u can define internal table in Smartforms.

You can define it in Global Definitions.

Read only

Former Member
0 Likes
1,406

Hi,

Here is a sample program in which used two internal tables in smart forms:

REPORT YPRINTPRG_SMARTFORM1 .

DATA : ITKNA1 LIKE KNA1,

ITVBAK LIKE VBAK OCCURS 0 WITH HEADER LINE.

PARAMETERS : PKUNNR LIKE KNA1-KUNNR.

SELECT * FROM KNA1 INTO ITKNA1

WHERE KUNNR = PKUNNR.

ENDSELECT.

SELECT * FROM VBAK

INTO TABLE ITVBAK

WHERE KUNNR = PKUNNR.

CALL FUNCTION '/1BCDWB/SF00000011' “THIS FUNCTION MODULE CALLS THE

SMART FORM WE WILL GET THIS AT MENU ENVIRONEMENT ”

EXPORTING

ITKNA1 = ITKNA1

TABLES

ITVBAK = ITVBAK.

IN SMART FORM

FORM INERFACE----


IMPORT (TAB)

Parameter name Type assignment Reference type Default value

ITKNA1 LIKE KNA1

FORM INERFACE----


TABLES (TAB)

ITVBAK LIKE VBAK

PAGES & WINDOWS--- MAIN WINDOW-LOOP 1--DATA(TAB)

ITVBAK INTO ITVBAK

PAGES & WINDOWS-----MAIN WINDOW--LOOP 1---TEXT 3(EDITOR)

&ITVBAK-VBELN& &ITVBAK-ERDAT& &ITVBAK-ERNAM& &ITVBAK-NETWR&

PAGES & WINDOWS-----HEADER WINDOW---TEXT 2(EDITOR)

Customer No. &itkna1-kunnr& CustomerName :&itkna1-name1&

Thanks,

Vinay

Read only

Former Member
1,406

In the form interface,there is a tab called 'TYPES'.

In that write like this:

types : begin of ty_mara,

matnr type mara-matnr,

end of ty_mara.

Then in the form interface , there is a tab called 'GLOBAL DATA'.

In that declare as below,

wa type ty_mara "for work area

itab type standard table of ty_mara "for internal table

In case of doubts, get back to me.

<b>rewards point for helpful answwer....</b>

thanks ..

Abhay SIingh.

Read only

Former Member
0 Likes
1,406

Hi,

Define looping process for internal table

Pages and windows

First Page -> Header Window (Cursor at First Page then click Edit -> Node -> Create)

Here, you can specify your title and page numbering

&SFSY-PAGE& (Page 1) of &SFSY-FORMPAGES(Z4.0)& (Total Page)

Main windows -> TABLE -> DATA

In the Loop section, tick Internal table and fill in

ITAB1 (table in ABAP SMARTFORM calling function) INTO ITAB2

3. Define table in smartforms

Global settings :

Form interface

Variable name Type assignment Reference type

ITAB1 TYPE Table Structure

global definitions

Variable name Type assignment Reference type

ITAB2 TYPE Table Structure

http://www.erpgenie.com/abap/smartforms.htm

<b>Reward points</b>

Regards

Read only

Former Member
0 Likes
1,406

You can pass data to smartforms either through a print program or directly within smartforms.

If you want to pass int.table (not of standard table type) , you can do like this.

1) In the Form Interface ,create a variable

ITAB LIKE ZSHAIL_T1

2) In the Global definition, create a structure

STRUCT LIKE ZSHAIL_T1

3)Create a Table Node and in the DATA tab, give it as

ITAB to STRUCT.

4) You can switch on the Field list (Ctrlshiftf4) and drag and drop your text(&struct-field_name&) wherever you want it to be displayed.

5) From the main program, call the FM SSF_FUNCTION_MODULE_NAME to get the FM name and then call the generated FM name and pass the internal table name in the tables parameter.

Hope this is clear for you...

Regards,

Abhay Singh.

Read only

Former Member
0 Likes
1,407

Hi,

is it not possible to say directly ?

LS_BWPOS_IT TYPE TABLE OF /DCA/P000_BWPOS

regards

ilhan

Read only

0 Likes
1,406

hi Ilhan Ertas,

yes it is possible

u will find three columns varialble name, type assignment and associated type.

( LS_BWPOS_IT , LIKE and TABLE OF /DCA/P000_BWPOS ) respectively.

regards,

Prabhu

reward if it is helpful

Read only

former_member196280
Active Contributor
0 Likes
1,406

Under Global settings

a) Form Interface

Table Tab

ITAB LIKE EKPO

Regards,

sairam

Read only

Former Member
0 Likes
1,406

Hi,

in the global declaration of smartform in table tab write the internal table name.

if this internal table consists of fields from different table ,there before enter the table name in smartform create a structure of that internal table type through transaction se11.

Regards

Debjani

Read only

Former Member
0 Likes
1,406

hi

click on form interface . select tables.

now u can specify parameter name = internal table name

type assignment = type\like

associated type = DB table name.

similarly in global definitions u can specify the work area.

ex:variable name = work area name.

type assignment -like

associated type - DB table name.

to use work area fields in the form\windows click on icon(field list on \off) left to form painter..

it will list all int tables and work areas..

drag fields into windows and proceed..

reward if useful