10-20-2006 5:59 PM
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
10-21-2006 5:06 PM
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
10-20-2006 8:31 PM
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.
10-21-2006 5:06 PM
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