2007 Apr 02 1:12 PM
I have two query like this
Query1.
SELECT SINGLE adrnr
INTO addr FROM lfa1
WHERE sortl = it_behdr-zzchanumber.
SELECT SINGLE name1 name2 name3 street house_num1 str_suppl1
str_suppl2 city1 post_code1
INTO (w_cname1, w_cname2, w_cname3, w_cstreet,w_chouse_num1,
w_cstr_suppl1, w_cstr_suppl2, w_ccity1, w_cpost_code1)
FROM adrc
WHERE addrnumber = addr.
Query2
SELECT SINGLE adrnr
INTO addr FROM Kna1
WHERE kunnr = it_behdr-kunnr.
SELECT SINGLE name1 name2 name3 street house_num1 str_suppl1
str_suppl2 city1 post_code1
INTO (w_cname1, w_cname2, w_cname3, w_cstreet,w_chouse_num1,
w_cstr_suppl1, w_cstr_suppl2, w_ccity1, w_cpost_code1)
FROM adrc
WHERE addrnumber = addr.
*************************************************
In these i need help like this,
In second query for customer the variables should have to change , Please do this.
Thanks
2007 Apr 02 1:29 PM
Query2
SELECT SINGLE adrnr
INTO addr FROM Kna1
WHERE kunnr = it_behdr-kunnr.
SELECT SINGLE name1 name2 name3 street house_num1 str_suppl1
str_suppl2 city1 post_code1
INTO (w_cname1, w_cname2, w_cname3, w_cstreet,w_chouse_num1,
w_cstr_suppl1, w_cstr_suppl2, w_ccity1, w_cpost_code1)
FROM adrc
WHERE addrnumber = <b>addr-adrnr</b>.
CLOSE DUPLICATE THREADS AWARDING POINTS.....
null
2007 Apr 02 1:17 PM
Hi Ali,
Change the query as follows as you need to get of the customer. Use ADRNR of ADDR to get the address of the customer from KNA1.
SELECT SINGLE name1 name2 name3 street house_num1 str_suppl1
str_suppl2 city1 post_code1
INTO (w_cname1, w_cname2, w_cname3, w_cstreet,w_chouse_num1,
w_cstr_suppl1, w_cstr_suppl2, w_ccity1, w_cpost_code1)
FROM adrc
WHERE addrnumber = <b>addr-ADRNR</b>.
Thanks,
Vinay
2007 Apr 02 1:29 PM
Query2
SELECT SINGLE adrnr
INTO addr FROM Kna1
WHERE kunnr = it_behdr-kunnr.
SELECT SINGLE name1 name2 name3 street house_num1 str_suppl1
str_suppl2 city1 post_code1
INTO (w_cname1, w_cname2, w_cname3, w_cstreet,w_chouse_num1,
w_cstr_suppl1, w_cstr_suppl2, w_ccity1, w_cpost_code1)
FROM adrc
WHERE addrnumber = <b>addr-adrnr</b>.
CLOSE DUPLICATE THREADS AWARDING POINTS.....
null
2007 Apr 02 1:42 PM
Hi..
Try this..
Create One internnal table..(itab)
For this fields..
w_cname1, w_cname2, w_cname3, w_cstreet,w_chouse_num1,
w_cstr_suppl1, w_cstr_suppl2, w_ccity1, w_cpost_code1
named as itab..
Then write ur first query ..
SELECT SINGLE name1 name2 name3 street house_num1 str_suppl1
str_suppl2 city1 post_code1
INTO corresponding fields of table itab FROM adrc
WHERE addrnumber = addr.
Then write the second query ..
SELECT SINGLE name1 name2 name3 street house_num1 str_suppl1
str_suppl2 city1 post_code1
APPENDING CORRESPONDING FIELDS OF TABLE itab FROM adrc
WHERE addrnumber = addr.
Hope this will helps..
Reward all useful answers.
Regards
Bala..