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

F4 help

Former Member
0 Likes
1,311

I have a parameter & select-option in my selection screen. Based on the entered parameter I need to create an f4 help for my select-option. send me a piece of code.

10 REPLIES 10
Read only

Former Member
0 Likes
1,273

This message was moderated.

Read only

faisalatsap
Active Contributor
0 Likes
1,273

>

> I have a parameter & select-option in my selection screen. Based on the entered parameter I need to create an f4 help for my select-option. send me a piece of code.

Hi,

Test following Sample code hope will solve out your problem I have tested it is working fine.

TABLES: t001w, t001l.
 
parameters p_werks LIKE t001w-werks .
SELECT-OPTIONS g_lgort FOR t001l-lgort NO-EXTENSION NO INTERVALS.
 
DATA: i_return TYPE ddshretval OCCURS 0 WITH HEADER LINE,
      c TYPE c VALUE 'S'.
 
* Search Help for LGORT
AT SELECTION-SCREEN ON VALUE-REQUEST FOR g_lgort-low.
 
  TYPES: BEGIN OF t_lgort,
    lgort LIKE t001l-lgort,
  END OF t_lgort.
 
  DATA: it_lgort TYPE STANDARD TABLE OF t_lgort WITH HEADER LINE.
 
  SELECT DISTINCT lgort
    INTO CORRESPONDING FIELDS OF TABLE it_lgort
    FROM t001l
    WHERE werks = p_werks.
 
  SORT it_lgort BY lgort.
 
  CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
    EXPORTING
      retfield    = 'G_WERKS'
      dynpprog    = sy-repid
      dynpnr      = sy-dynnr
      dynprofield = 'G_WERKS'
      value_org   = c
    TABLES
      value_tab   = it_lgort
      return_tab  = i_return.

Please Don't forget to Press Enter Button after Giving the Value in the first parameter

Please Reply if any Issue.

Kind Regards,

Faisal

Edited by: Faisal Altaf on Feb 17, 2009 2:33 AM

Read only

0 Likes
1,273

i m still not able to get the f4..

can u explain some more

Read only

Former Member
0 Likes
1,273

Hi,

use this FM

F4IP_INT_TABLE_VALUE_REQUEST

or

F4_IF_FIELD_VALUE_REQUEST

Regards

Kiran

Read only

Former Member
0 Likes
1,273

Hi,

Check this..

PARAMETERS : P_WERKS TYPE MARC-WERKS.

PARAMETERS: P_PLNNR ..

PARAMETERS : P_PLNAL...


AT SELECTION-SCREEN ON P_PLNNR.
data:
    lg_condition    type string.

  data:
     lwa_ddshretval type ddshretval,
     lwa_dselc      type dselc,
     lwa_dynpread   type dynpread.
  data:
     li_f4_insp     type standard table of t_f4_insp,
     li_ddshretval  type standard table of ddshretval,
     li_dselc       type standard table of dselc,
     li_dynpread    type standard table of dynpread.


  lwa_dynpread-fieldname = 'P_WERKS'.
  append lwa_dynpread to li_dynpread.
  clear lwa_dynpread.
* Read Screen Field Values.
  call function 'DYNP_VALUES_READ'
    exporting
      dyname     = sy-repid
      dynumb     = sy-dynnr
    tables
      dynpfields = li_dynpread.

* Read the first record as only one record will be present
  read table li_dynpread into lwa_dynpread index 1.
  p_werks = lwa_dynpread-fieldvalue.

  if p_werks is initial.
    move 'PLNTY EQ ''Q''' to lg_condition.
  else.
    move 'WERKS EQ P_WERKS AND PLNTY EQ ''Q''' to lg_condition.
  endif.

* Fetch Data
  select werks
         plnnr
         plnal
         plnty
         ktext
    into table li_f4_insp
    from plko
    where (lg_condition).

  lwa_dselc-fldname = 'F0002'.
  lwa_dselc-dyfldname = 'PLNNR'.
  append lwa_dselc to li_dselc.
  clear lwa_dselc.
  lwa_dselc-fldname = 'F0003'.
  lwa_dselc-dyfldname = 'PLNAL'.
  append lwa_dselc to li_dselc.
  clear lwa_dselc.
* FM For F4 Help
  call function 'F4IF_INT_TABLE_VALUE_REQUEST'
    exporting
      retfield        = 'PLNNR'
      dynpprog        = sy-cprog
      dynpnr          = sy-dynnr
      dynprofield     = 'PLNNR'
      value_org       = 'S'
    tables
      value_tab       = li_f4_insp
      return_tab      = li_ddshretval
      dynpfld_mapping = li_dselc
    exceptions
      parameter_error = 1
      no_values_found = 2
      others          = 3.

  if sy-subrc eq 0.
    refresh li_dynpread.
    read table li_ddshretval into lwa_ddshretval index 1.
    if sy-subrc eq 0.
      move lwa_ddshretval-fieldval to p_plnnr.
      lwa_dynpread-fieldname = 'P_PLNNR'.
      lwa_dynpread-fieldvalue = lwa_ddshretval-fieldval.
      append lwa_dynpread to li_dynpread.
      clear lwa_dynpread.
    endif.                             " IF sy-subrc EQ 0.
    read table li_ddshretval into lwa_ddshretval index 2.
    if sy-subrc eq 0.
      move lwa_ddshretval-fieldval to p_plnal.
      lwa_dynpread-fieldname = 'P_PLNAL'.
      lwa_dynpread-fieldvalue = lwa_ddshretval-fieldval.
      append lwa_dynpread to li_dynpread.
      clear lwa_dynpread.
    endif.                             " IF sy-subrc EQ 0.
  endif.                               " IF sy-subrc EQ 0.

