‎2009 Jan 05 4:23 PM
Hi
i create a table control and i drag a checkbox into that table control and if i select the checkbox it is selecting and if i press any pushbotton it is deselecting can any one tel what is the problem
‎2009 Jan 05 4:26 PM
Under PAI
Loop with control tc_xxxx.
update your internal table here like
modify it_**** from wa_**** index tc_XXXX-current_line
endloop.
Here it comes your User commands.
‎2009 Jan 05 4:26 PM
Under PAI
Loop with control tc_xxxx.
update your internal table here like
modify it_**** from wa_**** index tc_XXXX-current_line
endloop.
Here it comes your User commands.
‎2009 Jan 05 5:55 PM
‎2009 Jan 05 6:01 PM
Hi,
Have you declared the checkbox in your internal table as well?
Otherwise the previous code posted won't work.
Regards,
Gilberto Li
‎2009 Jan 05 8:15 PM
Gilberto li is right, you need to define checkbox as field in your internal table. Just put a break point between loop and endloop and check the variable.
‎2009 Jan 05 7:50 PM
HI, check the condition if theres one or chek in the PAI (PROCESS AFTER INPUT)
‎2009 Jan 05 10:39 PM
Hi King,
Please check the data type of the checkbox variabe you are using in table control. You must declare
them as "xfeld" which provides you either "x" or "space".
Best Regards,
Krishna
‎2009 Jan 06 4:28 AM
Hi,
You must be populating you table control through an internal table, just add another field with the same name as the checkbox on the tablecontorl in the defined internal table. Now write the code to update your internal table inside the loop .. endloop statement in the PAI. For example, if tabc is the name of the table control and itab is the name of the internal table than in the PAI
loop with tabc.
module modify_it.
endloop.
module modify_it input
modify itab index tabc-current_line.
endmodule.
Now after selecting the checkbox and pressing any pushbutton the checkbox will not reset as it was doing earlier.
I hope this solves your issue.
Thanks and Regards,
Sachin Dargan
‎2009 Jan 06 4:37 AM
Hi King,
You must have passed a code in PBO of the screen for reading internal table into the table control.
So it reads the internal table into the table control whenever you perform any action on use command.
All you need to do is to write a code to modify the internal table form the table control while performing any user action.
Use this code, its working,
Take screen fields as work_area-<field_name>.
And use loop at internal table into work area and print the contents line by line in table control
At screen logic,
PROCESS BEFORE OUTPUT.
MODULE status_8002. "for pf-status
LOOP WITH CONTROL po_tab. "po_tab is table control name
MODULE pass_data. "to pass data from internal table into the table control
ENDLOOP.
PROCESS AFTER INPUT.
LOOP WITH CONTROL po_tab. "po_tab is table control name
MODULE modify_data. "to modify data from the table control into the internal table
ENDLOOP.
MODULE user_command_8002. "module to capture the use events and handle them as per requirement
In PBO,
*&---------------------------------------------------------------------*
*& Module PASS_DATA OUTPUT
*&---------------------------------------------------------------------*
MODULE pass_data OUTPUT.
READ TABLE it_ekpo into wa_ekpo INDEX po_tab-current_line.
ENDMODULE. " PASS_DATA OUTPUT
In PAI,
*&---------------------------------------------------------------------*
*& Module MODIFY_DATA INPUT
*&---------------------------------------------------------------------*
MODULE modify_data INPUT.
MODIFY IT_EKPO INDEX PO_TAB-CURRENT_LINE FROM WA_EKPO.
ENDMODULE. " MODIFY_DATA INPUT
*&---------------------------------------------------------------------*
*& Module USER_COMMAND_8003 INPUT
*&---------------------------------------------------------------------*
MODULE USER_COMMAND_8003 INPUT.
OK_CODE = SY-UCOMM.
CASE OK_CODE.
WHEN '<function_code>'.
"code
WHEN '<function_code>'.
"code
ENDCASE.
ENDMODULE. " USER_COMMAND_8003 INPUT
Hope this solves your problem.
Thanks & Regards,
Tarun Gambhir