Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

selection screen validation......

Former Member
0 Kudos
273

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

12 REPLIES 12

former_member223537
Active Contributor
0 Kudos
218

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

Former Member
0 Kudos
218

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.

0 Kudos
218

hi

My validation field is in separate standard table 'ikpk' .how can i like in same select query of ztable...

regards

veera

0 Kudos
218

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

0 Kudos
218

<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

Former Member
0 Kudos
218

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.

shishupalreddy
Active Contributor
0 Kudos
218

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 .

former_member404244
Active Contributor
0 Kudos
218

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

0 Kudos
218

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

former_member404244
Active Contributor
0 Kudos
218

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

0 Kudos
218

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

0 Kudos
218

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