01-25-2010 8:20 AM
hi,
my questions is
go to LFA1 fetch ADRNR pass ADRNR into ADRC ,
Fetch address data,
i.e stree hous no: ADRC-STREET,
street 4: adrc-str suppl3 ,
street 5: adrc-location ,
city: adrc-city1 ,
pin code : adrc-postcode1 ,
region: adrc-region ,
country: adrc-country .
source code which i worte:
Moderator message - Please respect the 2,500 character maximum when posting. Post only the relevant portions of code
iam not able to get or pass adrnr field of lfa1 to adrc .
please can you help me.
Edited by: swami rajesh on Jan 25, 2010 9:21 AM
Edited by: Rob Burbank on Jan 26, 2010 2:42 PM
01-25-2010 8:29 AM
hi
Please check the logic.What is the input of your program?
select * into CORRESPONDING FIELDS OF table it_lfa1 from lfa1
WHERE ADRNR = LFA1-ADRNR.
where you r getting LFA1-ADRNR. ?
select * into corresponding fields of table it_itab from adrc
for all entries in it_lfa1 where adrnr = it_lfa1-adrnr.
01-25-2010 9:12 AM
select single adrnr into it_lfa1
from lfa1 .
then also iam not able to append it. plz can you help me
01-25-2010 10:20 AM
hi
Debug it.
Please check the sy-subrc , Structure and where condition
01-26-2010 7:38 PM
Do the following...
data : p_lifnr like lfa1-lifnr,
v_adrnr like adrc-adrnr.
Select single adrnr from lfa1 into v_adrnr where lifnr eq p_lifnr.
Here p_lifnr is the vendor number from your selection.
Once you get the address number into v_adrnr pass this value to adrc table.
Select * from adrc
into corresponding fields of it_itab
where adrnr eq v_adrnr.
you will get all the address information to your internal table...
then you can dilsply the alv report using this internal table.
Thanks
Govi
01-28-2010 9:52 AM
yes ! govi is exactly correct.
follow his coding.
you iwll definitely get all the details
01-28-2010 12:49 PM
try something like this:
data: lv_adrnr type ADRNR.
data: ls_adrc type adrc.
parameters: p_lifnr type lifnr.
. . . .
clear: lv_adrnr, ls_adrc.
select single adrnr from lfa1 into lv_adrnr where lifnr eq p_lifnr.
if sy-subrc eq 0.
select * from adrc into ls_adrc up to 1 rows "full key not supplied...so want only one row
where addrnumber eq lv_adrnr
and date_from le sy-datum
and date_to ge sy-datum "...(or maybe eq date_9999 ( declared as type d value '99991231')...
endselect.
. . . .