2007 Oct 09 4:33 PM
Hi All,
please let me know, if this code is right ??
I want to select data and move to ind fields,
data : w_post_code1 like adrc-post_code1,
w_post_code2 like adrc-post_code2.
SELECT single POST_CODE1 POST_CODE2 INTO
( w_post_code1 w_post_code2 ) from adrc
WHERE ADDRNUMBER eq s_adrnr .
endselect.
thank you.
madhu
2007 Oct 09 4:37 PM
Hi,
Please try this.
DATA: W_POST_CODE1 LIKE ADRC-POST_CODE1,
W_POST_CODE2 LIKE ADRC-POST_CODE2.
SELECT SINGLE POST_CODE1 POST_CODE2 INTO
(W_POST_CODE1, W_POST_CODE2) FROM ADRC
WHERE ADDRNUMBER EQ S_ADRNR .
WRITE: W_POST_CODE1, W_POST_CODE2.
Regards,
Ferry Lianto
2007 Oct 09 4:36 PM
When you are using SELECT SINGLE, ENDSELECT is not required, please remove that.
2007 Oct 09 4:37 PM
hi Madhu,
this: ( w_post_code1 w_post_code2 )
should be: (w_post_code1, w_post_code2)
(i. e. no spaces with brackets and comma between the fields)
and you don't need ENDSELECT with SELECT SINGLE
ec
2007 Oct 09 4:37 PM
Hi,
Please try this.
DATA: W_POST_CODE1 LIKE ADRC-POST_CODE1,
W_POST_CODE2 LIKE ADRC-POST_CODE2.
SELECT SINGLE POST_CODE1 POST_CODE2 INTO
(W_POST_CODE1, W_POST_CODE2) FROM ADRC
WHERE ADDRNUMBER EQ S_ADRNR .
WRITE: W_POST_CODE1, W_POST_CODE2.
Regards,
Ferry Lianto
2007 Oct 09 4:48 PM
Thank you all,
I got it now,
I was doinh 2 mistakes,
1) giving spaces between brackets
2) not using comma between 2 variables
3) using end select.
So got now. Thank you
i will close thread by alooting points .
thank you
madhu
2007 Oct 09 4:38 PM
Please use the ABAP Syntax checker before posting questions on the forum.
Ctrl+F2 would have given you the solution faster.
2007 Oct 09 4:43 PM
I've worked on SAP which was slower than an average internet connection...