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: 
Read only

Validations in RFC Programming

Former Member
0 Likes
313

i have to add a field by name (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 and i have to write the code in RFC's

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
297

Hi,

say the field name in RFC is V_LIFNR

If not V_LIFNR is initial and ne 'NO-ALLOC'.
select single LIFNR from LFA1
into l_lifnr where lifnr eq v_lifnr.
if sy-subrc ne 0.
RAISE NO_DATA.
endif.
endif.

In EXCEPTIONS tab, mention NO_DATA.

Best regards,

Prashant

1 REPLY 1
Read only

Former Member
0 Likes
298

Hi,

say the field name in RFC is V_LIFNR

If not V_LIFNR is initial and ne 'NO-ALLOC'.
select single LIFNR from LFA1
into l_lifnr where lifnr eq v_lifnr.
if sy-subrc ne 0.
RAISE NO_DATA.
endif.
endif.

In EXCEPTIONS tab, mention NO_DATA.

Best regards,

Prashant