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: 

problem in table control

Former Member
0 Kudos

hi,

i am created new transaction,in that there is a table control,data is dispalying perfectly.

1)in the table control when it displayed only 8 rows is avilable,

if 9 th record is there means it is not displaying ,at the same time if i scroll then again 9 records will come and load ,i want

if there is more than 8 records also it should disply when i scroll it,how to handle this,pls help me.following is the code.

&----


*& Module pool ZCRMM_CUPCLASS *

*& *

&----


*& *

*& *

&----


PROGRAM ZCRMM_CUPCLASS .

Tables:zcup_class,zcomm_ult_parent,zcup_class_log.

TYPES: begin of typ_zcupclass,

z_cup_number like zcup_class-Z_CUP_NUMBER,

z_cup_name like zcomm_ult_parent-z_cup_name,"zcup_name,

Z_CLASS_RANGE_ID like zcup_class-Z_CLASS_RANGE_ID,

Z_CLASS_TYPE_ID like zcup_class-Z_CLASS_TYPE_ID,

SEQNO LIKE ZCUP_CLASS-SEQNO,

Z_IND_SECTOR like zcup_class-Z_IND_SECTOR,

Z_CUP_SUB_CLASS like zcup_class-Z_CUP_SUB_CLASS,

end of typ_zcupclass.

TYPES: BEGIN OF TYP_FLAG,

mandt like sy-mandt,

Z_CUP_NUMBER LIKE ZCUP_CLASS_LOG-Z_CUP_NUMBER,

Z_CLASS_RANGE_ID LIKE ZCUP_CLASS_LOG-Z_CLASS_RANGE_ID,

Z_CLASS_TYPE_ID LIKE ZCUP_CLASS_LOG-Z_CLASS_TYPE_ID,

SEQNO LIKE ZCUP_CLASS_LOG-SEQNO,

Z_IND_SECTOR LIKE ZCUP_CLASS_LOG-Z_IND_SECTOR,

Z_OBJID LIKE ZCUP_CLASS_LOG-Z_OBJID,

Z_CUP_SUB_CLASS LIKE ZCUP_CLASS_LOG-Z_CUP_SUB_CLASS,

Z_CUP_CHNG_TYPE LIKE ZCUP_CLASS_LOG-Z_CUP_CHNG_TYPE,

Z_CLIENT_UPD_FLG LIKE ZCUP_CLASS_LOG-Z_CLIENT_UPD_FLG,

Z_DATE_TIME LIKE ZCUP_CLASS_LOG-Z_DATE_TIME,

END OF TYP_FLAG.

data: lt_zcupclass type typ_zcupclass occurs 0 with header line,

lt_zcupclass1 type typ_zcupclass occurs 0 with header line,

lt_log_wa type typ_flag,

lt_log_wa_del type typ_flag,

lt_zcupclass_wa type typ_zcupclass,

lt_zcupclass_wa1 type typ_zcupclass.

data: flag,

flag1,

fcode_edit(4),

fcode_create(4),

ln TYPE I.

data:z_cup_number like zcup_class-z_cup_number,

z_cup_name like zcomm_ult_parent-z_cup_name.

data:lt_zcupclass_del like zcup_class,

lt_zcupclass_insert like zcup_class,

lt_zcupclass_name like zcup_class.

data:lt_zcupclass_copied,

rad."copyflag.

data:var1(60),var3(65).

data: var2(4) value '%'.

data: lt_flag type TYP_FLAG occurs 0 with header line."del flag

*table

*&spwizard: declaration of tablecontrol 'TC_ZCUPCLASS' itself

controls: TC_ZCUPCLASS type tableview using screen 0100.

*&spwizard: lines of tablecontrol 'TC_ZCUPCLASS'

data: g_TC_ZCUPCLASS_lines like sy-loopc.

data: OK_CODE like sy-ucomm.

&----


*& Module lt_zcupclass_init OUTPUT

&----


  • text

----


MODULE lt_zcupclass_init OUTPUT.

REFRESH CONTROL 'TC_ZCUPCLASS' FROM SCREEN '0100'.

ENDMODULE. " lt_zcupclass_init OUTPUT

&----


*& Module tc_zcupclass_move OUTPUT

&----


  • text

----


MODULE tc_zcupclass_move OUTPUT.

*IF SY-UCOMM <> 'EXIT'.

loop at lt_zcupclass1.

move lt_zcupclass1 to lt_zcupclass.

append lt_zcupclass.

clear lt_zcupclass.

clear lt_zcupclass1.

endloop.

*ENDIF.

*DESCRIBE TABLE LT_ZCUPCLASS LINES LN.

*refresh lt_zcupclass1.

