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: 

fieldcatalog wrt layout

Former Member
0 Kudos

Hi ,

we all know that we can maintain layouts for alv grids. different layout will have diffrent fieldcatalog. i need the fieldcatalog w.r.t layout . before we display the grid. ie before we use fhe fm 'REUSE_ALV_GRID_DISPLAY'.

i kow that variants are being stored in the table 'v_ltdx'.

are there any FM's to get the fieldcatalog w.r.t layout.

jaffer vali shaik

2 REPLIES 2

Former Member
0 Kudos

Jaffer,

I am not clear what exactly are you trying to achieve.

There is no direct relation between a field catalog and a layout. A layout is linked to the program name, username and the value in the handle field of the IS_VARIANT parameter. So, if you want to get the layouts specific to a grid, you need to pass a unique handle name to the parameter while displaying the data so that marked against that grid.

A field catalog is a stand alone component and can be used for multiple grids, if you are not changing things at runtime and the fields are exactly the same. Other wise, you still need to have individual field catalogs for each of the grids.

If you want to get the layouts specific to the grid, you can use the REUSEGETLAYOUT* or LVCGETLAYOUT* function modules.

Regards,

Ravi

Note - Please mark all the helpful answers

Former Member
0 Kudos

Hi

I hope you requirement is to display specific fields based on selection.

You can save different layout set and call them as per your requirement.

You can <b>declare</b> the variant in the <b>selection screen</b>.

p_var_nt LIKE disvariant-variant.

Modify the following codes and you can achive the same task.

AT SELECTION SCREEN ON VALUE REQUEST:

-


DATA: l_exit(1) TYPE c.

os_variant-report = sy-repid.

CALL FUNCTION 'REUSE_ALV_VARIANT_F4'

EXPORTING

is_variant = os_variant

i_save = 'A'

IMPORTING

e_exit = l_exit

es_variant = os_variant

EXCEPTIONS

not_found = 2.

AT SELECTIN SCREEN ON FIELD:

-


FORM alv_variant_existence USING iv_variant LIKE disvariant-variant

CHANGING os_variant LIKE disvariant.

CHECK NOT iv_variant IS INITIAL.

os_variant-report = sy-repid.

os_variant-variant = iv_variant.

IF iv_variant CP '/*'. "user-specific variants begin with slash

os_variant-username = sy-uname.

ENDIF.

CALL FUNCTION 'REUSE_ALV_VARIANT_EXISTENCE'

EXPORTING

i_save = 'A'

CHANGING

cs_variant = os_variant

EXCEPTIONS

wrong_input = 1

not_found = 2

program_error = 3

OTHERS = 4.

Regards,

Baburaj