on 2021 Nov 18 9:20 AM
Hi all,
I am trying to fetch a field from ADURI which is a structure. But I'm getting an error that "ADURI is not declared as a table, projection view, or database view in ABAP Dictionary or does not exist in an active version."
Please help me resolve this. I am adding the code line below.
SELECT SINGLE uri_screen FROM ADURI
INTO @DATA(ls_uri) WHERE uri_screen = @lv_url.
Request clarification before answering.
Hi
You cannot apply SQL Query like this on structure you should use FM CATSXT_GET_DDIC_FIELDINFO
try the below code i tested, it is working fine just copy / paste
DATA: lt_fields TYPE ddfields,
lt_fcat TYPE lvc_t_fcat,
lt_fcat_alv TYPE slis_t_fieldcat_alv.
DATA: ls_fcat TYPE lvc_s_fcat,
ls_fields LIKE LINE OF lt_fields,
ls_fcat_alv LIKE LINE OF lt_fcat_alv.
DATA: lv_index TYPE i.
CALL FUNCTION 'CATSXT_GET_DDIC_FIELDINFO'
EXPORTING
im_structure_name = 'ADURI'
IMPORTING
ex_ddic_info = lt_fields
EXCEPTIONS
failed = 1
OTHERS = 2.
IF sy-subrc <> 0.
RAISE structure_not_found.
ENDIF.
cl_demo_output=>display_data( lt_fields[] ).
Please mark it as solution if it works for you.
Thanks
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
A structure is just a layout, a mask, it does not contain data. So you cannot make SELECT or anything else like this.
If you don't know the real table behind this structure, you could try to make a SQL trace on the transaction using ST01
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
100 | |
8 | |
6 | |
5 | |
5 | |
5 | |
4 | |
3 | |
2 | |
2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.