Can anyone help with the following issue that I am facing?
Requirement:
Check that a record exists in a database table:
The table name, table fields, field values are passed in a customising table
I have build the dynamic query
SELECT SINGLE *
FROM (lw_passed_table)
INTO lw_query_return
WHERE (lw_where_clause).
IF ( sy-subrc <> 0 ).
* Pass value not found in passed table using passed parameters
* Write error message here
ENDIF.
The issue is lw_query_return I have to hard code the type, in this case the query will check the existance of a vendor in LFB1 so in my code I have
DATA: lw_query_return TYPE LFB1
.
What I need to do is set the type of lw_query_return to the table that is stored in the vaibale lw_passed_table.
I have search for a long time and could not find any help with this.
Has anyone any idea how I can achieve what I need?
Thanking all in advance
Ian