‎2008 Oct 28 9:45 AM
Hi All,
I need to have validation on the BAPI input parameter against the SAP table.
Example:
BAPI Input Parameter:
Name ( is combination of field first name + Last Name in SAP table)
SAP table
Last name
First name
Can I know how I validate this input parameter with the SAP table fields
First name, last name. Please advise with the sample code. Thanks.
‎2008 Oct 28 10:18 AM
Hi,
I am not sure how much i am correct but have you tried with any select statement.
Data: l_firstname type <table name>-<field name of first name>.
select single <first name> from <table name> into l_firstname where <first name> = <Table name>-<field name>
and <last name field name> = <table name>-<last name field name>.
In the above i have shown you to validate first name and last name until both matches you can proceed further.
Cheers!!
VEnk@
‎2008 Oct 28 10:23 AM
Hi
Write a select statement as Venkat said...and put a condition saying...if sy-subrc is not equal to zero, then you want an error message to be displayed.
select * "select statement
if sy-subrc <> 0.
write: / "Invalid Name.
endif.Regards,
Vishwa.
‎2008 Oct 28 10:43 AM
Hi,
First of all, thanks.
How do i split out the data from BAPI input parameter first , then proceed with validation check against the data in table field first name and last name?
Example BAPI input value:
StudentName: Jenny Lee
(Student Name is combination of First name & last name)
SAP table
First name : Jenny
Last name : Lee
‎2008 Oct 28 10:48 AM
Hi
Ever heard about keyword "SPLIT"??
Use:
first and last are two variables.
SPLIT studentname at ' ' into first last.
Then Select * from xxx into itab where firstname(field) = first.Regards,
Vishwa.
‎2008 Nov 01 7:23 AM