2020 Apr 03 4:44 PM
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.
2020 Apr 03 5:37 PM
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
2020 Apr 03 6:26 PM
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!
2020 Apr 04 7:18 AM
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>?
2020 Apr 04 7:33 AM
I was abe to display the dialog box bt was unable to output it, not sure why


2020 Apr 04 9:53 AM
2020 Apr 04 2:44 PM
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.


2020 Apr 04 2:48 PM
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 ...
...
2020 Apr 04 4:50 PM
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."
2020 Apr 04 5:58 PM
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.
2020 Apr 04 6:32 PM
I see, noted.
Only database view table can be used as both search help and abap code?
2020 Apr 04 7:05 PM
I don't understand why you want to compare the possible data sources between ABAP and search help. Is there a reason?
2020 Apr 04 7:07 PM
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.
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |