Registration

Dear SAP Community Member,
In order to fully benefit from what the SAP Community has to offer, please register at:
http://scn.sap.com
Thank you,
The SAP Community team.
Skip to end of metadata
Go to start of metadata
Error rendering macro 'code': Invalid value specified for parameter 'lang'
*&---------------------------------------------------------------------*
*& Report  YMHCROBJONLOAN
*&
*&---------------------------------------------------------------------*
*&
*&---------------------------------------------------------------------* 
REPORT  YMHCROBJONLOAN. 
***********************************************************************
* PROGRAM....... YMHCROBJONLOAN                                        *
* TITLE......... OBJECTS ON LOAN                                      *
* AUTHOR........ Gaurav Patwari                               *
*                                                           *
* FUNCTIONAL....                                             *
* DATE WRITTEN.. 04.05.2009                                                *
* R/3 RELEASE... ECC 6.0                                                  *
* =================================================== *
* COPIED FROM... <IF APPLICABLE>                                           *
* TITLE......... <DETAILED DESCRIPTION>                                    *
* =================================================== *
* USED BY....... HUMAN RESOURCE TEAM                                       *
*                                                                          *
* =================================================== *
* PROGRAM TYPE.. REPORT                                                   *
* DEV.CLASS.....                                                          *
* LOGICAL DB...                                                           *
* MODIFICATION LOG                                                        *
* DATE       BY        CORRECTION NUMBER & BRIEF DESCRIPTION  RELEASE      *
* --------- ------- ------------------------------------ ------     *
*                                                                         *
*********************************************************************** 
INFOTYPES: 0040. TABLES: PERNR.
TYPE-POOLS: SLIS.
TYPES: BEGIN OF S_P0040,
        PERNR TYPE P0040-PERNR,
        ANZKL TYPE P0040-ANZKL,
        LOBNR TYPE P0040-LOBNR,
        BEGDA TYPE P0040-BEGDA,
        ENDDA TYPE P0040-ENDDA,
        LEIHG TYPE P0040-LEIHG,
        STEXT TYPE T591S-STEXT,
        ENAME TYPE P0001-ENAME,
       END OF S_P0040. DATA: ITAB_P0040 TYPE S_P0040 OCCURS 0 WITH HEADER LINE." P0040 WITH HEADER LINE.
DATA: ITAB_T591S TYPE TABLE OF T591S WITH HEADER LINE. 
*DATA: ITAB_P0040 TYPE S_P0040 OCCURS 0. 
DATA: IT_FIELDCAT TYPE SLIS_T_FIELDCAT_ALV,
      WA_FIELDCAT TYPE SLIS_FIELDCAT_ALV,
      I_EVENTS TYPE SLIS_T_EVENT,          " INTERNAL TABLE FOR EVENTS
      LS_LINE TYPE SLIS_LISTHEADER,        " WORK AREA FOR HEADER
      I_LINE TYPE SLIS_T_LISTHEADER.      " INTERNAL TABLE FOR HEADER 
DATA: GD_LAYOUT TYPE SLIS_LAYOUT_ALV,
      LS_EVENT TYPE SLIS_ALV_EVENT.  
TOP-OF-PAGE. 
START-OF-SELECTION. SELECT STEXT
       SUBTY
  FROM T591S
  INTO CORRESPONDING FIELDS OF TABLE ITAB_T591S
  WHERE SPRSL ='EN' AND INFTY = '0040'. GET PERNR.
  LOOP AT P0040 WHERE BEGDA >= PN-BEGDA AND ENDDA <= PN-ENDDA.
    CLEAR ITAB_P0040.
    ITAB_P0040-ENAME = PERNR-ENAME.
    MOVE-CORRESPONDING P0040 TO ITAB_P0040.
*    ITAB_P0040 = P0040.
    APPEND ITAB_P0040.
  ENDLOOP. *GET PERNR LATE.  LOOP AT ITAB_P0040.   
READ TABLE ITAB_T591S WITH KEY SUBTY = ITAB_P0040-LEIHG.
  IF  SY-SUBRC = 0.
    ITAB_P0040-STEXT = ITAB_T591S-STEXT.
    MODIFY ITAB_P0040.
  ENDIF.
