*----------------------------------------------------------------------*
* Contract Renewal Details *
*----------------------------------------------------------------------*
************************************************************************
* Description: The contract details of the customers in a particular *
* sales area are displayed. This report is run to view the *
* * contract details existing for Ypsilon *
* *
************************************************************************
REPORT zadi_sd_contractalv NO STANDARD PAGE HEADING
LINE-COUNT 45(2) LINE-SIZE 130
MESSAGE-ID ymessage.
**********************Type Pool Declaration for ALV********************
TYPE-POOLS: slis.
********************Table Declaration**********************************
TABLES: vbak,vbfa,veda.
*********************Declaring Data Objects****************************
DATA: BEGIN OF lt_sd_c1 OCCURS 0,
vbeln LIKE vbak-vbeln, "Sales Document Number
vbelv LIKE vbfa-vbelv, "Preceding Sales and Distribution Doc
kunnr LIKE vbak-kunnr, "Customer Number
END OF lt_sd_c1.
*data: Lt_Sd_C2 like veda occurs 0 with header line.
DATA: gt_fieldcat TYPE slis_t_fieldcat_alv, "ALV Catalog Table
gs_fieldcat TYPE slis_fieldcat_alv. "ALV Catalog Structure
DATA: BEGIN OF lt_sd_c2 OCCURS 0,
vbeln LIKE veda-vbeln, "Sales Document Number
vlaufz LIKE veda-vlaufz, "Validity Period of Contract
vuntdat LIKE veda-vuntdat, "Date on which Contract was Signed
vbegdat LIKE veda-vbegdat, "Contract Start Date
venddat LIKE veda-venddat, "Contract End Date
END OF lt_sd_c2.
*****************************Selection Screen***************************
SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-101.
SELECT-OPTIONS: s_vkorg FOR vbak-vkorg OBLIGATORY,"Sales organization.
s_vtweg FOR vbak-vtweg, "Distribution channel.
s_spart FOR vbak-spart, "Division.
s_kunnr FOR vbak-kunnr, "Customer number
p_dat FOR sy-datum."Date=current date
SELECTION-SCREEN END OF BLOCK b1.
SELECTION-SCREEN BEGIN OF BLOCK c1 WITH FRAME TITLE text-100.
PARAMETERS list RADIOBUTTON GROUP radi.
PARAMETERS alv RADIOBUTTON GROUP radi.
SELECTION-SCREEN END OF BLOCK c1.
*****************Validation of Selection Screen Fields******************
AT SELECTION-SCREEN.
SELECT SINGLE vkorg FROM tvko INTO vbak-vkorg WHERE vkorg IN s_vkorg.
IF sy-subrc <> 0.
MESSAGE e002.
ENDIF.
SELECT SINGLE vtweg FROM tvkov INTO vbak-vtweg WHERE vtweg IN s_vtweg.
IF sy-subrc <> 0.
MESSAGE e004.
ENDIF.
SELECT SINGLE spart FROM tspa INTO vbak-spart WHERE spart IN s_spart.
IF sy-subrc <> 0.
MESSAGE e006.
ENDIF.
SELECT SINGLE kunnr FROM kna1 INTO vbak-kunnr WHERE kunnr IN s_kunnr.
IF sy-subrc <> 0.
MESSAGE e007.
ENDIF.
*********************************Data Fetching**************************
START-OF-SELECTION.
SELECT a~vbeln a~kunnr b~vbelv
FROM vbak AS a INNER JOIN vbfa AS b
ON a~vbeln = b~vbeln
INTO CORRESPONDING FIELDS OF TABLE lt_sd_c1
WHERE vkorg IN s_vkorg
AND vtweg IN s_vtweg
AND spart IN s_spart
AND kunnr IN s_kunnr.
IF NOT lt_sd_c1[] IS INITIAL.
SELECT vbeln vlaufz vuntdat vbegdat venddat
FROM veda INTO CORRESPONDING FIELDS OF TABLE lt_sd_c2
FOR ALL ENTRIES IN lt_sd_c1
WHERE vbeln = lt_sd_c1-vbelv
AND venddat = p_dat.
ELSE.
MESSAGE i005.
EXIT.
ENDIF.
END-OF-SELECTION.
*******************************Display of Data**************************
IF list = 'X'.
LOOP AT lt_sd_c2.
WRITE:/0 sy-vline,
lt_sd_c2-vbeln UNDER 'SALES DOCUMENT', 16 sy-vline,
lt_sd_c2-vuntdat UNDER 'CONTRACT SINGED DATE', 42 sy-vline,
lt_sd_c2-vbegdat UNDER 'CONTRACT START DATE', 65 sy-vline,
lt_sd_c2-venddat UNDER 'CONTRACT END DATE' COLOR 6, 100 sy-vline,
lt_sd_c2-vlaufz UNDER 'VALIDITY PERIOD OF CONTRACT', 130 sy-vline.
ENDLOOP.
ULINE.
ELSE.
**************Calling a subroutine for Field display in ALV*************
PERFORM built_field_catalog.
*************Calling fucntion module for ALV****************************
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_background_id = 'ALV_BACKGROUND'
i_grid_title = 'Contract Details'
* i_structure_name = 'veda'
it_fieldcat = gt_fieldcat[]
TABLES
t_outtab = lt_sd_c2.
ENDIF.
**************************Header for the page***************************
TOP-OF-PAGE.
WRITE:/ 'CREATED BY : ', sy-uname,
102 'CREATED ON :', sy-datum,
/1(130) sy-uline .
WRITE:/ sy-vline, 50 ' CONTRACT DETAILS ' COLOR 5,
111 'Page No:',
sy-pagno,
130 sy-vline.
ULINE.
WRITE:/0 sy-vline,
2 'SALES DOCUMENT' COLOR 3,16 sy-vline,
20 'CONTRACT SIGNED DATE' COLOR 3, 42 sy-vline,
45 'CONTRACT START DATE' COLOR 3, 65 sy-vline,
75 'CONTRACT END DATE' COLOR 3, 100 sy-vline,
102 'VALIDITY PERIOD OF CONTRACT' COLOR 3, 130 sy-vline.
ULINE.
*&---------------------------------------------------------------------*
*& Form built_field_catalog
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* --> p1 text
* <-- p2 text *----------------------------------------------------------------------* FORM built_field_catalog. gs_fieldcat-col_pos = '1'. gs_fieldcat-fieldname = 'VBELN'.
gs_fieldcat-outputlen = 30. gs_fieldcat-seltext_l = 'SALES DOCUMENT NUMBER'.
APPEND gs_fieldcat TO gt_fieldcat. gs_fieldcat-col_pos = '2'. gs_fieldcat-fieldname = 'VLAUFZ'. gs_fieldcat-outputlen = 9. gs_fieldcat-seltext_l = 'VALIDITY'. APPEND gs_fieldcat TO gt_fieldcat. gs_fieldcat-col_pos = '3'. gs_fieldcat-fieldname = 'VUNTDAT'.
gs_fieldcat-outputlen = 12. gs_fieldcat-seltext_l = 'SIGNED DATE'. APPEND gs_fieldcat TO gt_fieldcat. gs_fieldcat-col_pos = '4'. gs_fieldcat-fieldname = 'VBEGDAT'. gs_fieldcat-outputlen = 12. gs_fieldcat-seltext_l = 'START DATE'. APPEND gs_fieldcat TO gt_fieldcat.
gs_fieldcat-col_pos = '5'. gs_fieldcat-fieldname = 'VENDDAT'. gs_fieldcat-outputlen = 12.
gs_fieldcat-seltext_l = 'END DATE'. APPEND gs_fieldcat TO gt_fieldcat. ENDFORM.
Wednesday, October 1, 2008
Subscribe to:
Post Comments (Atom)
Archives
-
▼
2008
(167)
-
▼
October
(145)
- SAP ALE ABAP DETIAL
- SAP ABAP ALE IDOC'S
- SAP - DIFFERENCE BETWEEN CONVERSION AND INTERFACE
- BAPI AND IDOC ALE
- SAP ABAP MESSAGE CONTORL
- SAP IDOC'S IN ABAP INTRODUCTION
- SAP ABAP IDOC'S OUTLOOK
- SAP ABAP IDOC PROCESSING
- SAP ABAP IDOC'S BASIC TOOLS I
- SAP ABAP IDOC'S BASIC TOOLS II
- SAP ABAP IDOC'S INBOUND BASIC TOOLS III
- SAP IDOC OUT BOUND TRIGGERS II
- SAP IDOCS OUTBOUND TRIGGER II
- SAP IDOC'S OUTBOUND TRIGGER III
- SAP Work flow based outbound Idoc's
- SAP ALE Change Pointers
- SAP Dispatching ALE IDocs for Change Pointers
- SAP IDOC design and Processing
- SAP Creation of the IDoc Data
- SAP Developing an Outbound IDoc Function
- SAP Converting Data into IDoc Segment Format
- SAP Partner Profiles and Ports
- SAP Defining the partner profile for ALE IDOC
- SAP Data Ports ( WE21 ) in idoc
- SAP RFC in R/3
- SAP Workflow from Change Documents
- SAP ALE Distribution Scenario
- SAP Useful ALE Transaction Codes
- BAPI Creating IDocs and ALE Interface
- R/3 RFC from MS Office Via Visual Basic
- SD WORK FLOW SCENARIOS I
- SD WORK FLOW SCENARIOS II
- SD WORK FLOW SCENARIOS III
- SD WORK FLOW SCENARIOS IV
- SD WORK FLOW SCENARIOS V
- SD WORK FLOW SCENARIOS VI
- SD WORK FLOW SCENARIOS VII
- MM WORK FLOW SCENORIOS I
- MM WORK FLOW SCENORIOS II
- MM WORK FLOW SCENORIOS III
- MM WORK FLOW SCENORIOS IV
- MM WORK FLOW SCENORIOS V
- MM WORK FLOW SCENORIOS VI
- MM WORK FLOW SCENARIOS VII
- MM WORK FLOW SCENARIOS VIII
- MM WORK FLOW SCENARIOS IX
- MM WORK FLOW SCENARIOS X
- MM WORK FLOW SCENARIOS XI
- WORK FLOW SCENARIOS in SAP ABAP
- SAP ABAP WORK FLOW I
- SAP ABAP WORK FLOW II
- SAP ABAP WORK FLOW III
- SAP ABAP Work Flow IV
- SAP ABAP Workflow Technology
- SAP OPTIMIZATION
- abap type key ward
- PERFORMENCE TIPS
- SAP ABAP INTERNAL TABLES IN BRIEF
- SAP ABAP RUN TIME ANALASIS
- MEMORY In SAP ABAP
- NAVIGATION In SAP ABAP
- WORK BENCH AND TOOLS In SAP ABAP
- DATA OBJECTS AND STATEMENTS In SAP ABAP
- INTERNAL PROGRAM MODULARIZATION In SAP ABAP
- SAP ABAP CONSITENCEY THROUGH INPUT CHECKS
- RUN TIME ENVIRONMENT In SAP ABAP
- SAP ABAP INTER TABLE OPERATIONS
- STATEMENTS In SAP ABAP
- SAP ABAP INTERNAL TABLES
- SAP ABAP SUB ROUTIENS
- SAP ABAP FUNCTION MODULES AND GROUPS
- SAP ABAP QUARY ADMINSTRATION
- SAP ABAP SAVING LISTS AND BACK GROUND PROCESSING
- SAP ABAP PROGRAM INTERFACE
- SAP ABAP LOCK CONCEPT
- SAP ABAP AUTHORISATION CHECKS
- SAP ABAP PERFORMENCE TIPS
- In SAP SYSTEM FIELDS
- SAP ABAP CONTROL BLOCKS
- SAP ABAP BUFFERING
- SAP ABAP MATCH CODE OBJECTS
- SAP ABAP LOCKS
- SAP SAMPLE CODE FOR OUTPUT TO EXCEL AND IN PUT FIL...
- SAP MULTIPLE INTERACTIVE REPORT SAMPLE CODE
- MULTIPLE INTERACTIVE REPORT SAMPLE CODE II
- CALLING PROGRAM AND PASSING DATA
- SAP TECHNIQUES FOR LIST CREATION AND SAP QUARY
- SAP SELECTION SCREENS ABAP REPORT
- SAP ABAP FAQ ON SCRIPTS I
- SAP ABAP FAQ ON SCRIPTS II
- SAP ABAP FAQ ON SCRIPTS III
- IN SAP ABAP TABLE TYPES
- SAP ABAP TYPES OF VIEWS
- SAP ABAP DATA BASE UPDATES COMPLETE
- SAP ABAP LOCK CONCEPT
- SAP ORGANIZING DATABASE UPDATES
- SAP ENHANCEMENTS TO DICTIONERY ELEMENTS
- DATA BASE DIALOG IN ABAP
- ABAP DICTIONARY I
- PERFORMANCE DURING TABLE ACCESS
-
▼
October
(145)
1 comment:
Thanks for all the information, it was very helpful I really like that you are providing information.
SAP HR Training in Dallas
SAP HR Training in Dallas
Post a Comment