* Set Screen Field Values.
  call function 'DYNP_VALUES_UPDATE'
    exporting
      dyname               = sy-repid
      dynumb               = sy-dynnr
    tables
      dynpfields           = li_dynpread
    exceptions
      invalid_abapworkarea = 1
      invalid_dynprofield  = 2
      invalid_dynproname   = 3
      invalid_dynpronummer = 4
      invalid_request      = 5
      no_fielddescription  = 6
      undefind_error       = 7
      others               = 8.

  check sy-subrc eq 0.

Read only

Former Member
0 Likes
1,273

Hi,

Try to use the function module CBIH_LB22_PHRASE_VALUE_REQUEST .

Hope this will helps you

Regards,

Rajani

Read only

Former Member
0 Likes
1,273

Hi,

AT SELECTION-SCREEN ON VALUE-REQUEST FOR SER_NO.

PERFORM SERRNO.

FORM SERRNO .

CALL FUNCTION 'F4IF_FIELD_VALUE_REQUEST'

EXPORTING

tabname = u2018dbtable'

fieldname = 'field'

SEARCHHELP = 'custom search help' e.g., Z_SH_SERNR1

  • SHLPPARAM = ' '

DYNPPROG = SY-CPROG

DYNPNR = SY-DYNNR

DYNPROFIELD = 'screen field ' SERNR1

  • STEPL = 0

  • VALUE = ' '

  • MULTIPLE_CHOICE = ' '

  • DISPLAY = ' '

  • SUPPRESS_RECORDLIST = ' '

CALLBACK_PROGRAM = 'SY-CPROG'

  • CALLBACK_FORM = ' '

TABLES

RETURN_TAB = T_RETURN

  • EXCEPTIONS

  • FIELD_NOT_FOUND = 1

  • NO_HELP_FOR_FIELD = 2

  • INCONSISTENT_HELP = 3

  • NO_VALUES_FOUND = 4

  • OTHERS = 5

.

IF sy-subrc <> 0.

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

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

ENDIF.

ENDFORM.

Thanks & Regards

GP

Read only

Former Member
0 Likes
1,273

**if suppose ur parameter is s_pbdnr (pbim-pbdnr)requirement plan no (it doesnt have f4 help)

**given CODE to create f4 help for S_PBDNR-LOW .follow these steps FOR S_PBDNR-HIGH also:

*step 1.

in the initialization event : write this code

SELECT pbdnr FROM pbim INTO TABLE it_f4 WHERE pbdnr NE ' '.

*filling unique pbdnr values from table it_f4 into it_f41.

SORT it_f4 BY pbdnr.

LOOP AT it_f4.

AT END OF pbdnr.

it_f41-pbdnr = it_f4-pbdnr.

APPEND it_f41.

ENDAT.

ENDLOOP.

step 2.

.AT SELECTION-SCREEN ON VALUE-REQUEST FOR s_pbdnr-low.

CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'

EXPORTING

retfield = 'S_PBDNR'

dynpprog = sy-repid

dynpnr = sy-dynnr

dynprofield = 'S_PBDNR-LOW'

value_org = 'S'

TABLES

value_tab = it_f41[]

EXCEPTIONS

parameter_error = 1

no_values_found = 2

OTHERS = 3

.

i think its quite helpful to you......

Read only

Former Member
0 Likes
1,273

Hi,

Call this FM 'F4IF_INT_TABLE_VALUE_REQUEST'

Regards,

Jyothi CH,

Read only

Former Member
0 Likes
1,273

Hi,

look into the below code.

REPORT ZVTEST2.

TABLES: ekpo.

DATA: BEGIN OF ITAB1 OCCURS 0,

EBELN TYPE EBELN,

MATKL TYPE MATKL,

END OF ITAB1.

DATA: RETURN_TAB TYPE TABLE OF DDSHRETVAL.

DATA: BEGIN OF DYNPFIELDS OCCURS 0.

INCLUDE STRUCTURE DYNPREAD.

DATA: END OF DYNPFIELDS.

PARAMETER: P1 LIKE EKPO-EBELN.

select-OPTIONS: p2 for ekpo-matkl.

AT SELECTION-SCREEN ON VALUE-REQUEST FOR P2-low.

CLEAR DYNPFIELDS.

REFRESH DYNPFIELDS.

DYNPFIELDS-FIELDNAME = 'P1'.

APPEND DYNPFIELDS.

CALL FUNCTION 'DYNP_VALUES_READ'

EXPORTING

DYNAME = SY-REPID

DYNUMB = SY-DYNNR

TABLES

DYNPFIELDS = DYNPFIELDS

EXCEPTIONS

OTHERS = 01.

IF SY-SUBRC = 0.

READ TABLE DYNPFIELDS WITH KEY FIELDNAME = 'P1'.

IF SY-SUBRC = 0.

P1 = DYNPFIELDS-FIELDVALUE.

ENDIF.

ENDIF.

SELECT EBELN MATKL FROM EKPO INTO TABLE ITAB1 WHERE EBELN = P1.

CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'

EXPORTING

  • DDIC_STRUCTURE = ' '

RETFIELD = 'MATKL'

  • PVALKEY = ' '

DYNPPROG = SY-REPID

DYNPNR = SY-DYNNR

DYNPROFIELD = 'P1'

VALUE_ORG = 'S'

TABLES

VALUE_TAB = ITAB1

RETURN_TAB = RETURN_TAB

.

IF SY-SUBRC <> 0.

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

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

ENDIF.

repeat the same for p2-high similar to p2-low.

regards,

vinod