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 Selected row Highlight Problem after Vertical Scrolling.

Former Member
0 Likes
2,534

Hello,

      I have a query in Table control when i select a row and press vertical scroll to select another row which is visible after scrolling down in table control

the selected row gets deselected. Please Help to solve this. I am giving my code snippet please go true if i am wrong.

PROCESS BEFORE OUTPUT.

LOOP AT gt_lcinvoice INTO gs_lcinvoice WITH CONTROL tctrl_invo

     CURSOR tctrl_invo-current_line.

     MODULE invoice_entry.

   ENDLOOP.

*&---------------------------------------------------------------------*

*&                      Module  INVOICE_ENTRY  OUTPUT

*&---------------------------------------------------------------------*

*       Move Invoices Details form workarea to respective Screen Fields.

*----------------------------------------------------------------------*

MODULE invoice_entry OUTPUT.

   IF gs_lcinvoice IS NOT INITIAL.

     zlcinvoice_dng-vbeln   = gs_lcinvoice-vbeln.

     zlcinvoice_dng-fkdat   = gs_lcinvoice-fkdat.

     zlcinvoice_dng-kunrg   = gs_lcinvoice-kunrg.

     zlcinvoice_dng-netwr   = gs_lcinvoice-netwr.

     zlcinvoice_dng-waerk   = gs_lcinvoice-waerk.

     CLEAR gs_lcinvoice.

   ENDIF.

ENDMODULE.                 " INVOICE_ENTRY  OUTPUT

LOOP AT gt_lcinvoice.

     MODULE modify_tab.

   ENDLOOP.

*&---------------------------------------------------------------------*

*&                  Module  MODIFY_TAB  INPUT

*&---------------------------------------------------------------------*

*   Modify Internal table based on values in table Control.

*----------------------------------------------------------------------*


MODULE modify_tab INPUT.

    MODIFY gt_lcinvoice INDEX tctrl_invo-current_line from gs_lcinvoice  TRANSPORTING PASS.

ENDMODULE.                 " MODIFY_TAB  INPUT

Thanks & Regards.

Dipti


1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
2,219

Hi Dipti,

In your internal table gt_lcinvoice add one more field, say SEL of type CHAR1. Then assign this field as the selection column in your table control.

If you have placed a structure screen fields, you can add this field in the structure and place accordingly. In either ways you should create a field for identifying the selection and place it in the screen accordingly.

Thanks,

Ajay Bose

Hello,

      I have a query in Table control when i select a row and press vertical scroll to select another row which is visible after scrolling down in table control

the selected row gets deselected. Please Help to solve this. I am giving my code snippet please go true if i am wrong.

PROCESS BEFORE OUTPUT.

LOOP AT gt_lcinvoice INTO gs_lcinvoice WITH CONTROL tctrl_invo

     CURSOR tctrl_invo-current_line.

     MODULE invoice_entry.

   ENDLOOP.

*&---------------------------------------------------------------------*

*&                      Module  INVOICE_ENTRY  OUTPUT

*&---------------------------------------------------------------------*

*       Move Invoices Details form workarea to respective Screen Fields.

*----------------------------------------------------------------------*

MODULE invoice_entry OUTPUT.

   IF gs_lcinvoice IS NOT INITIAL.

     zlcinvoice_dng-vbeln   = gs_lcinvoice-vbeln.

     zlcinvoice_dng-fkdat   = gs_lcinvoice-fkdat.

     zlcinvoice_dng-kunrg   = gs_lcinvoice-kunrg.

     zlcinvoice_dng-netwr   = gs_lcinvoice-netwr.

     zlcinvoice_dng-waerk   = gs_lcinvoice-waerk.

     CLEAR gs_lcinvoice.

   ENDIF.

ENDMODULE.                 " INVOICE_ENTRY  OUTPUT

LOOP AT gt_lcinvoice.

     MODULE modify_tab.

   ENDLOOP.

*&---------------------------------------------------------------------*

*&                  Module  MODIFY_TAB  INPUT

*&---------------------------------------------------------------------*

*   Modify Internal table based on values in table Control.

*----------------------------------------------------------------------*


MODULE modify_tab INPUT.

    MODIFY gt_lcinvoice INDEX tctrl_invo-current_line from gs_lcinvoice  TRANSPORTING PASS.

