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

Function Module for F1 help

Former Member
0 Likes
3,587

Hi all!

I want to know the function module to create your own F1 help.

Please Help me Out

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,764

Hi,

DSYS_SHOW_FOR_F1HELP

AT SELECTION-SCREEN ON HELP-REQUEST FOR <MY FIELD> .

PERFORM HELP_F1.

In the routine you have to insert the code to display the text, it depends on how you want to create it.

For example I created a text by trx SO72 and this is the code to display it:

DATA: T_LINE LIKE TLINE OCCURS 0,

XHEAD LIKE THEAD,

HELP_INFO LIKE HELP_INFO,

TEXC LIKE SY-UCOMM OCCURS 0,

V_OBJECT LIKE DOKHL-OBJECT.

DATA: PREF_SIMG(4) VALUE 'SIMG',

DOCID_HY LIKE DOKHL-ID VALUE 'HY'.

CONCATENATE PREF_SIMG 'Z_MY_DOC' INTO V_OBJECT.

Estrazione testo

CALL FUNCTION 'DOCU_GET_FOR_F1HELP'

EXPORTING

ID = DOCID_HY

LANGU = SY-LANGU

OBJECT = V_OBJECT

IMPORTING

HEAD = XHEAD

TABLES

LINE = T_LINE

EXCEPTIONS

RET_CODE = 1

OTHERS = 2.

CASE SY-SUBRC .

WHEN 0.

Visualizzazione testo

GET CURSOR FIELD HELP_INFO-DYNPROFLD.

HELP_INFO-DOCUID = DOCID_HY.

HELP_INFO-DOCUOBJECT = V_OBJECT.

HELP_INFO-SPRAS = SY-LANGU.

HELP_INFO-PROGRAM = SY-REPID.

HELP_INFO-DYNPRO = SY-DYNNR.

HELP_INFO-DYNPPROG = SY-REPID.

HELP_INFO-PFKEY = SY-PFKEY.

HELP_INFO-FIELDNAME = HELP_INFO-DYNPROFLD.

CALL FUNCTION 'HELP_DOCULINES_SHOW'

EXPORTING

HELP_INFOS = HELP_INFO

OVERLAY_HEADER = XHEAD

TABLES

EXCLUDEFUN = TEXC

HELPLINES = T_LINE.

WHEN OTHERS. MESSAGE S720(SH).

ENDCASE.

Edited by: Prince on Jun 24, 2008 12:35 PM

6 REPLIES 6
Read only

Former Member
0 Likes
1,765

Hi,

DSYS_SHOW_FOR_F1HELP

AT SELECTION-SCREEN ON HELP-REQUEST FOR <MY FIELD> .

PERFORM HELP_F1.

In the routine you have to insert the code to display the text, it depends on how you want to create it.

For example I created a text by trx SO72 and this is the code to display it:

DATA: T_LINE LIKE TLINE OCCURS 0,

XHEAD LIKE THEAD,

HELP_INFO LIKE HELP_INFO,

TEXC LIKE SY-UCOMM OCCURS 0,

V_OBJECT LIKE DOKHL-OBJECT.

DATA: PREF_SIMG(4) VALUE 'SIMG',

DOCID_HY LIKE DOKHL-ID VALUE 'HY'.

CONCATENATE PREF_SIMG 'Z_MY_DOC' INTO V_OBJECT.

Estrazione testo

CALL FUNCTION 'DOCU_GET_FOR_F1HELP'

EXPORTING

ID = DOCID_HY

LANGU = SY-LANGU

OBJECT = V_OBJECT

IMPORTING

HEAD = XHEAD

TABLES

LINE = T_LINE

EXCEPTIONS

RET_CODE = 1

OTHERS = 2.

CASE SY-SUBRC .

WHEN 0.

Visualizzazione testo

GET CURSOR FIELD HELP_INFO-DYNPROFLD.

HELP_INFO-DOCUID = DOCID_HY.

HELP_INFO-DOCUOBJECT = V_OBJECT.

HELP_INFO-SPRAS = SY-LANGU.

HELP_INFO-PROGRAM = SY-REPID.

HELP_INFO-DYNPRO = SY-DYNNR.

HELP_INFO-DYNPPROG = SY-REPID.

HELP_INFO-PFKEY = SY-PFKEY.

HELP_INFO-FIELDNAME = HELP_INFO-DYNPROFLD.

CALL FUNCTION 'HELP_DOCULINES_SHOW'

EXPORTING

HELP_INFOS = HELP_INFO

OVERLAY_HEADER = XHEAD

TABLES

EXCLUDEFUN = TEXC

HELPLINES = T_LINE.

WHEN OTHERS. MESSAGE S720(SH).

ENDCASE.

Edited by: Prince on Jun 24, 2008 12:35 PM

Read only

Former Member
0 Likes
1,764

hi

CALL FUNCTION 'HELP_OBJECT_SHOW_FOR_FIELD'

EXPORTING

DOKLANGU = SY-LANGU

DOKTITLE = TEXT-002

CALLED_FOR_TAB = 'DEMOF1HELP'

CALLED_FOR_FIELD = 'FIELD1'.

reward points if useful

regard

Parhtu

Read only

Former Member
0 Likes
1,764

Hi,

