Application Development 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: 

ALV Layout - Internal table Contents

VenkatRamesh_V
Active Contributor
0 Kudos

Dear Experts,

After executing  the report,  user selecting  the variant.

When  user select's Icon(Select All)  all items   present in the screen should be  marked  with 'X'.

In user Command  not able to get the  variant's data  in   internal table,  its displaying all data's.

Kindly suggest me  how to find  the variant's data contents in user command.

Regards,

Venkat.

1 ACCEPTED SOLUTION

deepak_sharma_sap
Active Participant
0 Kudos

Hi Venkat,

Let me know if you are using the Container to create the Alv and using class CL_GUI_ALV_GRID.

If yes , then you can use the method GET_FILTER_CRITERIA to read the variant details.

CALL METHPD GRID1->GET_FILTER_CRITERIA

   Importing ET_FILTER = GT_FILTER.

Field "Fieldname" of internal table GT_FILTER has the name of the field on which filter has been applied in variant and then there are filter values under fields "SIGN" "OPTION" "Low" "HIGH".

Using these details you can filter the records from the internal table that you passed to display ALV.

Or

There is another method GET_FILTERED_ENTRIES of class CL_GUI_ALV_GRID which can give you the entries that have been removed after applying the variant.

Based on that you can get the entries that are displayed.

OR

Use the FM : REUSE_ALV_GRID_LAYOUT_INFO_GET and Importing attribute ET_FILTERED_ENTRIES would give you the result.

Thanks

Deepak Sharma

7 REPLIES 7

deepak_sharma_sap
Active Participant
0 Kudos

Hi Venkat,

Can you please elaborate the issue. I could not understand the issue.

To read the variant contents you can use the FM : RS_VARIANT_CONTENTS.

Thanks

Deepak

Shubham1
Employee
Employee
0 Kudos

Hello

Can you specify which report / T code /Program you are referring to?

Shubham

thanga_prakash
Active Contributor
0 Kudos

Hello Venkat,

If your requirement is, when the users click on select all button then all the rows should be marked as X, then refer to the below post.

What do you mean by variant which users select after executing the report? I hope they select variant before the execution of the report, not after the execution of the report.

Regards,

Thanga

VenkatRamesh_V
Active Contributor
0 Kudos

Thanks For Replying.

Eg:  My  internal  table contains entries ALV.

Field1                    Field2

yarn                      10

Cone winding         20

Knitting                  30

In  report   output Created 3   Layout for  yarn, conewinding, knitting(Created Filter ).

User selects  yarn layout  means   only  yarn entries is displayed.  created   a  check  box.

when user select  Icon( Select All). While  in debugging(All 3 contents(Yarn, Conewinding, Knitting)   are  displayed  in internal table ).

Regards,

Ramesh

0 Kudos

Not clear Venkat, please explain in detail with screen shots or with more information

0 Kudos

Hi Prakash,

Actual  ALV  Output.

After   selecting  layout.

Only  yarn is displayed.

Created   icon's for  select  all   & delete all.

In User  command   internal table is filled with all  values as like in first screen shot(All  material description)

Want to identify  which  layout  user selected.  to mark the field with 'X'(Select all  ).

Hope  you   understand.

Regards,

Venkat.

deepak_sharma_sap
Active Participant
0 Kudos

Hi Venkat,

Let me know if you are using the Container to create the Alv and using class CL_GUI_ALV_GRID.

If yes , then you can use the method GET_FILTER_CRITERIA to read the variant details.

CALL METHPD GRID1->GET_FILTER_CRITERIA

   Importing ET_FILTER = GT_FILTER.

Field "Fieldname" of internal table GT_FILTER has the name of the field on which filter has been applied in variant and then there are filter values under fields "SIGN" "OPTION" "Low" "HIGH".

Using these details you can filter the records from the internal table that you passed to display ALV.

Or

There is another method GET_FILTERED_ENTRIES of class CL_GUI_ALV_GRID which can give you the entries that have been removed after applying the variant.

Based on that you can get the entries that are displayed.

OR

Use the FM : REUSE_ALV_GRID_LAYOUT_INFO_GET and Importing attribute ET_FILTERED_ENTRIES would give you the result.

Thanks

Deepak Sharma