ALV-LIGHT_SET

REPORT  ZLIGHT_SET.


TYPE-POOLS: SLIS.

TYPES: BEGIN OF TY_VBAK,
        VBELN TYPE VBAK-VBELN,
        ERNAM TYPE VBAK-ERNAM,
        NETWR TYPE VBAK-NETWR,
        LIGHTS TYPE  C,
      END OF TY_VBAK.



 DATA: IT_VBAK TYPE  TABLE OF TY_VBAK,
       WA_VBAK TYPE TY_VBAK.

DATA: WA_LAYOUT TYPE  SLIS_LAYOUT_ALV ,
       IT_FCAT   TYPE  SLIS_T_FIELDCAT_ALV ,
        WA_FCAT LIKE LINE OF IT_FCAT.

 SELECT-OPTIONS : S_VBELN FOR WA_VBAK-VBELN.


START-OF-SELECTION.



   SELECT VBELN ERNAM NETWR FROM VBAK
          INTO TABLE IT_VBAK UP TO 10 ROWS.


LOOP AT  IT_VBAK INTO WA_VBAK.

IF  WA_VBAK-ERNAM = 'BOLLINGER'.
   WA_VBAK-LIGHTS = 1.
MODIFY IT_VBAK FROM WA_VBAK TRANSPORTING LIGHTS.

   ELSEIF  WA_VBAK-ERNAM =  'ARUN'.
   WA_VBAK-LIGHTS = 3.

MODIFY IT_VBAK FROM WA_VBAK TRANSPORTING LIGHTS.
ENDIF.
ENDLOOP.
WA_FCAT-COL_POS = 1.
WA_FCAT-FIELDNAME = 'VBELN'.
WA_FCAT-TABNAME = 'VBAK'.
WA_FCAT-SELTEXT_M = 'SALES_ORDER_NO'.

APPEND WA_FCAT TO IT_FCAT.
CLEAR WA_FCAT.


WA_FCAT-COL_POS = 2.
WA_FCAT-FIELDNAME = 'ERNAM'.
WA_FCAT-TABNAME = 'VBAK'.
WA_FCAT-SELTEXT_M = 'CREATED BY'.

APPEND WA_FCAT TO IT_FCAT.
CLEAR WA_FCAT.

WA_FCAT-COL_POS = 3.
WA_FCAT-FIELDNAME = 'NETWR'.
WA_FCAT-TABNAME = 'VBAK'.
WA_FCAT-SELTEXT_M = 'SALES_ORDER_NO'.

APPEND WA_FCAT TO IT_FCAT.
CLEAR WA_FCAT.


WA_LAYOUT-LIGHTS_FIELDNAME = 'LIGHTS'.






   CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
    EXPORTING
*      I_INTERFACE_CHECK                 = ' '
*      I_BYPASSING_BUFFER                = ' '
*      I_BUFFER_ACTIVE                   = ' '
      I_CALLBACK_PROGRAM                = SY-REPID
*      I_CALLBACK_PF_STATUS_SET          = ' '
*      I_CALLBACK_USER_COMMAND           = ' '
*      I_CALLBACK_TOP_OF_PAGE            = ' '
*      I_CALLBACK_HTML_TOP_OF_PAGE       = ' '
*      I_CALLBACK_HTML_END_OF_LIST       = ' '
*      I_STRUCTURE_NAME                  =
*      I_BACKGROUND_ID                   = ' '
*      I_GRID_TITLE                      =
*      I_GRID_SETTINGS                   =
      IS_LAYOUT                         = WA_LAYOUT
      IT_FIELDCAT                       = IT_FCAT
*      IT_EXCLUDING                      =
*      IT_SPECIAL_GROUPS                 =
*      IT_SORT                           =
*      IT_FILTER                         =
*      IS_SEL_HIDE                       =
*      I_DEFAULT                         = 'X'
*      I_SAVE                            = ' '
*      IS_VARIANT                        =
*      IT_EVENTS                         =
*      IT_EVENT_EXIT                     =
*      IS_PRINT                          =
*      IS_REPREP_ID                      =
*      I_SCREEN_START_COLUMN             = 0
*      I_SCREEN_START_LINE               = 0
*      I_SCREEN_END_COLUMN               = 0
*      I_SCREEN_END_LINE                 = 0
*      I_HTML_HEIGHT_TOP                 = 0
*      I_HTML_HEIGHT_END                 = 0
*      IT_ALV_GRAPHICS                   =
*      IT_HYPERLINK                      =
*      IT_ADD_FIELDCAT                   =
*      IT_EXCEPT_QINFO                   =
*      IR_SALV_FULLSCREEN_ADAPTER        =
*    IMPORTING
*      E_EXIT_CAUSED_BY_CALLER           =
*      ES_EXIT_CAUSED_BY_USER            =
     TABLES
       T_OUTTAB                          = IT_VBAK
    EXCEPTIONS
      PROGRAM_ERROR                     = 1
      OTHERS                            = 2
             .
   IF SY-SUBRC <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
   ENDIF.


SAVE AND ACTIVE

EXECUTE

Comments

  1. Thank you for sharing the information here. Its much informative and really i got some valid information. You had posted the amazing article.

    SAP ABAP Training in Chennai

    SAP FICO Training in Chennai

    ReplyDelete
  2. This comment has been removed by the author.

    ReplyDelete
  3. Nice blog Content.It is very informative and helpful. Please share more content. Thanks.
    SAP training institute in Gurgaon

    ReplyDelete
  4. we provide a best modules in sap and (selenium) softwaare testing with real time scenarios.
    Our consultants are working professionals they will share our experience
    Who can learn in this module?
    Opportunities in this Module?
    Why Prefer Training with US?
    Training by Leading Architects
    Topic based Training
    Long-Term Technical Support
    Placement Assistance
    End to End – Project Support
    SAP HR Training in Chennai
    SAP Success Factors Training in Chennai
    SAP FICO Training in Chennai
    SAP MM Training in Chennai
    Sap Fiori Training in Chennai
    SAP HANA Training in Chennai
    software Testing modules
    Selenium Training in Chennaiss
    for more informations call 8122241286

    ReplyDelete

  5. It is amazing and wonderful to visit your site.Thanks for sharing this information,this is useful to me...
    http://chennaitraining.in/sap-fico-training-in-chennai/
    http://chennaitraining.in/sap-fscm-training-in-chennai/
    http://chennaitraining.in/sap-grc-training-in-chennai/
    http://chennaitraining.in/sap-hana-training-in-chennai/
    http://chennaitraining.in/sap-hcm-training-in-chennai/
    http://chennaitraining.in/sap-hr-training-in-chennai/
    http://chennaitraining.in/sap-le-training-in-chennai/
    http://chennaitraining.in/sap-mii-training-in-chennai/

    ReplyDelete

Post a Comment

Popular posts from this blog

FOR ALL ENTRIES (FAE) -4 TABLES USING ALV_GRID_DISPLAY

RADIO-BUTTONS IN BASIC REPORT

MODULE POOL -TABLE CONTROL_1: