Skip to Content
avatar image
Former Member

select stmt offset - how can I use select stmt to fetch data.

kna1-name2 contains store#XXXXXXX where XXXXXXX is a store number. example : store#3564261.

I must fetch this. how can i fetch this ?

Can I use

WHERE substr(name2,7,10) CS gt_soldto1-store_no

or can I use

WHERE name2+7(10) CS gt_soldto1-store_no

along with for all entries IN gt_soldto1

in the below select stmt.

*SELECT *

FROM kna1

INTO corresponding fields of TABLE gt_kna1

FOR ALL ENTRIES IN gt_soldto1

WHERE substr(name2,7,10) as gt_soldto1-store_no

OR j_3astcu = gt_soldto1-store_no

THANKS IN ADV

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

3 Answers

  • Best Answer
    Oct 15, 2008 at 05:19 PM

    Try this:

    WHERE name LIKE 'store#%'.

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Oct 15, 2008 at 06:17 PM

    Something like:

    data: pattern type gt_soldto1-store_no.
    
    CONCATENATE '_______' gt_soldto1-store_no into pattern.
    
    WHERE name like pattern.

    Rob

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Oct 15, 2008 at 06:53 PM

    Easiest way would be to create another field in your table gt_soldto1 as NAME2.

    update all entries in gt_SOLD2-NAME2 as cocatenation of 'store#' + gt_SOLD2-STORE_no

    then use your select statment

    SELECT *

    FROM kna1

    INTO corresponding fields of TABLE gt_kna1

    FOR ALL ENTRIES IN gt_soldto1

    WHERE NAME2 = gt_soldto1-name2

    Add comment
    10|10000 characters needed characters exceeded