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 experts,

i have declared a table is_ftable LIKE TABLE OF i_itf WITH HEADER LINE

DATA: BEGIN OF i_itf OCCURS 0,

vselect TYPE c,

tabname TYPE dfies-tabname,

fieldname TYPE dfies-fieldname,

fieldtext TYPE dfies-fieldtext,

position TYPE dfies-position,

END OF i_itf.

after populating is_ftable, i am outputting its content on table control.on executing first time there are 21 rows outputted.

on scrolling down the is_ftable-position field from position 1 to 21 changes to '21'.

why is content of only position field getting changed rest of the field remains same?

thanks.

9 REPLIES 9

Former Member
0 Kudos

Hi charudevrani

Can you please give the code through which you are populating the table control. By seeing the code we can tell if the code is correct or not.

thanks

Senthil

0 Kudos

hi,

pbo:

PROCESS BEFORE OUTPUT.

MODULE get_itfld.

LOOP AT is_ftable INTO wa_itf WITH CONTROL ITFLDSEL.

MODULE fill_itfld.

ENDLOOP.

PROCESS AFTER INPUT.

LOOP AT is_ftable.

MODULE fpro1.

ENDLOOP.

-


MODULE FPRO1 INPUT.

MODIFY is_ftable FROM i_itf INDEX ITFLDSEL-current_line.

ENDMODULE.

-


MODULE get_itfld OUTPUT.

IF is_ftable IS INITIAL .

REFRESH is_ftable.

CONCATENATE 'ZP' inftype INTO mtable.

tablenm = mtable.

SELECT * FROM dd03l INTO twa WHERE tabname = tablenm.

APPEND twa TO titab.

ENDSELECT.

SORT titab BY position.

LOOP AT titab INTO twa.

fieldnm = twa-fieldname.

CALL FUNCTION 'DDIF_FIELDINFO_GET'

EXPORTING

tabname = tablenm

fieldname = fieldnm

langu = sy-langu

TABLES

dfies_tab = inttab

EXCEPTIONS

not_found = 1

internal_error = 2

OTHERS = 3.

IF sy-subrc <> 0.

WRITE:/ 'Field name not found'.

ENDIF.

LOOP AT inttab INTO wa .

is_ftable-tabname = wa-tabname.

is_ftable-fieldname = wa-fieldname.

is_ftable-fieldtext = wa-fieldtext.

is_ftable-position = wa-position.

APPEND is_ftable.

ENDLOOP.

ENDLOOP.

ITFLDSEL-LINES = SY-TABIX.

ENDIF.

ENDMODULE.

MODULE fill_itfld OUTPUT.

MOVE-CORRESPONDING wa_itf TO i_itf.

ENDMODULE.

0 Kudos

hi,

PROCESS BEFORE OUTPUT.

MODULE get_itfld.

LOOP AT is_ftable INTO wa_itf WITH CONTROL ITFLDSEL.

MODULE fill_itfld.

ENDLOOP.

PROCESS AFTER INPUT.

LOOP AT is_ftable.

MODULE fpro1.

ENDLOOP.

-


MODULE FPRO1 INPUT.

MODIFY is_ftable FROM i_itf INDEX ITFLDSEL-current_line.

ENDMODULE.

-


MODULE get_itfld OUTPUT.

IF is_ftable IS INITIAL .

REFRESH is_ftable.

CONCATENATE 'ZP' inftype INTO mtable.

tablenm = mtable.

SELECT * FROM dd03l INTO twa WHERE tabname = tablenm.

APPEND twa TO titab.

ENDSELECT.

SORT titab BY position.

LOOP AT titab INTO twa.

fieldnm = twa-fieldname.

CALL FUNCTION 'DDIF_FIELDINFO_GET'

EXPORTING

tabname = tablenm

fieldname = fieldnm

langu = sy-langu

TABLES

dfies_tab = inttab

EXCEPTIONS

not_found = 1

internal_error = 2

OTHERS = 3.

IF sy-subrc <> 0.

WRITE:/ 'Field name not found'.

ENDIF.

LOOP AT inttab INTO wa .

is_ftable-tabname = wa-tabname.

is_ftable-fieldname = wa-fieldname.

is_ftable-fieldtext = wa-fieldtext.

is_ftable-position = wa-position.

APPEND is_ftable.

ENDLOOP.

ENDLOOP.

ITFLDSEL-LINES = SY-TABIX.

ENDIF.

ENDMODULE.

MODULE fill_itfld OUTPUT.

MOVE-CORRESPONDING wa_itf TO i_itf.

ENDMODULE.

0 Kudos

Hi

Your code seems to be ok

I don't know how MODULE fill_itfld is, but the module for PAI fpro1 is ok

MODULE FPRO1 INPUT.
MODIFY is_ftable FROM i_itf INDEX ITFLDSEL-current_line.
ENDMODULE.

I suppose the structure I_ITF is used for input/output field of table control?

Max

0 Kudos

Hi,

Can you try avoiding this module

MODULE fill_itfld OUTPUT.

MOVE-CORRESPONDING wa_itf TO i_itf.

ENDMODULE.

and use the same workarea that you use inside the loop statement in your PBO.

Also avoid using the MOVE-Corresponding statement.

0 Kudos

hi max,

you are right.i_itf is used for input and output.

when i scroll down first time in PAI module i_itf fills the is_ftable.

i_itf-position remains same i.e. 21 for every loop pass.but other fields like i_itf-fieldname and i_itf-fieldtext are correctly field.

what could be the possible solution?

0 Kudos

How do you fill the field POSITION?

Is it a field of table control?

Max

0 Kudos

HI MAX,

in module "get_itfld"(pbo),i am filling is_ftable.

LOOP AT inttab INTO wa .

is_ftable-tabname = wa-tabname.

is_ftable-fieldname = wa-fieldname.

is_ftable-fieldtext = wa-fieldtext.

IS_FTABLE-POSITION = wa-position.

APPEND is_ftable.

ENDLOOP.(i have posted the full code above).

0 Kudos

table control doesnt contain position field