Skip to Content
author's profile photo Former Member
Former Member

select with wild card like '*'

Hello All,

I am creating a RFC FM to return a list of vendors ( stored in a Z table). Import parameters are lifnr, name1 and couple other custom fields from Z table. If the FM is executed with wild card '*' in field LIFNR, it should return all the vendors, Same with all other fields too. I mean to say, it should work like a regular search help. So, do I need to write select statements or create a search help and somehow incorporate that search help in the FM? Please guide me what to do and how to do?

Thanks in advance,

Chandni

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Oct 26, 2006 at 09:16 PM

    Hi,

    Check this example..

    TABLES: KNA1.

    PARAMETERS: P_NAME1 TYPE KNA1-NAME1.

    RANGES: R_NAME1 FOR KNA1-NAME1.

    DATA: T_KNA1 LIKE KNA1 OCCURS 0 WITH HEADER LINE.

    *Build the range for the name1 *

    R_NAME1-SIGN = 'I'.

    R_NAME1-OPTION = 'CP'.

    CONCATENATE '' P_NAME1 '' INTO R_NAME1-LOW.

    APPEND R_NAME1.

    SELECT * FROM KNA1

    INTO TABLE T_KNA1

    WHERE NAME1 IN R_NAME1.

    LOOP AT T_KNA1.

    WRITE: / T_KNA1-KUNNR, T_KNA1-NAME1.

    ENDLOOP.

    Thanks,

    naren

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Oct 26, 2006 at 08:51 PM

    I suppose the easiest thing to do would be take the parameter, parse it to see if it is "*" and pass it to a range table for the SELECT.

    What would you do if the parameter is somethinglike "1*"?

    (A better way would be to pass a range table to the FM.)

    Rob

    Message was edited by: Rob Burbank

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.