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

Range

Former Member
0 Likes
1,213

hello,

how can i create a FM for Seach help which in turn will take inputs as range of values? then further fillter

it by the user's selection?

Regards,

Tamanna

1 ACCEPTED SOLUTION
Read only

former_member222860
Active Contributor
0 Likes
1,161

Hi,

you can define the ranges within the FM . sample code is here

RANGES: BELNR1 FOR BKPF-BELNR.
 REFRESH: BELNR1.

 IF NOT P_F_BELNR_HIGH IS INITIAL.
   BELNR1-LOW = P_F_BELNR_LOW.
   BELNR1-HIGH = P_F_BELNR_HIGH.
   BELNR1-SIGN = 'I'.
   BELNR1-OPTION = 'BT'.
 ELSE.
   BELNR1-LOW = P_F_BELNR_LOW.
   BELNR1-SIGN = 'I'.
   BELNR1-OPTION = 'EQ'.
ENDIF.
APPEND BELNR1.


SELECT * FROM BKPF
           INTO TABLE i_bkpf
          WHERE belnr IN belnr1.

thanks\

Mahesh

11 REPLIES 11
Read only

Former Member
0 Likes
1,161

in selection condisation u can pass the range value.

create call screen 100

PUT icon filter.

when press pass this parameters through where cluse.

Read only

Former Member
0 Likes
1,161

Hi,

Refer below links may help you.

Regards

Md.MahaboobKhan

Read only

0 Likes
1,161

hello All,

let me more specific wit my questions..

ive created a FM which takes in various values n filters it depending on the input and outputs the correspounding entries. for this to achive i used a dynamic select query.

now i want it to further enchance by passing the input parameters as range...

please suggest how i can i achive this.

Regards

Tamanna

Read only

former_member222860
Active Contributor
0 Likes
1,162

Hi,

you can define the ranges within the FM . sample code is here

RANGES: BELNR1 FOR BKPF-BELNR.
 REFRESH: BELNR1.

 IF NOT P_F_BELNR_HIGH IS INITIAL.
   BELNR1-LOW = P_F_BELNR_LOW.
   BELNR1-HIGH = P_F_BELNR_HIGH.
   BELNR1-SIGN = 'I'.
   BELNR1-OPTION = 'BT'.
 ELSE.
   BELNR1-LOW = P_F_BELNR_LOW.
   BELNR1-SIGN = 'I'.
   BELNR1-OPTION = 'EQ'.
ENDIF.
APPEND BELNR1.


SELECT * FROM BKPF
           INTO TABLE i_bkpf
          WHERE belnr IN belnr1.

thanks\

Mahesh

Read only

SuhaSaha
Product and Topic Expert
Product and Topic Expert
0 Likes
1,161

Hello Tamanna,

You have to create a range table for this.

Please see the thread below:

[input parameter with multiple values in function module|;

Hope this helps.

BR,

Suhas

Read only

Former Member
0 Likes
1,161

hello suhas,

I made the input parameters as of type range..

but i dont know how to refine my select query to give me the result depending on th selection critetia..

Regards,

Tamanna

Read only

former_member222860
Active Contributor
0 Likes
1,161

Hi,

can u paste ur code here

thanks\

Mahesh

Read only

0 Likes
1,161

hello ,

" Dynamic Select statement

TRY.

SELECT *

FROM vdarl

INTO TABLE l_tab_contract

WHERE (l_cond_syntax) .

CATCH cx_sy_dynamic_osql_error.

MESSAGE `Wrong WHERE condition!` TYPE 'I'.

ENDTRY.

here in l_cond_syntax im getting the values depending upon the user selection.,but i want it to work for range of values

regards,

Tamanna

Read only

SuhaSaha
Product and Topic Expert
Product and Topic Expert
0 Likes
1,161

Hello Tamanna,

here in l_cond_syntax im getting the values depending upon the user selection.,but i want it to work for range of values

Can you share the code how you are populating l_cond_syntax?

BR,

Suhas

Read only

Former Member
0 Likes
1,161

Hi.

If you want create serach help you can std function modules like F4IF_INT_TABLE_VALUE_REQUEST,

F4IF_DETERMINE_SEARCHHELP,

F4IF_FIELD_VALUE_REQUEST,

F4IF_INT_TABLE_VALUE_REQUEST,

'F4_SEARCH_HELP'

No need to create Z FM for that.

Regards.

Jay

Read only

former_member222860
Active Contributor
0 Likes
1,161

Hi,,

Let's say ur fieldname is field in ur where-clause

IF NOT field_LOW IS INITIAL AND NOT field_HIGH IS INITIAL.

    v_where = '& BETWEEN ''&'' AND ''&'' '.
    REPLACE '&' WITH key_field INTO v_where.
    REPLACE '&' WITH field_LOW INTO v_where.
    REPLACE '&' WITH field_HIGH INTO v_where.
    CONDENSE v_where.

select * into corresponding fields of table ITAB
             from (table_name)
            where (v_where).

hope u got it

thanks\

Mahesh