BASED ON GIVEN PURCHASING DOCUMENT NUMBER DISPLAY PURCHASING DOCUMENT NUMBERS, DOCUMENT DATES AND VENDOR NUMBERS BY USING ALV AND ALSO DISPLAY PURCHASING DOCUMENTS WITH GREEN COLOR & VENDOR WITH HOTSPOT BY USING MERGE FUNCTION MODULE.
REPORT ZALV_FM_MERGE.
TYPE-POOLS SLIS.
TABLES EKKO.
SELECT-OPTIONS S_EBELN FOR EKKO-EBELN.
DATA : BEGIN OF WA_EKKO,
EBELN LIKE EKKO-EBELN,
BEDAT LIKE EKKO-BEDAT,
LIFNR LIKE EKKO-LIFNR,
END OF WA_EKKO.
DATA IT_EKKO LIKE TABLE OF WA_EKKO.
SELECT EBELN BEDAT LIFNR FROM EKKO INTO TABLE IT_EKKO WHERE EBELN IN S_EBELN.
*DECLARING FIELD CATALOG INTERNAL TABLE.
DATA IT_FCAT TYPE SLIS_T_FIELDCAT_ALV,
WA_FCAT LIKE LINE OF IT_FCAT.
*FILLING FIELD CATALOG.
CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
EXPORTING
I_PROGRAM_NAME = SY-CPROG
I_INTERNAL_TABNAME = 'WA_EKKO'
I_INCLNAME = SY-CPROG.
CHANGING
CT_FIELDCAT = IT_FCAT.
*MODIFY FIELD CATALOG BASED ON REQUIREMENT.
WA_FCAT-KEY="**"
WA_FCAT-EMPHASIZE = 'C510'.
MODIFY IT_FCAT FROM WA_FCAT TRANSPORTING
EMPHASIZE KEY WHERE FIELDNAME = 'EBELN'.
WA_FCAT-HOTSPOT = 'X'.
MODIFY IT_FCAT FROM WA_FCAT TRANSPORTING HOTSPOT WHERE FIELDNAME = 'LIFNR'.
*DISPLAY OUTPUT.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
IT_FIELDCAT = IT_FCAT
TABLES
T_OUTTAB = IT_EKKO.
TYPE-POOLS SLIS.
TABLES EKKO.
SELECT-OPTIONS S_EBELN FOR EKKO-EBELN.
DATA : BEGIN OF WA_EKKO,
EBELN LIKE EKKO-EBELN,
BEDAT LIKE EKKO-BEDAT,
LIFNR LIKE EKKO-LIFNR,
END OF WA_EKKO.
DATA IT_EKKO LIKE TABLE OF WA_EKKO.
SELECT EBELN BEDAT LIFNR FROM EKKO INTO TABLE IT_EKKO WHERE EBELN IN S_EBELN.
*DECLARING FIELD CATALOG INTERNAL TABLE.
DATA IT_FCAT TYPE SLIS_T_FIELDCAT_ALV,
WA_FCAT LIKE LINE OF IT_FCAT.
*FILLING FIELD CATALOG.
CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
EXPORTING
I_PROGRAM_NAME = SY-CPROG
I_INTERNAL_TABNAME = 'WA_EKKO'
I_INCLNAME = SY-CPROG.
CHANGING
CT_FIELDCAT = IT_FCAT.
*MODIFY FIELD CATALOG BASED ON REQUIREMENT.
WA_FCAT-KEY="**"
WA_FCAT-EMPHASIZE = 'C510'.
MODIFY IT_FCAT FROM WA_FCAT TRANSPORTING
EMPHASIZE KEY WHERE FIELDNAME = 'EBELN'.
WA_FCAT-HOTSPOT = 'X'.
MODIFY IT_FCAT FROM WA_FCAT TRANSPORTING HOTSPOT WHERE FIELDNAME = 'LIFNR'.
*DISPLAY OUTPUT.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
IT_FIELDCAT = IT_FCAT
TABLES
T_OUTTAB = IT_EKKO.
SAP ABAP Online Training -
ReplyDeleteClick Here For Enquiry - http://www.21cssindia.com/courses/sap-abap-online-training-207.html
Introduction to SAP and different modules of SAP - Introduction to R/3 Architecture and ABAP - Data dictionary - Domains - Data elements - Search helps - Tables - Lock objects - Different data types - String operations - Selection screen - Modularization techniques - Subroutines - Function modules -
Thanks for sharing this Information. SAP ABAP Training in Gurgaon
ReplyDelete