Posts

Showing posts from September, 2024

ABAP-Managed Database Procedures (AMDP) with Example

Image
  Syntax of AMDP Classes An AMDP is implemented in an AMDP class with a regular static method or instance method in any visibility section. CLASS <my_amdp_class> DEFINITION . PUBLIC SECTION . * Marker interface with SAP HANA DB as database type INTERFACES IF_AMDP_MARKER_ < DB_TYPE >. ... METHODS <my_amdp_method> . ... ENDCLASS . CLASS <my_amdp_class> IMPLEMENTATION . ... * AMDP method METHOD <my_amdp_method> BY DATABASE PROCEDURE FOR <db_type> LANGUAGE <db_language> OPTIONS <db_options> USING <db_entity> . "Implementation of the procedure in a DB-specific language ... ENDMETHOD. ... ENDCLASS.    Example: Click on File->New->ABAP Class CLASS zvb_amdp_class DEFINITION PUBLIC   FINAL   CREATE PUBLIC .     PUBLIC SECTION.     TYPES:BEGIN OF ty_stu ,     ...

Drop Down In ALV

    Displaying Drop down in ALV : *Fetching reason code and description     SELECT reason,spra,description       FROM ztmnp_dis_reason       INTO TABLE @DATA(lt_disposal_rsn)       WHERE spra = @sy-langu. *Adding reason code description to the dropdown     LOOP AT lt_disposal_rsn INTO DATA(ls_disposal_rsn).       ls_dd-handle = '1'.       CONCATENATE ls_disposal_rsn-reason ls_disposal_rsn-description                 INTO ls_dd-value SEPARATED BY '-'.       APPEND ls_dd TO lt_dd.       CLEAR:ls_dd.     ENDLOOP.     CALL METHOD lo_alv->set_drop_down_table       EXPORTING         it_drop_down = lt_dd.   ...