‎2009 Mar 10 6:51 AM
Hi Gurus,
I have to validate a paticular field which hold the table name .ie
PARAMETERS : p_table(10) TYPE C. "getting the table name frm the user
FIELD-SYMBOLS: <t_itab> TYPE ANY TABLE.
w_tabname = p_table.
i need to validate the p_table ....... How to validate it .Can any one help to do it .
Advance Congrats
Regards
Abeehs
‎2009 Mar 10 6:54 AM
Hi,
What kind of validation u want.?..if u want to see if the table exists then check if this exists in DD02L table . This table holds the SAP Tables name.
keerthi
‎2009 Mar 10 6:54 AM
Hi,
What kind of validation u want.?..if u want to see if the table exists then check if this exists in DD02L table . This table holds the SAP Tables name.
keerthi
‎2009 Mar 10 6:57 AM
Write a SELECT query with P_TABLE on table DD02L (Please confirm in SE11).
‎2009 Mar 10 7:02 AM
could that be any table (or even structure) in SAP? If so, table names can be up to 16 characters long (and structures even more).
Try to use the same type as in SE11 for your parameter, would be nicer (better) for the user for selecting a table (structure) from data dictionary.
‎2009 Mar 10 7:27 AM
you can go for.
AT SELECTION-SCREEN ON p_table.
*select statement for that parameter. e.g:
SELECT SINGLE lifnr FROM lfa1 INTO p_lifnr
WHERE lifnr = p_lifnr.
Regards
‎2009 Mar 10 8:36 AM
Hi,
thanks for all your reply.. I need to check the table entered in the p_table ..whether the given table name is valid or not if not the nthrought the error message
‎2009 Mar 10 8:49 AM
validate against dd02l
select single tabname
from dd02l into l_v_file where tabname = p_file.
If sy-subrc ne 0.
Print ur error message.
Endif.
‎2009 Mar 10 10:24 AM
you can go for.
AT SELECTION-SCREEN ON p_table.
*select statement for that parameter. e.g:
SELECT SINGLE lifnr FROM lfa1 INTO p_lifnr
WHERE lifnr = p_lifnr.
if sy-subrc <> o.
message 'text mesage here' type 'E'.
endif.
Regards
‎2009 Mar 10 10:24 AM
you can go for.
AT SELECTION-SCREEN ON p_table.
*select statement for that parameter. e.g:
SELECT SINGLE lifnr FROM lfa1 INTO p_lifnr
WHERE lifnr = p_lifnr.
if sy-subrc <> o.
message 'text mesage here' type 'E'.
endif.
Regards
‎2009 Mar 13 1:37 PM
Hi,
Check to see if the table entered on the selection screen is available in the DD02L table.
The database table DD02L holds all the dictionary tables in SAP.
The pseudocode would look like below.
AT SELECTION-SCREEN on p_table.
Select single <tablename> into (g_tabname) from DD02L
where <tablename> = p_table.
If sy-subrc <> 0.
Return Error message.
endif.
Regards,
Vamsee