Application Development 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: 

FM 'VIEW_MAINTENANCE_CALL'

former_member182371
Active Contributor
0 Kudos

Hi,

i´m developing a program that has a selection screen.

The user inputs individual values and a maintenance view of a table is displayed.

i´m using FM '

VIEW_MAINTENANCE_CALL

'. Until now i´ve just been able to use it passing single values (via parameter in the selection screen).

How can i pass a select-option range of values to this function module.

Best regards.

1 ACCEPTED SOLUTION

former_member182371
Active Contributor
0 Kudos

Hi,

what i´m refering to is the values of table DBA_SELLIST.

In order to display a single value of the maintenance view i´d do somethine like:

i_sel-viewfield = 'KUNNR'.

i_sel-operator = 'EQ'.

i_sel-value = p_kunnr. (parameter in selection screen)

APPEND i_sel.

CLEAR i_sel.

this works ok, but my problem is that i don´t know how to select a range of values in case of a select-options via selections creen.

Best regards

7 REPLIES 7

Former Member
0 Kudos

Hi ,

I do not think you can pass more than one table to that FM at a time.

You need to call it several times for that purpose.

Regards,

Sandip Panigrahi.

Former Member
0 Kudos

hi casadillo,

in case you are referring to the tables parameter DBA_SELLIST, then it seems to me that you have to manually split the select-options in your <b>at selection-screen</b> event.

reading the documentation for the function module should give you a hint - you have to manipulate the operator.

regards,

anand mandalika.

former_member182371
Active Contributor
0 Kudos

Hi,

what i´m refering to is the values of table DBA_SELLIST.

In order to display a single value of the maintenance view i´d do somethine like:

i_sel-viewfield = 'KUNNR'.

i_sel-operator = 'EQ'.

i_sel-value = p_kunnr. (parameter in selection screen)

APPEND i_sel.

CLEAR i_sel.

this works ok, but my problem is that i don´t know how to select a range of values in case of a select-options via selections creen.

Best regards

0 Kudos

yes, that is exactly what i'm talking about.

let us say you have a select-option for kunnr - s_kunnr. the user enters 1 to 100 on the selection screen. you will have to do something like this -

i_sel-viewfield = 'KUNNR'.

loop at s_kunnr.
  if s_kunnr-option eq 'I'.
    if s_kunnr-option eq 'BT'.
      i_sel-operator = 'GE'.
      i_sel-value    = s_kunnr-low. 
      APPEND i_sel.
      CLEAR i_sel.

      i_sel-operator = 'LE'.
      i_sel-value    = s_kunnr-high. 
      APPEND i_sel.
      CLEAR i_sel.
    endif. 
  endif.
endloop. 

similarly, you will have to handle the other possible inputs for the select-options.

regards,

anand mandalika.

0 Kudos

hey did you take a look at the FM VIEW_RANGETAB_TO_SELLIST?

regards,

anand mandalika.

former_member182371
Active Contributor
0 Kudos

Hi Poornanad,

what i´ve finally done is to create a macro thus:

  • &1 = s_numde

  • &2 = s_numde-sign

  • &3 = s_numde-option

  • &4 = s_numde-low

  • &5 = s_numde-high

  • &6 = 'NUMDE' (nb.campo)

DEFINE seleccion->.

LOOP AT &1.

CASE &2.

WHEN 'I'.

CASE &3.

WHEN 'BT'.

i_sel-operator = 'GE'.

i_sel-value = &4.

i_sel-viewfield = &6.

i_sel-and_or = 'AND'.

APPEND i_sel.

CLEAR i_sel.

i_sel-operator = 'LE'.

i_sel-value = &5.

i_sel-viewfield = &6.

i_sel-and_or = 'AND'.

APPEND i_sel.

CLEAR i_sel.

WHEN 'EQ'.

i_sel-operator = 'EQ'.

i_sel-value = &4.

i_sel-viewfield = &6.

i_sel-and_or = 'AND'.

APPEND i_sel.

CLEAR i_sel.

ENDCASE.

WHEN 'E'.

CASE s_numde-option.

WHEN 'BT'.

i_sel-operator = 'LT'.

i_sel-value = &4.

i_sel-viewfield = &6.

i_sel-and_or = 'OR'.

APPEND i_sel.

CLEAR i_sel.

i_sel-operator = 'GT'.

i_sel-value = &5.

i_sel-viewfield = &6.

i_sel-and_or = 'AND'.

APPEND i_sel.

CLEAR i_sel.

WHEN 'EQ'.

i_sel-operator = 'NE'.

i_sel-value = &4.

i_sel-viewfield = &6.

i_sel-and_or = 'AND'.

APPEND i_sel.

CLEAR i_sel.

ENDCASE.

ENDCASE.

ENDLOOP.

END-OF-DEFINITION.

and y use it this way:

AT SELECTION-SCREEN.

CLEAR i_sel.

REFRESH i_sel.

seleccion-> s_numde s_numde-sign s_numde-option

s_numde-low s_numde-high 'NUMDE'.

Best regards.

0 Kudos

Hello Casladillo,

Having a macro for this is a good idea. But since there's a function module already available for this purpose, I would still strongly recommend using that.

If you have noticed, the Function Module has been created to handle exactly this kind of a situation.

And anyday, using a standard FM will always make your code more maintainable. Someone else who's looking at your code doesn't have to spend too much time and effort trying to understand what your code is doing.

Regards,

Anand Mandalika.