Posts

Showing posts from 2011

Simplest ALV Code

Well, if not you, I reluctant to code for ALV. It's so much stereotype. And most of the boring job is to create the field catalog. Here is a quick and simple way to create ALV in just 3-4 lines of code :) To achieve this we will use the class  CL_ALV_TABLE . Even if you are not aware of object oriented programming, you can use these simple lines of codes to generate ALV report. I_TAB can be any table. You can declare it as normal table (either through type / like db table / or even OCCURS 0 type table).   DATA : lo_alv  TYPE   REF   TO  cl_salv_table,         lx_salv_msg  TYPE   REF   TO  cx_salv_msg,         l_msg( 40 )  TYPE   c  .    TRY .        CALL   METHOD  cl_salv_table=>factory *    EXPORTING *      list_display   = IF_SALV_C_BOOL_SAP=>FALSE *      r_container    = *      container_name =          IMPORTING           r_salv_table   = lo_alv          CHANGING           t_table        = i_tab           .      CATCH  cx_salv_msg  INTO  lx_salv

Function Module to get DDIC details

TFW_GET_DDIC_INFO *" IMPORTING *" REFERENCE(IV_TABNAME) TYPE TABNAME *" REFERENCE(IV_RESOLVE_SUBSTRUCTURES) TYPE TFW_BOOLEAN DEFAULT *" ' ' *" REFERENCE(IV_LANGUAGE) TYPE SPRAS DEFAULT SY-LANGU *" EXPORTING *" REFERENCE(ET_DFIES) TYPE TFW_DFIES_TAB *" EXCEPTIONS *" WRONG_CALL *" ERRONEOUS_INPUT_DATA *" DDIC_DATA_READ_FAILED *" ERROR_OCCURRED

Few Tips for Transport Request Manipulation

Image
DON’T USE THESE UNLESS ABSOLUTELY NEEDED. The purpose of transport request is to organize and move development objects from one server (say development) to other server. But sometime due to conflict in timing of different releases, we may need to move objects from one transport to other transport to release lock / dependency / to avoid transport failure due to missing object. It’s not very easy task always, especially if the Transports are complex and contain multiple components. Things get more difficult if objects are locked in one transport or the transport is partially released (few tasks are released and locked object is inside that task). These off hand tips will help developer to manipulate transport request if complex situation arises. These methods are not very advisable as this may lead to transport inconsistency if not done properly or with proper understanding of the consequences. How to toggle the status of a Transport request? Here is a transport request where o

Sample OOPS ALV with Docking Container

*&---------------------------------------------------------------------* *& Report ZACHI_TEST_ALV_DOCK *& *&---------------------------------------------------------------------* *& *& *&---------------------------------------------------------------------* REPORT  zachi_test_alv_dock. CONSTANTS : n  TYPE   i   VALUE   '10' . CLASS  lcl_event_rcvr  DEFINITION  DEFERRED. DATA : go_cont  TYPE   REF   TO  cl_gui_docking_container, go_alv  TYPE   REF   TO  cl_gui_alv_grid, go_event  TYPE   REF   TO  lcl_event_rcvr, go_toolbar  TYPE   REF   TO  cl_alv_event_toolbar_set. TYPES :  BEGIN   OF  ty_data , object_id  LIKE  crmd_orderadm_h-object_id, process_type  LIKE  crmd_orderadm_h-process_type, posting_date  LIKE  crmd_orderadm_h-posting_date, style  TYPE  lvc_t_styl, END   OF  ty_data. DATA : gt_data  TYPE   STANDARD   TABLE   OF  ty_data, wa_data  TYPE  ty_data, gs_lay  TYPE  lvc_s_layo, it_fcat  TYPE  lvc_t_fcat, it_fcat2