Skip to Content
0

How to pass table name as a variable in AMDP procedure

Aug 30, 2017 at 10:05 AM

378

avatar image

I am Passing the table name from ABAP report into variable and passing the same variable to AMDP method as a importing parameter. But when i am trying to use same import parameter in AMDP method implementation as dynamic table in select * query, it is giving error as 'Scalar Type not allowed".

class-METHODS get_details

IMPORTING

VALUE(iv_table) TYPE TABNAME

VALUE(it_settlement) TYPE tt_settl_tmp

EXPORTING

VALUE(et_accounts) TYPE tt_accounts.

ENDCLASS.

CLASS /dcfc/cl_coxx_settlr_amdp_clas IMPLEMENTATION.

METHOD get_details BY DATABASE PROCEDURE

FOR HDB

LANGUAGE

SQLSCRIPT

options READ-ONLY.

et_accounts = SELECT * from :iv_table AS a inner join :it_setttlement as b on a.paledger = b.ledger AND a.wwcom = b.wwcom AND a.bukrs = b.bukrs_pos;

iv_table is variable where table name in comming

Regards,

NM

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

2 Answers

avatar image
Former Member Aug 31, 2017 at 12:13 PM
0

Hi,

Scalar Type not allowed  ???

This is skeptic, can perform analysis of error during runtime in transaction ST22. and tell us what are the findings.

may be the issue is somewhere else. .. May be---

Hope you find the solution,

Pavan Golesar

Share
10 |10000 characters needed characters left characters exceeded
avatar image
Former Member Aug 31, 2017 at 12:18 PM
0

Also, make sure while passing to AMDP parameter you are using -- Table types with a structured row type .. Note Pass by value is the only way we can pass paratmer to AMDP method as the Pass by reference is not supported by ABAP Managed Database Procedures(AMDP) Methods.

Thanks :-)

--Pavan Golesar

Share
10 |10000 characters needed characters left characters exceeded