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

Popup with Table columns

Former Member
0 Likes
6,701

Hi Experts,

I have internal table with 3 columns. I need to display a popup in which i need to display all the internal table columns with columns headings. Is there any FM to do this in report. . Thanks

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
3,008

a very simple one is:

SELECT * FROM t001 INTO TABLE lt_t001.
    IF sy-subrc = 0.
      CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
      EXPORTING
*         DDIC_STRUCTURE         = ' '
        retfield               = 'BUKRS'
*         PVALKEY                = ' '
*         DYNPPROG               = ' '
*         DYNPNR                 = ' '
*         DYNPROFIELD            = ' '
*         STEPL                  = 0
*         WINDOW_TITLE           =
*         VALUE                  = ' '
        value_org              = 'S'
*         MULTIPLE_CHOICE        = ' '
*         DISPLAY                = ' '
*         CALLBACK_PROGRAM       = ' '
*         CALLBACK_FORM          = ' '
*         MARK_TAB               =
*       _RESET            IMPORTING
*         USER =
      TABLES
        value_tab              = lt_t001
*         FIELD_TAB              =
        return_tab             = lt_return
*         DYNPFLD_MAPPING        =
      EXCEPTIONS
        parameter_error        = 1
        no_values_found        = 2
        OTHERS                 = 3.
      IF sy-subrc = 0.
        READ TABLE lt_return INTO ls_return INDEX 1.
        IF sy-subrc = 0.
          l_bukrs = ls_return-fieldval.
          CALL FUNCTION 'FI_COMPANY_CODE_DATA'
            EXPORTING
              i_bukrs      = l_bukrs
            IMPORTING
              e_t001       = ls_t001
            EXCEPTIONS
              system_error = 1
              OTHERS       = 2.
          IF sy-subrc <> 0.
            MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
            WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
          ENDIF.

        ENDIF.
        " ELSE.
        " MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
        "         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.

Hi Experts,

I have internal table with 3 columns. I need to display a popup in which i need to display all the internal table columns with columns headings. Is there any FM to do this in report. . Thanks

8 REPLIES 8
Read only

PedroGuarita
Active Contributor
0 Likes
3,008

There are many FM to do this. Goto SE37 and type POPUPTABLE* press F4 and select the one that most suits you.

Read only

vinod_vemuru2
Active Contributor
0 Likes
3,008

Hi,

Check the FM REUSE_ALV_POPUP_TO_SELECT.

Thanks,

Vinod.

Read only

Former Member
0 Likes
3,009

a very simple one is:

SELECT * FROM t001 INTO TABLE lt_t001.
    IF sy-subrc = 0.
      CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
      EXPORTING
*         DDIC_STRUCTURE         = ' '
        retfield               = 'BUKRS'
*         PVALKEY                = ' '
*         DYNPPROG               = ' '
*         DYNPNR                 = ' '
*         DYNPROFIELD            = ' '
*         STEPL                  = 0
*         WINDOW_TITLE           =
*         VALUE                  = ' '
        value_org              = 'S'
*         MULTIPLE_CHOICE        = ' '
*         DISPLAY                = ' '
*         CALLBACK_PROGRAM       = ' '
*         CALLBACK_FORM          = ' '
*         MARK_TAB               =
*       _RESET            IMPORTING
*         USER =
      TABLES
        value_tab              = lt_t001
*         FIELD_TAB              =
        return_tab             = lt_return
*         DYNPFLD_MAPPING        =
      EXCEPTIONS
        parameter_error        = 1
        no_values_found        = 2
        OTHERS                 = 3.
      IF sy-subrc = 0.
        READ TABLE lt_return INTO ls_return INDEX 1.
        IF sy-subrc = 0.
          l_bukrs = ls_return-fieldval.
          CALL FUNCTION 'FI_COMPANY_CODE_DATA'
            EXPORTING
              i_bukrs      = l_bukrs
            IMPORTING
              e_t001       = ls_t001
            EXCEPTIONS
              system_error = 1
              OTHERS       = 2.
          IF sy-subrc <> 0.
            MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
            WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
          ENDIF.

        ENDIF.
        " ELSE.
        " MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
        "         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.

