Application Development and Automation 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: 
Read only

Table control

Former Member
0 Likes
263

Hi Experts!!

I desined a table control having check box.

once i execute i got complete record from ztable.

when select checkbox. and re-press, enter

all the checkbox clear automatically. I have not used refresh or clear anywhere in SE38 Program.

Could you suggest. How to resolve this.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
243

Hi,

I will explain with an example.


Process Before Output.
loop at it_table into wa_table with control tc_ctrl.
endloop.

Process After Input.
Loop at it_table.
Endloop.

Consider the above code. Here tc_ctrl is the table control. it_table is the internal table containing your data. And the table control has 3 fields named wa_table-field1, wa_table-field2, wa_table-field3.

The purpose of PBO and PAI is to transfer the values between the ABAP program and the screen elements.

When you are checking the checkbox in the screen the value will be stored in wa_table-field1 (I take this as the field having checkbox). After this, if you press Enter, first PAI will be called. then your PBO. So the screen will again be refreshed from the values in your table it_table in this case.

So in order to save your changes, you need to add a module in your PAI.


Process After Input.
Loop at it_table.
Module update_table.
Endloop.

* Shoule be written in a PAI Include program.
Module update_table INPUT.
modify it_table from wa_table. "This moves the chages from screen variables to internal table
Endmodule.

Now when the PBO reads the data from internal table, the check box will be checked in the screen again.

Hope this helps!

Thanks and Regards,

Lakshmi.

2 REPLIES 2
Read only

Former Member
0 Likes
243

hi anee,

i was faced same problem.

In ur PBO you are filling internal table each and eavey time and problem is only that.

after press enter ur PAI was called. and then after PBO.

in PBO ur Internal table again filled with default value.

so to stop that thing you have to use flag variable.

after filling that you have to set taht flag.

if still there is any problem . reply me.

rewards must if helpful.

Read only

Former Member
0 Likes
244

Hi,

I will explain with an example.


Process Before Output.
loop at it_table into wa_table with control tc_ctrl.
endloop.

Process After Input.
Loop at it_table.
Endloop.

Consider the above code. Here tc_ctrl is the table control. it_table is the internal table containing your data. And the table control has 3 fields named wa_table-field1, wa_table-field2, wa_table-field3.

The purpose of PBO and PAI is to transfer the values between the ABAP program and the screen elements.

When you are checking the checkbox in the screen the value will be stored in wa_table-field1 (I take this as the field having checkbox). After this, if you press Enter, first PAI will be called. then your PBO. So the screen will again be refreshed from the values in your table it_table in this case.

So in order to save your changes, you need to add a module in your PAI.


Process After Input.
Loop at it_table.
Module update_table.
Endloop.

* Shoule be written in a PAI Include program.
Module update_table INPUT.
modify it_table from wa_table. "This moves the chages from screen variables to internal table
Endmodule.

Now when the PBO reads the data from internal table, the check box will be checked in the screen again.

Hope this helps!

Thanks and Regards,

Lakshmi.