‎2007 Jul 17 3:13 PM
Hello Friends,
i urgentllly require your help:
Actually I am having a table control which is being called inside a loop. My issue is when user enters some values in table control and press enter the values are going to be dis-appred. this issue I solved while removing the statement "clear wa_tab_ctr" from my PBO, but after removing this issue, when the table control comes 2nd time, the values are also there.... ( as I am calling the screen contaning the table control in loop )
Any idea, what I do there, to avoid this situation ?
Regards,
‎2007 Jul 17 3:15 PM
secondlly another issue what I am facing now is that, when I remove the statement clear wa_tab_ctl in my PBO, the row is not selected from TABLE CONTROL ...
‎2007 Jul 17 3:19 PM
Hi Shah,
The problem should be in your PAI. Follow small tips in your PBO & PAI
in PBO move the values from your internal table to the screen fields
in PAI move the values from the screen to the internal table and make sure you modify the internal table in the table control loop.
it would be easy to correct your errors if you can paste your code here.
Regards
Gopi
‎2007 Jul 17 3:26 PM
Okey, here is my code:
process before output.
*&spwizard: pbo flow logic for tablecontrol 'Z_TAB_CTRL'
module z_tab_ctrl_init.
module change_screen.
*&spwizard: module Z_TAB_CTRL_change_tc_attr.
*&spwizard: module Z_TAB_CTRL_change_col_attr.
loop at g_z_tab_ctrl_itab
into g_z_tab_ctrl_wa
with control z_tab_ctrl
cursor z_tab_ctrl-current_line.
*&spwizard: module Z_TAB_CTRL_change_field_attr
module z_tab_ctrl_move.
module z_tab_ctrl_get_lines.
endloop.
module status_0100.
module Z_TAB_CTRL_init output.
DESC_INPUT = DESC.
TC_IN_INPUT = 'testwest'.
if g_Z_TAB_CTRL_copied is initial.
*&spwizard: copy ddic-table 'ZENCO_TAB_CTRL'
*&spwizard: into internal table 'g_Z_TAB_CTRL_itab'
select * from ZENCO_TAB_CTRL
into corresponding fields
of table g_Z_TAB_CTRL_itab.
g_Z_TAB_CTRL_wa-VIDEOCODEC = ''. " INS SYED
"append g_Z_TAB_CTRL_wa to g_Z_TAB_CTRL_itab. " INS SYED
g_Z_TAB_CTRL_copied = 'X'.
refresh control 'Z_TAB_CTRL' from screen '0100'. " Enter test
Else. " Press enter
move-corresponding g_Z_TAB_CTRL_wa to ZENCO_TAB_CTRL." Press enter
endif.
endmodule.
*&spwizard: output module for tc 'Z_TAB_CTRL'. do not change this line!
*&spwizard: move itab to dynpro
module Z_TAB_CTRL_move output.
IF save_ok eq 'enter'.
"clear: g_Z_TAB_CTRL_wa.
move-corresponding g_Z_TAB_CTRL_wa to ZENCO_TAB_CTRL.
Else.
clear: g_Z_TAB_CTRL_wa.
move-corresponding g_Z_TAB_CTRL_wa to ZENCO_TAB_CTRL.
ENDIF.
*clear: g_Z_TAB_CTRL_wa.
"move-corresponding g_Z_TAB_CTRL_wa to ZENCO_TAB_CTRL.
endmodule.
*&spwizard: output module for tc 'Z_TAB_CTRL'. do not change this line!
*&spwizard: get lines of tablecontrol
module Z_TAB_CTRL_get_lines output.
g_Z_TAB_CTRL_lines = sy-loopc.
endmodule.
&----
*& Module change_screen OUTPUT
&----
text
----
MODULE change_screen OUTPUT.
Loop AT SCREEN.
if screen-name = 'ASPECT_RATIO_INPUT'.
screen-output = '1'.
screen-input = '0'.
screen-value_in = '1'.
screen-ACTIVE = '1'.
endif.
*MODIFY SCREEN.
ENDLOOP.
ENDMODULE.
PAI***************
process after input.
*&spwizard: pai flow logic for tablecontrol 'Z_TAB_CTRL'
MODULE MODULE_EXIT at exit-command.
loop at g_z_tab_ctrl_itab.
chain.
field zenco_tab_ctrl-videocodec.
field zenco_tab_ctrl-BITC.
field zenco_tab_ctrl-AUDIO.
field zenco_tab_ctrl-kommentar.
field zenco_tab_ctrl-videonorm.
field zenco_tab_ctrl-hdformat.
field zenco_tab_ctrl-bitratemin.
field zenco_tab_ctrl-bitrateave.
field zenco_tab_ctrl-bitratemax.
field zenco_tab_ctrl-videosize.
field zenco_tab_ctrl-aspectratio.
field zenco_tab_ctrl-qc_level.
module z_tab_ctrl_modify on chain-request.
endchain.
endloop.
MODULE EXIT AT EXIT-COMMAND.
MODULE MODULE_EXIT at exit-command.
module z_tab_ctrl_user_command.
*&spwizard: module Z_TAB_CTRL_change_tc_attr.
*&spwizard: module Z_TAB_CTRL_change_col_attr.
module user_command_0100.
process on value-request.
field zenco_tab_ctrl-videocodec module vcodec_f4.
field ZENCO_TAB_CTRL-VIDEONORM module vnorm_f4.
field ZENCO_TAB_CTRL-HDFORMAT module hdformat_f4.
field ZENCO_TAB_CTRL-VIDEOSIZE module vsize_f4.
field ZENCO_TAB_CTRL-ASPECTRATIO module aratio_f4.
field ZENCO_TAB_CTRL-BITC module BITC_f4.
field ZENCO_TAB_CTRL-AUDIO module AUDIO_f4.
field ZENCO_TAB_CTRL-qc_level module qc_level_f4.
*MODULE STATUS_0100 .
*
SET TITLEBAR 'xxx'.
*
*ENDMODULE.
MODULE MODULE_EXIT INPUT.
save_ok = ok_code.
CLEAR ok_code.
CASE save_ok.
WHEN 'CANCEL'.
leave PROGRAM.
LEAVE TO SCREEN 0.
ENDCASE.
ENDMODULE.
module Z_TAB_CTRL_user_command input.
OK_CODE = sy-ucomm.
perform user_ok_tc using 'Z_TAB_CTRL'
'G_Z_TAB_CTRL_ITAB'
'FLAG'
changing OK_CODE.
sy-ucomm = OK_CODE.
endmodule.
MODULE USER_COMMAND_0100 INPUT.
save_ok = ok_code.
CLEAR ok_code.
CASE save_ok.
WHEN 'BACK'.
leave PROGRAM.
WHEN 'OK_BUT'.
LOOP at g_Z_TAB_CTRL_itab into g_Z_TAB_CTRL_wa. "WITH CONTROL Z_TAB_CTRL .
endloop.
leave to SCREEN 0.
"leave PROGRAM.
flights-top_line = flights-top_line - 1.
IF flights-top_line < 0.
flights-top_line = 0.
ENDIF.
WHEN 'CANCEL'.
LEAVE PROGRAM.
WHEN 'PREV_PAGE'.
flights-top_line = flights-top_line - lines.
IF flights-top_line < 0.
flights-top_line = 0.
ENDIF.
WHEN 'LAST_PAGE'.
flights-top_line = fill - lines + 1.
WHEN 'FIRST_PAGE'.
flights-top_line = 0.
when space.
save_ok = 'enter'.
ENDCASE.
ENDMODULE.
‎2007 Jul 17 3:59 PM