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

How to display name of the employees start with any letter?

Hi Developer,

Please guide me in solving the issues, that i need to display names of the employee starting with any letter.

example:

if i provide name of the employee starting letter 'A' it should display only those name in the database table with starting letter.

parameters: a*

it should display name with starting letter a.

example:

abdi

akbar

akash

akilesh

thanks,

ravi.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

5 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Jul 21, 2014 at 01:09 PM

    Hello,

    you mean like this?

    SELECT * FROM xyz

    WHERE name LIKE A%

    OR name LIKE a%

    Regards

    Michael

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jul 21, 2014 at 01:17 PM

    Hi Ravinder,

    DATA: it_name type table of name1.

    PARAMETER pa_name type name1.

    REPLACE '*' IN pa_name WITH '%'.

    SELECT name FROM table_name INTO TABLE it_name WHERE name LIKE pa_name.

    Regards

    Sreekanth

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Jul 21, 2014 at 01:26 PM

    Hi ravi,

    Please find the below code.

    "Data Declarations

    PARAMETERS: p_ename TYPE pa0001-ename.

    TYPES: BEGIN OF ty_pa0001,

    pernr TYPE pernr_d,

    ename TYPE pa0001-ename,

    END OF ty_pa0001.

    DATA: it_pa0001 TYPE TABLE OF ty_pa0001.

    "Merge the Percentage symbol to Employee name

    CONCATENATE p_ename '%' INTO p_ename.

    "Retrieve the value from database

    SELECT pernr

    ename

    FROM pa0001

    INTO TABLE it_pa0001

    WHERE ename LIKE p_ename.



    Regards


    Rajkumar Narasimman

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Jul 21, 2014 at 01:41 PM

    Hi Ravinder,

    You can use Ranges for this purpose:

    RANGES: r_name FOR type_name.

    r_name-sign = 'I'.

    r_name-option = 'CP'.

    r_name-low = 'a*'.

    INSERT r_name.

    SELECT name FROM table_name INTO TABLE it_name WHERE name IN r_name.


    Regards.

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Jul 21, 2014 at 01:09 PM

    Could you at least provide some detail! where do you want to do this? in a program or in PA20? Why do you want this? etc....

    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.