2013 Oct 31 6:13 AM
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
2013 Oct 31 6:43 AM
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
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
2013 Oct 31 6:25 AM
Hi Dipti,
In Table control options did you selection "Multiple" option in Attributes. if not select that option and try.
Regards,
Rajesh
2013 Oct 31 6:46 AM
hii @rajesh,
thanks for your reply. i have selected Multiple in Table Control Attributes.
Regards,
dipti
2013 Oct 31 6:50 AM
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.
2013 Oct 31 6:54 AM
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
2013 Oct 31 7:05 AM
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
2013 Oct 31 7:06 AM
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
2013 Oct 31 7:06 AM
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.
2013 Oct 31 7:33 AM
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.
2013 Oct 31 7:36 AM
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.
2013 Oct 31 7:41 AM
Can you please attach a screen shot of what do you mean by highlighted..?
2013 Oct 31 8:09 AM
The highlighted part ie. in yellow colour in table control when the user selects the row.Sorry m not able to take screen shots.
2013 Oct 31 6:43 AM
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
2013 Oct 31 6:48 AM
@ ajay,
I have added the feild as pass in gt_lcinvoice. But still the same problem. thanks for your reply.
Regards,
Dipti.
2013 Oct 31 6:58 AM
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
2013 Oct 31 10:22 AM
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 .
2013 Oct 31 1:39 PM
Hi Deepthi,
Glad to hear that. Kindly close the thread.
Thanks,
Ajay Bose
2013 Oct 31 8:39 AM
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.
| User | Count |
|---|---|
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |