Application Development 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: 

table control

Former Member
0 Kudos

Hi,

I have designed a table control..there are 3 columns..I have not given tables structure..

Simple 3 fields..

While loading the screen i want to display the values from the internal table to the particular fields..

help me with sample code

1 ACCEPTED SOLUTION

Former Member
0 Kudos

yaaaa

loop at it with control tab_controlname

perform fill_it " fill ur internal table

endloop

use this in pbo of screen

3 REPLIES 3

Former Member
0 Kudos

yaaaa

loop at it with control tab_controlname

perform fill_it " fill ur internal table

endloop

use this in pbo of screen

Former Member
0 Kudos

hi check this...

REPORT ZSELECTIONSCREEN001.

tables:mara,

marc,

mard,

sscrfields.

data: begin of it_mara occurs 0,

matnr like mara-matnr,

meins like mara-meins,

mtart like mara-mtart,

pstat like mara-pstat,

ernam like mara-ernam,

end of it_mara.

selection-screen begin of screen 100 as subscreen.

selection-screen begin of block b1 with frame title text-001.

select-options:matno for mara-matnr.

selection-screen end of block b1.

selection-screen end of screen 100.

selection-screen begin of screen 200 as subscreen.

selection-screen begin of block b2 with frame title text-002.

select-options:industry for mara-meins.

selection-screen end of block b2.

selection-screen end of screen 200.

selection-screen begin of screen 300 as subscreen.

selection-screen begin of block b3 with frame title text-003.

select-options:mattype for mara-mtart.

selection-screen end of block b3.

selection-screen end of screen 300.

SELECTION-SCREEN: FUNCTION KEY 1,

FUNCTION KEY 2.

SELECTION-SCREEN: BEGIN OF TABBED BLOCK SUB FOR 15 LINES,

END OF BLOCK SUB.

initialization.

SSCRFIELDS-FUNCTXT_01 = '@0D@'.

SSCRFIELDS-FUNCTXT_02 = '@0E@'.

SUB-PROG = SY-REPID.

SUB-DYNNR = 100.

AT SELECTION-SCREEN.

CASE SY-DYNNR.

WHEN 100.

IF SSCRFIELDS-UCOMM = 'FC01'.

SUB-DYNNR = 300.

ELSEIF SSCRFIELDS-UCOMM = 'FC02'.

SUB-DYNNR = 200.

ENDIF.

WHEN 200.

IF SSCRFIELDS-UCOMM = 'FC01'.

SUB-DYNNR = 100.

ELSEIF SSCRFIELDS-UCOMM = 'FC02'.

SUB-DYNNR = 300.

ENDIF.

WHEN 300.

IF SSCRFIELDS-UCOMM = 'FC01'.

SUB-DYNNR = 200.

ELSEIF SSCRFIELDS-UCOMM = 'FC02'.

SUB-DYNNR = 100.

ENDIF.

ENDCASE.

START-OF-SELECTION.

select matnr

meins

mtart

pstat

ernam

from mara

into table it_mara

up to 100 rows

where matnr in matno.

loop at it_mara.

write:/ it_mara-matnr,

it_mara-meins,

it_mara-mtart,

it_mara-pstat,

it_mara-ernam.

endloop.

end-of-selection.

regards,

venkat

Former Member
0 Kudos

Hi..

well all u have to do is.

<<<<< P B O>>>>

loop at it into wa with tablecontrol tb_cnrl.

module data_fetch.

endloop.

stucture of a screen should be LIKE THIS..

now write a simple SELECT QUERY IN MODULE DATA_FETCH.

all set.

regards

Manish.