‎2007 Jan 15 7:34 AM
Hi Everyone,
i have to display branch address in a window in a script. everything's fine with the script, the prob. is with the select stmt.
this is a delivery challan... so initially the code was like this
SELECT SINGLE * FROM TVBUR
WHERE VKBUR = LIKP-VKBUR.
SELECT SINGLE * FROM ADRC
INTO B_ADRC
WHERE ADDRNUMBER = TVBUR-ADRNR.
now the problem is that there is no data in the field LIKP-VKBUR, so the alternative i thought is to get the data from VBRP table, and the common field b/w them both is VSTEL(shipping point).....
so can u pls help in writing the select stmt..
Thanks in advance,
CAPC
‎2007 Jan 15 7:44 AM
use inner join concept -
select afield1 into d_var from vkbur as A inner join vbrp as B on AVSTEL = B~VSTEL
where afield2 = 'abc' and bfield3 = 'xyz'. "use Where condition if required
or
select single vkbur into d_vkbur
from vbap where vbeln in (
select vgbel from lips where
vbeln = likp~vbeln ).
select single * from tvbur where vkbur = lv_vkbur.
‎2007 Jan 15 7:50 AM
Thanks for the reply....
but after that how do i retrieve the information from adrc??
coz the condition is based on tkbur(table)...
thanks,
capc
‎2007 Jan 15 7:54 AM
Hello,
the VKBUR is normally found in the predecessor document, which is normally a sales order. I assume that the delivery document has only one predecessor. In this case, you could write:
* Don't forget to declare the variable in the
* declaration part of your code
data lv_vkbur type vkbur.
(...)
select single vkbur into lv_vkbur
from vbap where vbeln in (
select vgbel from lips where
vbeln = likp~vbeln ).
select single * from tvbur where vkbur = lv_vkbur.
I hope this will solve your problem.
Regards Joerg
‎2007 Jan 15 8:46 AM
can i use this stmt
SELECT SINGLE * FROM TVBUR
WHERE VKBUR = LIPS-VKBUR.
instead of
SELECT SINGLE * FROM TVBUR
WHERE VKBUR = LIKP-VKBUR.
i mean lips in place of likp, would it work...
thanx in advance,
CAPC
‎2007 Jan 15 7:54 AM
Hi,
usually the delivery originates from an order. A delivery item comes from a specific order. If you use anything from standard, then check VBDKL-VBELN or go through document flow VBFA. A direct link from delivery item to order is VBAK-VBELN = LIPS-VGBEL.
In VBAK you will find the VKBUR and VKORG where you can fetch the address of.
Regards,
Clemens
‎2007 Jan 15 8:33 AM
‎2007 Jan 15 12:56 PM