Help Request (triggered by F1 key) provides field-level documentation to help users understand the purpose or use of a field.
Types of Help Request:
-
Automatic Help (F1) from Data Element
-
Comes from documentation maintained in the data element.
-
No coding needed — just maintain the documentation in SE11.
-
-
Custom Help Request (Manual)
-
In module pool programs, you can write custom F1 help logic using
PROCESS ON HELP-REQUEST
.
-
Code :
*&---------------------------------------------------------------------*
*&---------------------------------------------------------------------*
*& Report ZPRG_TEST
*&---------------------------------------------------------------------*
REPORT zprg_test_ecc.
DATA : it_help TYPE STANDARD TABLE OF helpval WITH HEADER LINE.
PARAMETERS : s_id TYPE ZAR_STUDENT_ID.
AT SELECTION-SCREEN ON s_id.
SELECT SINGLE student_id FROM zar_student_data INTO @DATA(id).
IF id IS INITIAL.
MESSAGE 'Student ID not found' TYPE 'E'.
ENDIF.
AT SELECTION-SCREEN ON HELP-REQUEST FOR s_id.
CLEAR it_help[].
it_help-tabname = 'bkid'.
it_help-fieldname = 'Student_ID'.
it_help-keyword = 'Description'.
it_help-length = 150.
it_help-value = 'Enter a student id or refer table ZAR_STUDENT_DATA to find student id'.
APPEND it_help.
CALL FUNCTION 'HELP_GET_VALUES'
EXPORTING
popup_title = 'About s-id'
TABLES
fields = it_help
EXCEPTIONS
no_entries = 1
OTHERS = 2.
IF sy-subrc <> 0.
* Implement suitable error handling here
ENDIF.
START-OF-SELECTION.
SELECT * FROM zar_student_data INTO TABLE @DATA(lc_it_zlib) WHERE STUDENT_ID = @s_id.
LOOP AT lc_it_zlib INTO DATA(wa_zlib).
WRITE (22) : wa_zlib-student_id, wa_zlib-student_fname.
SKIP.
ENDLOOP.
Output :
Execute and Press F1.