cancel
Showing results for 
Search instead for 
Did you mean: 

calling internal table in smartform

Former Member
0 Kudos

Hi all,

I'm working on smartforms,

i'm getting one internal table value from a function module with 3 records this i should display,

i'm able to display only the last record if i use work area, if i use interna table it giving error as

"occurs 0 specification is missing" or "internal table without headerline" .


SORT leistung BY EXTROW packno .
clear wa_text.
loop at leistung into wa_le.
 wa_text-EXTROW = wa_le-EXTROW.
 WA_text-kTEXT1 = wa_le-KTEXT1.
 wa_text-packno = wa_le-packno.
 wa_text-introw = wa_le-introw.
append wa_text into it_text .
endloop.

if i call &it_text-ktext1& its giving error.

global definiton i've declared like this..


types : begin of ty_text,
        count type i,
        extrow like esll-extrow,
        ktext1 like esll-ktext1,
        packno like esll-packno,
        introw like esll-introw,
        end of ty_text.

types : wa_text type standard table of ty_text.

global data :


wa_text type ty_text.
it_text type ty_text occurs 0.

regards

Suprith

<MOVED BY MODERATOR TO THE CORRECT FORUM>

Code Formatted by: Alvaro Tejada Galindo on Jan 8, 2009 4:42 PM

Accepted Solutions (0)

Answers (9)

Answers (9)

Former Member
0 Kudos

Hi Suprith,

TYPES:
  begin of ty_text,
    count type i,
    extrow like esll-extrow,
    ktext1 like esll-ktext1,
    packno like esll-packno,
    introw like esll-introw,
  end of ty_text.      " Declare it in the TYPES tab of Global Definitions

" And Declare the internal table and work area in the Global Data tab of Global Definitions.
  wa_text type ty_text
  it_text type table of ty_text

With luck,

Pritam.

Edited by: Pritam Ghosh on Jan 8, 2009 8:10 AM

Former Member
0 Kudos

Hi,

Place a loop, and on 'data tab' of LOOP

click internal table check box

give your 'internal table name' to 'work area name'

Thanks & Regards,

Krishna..

Former Member
0 Kudos

types : wa_text type standard table of ty_text.

global data :

wa_text type ty_text.

it_text type ty_text occurs 0.

regards

INSTEAD OF THIS.. TYR WITH THE BELOW

IT_TEXT LIKE TY_TEXT OCCURS 0 WITH HEADER LINE.

Hope the answer to the Query

Former Member
0 Kudos

Hi,

In global Data declare like this....

global data :

wa_text type Table of ty_text

it_text type table of ty_text

This is working.....

Former Member
0 Kudos

I've declared as above i'll get two errors...

occurs 0 specification is missing for it_text or

it_text is a table without headerline.

Former Member
0 Kudos

Hi ,

Do like this....

Create LOOP

In that use like this.....

internaltable it_text into wa_text.

Ofter create text element And call wa_text-field.

Try this.....

Former Member
0 Kudos

go to commandline editor.

describel table line.

now u can find numeber of rows

after

use read statement.

Read the last row.

Former Member
0 Kudos

Hi,

declare it

data: wa_text type ty_text,

it_text type standard table of ty_text

instead of

it_text type ty_text occurs 0.

regards,

Santosh Thorat

Former Member
0 Kudos

Hi,

Check below program.

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' u201CTHIS FUNCTION MODULE CALLS THE

SMART FORM WE WILL GET THIS AT MENU ENVIRONEMENT u201D

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&

Regards

Md.MahaboobKhan

Former Member
0 Kudos

Hi

Please check the ITAB IT_TEXT is being declared as table and called.

If not create a table type and then pass the ITAB and WA

Regards

Shiva

former_member223537
Active Contributor
0 Kudos
SORT leistung BY EXTROW packno .
clear wa_text.
loop at leistung into wa_le.
wa_text-EXTROW = wa_le-EXTROW.
WA_text-kTEXT1 = wa_le-KTEXT1.
wa_text-packno = wa_le-packno.
wa_text-introw = wa_le-introw.
append wa_text into it_text .
endloop.


loop at it_text into wa_text.  " <=== Create a TABLE node & add this statement

&wa_text-ktext1&. "  <====== Create a text element

if i call &it_text-ktext1& its giving error.

global definiton i've declared like this..

types : begin of ty_text,
count type i,
extrow like esll-extrow,
ktext1 like esll-ktext1,
packno like esll-packno,
introw like esll-introw,
end of ty_text.




* Global data :

data : wa_text type ty_text.
         it_text type standard table of ty_text.