Function module for F1:

DSYS_SHOW_FOR_F1HELP

For sample code check this link:

http://www.saptechnical.com/Tutorials/ABAP/F1Help/Create.htm

Regards

Adil

Edited by: Syed Abdul Adil on Jun 24, 2008 12:34 PM

Read only

Former Member
0 Likes
1,764

U can use FMs 'DSYS_SHOW_FOR_F1HELP'/1. HELP_OBJECT_SHOW_FOR_FIELD /HELP_OBJECT_SHOW

Example:

REPORT ZGB_TEST_SEARCH_HELP .

  • INTERNAL TABLE FOR STORING NAMES IN SELECTION LIST

data: begin of t_itab occurs 0,

name(10) type c,

end of t_itab.

*FIELDNAME AND TAB NAME FOR THE SELECTION

DATA :field_tab LIKE dfies OCCURS 0 WITH HEADER LINE.

*THE TABLE FOR RETURNING THE NAME OF THE SELECTED ITEM

DATA : return_tab LIKE ddshretval OCCURS 0 WITH HEADER LINE.

*START THE SELECTION SCREEN BLOCK

selection-screen begin of block ss1 with frame.

parameters: p_name1(10) type c.

selection-screen end of block ss1.

&----


*& *

*& F4 Help for p_name1 *

&----


at selection-screen on value-request for p_name1.

*CLEAR ALL EXISTING DATA

*TO BE DONE EVERYTIME F4 HELP IS REQUESTED

REFRESH t_itab.

REFRESH field_tab.

field_tab-fieldname = 'ERNAM'.

field_tab-tabname = 'VBAK'.

APPEND field_tab.

t_itab-name = 'Andrews'.

append t_itab.

t_itab-name = 'Jennie'.

append t_itab.

CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'

EXPORTING

  • DDIC_STRUCTURE = ' '

retfield = field_tab-fieldname

  • PVALKEY = ' '

  • DYNPPROG = ' '

  • DYNPNR = ' '

  • DYNPROFIELD = ' '

  • STEPL = 0

WINDOW_TITLE = 'Select name'

  • VALUE = ' '

  • VALUE_ORG = 'C'

  • MULTIPLE_CHOICE = ' '

  • DISPLAY = ' '

  • CALLBACK_PROGRAM = ' '

  • CALLBACK_FORM = ' '

  • MARK_TAB =

  • IMPORTING

  • USER_RESET =

tables

value_tab = t_itab

FIELD_TAB = field_tab

RETURN_TAB = return_tab

  • DYNPFLD_MAPPING =

EXCEPTIONS

PARAMETER_ERROR = 1

NO_VALUES_FOUND = 2

OTHERS = 3

.

IF sy-subrc <> 0.

MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

else.

p_name1 = return_tab-fieldval.

ENDIF.

&----


*& *

*& F1 Help for p_name1 *

&----


at selection-screen on help-request for p_name1.

CALL FUNCTION 'DSYS_SHOW_FOR_F1HELP'

EXPORTING

  • APPLICATION = 'SO70'

dokclass = 'TX'

DOKLANGU = SY-LANGU

dokname = 'Z_GAURAB_DEMO'

  • DOKTITLE = 'This appears as bold title'

  • HOMETEXT = ' '

  • OUTLINE = ' '

  • VIEWNAME = 'STANDARD'

  • Z_ORIGINAL_OUTLINE = ' '

  • CALLED_FROM_SO70 = ' '

  • SHORT_TEXT = ' '

  • APPENDIX = ' '

  • IMPORTING

  • APPL =

  • PF03 =

  • PF15 =

  • PF12 =

EXCEPTIONS

CLASS_UNKNOWN = 1

OBJECT_NOT_FOUND = 2

OTHERS = 3

.

IF sy-subrc <> 0.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

Regards,

Joy.

Read only

Former Member
0 Likes
1,764

Hi Abhijeet,

PARAMETERS:
  p_carrid(2) TYPE c,

DATA:
  t_f1help LIKE                        " F1 HELP INTERNAL TABLE
STANDARD TABLE
      OF helpval
    WITH HEADER LINE,

AT SELECTION-SCREEN ON HELP-REQUEST FOR p_carrid.
  CLEAR t_f1help[].
  t_f1help-fieldname = 'p_carrid'.
  t_f1help-length = 50.
  t_f1help-value = 'This is Airline Carrier ID Ex: ''AA'' ....By NARIN'
.
  APPEND t_f1help.

  CALL FUNCTION 'HELP_GET_VALUES'
    EXPORTING
      popup_title = 'CARRIER ID'
    TABLES
      fields      = t_f1help
    EXCEPTIONS
      no_entries  = 1
      OTHERS      = 2.

  IF sy-subrc EQ 1.
    MESSAGE 'No Text Found' TYPE 'I'.

  ELSEIF sy-subrc EQ 2.
    MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
            WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.

  ENDIF.                               " IF SY-SUBRC EQ 1

Hope this will clear your point.

Regards

Narin Nandivada

Read only

Former Member
0 Likes
1,764

hi.

you can try these functions:

'HELP_GET_VALUES'

DSYS_SHOW_FOR_F1HELP

FIELD_HELP

This will hepl.

Sumit Agarwal