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

layout field

Former Member
0 Likes
509

Hi,

I want to add F4 help for a layout field in the selection screen.

Can anybody tell me from which table the does the layout values come?

points for sure.

Regards

rose

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
474

Hi Rose,

Try this,

Data:

v_variant LIKE disvariant,

v_variant1 LIKE disvariant.

AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_LAYOUT.

PERFORM layout.

&----


*& Form layout

&----


  • text

----


  • --> p1 text

  • <-- p2 text

----


Form Layout.

v_variant-report = sy-repid.

v_variant-username = sy-uname.

CALL FUNCTION 'REUSE_ALV_VARIANT_F4'

EXPORTING

is_variant = v_variant

i_save = v_save

IMPORTING

e_exit = v_exit1

es_variant = v_variant1

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 v_exit1 = space.

P_LAYOUT = v_variant1-variant.

v_variant = v_variant1.

ELSE.

MESSAGE 'No layouts found' TYPE 'I'.

ENDIF.

ENDIF.

Reward if helpful,

Regards,

Mandeep

3 REPLIES 3
Read only

Former Member
0 Likes
475

Hi Rose,

Try this,

Data:

v_variant LIKE disvariant,

v_variant1 LIKE disvariant.

AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_LAYOUT.

PERFORM layout.

&----


*& Form layout

&----


  • text

----


  • --> p1 text

  • <-- p2 text

----


Form Layout.

v_variant-report = sy-repid.

v_variant-username = sy-uname.

CALL FUNCTION 'REUSE_ALV_VARIANT_F4'

EXPORTING

is_variant = v_variant

i_save = v_save

IMPORTING

e_exit = v_exit1

es_variant = v_variant1

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 v_exit1 = space.

P_LAYOUT = v_variant1-variant.

v_variant = v_variant1.

ELSE.

MESSAGE 'No layouts found' TYPE 'I'.

ENDIF.

ENDIF.

Reward if helpful,

Regards,

Mandeep

Read only

Former Member
0 Likes
474

Hi Rose,

you may try table LTDXT. I have found it by tracing (transaction ST05) the F4 on a standard program (RFITEMGL).

I hope this helps. Best regards,

Alvaro

Read only

Former Member
0 Likes
474

Hi,

PLease you the below code :


* Data for ALV variant
DATA  gv_repname          LIKE sy-repid.
DATA  gv_x_variant        LIKE disvariant.
DATA  gv_exit(1)          TYPE c.
DATA  gv_save(1)          TYPE c.
DATA  gv_variant          LIKE disvariant.


SELECTION-SCREEN BEGIN OF BLOCK b3 WITH FRAME TITLE text-005.
PARAMETERS: gp_vari LIKE disvariant-variant. "Variant
SELECTION-SCREEN END OF BLOCK b3.

INITIALIZATION.
  PERFORM f_initialize_variant.


*&---------------------------------------------------------------------*
*&      Form  f_initialize_variant
*&---------------------------------------------------------------------*
*       text: initialize the variant
*----------------------------------------------------------------------*

FORM f_initialize_variant .
  CLEAR gv_variant.
  gv_save           = 'A'.
  gv_variant-report = gv_repname.
  gv_x_variant      = gv_variant.

  CALL FUNCTION 'REUSE_ALV_VARIANT_DEFAULT_GET'
    EXPORTING
      i_save     = gv_save
    CHANGING
      cs_variant = gv_x_variant
    EXCEPTIONS
      not_found  = 2.

  IF sy-subrc = 0.
    gp_vari = gv_x_variant-variant.
  ENDIF.
ENDFORM.                    " f_initialize_variant


*---------------------------------------------------------------------
*At selection screen
*---------------------------------------------------------------------


AT SELECTION-SCREEN ON VALUE-REQUEST FOR gp_vari.
  PERFORM f_f4_for_variant.

*&---------------------------------------------------------------------*
*&      Form  f_f4_for_variant
*&---------------------------------------------------------------------*
*       text: On-F4 event for the variant
*----------------------------------------------------------------------*

FORM f_f4_for_variant .
  CALL FUNCTION 'REUSE_ALV_VARIANT_F4'
    EXPORTING
      is_variant = gv_variant
      i_save     = gv_save
    IMPORTING
      e_exit     = gv_exit
      es_variant = gv_x_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 gv_exit = space.
      gp_vari = gv_x_variant-variant.
    ENDIF.
  ENDIF.

Thanks,

Sriram Ponna.