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

Program (IS_VARIANT-REPORT) not specified ERROR IN SAVING A LAYOUT

Former Member
0 Likes
2,472

My code in saving a variant or layout is

data: g_save type c value 'X'.

    data: g_variant type disvariant.

data: gx_variant type disvariant.

data: g_exit type c.

    gx_variant-report = sy-repid.

DATAlayout TYPE SLIS_LAYOUT_ALV.


CALL FUNCTION 'REUSE_ALV_VARIANT_DEFAULT_GET'

        EXPORTING

             I_SAVE     = g_save

        CHANGING

             CS_VARIANT = gx_variant

        EXCEPTIONS

             NOT_FOUND  = 2.

   IF SY-SUBRC = 0.

     variant = gx_variant-variant.

   ENDIF.

*at selection-screen on value-request for variant.

   CALL FUNCTION 'REUSE_ALV_VARIANT_F4'

        EXPORTING

             IS_VARIANT          = g_variant

             I_SAVE              = g_save

        IMPORTING

             E_EXIT              = g_exit

             ES_VARIANT          = gx_variant

        EXCEPTIONS

             NOT_FOUND = 2.

   IF SY-SUBRC = 2.

     MESSAGE ID SY-MSGID TYPE 'S'      NUMBER SY-MSGNO

             WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

   ELSE.

     IF g_exit = SPACE.

       variant = gx_variant-variant.

     ENDIF.

   ENDIF.


CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'

  EXPORTING

*   I_INTERFACE_CHECK                 = ' '

*   I_BYPASSING_BUFFER                = ' '

*   I_BUFFER_ACTIVE                   = ' '

    i_callback_program                = sy-repid

*   I_CALLBACK_PF_STATUS_SET          = ' '

    i_callback_user_command           = 'USER_COMMAND'

*   I_CALLBACK_TOP_OF_PAGE            = 'TOP-OF-PAGE'

    i_callback_html_top_of_page       = 'HTML_TOP_OF_PAGE '

*   I_CALLBACK_HTML_END_OF_LIST       = ' '

    i_structure_name                  = 'ZIM_S_V_SALES_TAB'

*   I_BACKGROUND_ID                   = ' '

*   I_GRID_TITLE                      =

*   I_GRID_SETTINGS                   =

    IS_LAYOUT                         = LAYOUT

*   IT_FIELDCAT                       =

*   IT_EXCLUDING                      =

*   IT_SPECIAL_GROUPS                 =

*   IT_SORT                           =  IT_SORT

*   IT_FILTER                         =

*   IS_SEL_HIDE                       =

*   I_DEFAULT                         = 'X'

    I_SAVE                            = G_SAVE

    IS_VARIANT                        = gX_variant

*   IT_EVENTS                         =

*   IT_EVENT_EXIT                     =

*   IS_PRINT                          =

*   IS_REPREP_ID                      =

*   I_SCREEN_START_COLUMN             = 0

*   I_SCREEN_START_LINE               = 0

*   I_SCREEN_END_COLUMN               = 0

*   I_SCREEN_END_LINE                 = 0

*   I_HTML_HEIGHT_TOP                 = 0

*   I_HTML_HEIGHT_END                 = 0

*   IT_ALV_GRAPHICS                   =

*   IT_HYPERLINK                      =

*   IT_ADD_FIELDCAT                   =

*   IT_EXCEPT_QINFO                   =

*   IR_SALV_FULLSCREEN_ADAPTER        =

* IMPORTING

*   E_EXIT_CAUSED_BY_CALLER           =

*   ES_EXIT_CAUSED_BY_USER            =

   TABLES

     t_outtab                          = p_gt_output

* EXCEPTIONS

*   PROGRAM_ERROR                     = 1



*   OTHERS                            = 2



please help to overcome this error







3 REPLIES 3
Read only

michael_kozlowski
Active Contributor
0 Likes
1,665

Try to store sy-repid for ex in data g_repid  and change your code like this:

CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'

  EXPORTING

*   I_INTERFACE_CHECK                 = ' '

*   I_BYPASSING_BUFFER                = ' '

*   I_BUFFER_ACTIVE                   = ' '

    i_callback_program                = g_repid

*   I_CALLBACK_PF_STATUS_SET          = ' '

    i_callback_user_command           = 'USER_COMMAND'

...

Read only

0 Likes
1,665

I used this code

data: g_repid  type sy-repid.

and used in i_callback_program                = g_repid

Is that right,Michael?

Read only

0 Likes
1,665

Yep and don't forget the move... g_repid = sy-repid.