cancel
Showing results for 
Search instead for 
Did you mean: 

field validation

Former Member
0 Kudos

hi

I have to validate a field that is vbeln. if vbeln, bukrs,lifnr and fkdat all these three are in table I should throw some error else I would allow..

(All the four fields are in y table)

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi,

All you have to do is to write a set of code in WDDOMODIFY or on action of the button which checks for your condition.

If the Y table you mentioned is an internal table then a read statement will do and if sy-surc for the read statement is eq 0 then display the message using message manager.

Is this what you wanted??

Regards,

Kinshuk

Former Member
0 Kudos

Hi Rupa,

Write your code like this...

Get VBELN value from view.

data:begin of ty_itab,

vbeln type vbak-vbeln,

bukrs type .....

lifnr type ....

fldate type...

end of ty_itab,

wa_stru type ty_itab.

select vbeln bukrs lifnr fldate from vbak into wa_stru

where vbeln = <input value>.

if wa_stru-vbeln is not initial and

wa_stru-bukrs is not initial and

wa_stru-lifnr is not initial and

wa_stru-fldate is not initial.

write logic..

else.

logic to exit.

endif.

Thanks

suman

Former Member
0 Kudos

cant I give condition like Vbeln = ytable-vbeln and bukRs = ytable-bukrs and fkdat = ytable-fkdat in where condition. I tried this but its not working. I need the vbeln value should check against other three fields. if that vbeln exists for the same other fields it should throw error

Former Member
0 Kudos

Hi Rupa,

I didn't get your doubt.can you explain me in detail.

Thanks

Suman

Former Member
0 Kudos

solved.

Can u tell me any possibilities where I can edit and also use the drop down for a particular column in ordinary table. If yes pls give me some dummy code...

Former Member
0 Kudos

Hi Rupa,

It is also same as Yester day's solution which i gave for ALV.

Here also we have a cell editor for column.so you use this method to achieve the requirement.

thanks

Suman