ENDMODULE. " tc_zcupclass_move OUTPUT

*&spwizard: output module for tc 'TC_ZCUPCLASS'. do not change this line

*&spwizard: get lines of tablecontrol

module TC_ZCUPCLASS_get_lines output.

g_TC_ZCUPCLASS_lines = sy-loopc.

ENDMODULE. " get_T_CTRL_lines OUTPUT

  • endmodule.

*&spwizard: input module for tc 'TC_ZCUPCLASS'. do not change this line!

*&spwizard: modify table

module TC_ZCUPCLASS_modify input.

move-corresponding lt_zcupclass to lt_zcupclass_wa.

IF rad = 'X'.

move lt_zcupclass_wa to lt_zcupclass_wa1.

endif.

modify LT_ZCUPCLASS

from lt_zcupclass_wa

index TC_ZCUPCLASS-current_line.

endmodule.

&----


*& Module USER_COMMAND_0100 INPUT

&----


  • text

----


MODULE USER_COMMAND_0100 INPUT.

IF sy-ucomm = 'SEAR'.

clear sy-ucomm.

refresh lt_zcupclass.

if z_cup_number is initial and zcomm_ult_parent-z_cup_name is

initial.

MESSAGE e010(ad) WITH 'You must enter a CUP number or name'.

endif.

var1 = zcomm_ult_parent-z_cup_name.

CONCATENATE var1 var2 INTO VAR3.

flag1 = 'X'.

**if flag1 = 'X'.

if z_cup_number is not initial.

select fz_cup_number fz_class_range_id f~z_class_type_id

fseqno fz_ind_sector f~z_cup_sub_class

p~z_cup_name from zcup_class as f inner join zcomm_ult_parent as

p on fz_cup_number = pz_cup_number

into corresponding fields of table lt_zcupclass1 where

fz_cup_number = z_cup_number. "or pz_cup_name = z_cup_name

elseif zcomm_ult_parent-z_cup_name is not initial.

select fz_cup_number fz_class_range_id f~z_class_type_id

fz_ind_sector fz_cup_sub_class

p~z_cup_name from zcup_class as f inner join zcomm_ult_parent as

p on fz_cup_number = pz_cup_number

into corresponding fields of table lt_zcupclass1 where

p~z_cup_name like 'ab'."= zcomm_ult_parent-z_cup_name.

endif.

if sy-subrc <> 0.

MESSAGE: e010(ad) WITH

'No records found, change the search Criteria and try again'.

.

ENDIF.

lt_zcupclass_copied = 'X'.

    • endif.

LEAVE TO SCREEN '0100'.

elseif sy-ucomm = 'EDIT'.

move sy-ucomm to fcode_edit.

clear sy-ucomm.

flag = 'X'.

IF NOT lt_zcupclass_wa1 IS INITIAL.

move-corresponding lt_zcupclass_wa1 to LT_ZCUPCLASS.

*move-corresponding lt_zcupclass_wa1 to ZCOMM_ULT_PARENT.

leave to screen '200'.

endif.

ELSEIF sy-ucomm = 'CREA'.

MOVE SY-UCOMM TO fcode_create.

clear sy-ucomm.

CLEAR flag.

CLEAR lt_zcupclass.

LEAVE TO SCREEN '0200'.

ELSEIF sy-ucomm = 'DELE'.

clear sy-ucomm.

refresh lt_zcupclass.

move-corresponding lt_zcupclass_wa1 to lt_zcupclass_del.

DELETE zcup_class from lt_zcupclass_del.

if sy-subrc = 0.

lt_flag-Z_CUP_CHNG_TYPE = 'D'.

lt_flag-Z_CLIENT_UPD_FLG = ''.

move-corresponding lt_zcupclass_del to lt_flag.

insert zcup_class_log from lt_flag.

endif.

  • DELETE ZCOMM_ULT_PARENT FROM LT_ZCUPCLASS.

ELSEIF sy-ucomm = 'EXIT'.

clear sy-ucomm.

SET SCREEN 0.

LEAVE SCREEN.

ENDIF.

ENDMODULE. " USER_COMMAND_0100 INPUT

&----


*& Module USER_COMMAND_0200 INPUT

&----


  • text

----


MODULE USER_COMMAND_0200 INPUT.

IF sy-ucomm = 'SAVE'.

clear sy-ucomm.

if fcode_edit = 'EDIT'.

if lt_zcupclass_wa1-Z_CLASS_RANGE_ID = lt_zcupclass-Z_CLASS_RANGE_ID and

lt_zcupclass_wa1-Z_CLASS_TYPE_ID = lt_zcupclass-Z_CLASS_TYPE_ID and

