amdp


13 video [amdp procedure -1]

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~



CLASS zajay_class_amdp_procedure DEFINITION PUBLIC.


  PUBLIC SECTION.

  INTERFACES if_amdp_marker_hdb.

  TYPES: begin of typ_sales,

         vbeln type vbeln,

         auart type auart,

         end of TYP_SALES.

  TYPES:  begin of typ_mat,

          matnr type matnr,

          mtart type mtart,

          END OF TYP_MAT.

   TYPES: tt_sales_details type table of typ_sales,

          tt_mat_details type table of typ_mat.

  class-METHODS get_sales_details IMPORTING value(im_auart) type auart

                                    EXPORTING value(ex_sales_details) type tt_sales_details .

  CLASS-METHODS get_materail_details EXPORTING value(ex_mat_details) type tt_mat_details.

  PROTECTED SECTION.

  PRIVATE SECTION.

ENDCLASS.


CLASS zajay_class_amdp_procedure IMPLEMENTATION.

    METHOD get_sales_details BY DATABASE PROCEDURE FOR HDB LANGUAGE

        SQLSCRIPT OPTIONS READ-ONLY USING vbak.


        ex_sales_details = select vbeln , auart from vbak where auart = :im_auart;

    ENDMETHOD.


    METHOD get_materail_details BY DATABASE PROCEDURE FOR HDB LANGUAGE

        SQLSCRIPT OPTIONS READ-ONLY USING mara.


        ex_mat_details = select matnr , mtart from mara;


    ENDMETHOD.


ENDCLASS.



*&---------------------------------------------------------------------*

*& Report ZAJAY_AMDP_CALL

*&---------------------------------------------------------------------*

*&

*&---------------------------------------------------------------------*

REPORT zajay_amdp_call.


DATA(obj) = NEW zajay_class_amdp_procedure( ) .


CALL METHOD zajay_class_amdp_procedure=>get_sales_details

  EXPORTING

    im_auart         = 'TA'

  IMPORTING

    ex_sales_details = data(it_sales_details)


  .

BREAK-POINT.




14 video [amdp procedure -2]

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


amdp  }  --> function  --> cds views

--> procedure --> abap objects

















Comments

Popular posts from this blog

bapi introduction

ABAP for all