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

CL_SALV_TABLE - Rows Selection

Former Member
0 Likes
15,617

Hi Experts,

We have a requirement to select multiple records in ALV and process them for creation of posting documents.

Able to achieve multiple selection of rows in ALV.

But we need like the below mentioned.

1. When records are processed successfully then STATUS is set to 'S'.

2. When selected 'Select All' standard option in SAP - then it would select even processed records with STATUS = 'S'.

3. But our requirement is when records 'STATUS' = 'S' then even clicked on 'SELECTALL' standard option all rows should be selected except those records with 'STATUS = S'. The rows with STATUS = 'S' should be shown normally in ALV without any kind of selection of rows.

4. That is only rows with status = 'E' (Error must be selected but not records with STATUS = 'S').

please shares ideas if any.

Regards,

Mohammed

5 REPLIES 5
Read only

Former Member
0 Likes
3,027

Hello,

I would add one more column (as CHAR01 ) in output table for ALV. I would use it as flag when any records are updated successfully, I would just mark it as 'X'.

Also, I would mark this field as hidden so that user perspective there is no change in data layout.

During select all scenario, I would just neglect rows which are marked 'X' & processed all other records.

Regards,

Sameer

Read only

0 Likes
3,027

Hi Sameer,

Thanks for your reply.

I am following the same scenario, but how the rows in ALV gets selected when clicked on 'SelectAll' option placed on ALV.

Would need some idea in how to proceed programmatically.

Regards,

Mohammed

Read only

0 Likes
3,027

Hello,

Please see program SALV_TEST_TABLE_EVENTS for your ref.

Regards,

Sameer

Read only

0 Likes
3,027

Yahoooo.....

I got it....

Read only

rosenberg_eitan
Active Contributor
3,027

Hi,

Thinking aloud...

- Disable the standard SAP selection.

ob_salv_selections = ob_salv_table->get_selections( ).
ob_salv_selections->set_selection_mode( if_salv_c_selection_mode=>none ).

Add your own function to do the selection.

See SALV_DEMO_TABLE_EVENTS

Regards.