ENDLOOP. END-OF-SELECTION.
CLEAR WA_FIELDCAT.
WA_FIELDCAT-COL_POS       =  1.
WA_FIELDCAT-FIELDNAME     = 'PERNR'.
WA_FIELDCAT-SELTEXT_M     = 'PERSONAL NO.'.
APPEND WA_FIELDCAT TO IT_FIELDCAT. CLEAR WA_FIELDCAT.
WA_FIELDCAT-COL_POS       =  2.
WA_FIELDCAT-FIELDNAME     = 'LOBNR'.
WA_FIELDCAT-SELTEXT_M     = 'Name of object on loan'.
APPEND WA_FIELDCAT TO IT_FIELDCAT. CLEAR WA_FIELDCAT.
WA_FIELDCAT-COL_POS       =  3.
WA_FIELDCAT-FIELDNAME     = 'BEGDA'.
WA_FIELDCAT-SELTEXT_M     = 'START DATE'.
APPEND WA_FIELDCAT TO IT_FIELDCAT. CLEAR WA_FIELDCAT.
WA_FIELDCAT-COL_POS       =  4.
WA_FIELDCAT-FIELDNAME     = 'ENDDA'.
WA_FIELDCAT-SELTEXT_M     = 'END DATE'.
APPEND WA_FIELDCAT TO IT_FIELDCAT. *CLEAR WA_FIELDCAT.
*WA_FIELDCAT-COL_POS       =  5.
*WA_FIELDCAT-FIELDNAME     = 'LEIHG'.
*WA_FIELDCAT-SELTEXT_M     = 'SUBTYPE'.
*APPEND WA_FIELDCAT TO IT_FIELDCAT. CLEAR WA_FIELDCAT.
WA_FIELDCAT-COL_POS       =  6.
WA_FIELDCAT-FIELDNAME     = 'ANZKL'.
WA_FIELDCAT-SELTEXT_M     = 'NO'.
APPEND WA_FIELDCAT TO IT_FIELDCAT. CLEAR WA_FIELDCAT.
WA_FIELDCAT-COL_POS       =  7.
WA_FIELDCAT-FIELDNAME     = 'STEXT'.
WA_FIELDCAT-SELTEXT_M     = 'LOAN FOR OBJECT'.
APPEND WA_FIELDCAT TO IT_FIELDCAT. CLEAR WA_FIELDCAT.
WA_FIELDCAT-COL_POS       =  8.
WA_FIELDCAT-FIELDNAME     = 'ENAME'.
WA_FIELDCAT-SELTEXT_M     = 'EMPLOYEE NAME'.
APPEND WA_FIELDCAT TO IT_FIELDCAT. GD_LAYOUT-ZEBRA = 'X'.
GD_LAYOUT-COLWIDTH_OPTIMIze = 'X'.   
CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
    EXPORTING
      I_LIST_TYPE = 0
    IMPORTING
      ET_EVENTS   = I_EVENTS.
  READ TABLE I_EVENTS WITH KEY NAME =  SLIS_EV_TOP_OF_PAGE
                           INTO LS_EVENT.
  IF SY-SUBRC = 0.
    LS_EVENT-FORM = 'TOP_OF_PAGE1'.
    APPEND LS_EVENT TO I_EVENTS.
  ENDIF.   CLEAR LS_LINE.
  LS_LINE-TYP  = 'S'.
  LS_LINE-INFO = 'TORRENT POWER LTD.'.
  APPEND LS_LINE TO I_LINE.   CLEAR LS_LINE.
  LS_LINE-TYP  = 'H'.
  LS_LINE-INFO = 'HUMAN RESOURCE DEPARTMENT'.
  APPEND LS_LINE TO I_LINE.    
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
    EXPORTING
      I_CALLBACK_PROGRAM = SY-REPID
      IS_LAYOUT          = GD_LAYOUT
      IT_FIELDCAT        = IT_FIELDCAT[]
      IT_EVENTS          = I_EVENTS
    TABLES
      T_OUTTAB           = ITAB_P0040.
  IF SY-SUBRC <> 0.   ENDIF. 
* ---------------------------------------------------------------------*
*   -->  E04_LT_TOP_OF_PAGE                                            *
*---------------------------------------------------------------------*
FORM TOP_OF_PAGE1.
  CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
    EXPORTING
      IT_LIST_COMMENTARY = I_LINE
*      I_LOGO             = ''.
ENDFORM.
  • No labels