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
893

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

1 ACCEPTED SOLUTION
Read only

former_member191735
Active Contributor
0 Likes
854

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.

8 REPLIES 8
Read only

former_member191735
Active Contributor
0 Likes
855

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.

Read only

0 Likes
854

Hi

Thank u for ur ans

but its not working

Read only

0 Likes
854

Hi,

Have you declared the checkbox in your internal table as well?

Otherwise the previous code posted won't work.

Regards,

Gilberto Li

Read only

0 Likes
854

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.

Read only

Former Member
0 Likes
854

HI, check the condition if theres one or chek in the PAI (PROCESS AFTER INPUT)

Read only

nkr1shna
Contributor
0 Likes
854

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

Read only

Former Member
0 Likes
854

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

Read only

I355602
Product and Topic Expert
Product and Topic Expert
0 Likes
854

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