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: 

Drop down list for User ID's and SAP List viewer format

Former Member
0 Kudos

Couple of quick questions. Any help will be greatly appreciated.

1) I need to put User ID on the selection criteria screen. And also, I need to build a dropdown list for user ID selection by finding all user IDs in the Finance department and put it on the list.

2) I need to display the report in the SAP List viewer format, which enable these functions including sorting, hiding fields, filtering, exporting to an excel file as necessary. My output is currently plain vanilla as follows

loop at ibkpf where belnr = ibseg-belnr.

read table iskat with key saknr = ibseg-hkont.

read table icepct with key prctr = ibseg-prctr.

read table icskt with key kostl = ibseg-kostl.

write:/

iBKPF-BELNR, " Accounting document number

iBKPF-BUKRS, " Company code

iBKPF-GJAHR, " Fiscal Year Range

iBKPF-MONAT, " Period

iBKPF-USNAM, " Username

iBSEG-BELNR, "Document #

iBSEG-BUZEI, "Item #

iBSEG-BSCHL, "Posting Key

iBSEG-SHKZG, "Debit/credit indicator

iBSEG-PRCTR, "Profit Center

icepct-ktext,

iBSEG-KOSTL, "Cost Center

icskt-ltext,

iBSEG-HKONT, "G/L Account

iskat-TXT20,

iBSEG-DMBTR, "Local currency

iBSEG-WRBTR, "Document currency

iBSEG-SGTXT, "Explanation

iBSEG-KOART. "Account type

1 ACCEPTED SOLUTION

uwe_schieferstein
Active Contributor
0 Kudos

Hello Syed

Here is a sample coding for a dropdown listbox:

*&---------------------------------------------------------------------*
*& Report  ZUS_SDN_DROPDOWN_LIST
*&
*&---------------------------------------------------------------------*
*&
*&
*&---------------------------------------------------------------------*

REPORT  zus_sdn_dropdown_list.


TYPE-POOLS: vrm. " Value Request Manager: Typen und Konstanten


DATA:
  gt_values   TYPE vrm_values.

PARAMETERS:
  p_usrid    TYPE xubname AS LISTBOX VISIBLE LENGTH 13.



INITIALIZATION.
* Select the allowed values for dropdown listbox
  SELECT bname AS key FROM  usr02 INTO TABLE gt_values
         WHERE  bname  LIKE 'S%'.



  CALL FUNCTION 'VRM_SET_VALUES'
    EXPORTING
      id              = 'P_USRID'
      values          = gt_values
    EXCEPTIONS
      id_illegal_name = 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.



START-OF-SELECTION.


END-OF-SELECTION.

You have two fields for the listbox available:

- KEY (obligatory)

- TEXT (optional)

Regards

Uwe

2 REPLIES 2

Former Member
0 Kudos

you can program your own drodown list for your parameter in at selection-screen on value-request for <your parameter name>

Check FM F4IF_INT_TABLE_VALUE_REQUEST which can be used to display/select your value.

uwe_schieferstein
Active Contributor
0 Kudos

Hello Syed

Here is a sample coding for a dropdown listbox:

*&---------------------------------------------------------------------*
*& Report  ZUS_SDN_DROPDOWN_LIST
*&
*&---------------------------------------------------------------------*
*&
*&
*&---------------------------------------------------------------------*

REPORT  zus_sdn_dropdown_list.


TYPE-POOLS: vrm. " Value Request Manager: Typen und Konstanten


DATA:
  gt_values   TYPE vrm_values.

PARAMETERS:
  p_usrid    TYPE xubname AS LISTBOX VISIBLE LENGTH 13.



INITIALIZATION.
* Select the allowed values for dropdown listbox
  SELECT bname AS key FROM  usr02 INTO TABLE gt_values
         WHERE  bname  LIKE 'S%'.



  CALL FUNCTION 'VRM_SET_VALUES'
    EXPORTING
      id              = 'P_USRID'
      values          = gt_values
    EXCEPTIONS
      id_illegal_name = 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.



START-OF-SELECTION.


END-OF-SELECTION.

You have two fields for the listbox available:

- KEY (obligatory)

- TEXT (optional)

Regards

Uwe