AMDP Procedure with Changing Table Parameter

light111AMDP Procedure with Changing Table Parameter


SPLFI Table Details

1

AMDP Procedure with changing table parameter- which can be used both for reading and writing purpose.

2

Report to check AMDP procedure method.

3

Test In Debugging Details:

4

Input details

5

Output details

6


AMDP procedure method with changing table parameter

CLASS zcl_demo_006_amdp DEFINITION PUBLIC FINAL CREATE PUBLIC .

PUBLIC SECTION.
INTERFACES: if_amdp_marker_hdb.
METHODS: get_spfli_details_public CHANGING VALUE(ct_spfli) TYPE spfli_tab.
PROTECTED SECTION.
PRIVATE SECTION.
METHODS: get_spfli_details_private CHANGING VALUE(ct_spfli) TYPE spfli_tab.
ENDCLASS.

CLASS zcl_demo_006_amdp IMPLEMENTATION.

METHOD get_spfli_details_public BY DATABASE PROCEDURE FOR HDB LANGUAGE SQLSCRIPT OPTIONS READ-ONLY USING zcl_demo_006_amdp=>get_spfli_details_private.
CALL “ZCL_DEMO_006_AMDP=>GET_SPFLI_DETAILS_PRIVATE”( CT_SPFLI__IN__ => :CT_SPFLI, CT_SPFLI => :CT_SPFLI );
ENDMETHOD.

METHOD get_spfli_details_private BY DATABASE PROCEDURE FOR HDB LANGUAGE SQLSCRIPT OPTIONS READ-ONLY USING spfli.
ct_spfli = SELECT s.* FROM spfli AS s INNER JOIN :ct_spfli as i ON s.mandt = i.mandt AND s.carrid = i.carrid;
ENDMETHOD.

ENDCLASS.


REPORT ztest_amdp.

CLASS lcl_test_amdp DEFINITION.
  PUBLIC SECTION.
    CLASS-METHODSrun.
ENDCLASS.
CLASS lcl_test_amdp IMPLEMENTATION.
  METHOD run.

    DATA(lt_spfliVALUE spfli_tabmandt symandt carrid ‘AA’ mandt symandt carrid ‘AB’ ).
    DATA(lt_spfli_templt_spfli.
* AMDP Method call
    TRY.
        IF cl_abap_dbfeatures=>use_featuresrequested_features VALUE #cl_abap_dbfeatures=>call_amdp_method abap_true.
          NEW zcl_demo_006_amdp)->get_spfli_details_publicCHANGING ct_spfli lt_spfli ).
          BREAK-POINT.
        ENDIF.
      CATCH cx_abap_invalid_param_value.
    ENDTRY.

  ENDMETHOD.
ENDCLASS.

START-OF-SELECTION.
  lcl_test_amdp=>run).


 

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s