ENDMODULE.                 " MODIFY_TAB  INPUT

Thanks & Regards.

Dipti


17 REPLIES 17
Read only

former_member188282
Active Participant
0 Likes
2,219

Hi Dipti,

In Table control options did you selection "Multiple" option in Attributes. if not select that option and try.

Regards,

Rajesh

Read only

0 Likes
2,219

hii @rajesh,

     thanks for your reply. i have selected Multiple in Table Control Attributes.

Regards,

dipti

Read only

0 Likes
2,219

When you are doing scrolling please press /H before pressing scrool button. It will trigger PAI and make sure in your table control loop you have in internal table mark field as X. The reason is the value of that mark field is becoming blank when scroll down.

Read only

0 Likes
2,219

hii @nabheet,

        Yup i have checked in debugger the internal table has 'X' in the pass field used for selection.

In PBO too internal table has 'X' but the row selected in table control is not highlighted.

But still the same issue..

Regards,

Dipti

Read only

0 Likes
2,219

Hi Dipti,

When you are scrolling your PAI will trigger...so in PAI that field is availble...can you please check.

FIELD SEL.

Regards,

Rajesh

Read only

0 Likes
2,219

Hi Dipti,

As you mentioned, if the Selection flag value of selected row/record being 'X' after scrolling down, just try refreshing the table display at last of PAI.

CALL METHOD g_ref_var->refresh_table_display   "g_ref_var type CL_GUI_ALV_GRID

  EXCEPTIONS

     finished = 1

     OTHERS   = 2.

This may help you.

Thanks & Regards,

- Vijay

Read only

0 Likes
2,219

What is the column name yuou have in the screen please attach screen shot plus your internal table and work area name. Please note that in PBO when you do LOOP at itab1 into lwa_itab1 with control.

the field name should also be LWA_ITAB1-MARK or whatever you like. Both screen name and work area name should be same.

Read only

0 Likes
2,219

hii @nabheet,

    The screen name and field name is same. and internal table name is gt_lcinvoice has a field mark which has 'X' even when it go to PBO . But even though the row is not highlighted.

the issue is just of highlighting of row not of deselecting. All is working perfectly in internal table but the table control issue is the row get unhighlighted when i select the table scroll.

Read only

0 Likes
2,219

hii @rajesh,

    I checked the field in gs_lcinvoice-mark in PAI it has 'X' and the row gets selected just it does not highlighted in  table control when i scroll down.

Read only

0 Likes
2,219

Can you please attach a screen shot of what do you mean by highlighted..?

Read only

0 Likes
2,219

The highlighted part ie. in yellow colour in table control when the user selects the row.Sorry m not  able to take screen shots.

Read only

Former Member
0 Likes
2,220

Hi Dipti,

In your internal table gt_lcinvoice add one more field, say SEL of type CHAR1. Then assign this field as the selection column in your table control.

If you have placed a structure screen fields, you can add this field in the structure and place accordingly. In either ways you should create a field for identifying the selection and place it in the screen accordingly.

Thanks,

Ajay Bose

Read only

0 Likes
2,219

@ ajay,

     I have added the feild as pass in gt_lcinvoice. But still the same problem. thanks for your reply.

Regards,

Dipti.

Read only

0 Likes
2,219

Hi Dipti,

Where is your screen field referring to ? gs_lcinvoice or zlcinvoice_dng ? because in PBO you are moving gs_lcinvoice to zlcinvoice_dng.

Thanks,

Ajay Bose

Read only

0 Likes
2,219

hey @ ajay,

      thanks a lot it was the issue of Moving table fields. I was individually moving table control fields and now i used MOVE-CORRESPONDING to move all the fields so it worked .

Read only

0 Likes
2,219

Hi Deepthi,

Glad to hear that. Kindly close the thread.

Thanks,

Ajay Bose

Read only

Former Member
0 Likes
2,219

Hi Dipti,

As per the code you have posted, i assume the screen field table is  zlcinvoice_dng from the PBO module.

But i cannot see the code to pass the screen field (zlcinvoice_dng) values to the workarea (gs_lcinvoice) in the PAI module. And also i am not able to see the logic in PBO to pass the field 'PASS' to the screen field.

Try by populating the fields correctly to the screen field and internal table.

Regards,

Balu.