Sunday, December 26, 2010
Show a list of possible values for F4 popup help on selection screens. This function module pops up a screen that is just like all the other F4 helps, so it looks like the rest of the SAP system. Very useful for providing dropdowns on fields that do not have them predefined.
REPORT ZTEST_NOTEPAD. TABLES: T001W. DATA: LC_WERKS LIKE T001W-WERKS, LTAB_FIELDS LIKE HELP_VALUE OCCURS 0 WITH HEADER LINE, BEGIN OF LTAB_VALUES OCCURS 0, FELD(40) TYPE C, END OF LTAB_VALUES. START-OF-SELECTION. " Set up fields to retrieve data LTAB_FIELDS-TABNAME = 'T001W'. LTAB_FIELDS-FIELDNAME = 'WERKS'. LTAB_FIELDS-SELECTFLAG = 'X'. APPEND LTAB_FIELDS. LTAB_FIELDS-TABNAME = 'T001W'. LTAB_FIELDS-FIELDNAME = 'NAME1'. LTAB_FIELDS-SELECTFLAG = SPACE. APPEND LTAB_FIELDS. " Fill values SELECT * FROM T001W. LTAB_VALUES-FELD = T001W-WERKS. APPEND LTAB_VALUES. LTAB_VALUES-FELD = T001W-NAME1. APPEND LTAB_VALUES. ENDSELECT. CALL FUNCTION 'HELP_VALUES_GET_WITH_TABLE' EXPORTING FIELDNAME = 'WERKS' TABNAME = 'T001W' TITLE_IN_VALUES_LIST = 'Select a value' IMPORTING SELECT_VALUE = LC_WERKS TABLES FIELDS = LTAB_FIELDS VALUETAB = LTAB_VALUES EXCEPTIONS FIELD_NOT_IN_DDIC = 01 MORE_THEN_ONE_SELECTFIELD = 02 NO_SELECTFIELD = 03.
Followers
Popular Posts
- ABAP - ALV Report example with steps
- ABAP - Step by step tutorial on Smart Forms - Template Node
- ABAP - Sending email with pdf attachment
- SAP Adobe Form - Steps to create simple ADOBE Form and calling it from ABAP Program
- SAP ABAP - CL_ABAP_CHAR_UTILITIES class usage
- ABAP - Multiple value selection from F4 help for SELECT-OPTIONS
- Execute ABAP Report using SUBMIT statement
- ABAP - Select all or Deselect all in ALV or Check box handling in ALV
- Web Dynpro ABAP ALV - ON_CLICK event
- ABAP - Dynamic WHERE clause
0 comments:
Post a Comment
Your useful comments, suggestions are appreciated.Your comments are moderated.