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 for a select option selection screen without table reference

former_member764673
Participant
0 Likes
1,893

Hi All,

My requirement is to have a single char field as a select option in the selection screen. When i press F4 i should get values a, b, c, ...... to z from there i should be able to select the value for the select option.

I dont have a table field referrenece for declaring the select option. i search for a single char field in few tables and used.

Please help

1 ACCEPTED SOLUTION
Read only

sridharreddy_kondam
Active Contributor
0 Likes
963

Hi Rajanidhi,

U can handle this using the event <b>At selection-screen ON VALUE-REQUEST FOR psel_low_high</b>

To get the values use an internal table and add the values to itab and pass to the below FM..

Use this FM F4IF_INT_TABLE_VALUE_REQUEST ..

if the above one doesnt work then

look this link

http://www.sap-img.com/abap/value-request-for-parameter.htm

Regards,

Sridhar

5 REPLIES 5
Read only

sridharreddy_kondam
Active Contributor
0 Likes
964

Hi Rajanidhi,

U can handle this using the event <b>At selection-screen ON VALUE-REQUEST FOR psel_low_high</b>

To get the values use an internal table and add the values to itab and pass to the below FM..

Use this FM F4IF_INT_TABLE_VALUE_REQUEST ..

if the above one doesnt work then

look this link

http://www.sap-img.com/abap/value-request-for-parameter.htm

Regards,

Sridhar

Read only

Former Member
0 Likes
963

Hi,

Check this Demo program <b>DEMO_SELECTION_SCREEN_F4</b>

and also you can use the FM in the event at selection-screen on value-request for p_matnr.

<b>F4IF_INT_TABLE_VALUE_REQUEST</b>

Regards

vijay

Read only

Former Member
0 Likes
963

Hai Rajasekeran

TABLES : MARA.

DATA: BEGIN OF IT_MARA OCCURS 0,

MATNR LIKE MARA-MATNR,

MTART LIKE MARA-MTART,

END OF IT_MARA.

DATA : T_RETURN TYPE STANDARD TABLE OF DDSHRETVAL WITH HEADER LINE.

parameters : P_MATNR LIKE MARA-MATNR.

AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_MATNR.

SELECT MATNR MTART FROM MARA INTO table it_mara where MTART = 'ROH'.

CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'

EXPORTING

RETFIELD = 'MATNR'

DYNPPROG = SY-REPID

DYNPNR = '1000'

DYNPROFIELD = 'P_MATNR'

VALUE_ORG = 'S'

TABLES

VALUE_TAB = it_mara

RETURN_TAB = T_RETURN

EXCEPTIONS

PARAMETER_ERROR = 1

NO_VALUES_FOUND = 2

OTHERS = 3.

Thanks & regards

Sreenivasulu P

Read only

Former Member
0 Likes
963

Hi,

1) <b>F4IF_INT_TABLE_VALUE_REQUEST --> </b> F4 help that returns the values selected in an internal table. Very handy when programming your very own F4 help for a field.

*********************************************************

2) create a MATCHCODE object for your field ....

<b>MATCHCODE OBJECT mobj</b>

<b>Effect</b>On the selection screen, assigns the matchcode object mobj to the parameter.

--> On the selection screen, the matchcode object mobj is assigned to the left range limit of the selection criterion.

<b>Note</b>

The name of the matchcode object must be a constant, i.e. a value specified without quotation marks, and can be up to 4 characters long.

Thanks

Sudheer

Read only

Former Member
0 Likes
963

Hi,

Check this sample..

report  zvalue_help.
data: v_plant type werks_d.
data: begin of t_marc occurs 0,
        material type matnr,
        werks type werks_d,
      end of t_marc.


parameters: plant type werks_d,
            material type matnr.


at selection-screen on value-request for material.

  data:
    l_dynfieldtab           like dynpread occurs 1,
    l_dynfieldtab_wa        like dynpread,
    l_repid                 like sy-repid,
    l_dynnr                 like sy-dynnr.


  move : sy-repid to l_repid,
         sy-dynnr to l_dynnr.

* move selected entry to screen
* fill internal table with screen fields
  clear   l_dynfieldtab.
  refresh l_dynfieldtab.

  move 'PLANT' to l_dynfieldtab_wa-fieldname.
  append l_dynfieldtab_wa to l_dynfieldtab.


  call function 'DYNP_VALUES_READ'
    exporting
      dyname                         = l_repid
      dynumb                         = l_dynnr
    tables
      dynpfields                     = l_dynfieldtab
* EXCEPTIONS
*   INVALID_ABAPWORKAREA           = 1
*   INVALID_DYNPROFIELD            = 2
*   INVALID_DYNPRONAME             = 3
*   INVALID_DYNPRONUMMER           = 4
*   INVALID_REQUEST                = 5
*   NO_FIELDDESCRIPTION            = 6
*   INVALID_PARAMETER              = 7
*   UNDEFIND_ERROR                 = 8
*   DOUBLE_CONVERSION              = 9
*   STEPL_NOT_FOUND                = 10
*   OTHERS                         = 11
            .
  if sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
  endif.

  if sy-subrc <> 0.
    message i711(qp).    "internal error: system. adm.
  else.
  read table l_dynfieldtab into l_dynfieldtab_wa index 1.
    v_plant  = l_dynfieldtab_wa-fieldvalue.
  endif.

  select matnr werks into table t_marc
         from marc
         where werks = v_plant.

*--local data declaration
  data: lv_retfield type  dfies-fieldname,     " Field Name
        lv_maxline type i,                     " Maximum no of records
        lt_return_tab like ddshretval occurs 0 with header line.

  lv_retfield = 'MATERIAL'.
*--Calling the function module for F4 help.
  call function 'F4IF_INT_TABLE_VALUE_REQUEST'
    exporting
      retfield        = lv_retfield
      value_org       = 'S'
    tables
      value_tab       = t_marc[]
      return_tab      = lt_return_tab
    exceptions
      parameter_error = 1
      no_values_found = 2
      others          = 3.
  if sy-subrc = 0.
    read table lt_return_tab  index 1.
    material = lt_return_tab-fieldval.
  endif.

start-of-selection.
  write:/ 'F4 VALUE HELP TEST PROGRA'.

Regards

vijay