‎2007 Jan 25 7:58 AM
hi,
i am new to abap ,i have a query, in selection screen there are three inputs,like cus no,ven no,po num, suppose ven no is not given as input(it is empty).i had to write a condition for that if ven no is not given then select it from some other table.hou can do this,can any body provide some code,
thanks in advance
‎2007 Jan 25 8:03 AM
Hi Venkat
Please try to build a logic similar to below:
parameters: p_cus type kunnr,
p_ven type lifnr,
p_po type ebeln.
data: tab type tabname.
start-of-selection.
if p_ven is initial.
tab = 'TABLE1'.
else.
tab = 'TABLE2'.
endif.
select fld1 fld2
into table itab
from (tab)
where (cond).Kind Regards
Eswar
‎2007 Jan 25 8:01 AM
hi Venkat,
WELCOME TO SDN...
at selection-screen.
select single * from lfa1 where lifnr = s_lifnr.
if sy-subrc <> 0.
message e100 with ' No vendor exists in the specified table'.
endif.Regards,
Santosh
‎2007 Jan 25 8:03 AM
Hi Venkat
Please try to build a logic similar to below:
parameters: p_cus type kunnr,
p_ven type lifnr,
p_po type ebeln.
data: tab type tabname.
start-of-selection.
if p_ven is initial.
tab = 'TABLE1'.
else.
tab = 'TABLE2'.
endif.
select fld1 fld2
into table itab
from (tab)
where (cond).Kind Regards
Eswar
‎2007 Jan 25 8:04 AM
parameters: p1 like pa0001-pernr,
p2 like pa0001-plans,
p3 like pa0001-begda.
start-of-selection.
if p1 is initial.
select single pernr into p1 from pa0001.
endif.
write p1.