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

ALV Layout Variant Information

VikasB
Active Participant
0 Likes
5,211

Hello,

I have requirement where I need to validate the ALV Layout for any particular Report. For this I am using function module 'REUSE_ALV_VARIANT_EXISTENCE'.

Now if this layout is valid I need to get it's all parameters such as on which fileds SORT, FILTER, etc.. criteria is applied. I tried using below function modules but had not any success. Those only validate the layout variant but do not return SORT, FILTER tables.

- REUSE_ALV_VARIANT_SELECT

- K_KKB_LIST_LAYOUT_INFO_GET

- LVC_VARIANT_SELECT

- LT_VARIANT_LOAD

- LT_VARIANTS_READ_FROM_LTDX

I am not using ALV grid Object to get all this information after displaying data on ALV. I just need to validate that layout for report and then fetch it's all information.

Is there any FM or class-methods which I can use for this?

Thanks,

Vikas

1 ACCEPTED SOLUTION
Read only

kesavadas_thekkillath
Active Contributor
0 Likes
2,607

Check LT_DBDATA_READ_FROM_LTDX - Just check the function group SKBS for list of fm's

SELECT SINGLE * FROM ltdx

WHERE variant = p_var

AND report = sy-repid.

if sy-subrc = 0.

is_varkey-report = ltdx-report.

is_varkey-handle = ltdx-handle.

is_varkey-log_group = ltdx-log_group.

is_varkey-username = ltdx-username.

is_varkey-variant = ltdx-variant.

is_varkey-type = ltdx-type.

call fm here

endif.

Hello,

I have requirement where I need to validate the ALV Layout for any particular Report. For this I am using function module 'REUSE_ALV_VARIANT_EXISTENCE'.

Now if this layout is valid I need to get it's all parameters such as on which fileds SORT, FILTER, etc.. criteria is applied. I tried using below function modules but had not any success. Those only validate the layout variant but do not return SORT, FILTER tables.

- REUSE_ALV_VARIANT_SELECT

- K_KKB_LIST_LAYOUT_INFO_GET

- LVC_VARIANT_SELECT

- LT_VARIANT_LOAD

- LT_VARIANTS_READ_FROM_LTDX

I am not using ALV grid Object to get all this information after displaying data on ALV. I just need to validate that layout for report and then fetch it's all information.

Is there any FM or class-methods which I can use for this?

Thanks,

Vikas

5 REPLIES 5
Read only

Former Member
0 Likes
2,607

try this:

CALL FUNCTION 'LVC_VARIANT_EXISTENCE_CHECK'

EXPORTING

i_save = gdf_variant_save

CHANGING

cs_variant = gds_variant

EXCEPTIONS

OTHERS = 01.

Read only

0 Likes
2,607

I can validate the layout with function module 'REUSE_ALV_VARIANT_EXISTENCE', I need all parameters for that layout.

Thanks,

Vikas

Read only

kesavadas_thekkillath
Active Contributor
0 Likes
2,608

Check LT_DBDATA_READ_FROM_LTDX - Just check the function group SKBS for list of fm's

SELECT SINGLE * FROM ltdx

WHERE variant = p_var

AND report = sy-repid.

if sy-subrc = 0.

is_varkey-report = ltdx-report.

is_varkey-handle = ltdx-handle.

is_varkey-log_group = ltdx-log_group.

is_varkey-username = ltdx-username.

is_varkey-variant = ltdx-variant.

is_varkey-type = ltdx-type.

call fm here

endif.

Read only

0 Likes
2,607

Thanks Keshav, this FM worked fine.

Just one more issue how can we apply filter criteria to the internal table? I am having one internal table data and now I want to apply this filter parameters to that internal table. I am not displaying that internal table data with ALV grid or something so I can not pass the layout or filter information to it.

Thanks,

Vikas

Read only

RaymondGiuseppi
Active Contributor
0 Likes
2,607

Use

- For the old structure of SLIS type pool, use REUSE_ALV_VARIANT_SELECT

- For the OO/LVC DDIC structure, use LVC_VARIANT_SELECT

But you must provide most of the parameters of those FM to get something (don't forget a default fieldcat to increase success chance)

Regards,

Raymond