Read only

0 Likes
3,008

hi,

in my senario, there is no F4 help....this popup wil trigger on click on some button...so plz guide acordingly. Thanks

Read only

0 Likes
3,008

FM POPUP_TO_SHOW_DB_DATA_IN_TABLE for example.

Read only

0 Likes
3,008

Hi,

Use POPUP_GET_VALUES

DATA : fields TYPE STANDARD TABLE OF sval WITH HEADER LINE.

fields-tabname = 'RF02E'.
fields-fieldname = 'FLEX_LEDGER'.
APPEND fields.
CLEAR fields.

fields-tabname = 'MARA'.
fields-fieldname = 'MATNR'.
APPEND fields.


CALL FUNCTION 'POPUP_GET_VALUES'
  EXPORTING
*  NO_VALUE_CHECK        = ' '
    popup_title           = 'popup_title'
   START_COLUMN          = '5'
   START_ROW             = '5'
 IMPORTING
*   RETURNCODE            = RETURNCODE
  TABLES
    fields                = fields
 EXCEPTIONS
   ERROR_IN_FIELDS       = 1
   OTHERS                = 2
          .
IF sy-subrc <> 0.
 MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.

Cheerz

Ram

Read only

Former Member
0 Likes
3,008

hi,

try the POPUP_WITH_TABLE_DISPLAY function module


   data: begin of itab occurs 0,
         name(10)     type c,
         Tel_NO(12)   type c ,
         Mob_NO(12)   type c,
         end of itab.



 itab-name    = 'ABC'.
 itab-tel_no  = '0114556654' .
 itab-mob_no  = '981145'.
 append itab .
 clear itab.

 itab-name    = 'XYZ'.
 itab-tel_no  = '0114588954' .
 itab-mob_no  = '987745'.
 append itab .
 clear itab.

 itab-name    = 'ASD'.
 itab-tel_no  = '0118996654' .
 itab-mob_no  = '984545'.
 append itab .
 clear itab.


    CALL FUNCTION 'POPUP_WITH_TABLE_DISPLAY'
      EXPORTING
        endpos_col         = 80
        endpos_row         = 25
        startpos_col       = 1
        startpos_row       = 1
        titletext          = 'Title POPUP_WITH_TABLE_DISPLAY'

*   IMPORTING
*     CHOISE             =
      TABLES
        valuetab           = itab
     EXCEPTIONS
       break_off          = 1
       OTHERS             = 2
              .

hope this helps

Regards

RItesh

Read only

Former Member
0 Likes
3,008

Example:-


DATA: BEGIN OF ITAB OCCURS 0,
        NAME(10)     TYPE C,
        TEL_NO(12)   TYPE C ,
        MOB_NO(12)   TYPE C,
        END OF ITAB.
  ITAB-NAME    = 'Jitender'.
  ITAB-TEL_NO  = '0114556654' .
  ITAB-MOB_NO  = '981145'.
  APPEND ITAB .
  CLEAR ITAB.
  ITAB-NAME    = 'Narender'.
  ITAB-TEL_NO  = '0114588954' .
  ITAB-MOB_NO  = '987745'.
  APPEND ITAB .
  CLEAR ITAB.
  ITAB-NAME    = 'Priyank'.
  ITAB-TEL_NO  = '0118996654' .
  ITAB-MOB_NO  = '984545'.
  APPEND ITAB .
  CLEAR ITAB.
  CALL FUNCTION 'POPUP_WITH_TABLE_DISPLAY'
    EXPORTING
      ENDPOS_COL         = 80
      ENDPOS_ROW         = 25
      STARTPOS_COL       = 1
      STARTPOS_ROW       = 1
      TITLETEXT          = 'Title POPUP_WITH_TABLE_DISPLAY'
*   IMPORTING
*     CHOISE             =
    TABLES
      VALUETAB           = ITAB
   EXCEPTIONS
     BREAK_OFF          = 1
     OTHERS             = 2