lt_zcupclass_wa1-Z_CUP_SUB_CLASS = lt_zcupclass-Z_CUP_SUB_CLASS.

flag = ''.

else.

flag = 'X'.

endif.

IF flag = 'X'.

UPDATE ZCUP_CLASS SET Z_CLASS_RANGE_ID =

LT_ZCUPCLASS-Z_CLASS_RANGE_ID

Z_CLASS_TYPE_ID =

LT_ZCUPCLASS-Z_CLASS_TYPE_ID

Z_IND_SECTOR = LT_ZCUPCLASS-Z_IND_SECTOR

where

Z_CUP_NUMBER = LT_ZCUPCLASS_wa1-Z_CUP_NUMBER AND

z_class_range_id = LT_ZCUPCLASS_wa1-z_class_range_id AND

z_class_typE_id = LT_ZCUPCLASS_wa1-Z_CLASS_TYPE_ID AND

SEQNO = LT_ZCUPCLASS_wa1-SEQNO.

*if sy-subrc = 0.

*zcup_class_log-

*

*UPDATE ZCOMM_ULT_PARENT SET Z_CUP_NAME = lt_zcupclass-Z_CUP_NAME

  • where z_cup_number =

*lt_zcupclass_wa1-z_cup_name.

*

*MODIFY ZCUP_CLASS FROM TABLE LT_ZCUPCLASS.

COMMIT WORK.

if sy-subrc = 0.

lt_log_wa-Z_CUP_CHNG_TYPE = 'D'.

lt_log_wa-Z_CLIENT_UPD_FLG = ''.

move-corresponding lt_zcupclass_wa1 to lt_log_wa.

insert zcup_class_log from lt_zcupclass_wa1.

lt_log_wa-Z_CUP_CHNG_TYPE = 'E'.

lt_log_wa-Z_CLIENT_UPD_FLG = ''.

insert zcup_class_log from lt_zcupclass.

endif.

ENDIF.

elseIF fcode_create = 'CREA'.

move-corresponding lt_zcupclass to lt_zcupclass_insert.

*move-corresponding lt_zcupclass to lt_zcupclass_name.

insert zcup_class from lt_zcupclass_insert.

if sy-subrc = 0.

lt_log_wa-Z_CUP_CHNG_TYPE = 'C'.

lt_log_wa-Z_CLIENT_UPD_FLG = ''.

move-corresponding lt_zcupclass_insert to lt_log_wa.

insert zcup_class_log from lt_log_wa.

endif.

*insert ZCOMM_ULT_PARENT from lt_zcupclass_name.

ENDIF.

ELSEif sy-ucomm = 'EXIT'.

clear sy-ucomm.

refresh lt_zcupclass.

  • SET SCREEN 0.

CALL SCREEN '0100'.

ENDIF.

ENDMODULE. " USER_COMMAND_0200 INPUT

&----


*& Module invisible OUTPUT

&----


  • text

----


MODULE invisible OUTPUT.

if flag = 'X'.

loop at screen .

if screen-group1 = 'GR1'.

screen-input = '0'.

modify screen.

endif.

endloop.

endif.

ENDMODULE. " invisible OUTPUT

&----


*& Module STATUS_0100 OUTPUT

&----


  • text

----


MODULE STATUS_0100 OUTPUT.

  • SET PF-STATUS 'xxxxxxxx'.

  • SET TITLEBAR 'xxx'.

*data:wf_lines type i.

*clear wf_lines.

*DESCRIBE TABLE LT_ZCUPCLASS LINES sy-tabix.

*

*

*TC_ZCUPCLASS-LINES = sy-tabix."wf_lines + 1 .

ENDMODULE. " STATUS_0100 OUTPUT

&----


*& Module SET_DATA_TO_T_CTRL OUTPUT

&----


  • text

----


MODULE SET_DATA_TO_T_CTRL OUTPUT.

data:wf_lines type i.

clear wf_lines.

DESCRIBE TABLE LT_ZCUPCLASS LINES wf_lines.

TC_ZCUPCLASS-LINES = wf_lines ."+ 1 .

ENDMODULE. " SET_DATA_TO_T_CTRL OUTPUT

2 REPLIES 2

Former Member
0 Kudos

HI,

Look at the DEMP Programs

DEMO_DYNPRO_TABLE_CONTROL_1

DEMO_DYNPRO_TABLE_CONTROL_2

Regards

Sudheer

SantoshKallem
Active Contributor
0 Kudos

<b>PROCESS BEFORE OUTPUT.

tc_zcupclass-LINES = 100 </b>

/community [original link is broken]

It could help u .

reward if useful

Regards..

santhosh

Message was edited by:

santhosh reddy