11-07-2011 7:34 AM
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.
11-07-2011 9:56 AM
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
11-07-2011 10:02 AM
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.
11-07-2011 10:05 AM
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.
11-07-2011 10:11 AM
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
11-07-2011 10:15 AM
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.
11-07-2011 11:26 AM
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?
11-07-2011 11:37 AM
How do you fill the field POSITION?
Is it a field of table control?
Max
11-07-2011 11:43 AM
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).
11-07-2011 11:45 AM