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

Read values

Former Member
0 Likes
987

Hello Experts,

i have 2 select options with F4 hlp.

I want to read multiple value from selection screen for both select option .

1.Either user enter from using F4 help.

2.Or enter thru keyboard.

& in second select option fetch values in F4 help acc to values in first sect option input.

Plz suggest.

Aastha.

11 REPLIES 11
Read only

Former Member
0 Likes
958
PARAMETERS: Bukrs TYPE spfli-carrid,
name1 TYPE spfli-carrid.

AT SELECTION-SCREEN ON VALUE-REQUEST FOR name1.
CALL SCREEN 100 STARTING AT 10 5
ENDING AT 50 10.

MODULE value_list OUTPUT.
SUPPRESS DIALOG.
LEAVE TO LIST-PROCESSING AND RETURN TO SCREEN 0.
SET PF-STATUS space.
NEW-PAGE NO-TITLE.

select single bukrs from <Databasetable> into <ITAB>-BUkrs
where name1 = name1.

Write : / Itab-bukrs.
hide bukrs.
Endselect.
ENDMODULE.

AT LINE-SELECTION.
CHECK NOT name1 IS INITIAL.
LEAVE TO SCREEN 0.

OR

[F4 help|https://wiki.sdn.sap.com/wiki/display/Snippets/F4helpofonefielddependsonotherfield]

Regards,

Gurpreet

Read only

0 Likes
958

Hello Gurpreet,

Can i read values from selection screen without any event .

Plz sugggest.

Aastha

Read only

0 Likes
958

Hi Aastha,

Yes you are right we can read values from selection screen without events by using search helps...

Regards,

Siddarth

Read only

0 Likes
958

Hi,

Yes we can read without event.

Declare the variables referring to foreign key table or referenced tables:

Example:

Parameters:

P_carrid type sflight-carrid,

p_connid type sflight-connid.

Her spfli is the parent table but SFlight is forign key table.

So here what ever value you give in Carrid and press f4 on connid

value will appear based on carrid.

Hope this resolves your issue.

Regards,

Gurpreet

Read only

Former Member
0 Likes
958

HI,

consider this example it will solve ur problem:

If the requirement in selection screen is:

There are 2parameters in selection screen. For e.g. matnr and werks.

If I am giving matnr then respect to that matnr i should get only those plant in F4 help.

Solution:

AT SELECTION-SCREEN ON VALUE-REQUEST FOR werks.

select the werks based on plant in internal.table 
use f.m

F4IF_INT_TABLE_VALUE_REQUEST.
and pass the i.tab here in 

tables
value_t = i.tab

Or

Follow the psudo code below.

Note: it_matnr has only single field MATNR.

**--- Return table to handle selected field in F4 help ---**

data: it_return like ddshretval occurs 0 with header line.
 
parameters: p_matnr type marc-matnr,
                  p_werks type marc-werks.
 
at selection-screen on value-request for p_repnam.
 
  select matnr
         from marc
         into table it_matnr
         where werks eq p_werks.
 
  call function 'F4IF_INT_TABLE_VALUE_REQUEST'
    exporting
      retfield         = 'OBJ_NAME'
      dynpprog         = sy-cprog
      dynpnr           = sy-dynnr
      value_org        = 'S'
      callback_program = sy-cprog
    tables
      value_tab        = it_matnr
      return_tab       = it_return
    exceptions
      parameter_error  = 1
      no_values_found  = 2.
 
  if sy-subrc eq 0.
    loop at it_return.
      clear p_repnam.
      p_repnam = it_return-fieldval.
    endloop.
 
  endif.

regards

rahul

Read only

viquar_iqbal
Active Contributor
0 Likes
958

Hi

you can do that using function module F4IF_INT_TABLE_VALUE_REQUEST

search in sdn youll find many examples on it

You can also use search help

Thanks

Viquar Iqbal

Read only

Former Member
0 Likes
958

use AT SELECTION SCREEN ON VALUE REQUEST event

Read only

Former Member
0 Likes
958

Use FM,

DYNP_VALUES_READ

REfer this link , similar to your requirement

Edited by: Tharani on Feb 19, 2009 7:37 AM

Read only

Former Member
0 Likes
958
Read only

Subhankar
Active Contributor
0 Likes
958

Hi ...

Use the Functio module 'DYNP_VALUES_READ to get the value of the section screen parameter.

  • Get the selection screen value dynamically

call function 'DYNP_VALUES_READ'

exporting

dyname = sy-repid " Program name

dynumb = sy-dynnr " Screen number

tables

dynpfields = l_i_dynp

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.

  • Put the screen value in the select-options

read table l_i_dynp into l_wa_dynp index 1." For single value

s_prog-low = l_wa_dynp-fieldvalue.

endif.

Read only

Former Member
0 Likes
958

Hello Subhankar,

In which event we call fm DYNP_VALUES_READ .

Aastha