‎2011 Feb 16 5:25 PM
Hi Guys , I m trying to update the internal table that I use to drive the fields of a table control , but it doesnt modify the internal table.
some code is easier i guess
in the include to
types : begin of ty_zrc006,
zrc_cond type zrc_c006_c-zrc_cond,
zrc_period_i type zrc_c006_c-zrc_period_i,
zrc_period_f type zrc_c006_c-zrc_period_f,
knumh type zrc_c006_c-knumh,
aedat type zrc_c006_c-aedat,
aezet type zrc_c006_c-aezet,
aenam type zrc_c006_c-aenam,
kostl type zrc_c006_i-kostl,
zrc_perc type zrc_c006_i-zrc_perc,
MARK TYPE C.
types : end of ty_zrc006.
data: ti_zrc006 type standard table of ty_zrc006 initial size 0." with header line.in other include
module MODIFY_LIN input.
read table ti_zrc006 into wa_zrc006 index tabc_ctocusto-CURRENT_LINE.
move: zrc_c006_i-kostl to wa_zrc006-kostl,
zrc_c006_i-zrc_perc to wa_zrc006-zrc_perc,
'X' to wa_zrc006-mark.
modify ti_zrc006 INDEX tabc_ctocusto-CURRENT_LINE from wa_zrc006 ." transporting . "
endmodule. " MODIFY_ITAB_REG INPUTBut when I execute after PAI it never update ti_zrc006 even when wa_zrc006 is filled. any idea ?
‎2011 Feb 17 8:54 AM
Hi
Try this out.
In PAI
loop at itab.
" Place all your FIELD and CHAIN statements before you call the below module
module modify_tab. " This should not be linked up with any field statements and be an independent module
" The above should execute irrespective of any changes to the screen fields
endloop.
in Program
module modify_tab.
describe table itab lines tc-lines.
if tc-current_line > tc-lines.
append itab.
else.
modify itab index tc-current_line.
endif.
endmoduleCheerz.
Ramchander Rao.K
‎2011 Feb 16 6:06 PM
Just remove following line.
read table ti_zrc006 into wa_zrc006 index tabc_ctocusto-CURRENT_LINE.Also make sure that the module MODIFY_LIN is called between Loop. Endloop. of PAI.
Regards,
Aditya
‎2011 Feb 16 6:17 PM
thank you Aditya , I ve already try that, but it doesnt work : my PBO PAI are this way :
process before output.
module fill_list_condic.
module status_0100.
loop at ti_zrc006 into wa_zrc006 with control tabc_ctocusto.
module modify_lin .
endloop.
process after input.
loop at ti_zrc006 .
chain.
field: ZRC_C006_I-kostl,
ZRC_C006_I-zrc_perc.
module update_line on chain-request.
endchain.
endloop.
chain.
field : ti_zrc006-bukrs,
ti_zrc006-desc_cond,
ti_zrc006-zrc_period_i,
ti_zrc006-zrc_period_f.
module modify_cab on chain-request.
endchain.
module user_command_0100.
‎2011 Feb 17 2:22 AM
Hi
as you are getting the values ZRC_C006_I-kostl and ZRC_C006_I-zrc_perc from input, modify your internal table in your PAI. because PBO only displays the data in internal table.
in PBO write the code as,
Loop at ti_zrc006 with control tabc_ctocusto cursor tabc_ctocusto-current_line.
module display_int_table.
endloop.
Module display_int_table.
tabc_ctocusto-kostl = ti_zrc006-kostl.
..
..
..n whatever the other fields are.
endmodule.Hope this helps.
and one more thing, when you are modifying an internal table inside the loop , INDEX is not needed, it automatically updates the current line in loop.
Edited by: mbd2186 on Feb 17, 2011 4:14 AM
‎2011 Feb 17 7:52 AM
Hi,
I guess the Internal table might have updated with the new values but the table control in the screen would have not refreshed in the PAI. So I suggest you to see in the debug mode whether the Internal table which you are modifying is updated with the new values or not. I guess it might have updated but you also need to REFRESH the table control used for displaying the data in the PAI.
Please implement this and let me know in case of any.
Regards,
SRinivas
‎2011 Feb 17 8:54 AM
Hi
Try this out.
In PAI
loop at itab.
" Place all your FIELD and CHAIN statements before you call the below module
module modify_tab. " This should not be linked up with any field statements and be an independent module
" The above should execute irrespective of any changes to the screen fields
endloop.
in Program
module modify_tab.
describe table itab lines tc-lines.
if tc-current_line > tc-lines.
append itab.
else.
modify itab index tc-current_line.
endif.
endmoduleCheerz.
Ramchander Rao.K