‎2007 Nov 28 1:37 PM
I have to add a field(vendor reference) in RFC Table and that should be an optional field and the validations that i have to do is that
The entered value should exist in the table LFA1 and in the field LIFNR (LFA1-LIFNR) or the entered value should me a text with"NO-ALLOC"
Otherwise it should show an error,
Please provide me the code
‎2007 Nov 28 1:43 PM
Select lifnr from lfa1 into lv_lifnr
where lifnr = entered value.
if sy-subrc <> 0.
get text for entered value in lv_text.
if lv_text ne 'NO-ALLOC'.
error message.
endif.
Lokesh
pls. reward if it helps.
Message was edited by:
Lokesh Aggarwal
‎2007 Nov 28 1:41 PM
hmmm well, theres no code need to achieve this. all you need to do is to assign LFA1 as foreign key table to that field. this will give you on one hand a validation against the values in LFA1, AND a F4 help as well for that field.
‎2007 Nov 28 1:43 PM
Select lifnr from lfa1 into lv_lifnr
where lifnr = entered value.
if sy-subrc <> 0.
get text for entered value in lv_text.
if lv_text ne 'NO-ALLOC'.
error message.
endif.
Lokesh
pls. reward if it helps.
Message was edited by:
Lokesh Aggarwal