cancel
Showing results for 
Search instead for 
Did you mean: 

Preview table function data error

Song
Explorer
0 Kudos
222

Hi All :

We are developing on S/4 HANA Cloud 3SL.

I am trying to use the table function to obtain annotation information in i_purchaseordeitemnotet_2, but an error occurred while previewing the data

If you could help me solve this problem, I would greatly appreciate it.

Song

Accepted Solutions (1)

Accepted Solutions (1)

junwu
Active Contributor

错误信息说的很明白了

你的method没申明是为了哪个cds

method要加上这 for table function ZTF_PURORDERITEMNOTE

https://help.sap.com/docs/SAP_NETWEAVER_750/f2e545608079437ab165c105649b89db/e5529f75afbc43e7803b303...

Answers (1)

Answers (1)

xiaosanyu
Participant
0 Kudos
BY DATABASE
FUNCTION FOR HDB LANGUAGE
SQLSCRIPT OPTIONS READ-ONLY


CHANGE PROCEDURE TO FUNCTION

xiaosanyu
Participant
0 Kudos

@EndUserText.label: 'AMDP_TEST01'
define table function ZAMDP_TEST01
with parameters
@Environment.systemField: #CLIENT
p_clnt : abap.clnt
returns
{
mandt : abap.clnt;
EBELN : ebeln;
EBELP : ebelp;
ERNAM : ernam;
MATNR : matnr;
LIFNR : lifnr;
}
implemented by method
zcl_amdp_test01=>get_mm_ekpo;

CLASS zcl_amdp_test01 DEFINITION
PUBLIC
FINAL
CREATE PUBLIC .
PUBLIC SECTION.
INTERFACES if_amdp_marker_hdb .
CLASS-METHODS:get_mm_ekpo FOR TABLE FUNCTION zamdp_test01.
PROTECTED SECTION.
PRIVATE SECTION.
ENDCLASS.


CLASS zcl_amdp_test01 IMPLEMENTATION.
METHOD get_mm_ekpo BY DATABASE
FUNCTION FOR HDB LANGUAGE
SQLSCRIPT OPTIONS READ-ONLY
USING ekko ekpo .
RETURN
SELECT DISTINCT
a.mandt,
a.ebeln,
b.ebelp,
a.ernam ,
b.matnr,
a.lifnr
from ekko as a
left join ekpo as b on a.mandt = b.mandt and a.ebeln = b.ebeln
where a.bukrs = '1000'
AND a.mandt = p_clnt;
ENDMETHOD.
ENDCLASS.