‎2007 Jul 17 12:27 PM
Hello Friends,
When I fill the table control and press enter button the values entered are going to dis-appred any idea whats going on?
the table control is shown in a screen as pop-up
Regards,
‎2007 Jul 17 12:36 PM
hi..
Table control may be not updating the internal table from which data is displaying. They might have written code for trigerring PAI event for "ENTER "
key .When PAI and PBO trigers ,it again displays the same internal table content for "ENTER " key.For table control update check the demo program
<b>demo_dynpro_tabcont_loop_at</b>
regards,
veeresh
‎2007 Jul 17 12:31 PM
Are you referring the table control and the internal table are same.
and can you show your PBO module code.
If you are using the same reference then there is some problem with PBO logic.
which is present in the
loop at itab with control tc.
module transfer_tab_to_tc. "<----here might be the problem
endloop.
Just show your code once.
Best Regards
Vijay
‎2007 Jul 17 12:35 PM
Hello ,
Here is the 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'.
endif.
endmodule.
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.
module Z_TAB_CTRL_move output.
clear: g_Z_TAB_CTRL_wa.
move-corresponding g_Z_TAB_CTRL_wa to ZENCO_TAB_CTRL.
endmodule.
module Z_TAB_CTRL_get_lines output.
g_Z_TAB_CTRL_lines = sy-loopc.
endmodule.
Regards,
‎2007 Jul 17 12:34 PM
hi ,
You need to write the code in the PBO of the screen containing the table control to retain the values after you press enter ..
Actually whats happening in your program is , once u r entering PAI is getting triggered and again the PBO , when its triggering the PBO , your field values are getting refreshed , so u need to avoid that and code to retain the values . That is simply loop at the itab and pass the values back to the fields in the PBO itself .
Hope I am clear else revert back .
Regards,
Ranjita
‎2007 Jul 17 12:36 PM
After entering values in table control you may not be storing those values in an internal table, in internal table no values exist.. and when it come to PBO, it again find itab as blank and show u blank table control..
plz check it..
Regards
Prax
‎2007 Jul 17 12:36 PM
hi..
Table control may be not updating the internal table from which data is displaying. They might have written code for trigerring PAI event for "ENTER "
key .When PAI and PBO trigers ,it again displays the same internal table content for "ENTER " key.For table control update check the demo program
<b>demo_dynpro_tabcont_loop_at</b>
regards,
veeresh
‎2007 Jul 17 12:36 PM
hi
in pai u might have written codings to transfer data from table control(what u have entered thro keyboard) to internal table. so every record will be transferred to int table..
so in PBO again u have to move tto screen..
i think u have put all screen fields in a custom table..
loop at tc.
move-corresponding int table to screen.(custom table name)
endloop.
reward if useful
‎2007 Jul 17 12:41 PM
I have to restrict the PBO to execute again, when use press the enter button ....
why the PBO is executed when the user press the enter button ?
Can anyone pls see my code above, and let me know what I am doing wrong?
Regards,
‎2007 Jul 17 12:57 PM
‎2007 Jul 17 12:59 PM
HI Sash ,
The basic of screen programming is , when u see the screen for the first time the PBO part of the screen is procesed and once you trigger any event on the screen , the PAI gets triggered and then the PBO is called again n u can see the screen back . this is the basic flow of the screens when we see them .
Now coming to your querry , I did not understand why have you pur a REFRESH in the 1st module unit of PBO . You shuld comment it n try again .
Notice this area :
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'. <b>" comment this line and check [\b] .
endif.
endmodule.
Else I'll be Posting a sample code for table controls with wizard and you can very well compare the logics.
Ranjita
‎2007 Jul 17 1:03 PM
The refersh button is not executed the second time the PBO is called, because the statement if g_Z_TAB_CTRL_copied is initial. is not true...
Regards,
‎2007 Jul 17 1:05 PM
hey ..
check the logic from here :
process before output.
*&SPWIZARD: PBO FLOW LOGIC FOR TABLECONTROL 'TC_01'
module tc_01_init.
*&SPWIZARD: MODULE TC_01_CHANGE_TC_ATTR.
*&SPWIZARD: MODULE TC_01_CHANGE_COL_ATTR.
loop at g_tc_01_itab
into g_tc_01_wa
with control tc_01
cursor tc_01-current_line.
*&SPWIZARD: MODULE TC_01_CHANGE_FIELD_ATTR
module tc_01_move.
module tc_01_get_lines.
endloop.
module status_0001.
*
process after input.
*&SPWIZARD: PAI FLOW LOGIC FOR TABLECONTROL 'TC_01'
loop at g_tc_01_itab.
chain.
field sflight-carrid.
field sflight-connid.
field sflight-fldate.
module tc_01_modify on chain-request.
endchain.
endloop.
module tc_01_user_command.
*&SPWIZARD: MODULE TC_01_CHANGE_TC_ATTR.
*&SPWIZARD: MODULE TC_01_CHANGE_COL_ATTR.
MODULE USER_COMMAND_0001.
Regards,
Ranjita
‎2007 Jul 17 1:06 PM
hi , I have tried following:
module Z_TAB_CTRL_move output.
clear: g_Z_TAB_CTRL_wa.
move-corresponding g_Z_TAB_CTRL_wa to ZENCO_TAB_CTRL.
endmodule.
I have comment the statement-.
clear: g_Z_TAB_CTRL_wa. and seems to me worked fine ?
Any idea, what could be wrong, if i do not clear this wa ?
( but to this problem it works fine now )...
Regards,
‎2007 Jul 17 1:17 PM
hi Sash ,
Please comment " module z_tab_ctrl_init. " and check .
I think it should work .
Regard,
Ranjita
‎2007 Jul 17 1:14 PM
Hi
If u saving table control data to any internal table than try one thing..
There would b one module in PAI
MODULE tab1_modify INPUT.
there will b some code like
MODIFY itab_det
FROM itab_det
INDEX tab1-current_line.
after this put this code...
APPEND itab_det.
Hope it will helpful to u
‎2007 Jul 17 1:19 PM
The thing is, the pop-up carring the table control has to be called multiple time, I have comment the following statement:
clear: g_Z_TAB_CTRL_wa.
and now after pressing the enter button the things work fine, but when the screen called second time, the values are still there...........
How I can fix the both issues that, when user press the enter button then the values should be shown, but when screen comes second time, it should be clean ?
Regards,
‎2007 Jul 17 1:28 PM
hello Ranjita ,
Any idea, how I can handel both stuff ?
While press enter, values showed be shown, but when the screen called second time in the loop, the values should not be there..... is it possible to have such stuff ?
Regards,
Message was edited by:
Shah H