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

Search Help for Help View

Former Member
0 Likes
4,532

Hi

I am a newbie in abap and currently practicing on it.

I am facing this error on declaration

"ZAS_HPVIEW_MATNR" is not declared as a table, projection view, or database view in ABAP Dictionary or does not exist in an active version."

Can help view table be used in select statement?

Code:

DATA: it_zabap TYPE STANDARD TABLE OF ZAS_HPVIEW_MATNR WITH HEADER LINE. """" help view - outer join
DATA ls_zabap TYPE ZABAP03_S_HLP_STRU.

PARAMETERS:
PA_MATN3 like ls_zabap-matnr.

SELECT matnr lifnr land1 name1 name2 spras
FROM ZAS_HPVIEW_MATNR INTO CORRESPONDING FIELDS OF TABLE it_zabap
WHERE matnr = pa_matn3.

Hi

I am a newbie in abap and currently practicing on it.

I am facing this error on declaration

"ZAS_HPVIEW_MATNR" is not declared as a table, projection view, or database view in ABAP Dictionary or does not exist in an active version."

Can help view table be used in select statement?

Code:

DATA: it_zabap TYPE STANDARD TABLE OF ZAS_HPVIEW_MATNR WITH HEADER LINE. """" help view - outer join
DATA ls_zabap TYPE ZABAP03_S_HLP_STRU.

PARAMETERS:
PA_MATN3 like ls_zabap-matnr.

SELECT matnr lifnr land1 name1 name2 spras
FROM ZAS_HPVIEW_MATNR INTO CORRESPONDING FIELDS OF TABLE it_zabap
WHERE matnr = pa_matn3.

12 REPLIES 12
Read only

Sandra_Rossi
Active Contributor
0 Likes
4,335

You cannot query a help view. A help view can only be used as the data source of the search help, not in ABAP code. Reference: https://help.sap.com/viewer/product/SAP_NETWEAVER_AS_ABAP_752/7.52.5/en-US?q=Views

Read only

former_member1716
Active Contributor
4,335

gheing.sheng.sao,

No you cannot use Help view in a select query, as suggested by Sandra it is only used for Search help as data source.

In case you wanted your select statement to give the same result of the help view, you can write a select query by using the same tables and join conditions used in the help view. Do remember to join the tables using outer Join since help views are constructed based on outer joins. By this you can ensure the results are same.

Regards!

Read only

0 Likes
4,335

Hi, do you mean using this?

Example:

select t001~bukrs t001~butxt knb1~kunnr into table it_final from t001 left outer join knb1 on t001~bukrs = knb1~kunnr where <condition>?

Read only

0 Likes
4,335

I was abe to display the dialog box bt was unable to output it, not sure why

Read only

0 Likes
4,335
gheing.sheng.sao What is your question? What is your code?
Read only

Former Member
0 Likes
4,334

Im not able to execute the output on selection screen with help view field (matnr data element created with parameter created in Elementary search help assigned)

*types: begin of ty_final,
* matnr TYPE mara-matnr,
* lifnr TYPE lfa1-lifnr,
* land1 TYPE lfa1-land1,
* name1 TYPE lfa1-name1,
* name2 TYPE lfa1-name2,
* spras TYPE lfa1-spras,
* end of ty_final.
*
* DATA: it_final TYPE ty_final.
* DATA: ls_final TYPE zabap03_s_hlp_stru.
*SELECT mara~matnr lfa1~lifnr lfa1~land1 lfa1~name1 lfa1~name2 lfa1~spras INTO CORRESPONDING FIELDS OF TABLE it_final
* FROM MATNR LEFT OUTER JOIN lfa1 on mara~matnr = lfa1~lifnr
* WHERE mara~matnr = pa_matn3.
IF sy-subrc = 0.

loop at it_zabap03 INTO ls_zabap03.
IF pa_matn3 is not INITIAL.
WRITE: / sy-tabix,
ls_zabap03-matnr,
ls_zabap03-lifnr,
ls_zabap03-land1,
ls_zabap03-name1,
ls_zabap03-name2,
ls_zabap03-spras.
endif.
endloop.
endif.

Read only

0 Likes
4,334

It seems that it's a different question.

Whatever...

You must define code as follows, and on the selection screen press the key F8 to execute.

START-OF-SELECTION.
  ...
  WRITE ...
  ...
Read only

Former Member
0 Likes
4,334

Sorry for confusion, it is still showing this issue

"is not declared as a table, projection view, or database view in ABAP Dictionary or does not exist in an active version."

Read only

0 Likes
4,334

Why do you still use the help view? You cannot use a help view in ABAP code, it can be used only in a search help.

Read only

Former Member
0 Likes
4,334

I see, noted.

Only database view table can be used as both search help and abap code?

Read only

0 Likes
4,334

I don't understand why you want to compare the possible data sources between ABAP and search help. Is there a reason?

Read only

0 Likes
4,334

Please use the COMMENT button for comments, questions, adding details, etc., ANSWER is only to propose a solution, dixit SAP text at the right of the answer area.