Skip to Content

How to pass table name as a variable in AMDP procedure

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

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Aug 31, 2017 at 12:13 PM

    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

    Add comment
    10|10000 characters needed characters exceeded

  • Aug 31, 2017 at 12:18 PM

    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

    Add comment
    10|10000 characters needed characters exceeded