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

no layout available

Former Member
0 Likes
673

Hello!

On press to F4 Button in my selection screen there

are no layouts existing although I have saved some of them by the ALV output.

What is wrong at the following scenario.

Regards

ertas

SELECTION-SCREEN SKIP.
PARAMETERS: pa_lv TYPE disvariant-variant.


AT SELECTION-SCREEN ON VALUE-REQUEST FOR pa_lv. 
CALL FUNCTION 'REUSE_ALV_VARIANT_F4'
    EXPORTING
      is_variant                = wa_variant
*     I_TABNAME_HEADER          =
*     I_TABNAME_ITEM            =
*     IT_DEFAULT_FIELDCAT       =
*     I_SAVE                    = ' '
*     I_DISPLAY_VIA_GRID        = ' '
*   IMPORTING
*     E_EXIT                    =
*     ES_VARIANT                =
*   EXCEPTIONS
*     NOT_FOUND                 = 1
*     PROGRAM_ERROR             = 2
*     OTHERS                    = 3
            .
  IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
  ENDIF.

wa_variant-report = sy-cprog.
  IF NOT pa_lv IS INITIAL.
    wa_variant-variant = pa_lv.
    save = 'A'.
  ENDIF.


CALL METHOD gr_alv->set_table_for_first_display
       EXPORTING
         i_structure_name              = 'ZITAB
         is_variant                    = wa_variant
         i_save                        = save
         i_default                     =  'X'
         is_layout                     = wa_layout
      CHANGING
        it_outtab                     =  it_li
        it_fieldcatalog               =  it_fcat
 
       EXCEPTIONS
 
         OTHERS                        = 4

1 ACCEPTED SOLUTION
Read only

MusAbaper
Active Participant
0 Likes
647

Hi, you can see this codes perrhaps he will be helpful :

CALL FUNCTION 'REUSE_ALV_VARIANT_F4'

EXPORTING

is_variant = w_g_variant

i_save = w_g_save

IMPORTING

e_exit = w_g_exit

es_variant = w_gx_variant

EXCEPTIONS

not_found = 2.

CALL FUNCTION 'REUSE_ALV_VARIANT_DEFAULT_GET'

EXPORTING

i_save = w_g_save

CHANGING

cs_variant = w_gx_variant

EXCEPTIONS

not_found = 2.

CALL FUNCTION 'REUSE_ALV_VARIANT_EXISTENCE'

EXPORTING

i_save = w_g_save

CHANGING

cs_variant = w_gx_variant.

CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'

EXPORTING

i_callback_program = w_g_repid

is_layout = t_layout

it_fieldcat = t_fieldcat

i_default = 'X'

i_save = w_g_save

is_variant = w_g_variant

it_events = t_events

IMPORTING

es_exit_caused_by_user = t_exit

TABLES

t_outtab = t_edition

EXCEPTIONS

program_error = 1

OTHERS = 2.

reward if it helpful, or if you have a question.

rergards.

Mustapha

Hello!

On press to F4 Button in my selection screen there

are no layouts existing although I have saved some of them by the ALV output.

What is wrong at the following scenario.

Regards

ertas

SELECTION-SCREEN SKIP.
PARAMETERS: pa_lv TYPE disvariant-variant.


AT SELECTION-SCREEN ON VALUE-REQUEST FOR pa_lv. 
CALL FUNCTION 'REUSE_ALV_VARIANT_F4'
    EXPORTING
      is_variant                = wa_variant
*     I_TABNAME_HEADER          =
*     I_TABNAME_ITEM            =
*     IT_DEFAULT_FIELDCAT       =
*     I_SAVE                    = ' '
*     I_DISPLAY_VIA_GRID        = ' '
*   IMPORTING
*     E_EXIT                    =
*     ES_VARIANT                =
*   EXCEPTIONS
*     NOT_FOUND                 = 1
*     PROGRAM_ERROR             = 2
*     OTHERS                    = 3
            .
  IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
  ENDIF.

wa_variant-report = sy-cprog.
  IF NOT pa_lv IS INITIAL.
    wa_variant-variant = pa_lv.
    save = 'A'.
  ENDIF.


CALL METHOD gr_alv->set_table_for_first_display
       EXPORTING
         i_structure_name              = 'ZITAB
         is_variant                    = wa_variant
         i_save                        = save
         i_default                     =  'X'
         is_layout                     = wa_layout
      CHANGING
        it_outtab                     =  it_li
        it_fieldcatalog               =  it_fcat
 
       EXCEPTIONS
 
         OTHERS                        = 4

3 REPLIES 3
Read only

MusAbaper
Active Participant
0 Likes
648

Hi, you can see this codes perrhaps he will be helpful :

CALL FUNCTION 'REUSE_ALV_VARIANT_F4'

EXPORTING

is_variant = w_g_variant

i_save = w_g_save

IMPORTING

e_exit = w_g_exit

es_variant = w_gx_variant

EXCEPTIONS

not_found = 2.

CALL FUNCTION 'REUSE_ALV_VARIANT_DEFAULT_GET'

EXPORTING

i_save = w_g_save

CHANGING

cs_variant = w_gx_variant

EXCEPTIONS

not_found = 2.

CALL FUNCTION 'REUSE_ALV_VARIANT_EXISTENCE'

EXPORTING

i_save = w_g_save

CHANGING

cs_variant = w_gx_variant.

CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'

EXPORTING

i_callback_program = w_g_repid

is_layout = t_layout

it_fieldcat = t_fieldcat

i_default = 'X'

i_save = w_g_save

is_variant = w_g_variant

it_events = t_events

IMPORTING

es_exit_caused_by_user = t_exit

TABLES

t_outtab = t_edition

EXCEPTIONS

program_error = 1

OTHERS = 2.

reward if it helpful, or if you have a question.

rergards.

Mustapha

Read only

Former Member
0 Likes
647

Mustapha ABAPER thank u but this kind of approaching to this problem

was not effective. So I would rather like wait until somebody can really

give the right answer for my problem regarding to my posted code example.

Regards

ertas

Read only

Former Member
0 Likes
647

.. really no idea

Regards

ilhan