2006 Sep 25 10:12 AM
hi
i want to validate my selection screen.my scinerio is----->
inventry doc no in selection screen, i want to validate by ikpf-zsat='x' and vgart = 'ib' and date = '20006' (sy -datum.)
this is wm report inv doc no is in ztable.if it not correct has to give error message .. pls give me sugession and code ..urgent ..advance thanks...
regards
veera
2006 Sep 25 10:16 AM
Hi,
START-OF-SELECTION.
Select zsat
vgart
into ( l_zsat , l_vgart )
from ikpf
where IBLNR = p_inv_doc.
if sy-subrc ne 0.
message e001.
elseif l_zsat ne `X`.
message e002.
elseif l_vgart ne `ib`.
message e003.
endif.
if p_Date ne sy-datum.
message e004.
endif.
Best regards,
Prashant
2006 Sep 25 10:17 AM
parameters : p_IBLNR type ikpf-IBLNR.
data : w_IBLNR type ikpf-IBLNR.
at selection screen on p_iblnr.
select single iblnr from (ztable)
into w_iblnr
where iblnr eq p_iblnr
and zsat = 'X'
and vgart = 'ib'
and date eq sy-datum.
if sy-subrc ne 0.
message e398(00) with 'Wrong' 'Inventory Doc'.
endif.
2006 Sep 25 10:43 AM
hi
My validation field is in separate standard table 'ikpk' .how can i like in same select query of ztable...
regards
veera
2006 Sep 25 10:48 AM
hi
My validation field zstat, vgart ,sy-datum is in separate standard table 'ikpk' .how can i link in same select query of ztable...
regards
veera
2006 Sep 25 11:00 AM
<b>at selection screen on p_iblnr.
select single Z~iblnr
from ztable as Z inner join ikpf as i on
ziblnr = iiblnr
into w_iblnr
where Z~iblnr eq p_iblnr
and i~zstat = 'X'
and I~vgart = 'IB'
and i~gjahr eq sy-datum(4).
if sy-subrc ne 0.
message e398(00) with 'Wrong' 'Inventory Doc'.
endif.</b>
Try the above code it should work as per your requirement
Message was edited by: Anurag Bankley
2006 Sep 25 10:32 AM
AT SELECTION-SCREEN
SELECT ZSAT INTO IKPF-ZSAT FROM ZTABLE WHERE ZSAT = 'X'.
IF SY-SUBRC <> 0.
MESARG 'DATA NOT FOUND'.
ENDIF.
SELECT VGART INTO IKPF-VGART FROM ZTABLE WHERE VGART = 'iB'.
IF SY-SUBRC <> 0.
MESARG 'DATA NOT FOUND'.
ENDIF.
2006 Sep 25 11:02 AM
Helo ,
For validations in reporting .
could you please provide the clear picture of ur validation scenario so that i can give you the correct code .
I mean which fields are u r validating wht is the picture of the selectinscreen .
2006 Sep 25 11:04 AM
Hi Veera,
do like this.
at selection-screen.
select ilbnr from ztable into table i_iblnr
where ilbnr in s_ilbnr (if its a select-option)
where ilbnr = p_ilbnr(if it is a parameter).
if not i_iblnr[] is initial.
select zstat vgart gjahr
from ikpf for all entries in i_iblnr
where zstat = 'X'
and vgart = 'IB'
and gjahr = '2006'.
if sy-subrc ne 0.
throw error message.
endif.
endif.
Regards,
Nagaraj
2006 Sep 25 12:21 PM
hi nagaraj ,
the following syntax error is thrown ....
(Field list without INTO clause is not allowed. itab" OR "INTO
(f1,...,fn)" is not allowed.)
at selection-screen.
select iblnr from ziseg into table it_iseg where iblnr = p_iblnr.
if not it_iseg[] is initial.
the following code i have return...
select zstat vgart gjahr from ikpf for all entries in it_iseg where zstat <> 'X'
and vgart = 'IB'
and gjahr = '2006'.
if sy-subrc ne 0.
message e398(00) with 'Wrong' 'Inventory Doc Number'.
endif.
regards
veeera
2006 Sep 25 2:03 PM
Hi veera,
sorry i missed one statement.
at selection-screen.
select ilbnr from ztable into table i_iblnr
where ilbnr in s_ilbnr (if its a select-option)
where ilbnr = p_ilbnr(if it is a parameter).
if not i_iblnr[] is initial.
select zstat vgart gjahr
from ikpf into i_ikpf
for all entries in i_iblnr
where zstat = 'X'
and vgart = 'IB'
and gjahr = '2006'.
if sy-subrc ne 0.
throw error message.
endif.
endif.
i missed the into clause .
Now try like above
Reagrds,
Nagaraj
2006 Sep 25 4:34 PM
HI
IAM WRITING SELECTION SCREEN VALIDATION .IAM USING FOR ALL ENTRIES SELECT STATEMENT..AS LIKE
select zstat vgart gjahr from ikpf into CORRESPONDING FIELDS OF TABLE IT_ik1 for all entries in it_iblnr
where zstat = 'X'
and vgart = 'IB'
and gjahr = '2006'.
THERE IS SYNTAX ERROR ...LIKE BELOW ..CAN ANY ONE CORRECT IT..
(The WHERE condition does not refer to the FOR ALL ENTRIES table. -) ........URGENT...
REGARDS
VEERA
2006 Sep 25 4:40 PM
error is obvious bcoz u r using FOR ALL ENTRIES and u r not not referring any field from table it_iblnr
so change like this
select zstat vgart gjahr from ikpf into CORRESPONDING FIELDS OF TABLE IT_ik1 for all entries in it_iblnr
where zstat = 'X'
and vgart = 'IB'
and gjahr = '2006'
<b>and field1 = it_iblnr-field1.</b>
reward if helpful