Application Development 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: 

AMDP with mutliple output parameters

Former Member
0 Kudos

Hello everyone,

I have created an AMDP and would like to return multiple Output Parameters with a method.

One example: With the method CALL_PAL_130 I fill the parameters

"et_car_out" and "OUT_REASON_MSG" I would like to return.

When I debug the code I see, that both variables "et_car_out" and "OUT_REASON_MSG" have the value I expect.

When I consume CALL_PAL_130 in an ABAP Report/Function module only et_car_out has a value. "OUT_REASON_MSG" is empty.

So how can I return multiple parameters (table type and scalar type) with an amdp method?

Thanks a lot in advance!

method CALL_PAL_130
    by database procedure
        for hdb
        language sqlscript

<....>

OUT_REASON_MSG = 'TEST Reason';

 et_car_out = SELECT "ID", "SCORING", :SCORING_LOW AS SCORING_LOW, :SCORING_HIGH AS SCORING_HIGH, :LV_OUTLIER AS OUTLIER
FROM "XXX" AS SCORING;
endmethod.

        class-methods CALL_PAL_130
        IMPORTING
            VALUE(lt_CAR_IN) TYPE tt_CAR_IN
            VALUE(FIN_IN) TYPE FIN_IN
            VALUE(SACO_SQL_IN) TYPE SACO_SQL_IN
        EXPORTING
        VALUE(et_car_out) TYPE tt_car
        VALUE(ex_message) TYPE STRING
        VALUE(OUT_REASON_MSG) TYPE ty_OUT_REASON_MSG.

1 REPLY 1

horst_keller
Product and Topic Expert
Product and Topic Expert
0 Kudos

Can't reproduce the error.

METHODS select_get_scarr_spfli
      IMPORTING
                VALUE(clnt)            TYPE sy-mandt
      EXPORTING VALUE(scarr_spfli_tab) TYPE scarr_spfli_tab
                VALUE(mess) type string.
METHOD select_get_scarr_spfli
         BY DATABASE PROCEDURE FOR HDB
         LANGUAGE SQLSCRIPT
         OPTIONS READ-ONLY
         USING cl_kellerh_amdp=>get_scarr_spfli.
    SCARR_SPFLI_TAB =
    SELECT *
           FROM "CL_KELLERH_AMDP=>GET_SCARR_SPFLI"(
                  clnt => :clnt );
    mess = 'xxxx';
  ENDMETHOD.
data itab type cl_kellerh_amdp=>scarr_spfli_tab.
data mess type string.
new cl_kellerh_amdp( )->select_get_scarr_spfli( EXPORTING clnt = sy-mandt
                                         IMPORTING scarr_spfli_tab = itab
                                                   mess = mess ).

I get both parameters filled.

Is it something with TYPE ty_OUT_REASON_MSG?