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

Select options having wrong value from F4

Former Member
0 Likes
792

Halo Experts,

I am doing a selection screen select options parameter s_id .The f4 value help for s_id should return multiple values to it

So I am doing the following code


tables: zscct.
data lt_scct type table of  zscct.

selection-screen begin of block b0k with frame title text-k01.
select-options : s_id  for zscct-id.
selection-screen end of block b0k.

at selection-screen on value-request for s_id-low.

  data lt_return_tab like ddshretval occurs 0 with header line.
  refresh: lt_return_tab.

  select * from zscct into table lt_scct.

  call function 'F4IF_INT_TABLE_VALUE_REQUEST'
  exporting
*   DDIC_STRUCTURE         = ' '
    retfield               = 'ID'
*   PVALKEY                = ' '
    dynpprog               = sy-repid
    dynpnr                 = sy-dynnr
 dynprofield            = 'S_ID'
*   STEPL                  = 0
*   WINDOW_TITLE           =
*   VALUE                  = ' '
   value_org              = 'S'
    multiple_choice        = 'X'
*    DISPLAY                = 'X'
*   CALLBACK_PROGRAM       = ' '
*   CALLBACK_FORM          = ' '
*   MARK_TAB               =
* IMPORTING
*   USER_RESET             =
  tables
    value_tab              = lt_scct
*   FIELD_TAB              =
return_tab             = lt_return_tab
*   DYNPFLD_MAPPING        =
* EXCEPTIONS
*   PARAMETER_ERROR        = 1
*   NO_VALUES_FOUND        = 2
*   OTHERS                 = 3
          .
  break-point.

  loop at lt_return_tab .
    s_id-low = lt_return_tab-fieldval.
    s_id-option = 'EQ'.
    s_id-sign = 'I'.
    s_id-high = space.
    append s_id.
  endloop.

i selected ids 0001 0002 0003 from the value_tab and return_tab is having those fieldval and s_id is filled accordingly.

But when the screen is being displayed , s_id values are 0003 0002 0003 and not 0001 0002 0003.

Here the first value is getting replaced by the last value . May be this is because the s_id header line is clearing off the first line.

Is there any solution so that I get the correct values in select option s_id.

Regards

Kallu

1 ACCEPTED SOLUTION
Read only

uwe_schieferstein
Active Contributor
0 Likes
605

Hello Kallu

Have you tried already the following approach::


...
  loop at lt_return_tab .
    s_id-low = lt_return_tab-fieldval.
    s_id-option = 'EQ'.
    s_id-sign = 'I'.
    s_id-high = space.
    append s_id.
  endloop.

READ TABLE s_id INDEX 1.  " <<<

Regards

Uwe

3 REPLIES 3
Read only

uwe_schieferstein
Active Contributor
0 Likes
606

Hello Kallu

Have you tried already the following approach::


...
  loop at lt_return_tab .
    s_id-low = lt_return_tab-fieldval.
    s_id-option = 'EQ'.
    s_id-sign = 'I'.
    s_id-high = space.
    append s_id.
  endloop.

READ TABLE s_id INDEX 1.  " <<<

Regards

Uwe

Read only

0 Likes
605

Halo Uwe,

It solved my problem . But dont understand why the problems occur .

You are a real genius boss . You always provide straight forward answers and I am worried why I am not able to think in that simple and straight forward manner .

If given a chance , I would love to accept you as a Mentor in SAP.

Regards

Kallu

Read only

0 Likes
605

Hello Kallu

Perhaps one explanation might be that I am NOT an IT guy but a scientist (to be more precise: Biochemist) and that is the way how I try to solve problem:

Developing a hypothesis, challenge it by systematic "experiments" (sometimes extended to "trial & error"), and, if required, dismiss my original idea and find a new one which fits to the available observations.

Regards

Uwe