**--- End of Program
* Sales Order Changed History Display
*
* You can execute the report by :
* 1. Change Date
* 2. User Name
* 3. Sales Order Number
*
* Submitted by : SAP Basis, ABAP Programming and Other IMG Stuff
*
*
REPORT ZSDCHANGE LINE-SIZE 132 NO STANDARD PAGE HEADING
LINE-COUNT 065(001)
MESSAGE-ID VR.
TABLES: DD04T,
CDHDR,
CDPOS,
DD03L,
DD41V,
T685T,
VBPA,
TPART,
KONVC,
VBUK.
DATA: BEGIN OF ICDHDR OCCURS 50.
INCLUDE STRUCTURE CDHDR.
DATA: END OF ICDHDR.
SELECT-OPTIONS: XUDATE FOR ICDHDR-UDATE,
XNAME FOR ICDHDR-USERNAME,
XVBELN FOR VBUK-VBELN.
SELECTION-SCREEN SKIP.
SELECTION-SCREEN BEGIN OF BLOCK BLK1 WITH FRAME TITLE TEXT-001.
PARAMETERS: SUDATE RADIOBUTTON GROUP R1,
SNAME RADIOBUTTON GROUP R1,
SOBID RADIOBUTTON GROUP R1.
SELECTION-SCREEN END OF BLOCK BLK1.
DATA: WFLAG,
WCHANGENR LIKE CDHDR-CHANGENR,
WUDATE LIKE CDHDR-UDATE,
WNAME LIKE CDHDR-USERNAME,
WVBELN LIKE VBUK-VBELN,
WDEC1 TYPE P DECIMALS 3,
WDEC2 TYPE P DECIMALS 3,
WDEC3 TYPE P DECIMALS 3,
WDEC4 TYPE P DECIMALS 3.
DATA: UTEXT(16) VALUE 'has been changed',
ITEXT(16) VALUE 'has been created',
DTEXT(16) VALUE 'has been deleted'.
DATA: BEGIN OF ICDSHW OCCURS 50.
INCLUDE STRUCTURE CDSHW.
DATA: END OF ICDSHW.
DATA: BEGIN OF ITAB OCCURS 10.
INCLUDE STRUCTURE CDSHW.
DATA: UDATE LIKE CDHDR-UDATE,
USERNAME LIKE CDHDR-USERNAME,
CHANGENR LIKE CDHDR-CHANGENR,
VBELN(10),
POSNR(6),
ETENR(4),
INDTEXT(200),
END OF ITAB.
SELECT * FROM VBUK WHERE VBELN IN XVBELN.
CLEAR CDHDR.
CLEAR CDPOS.
CDHDR-OBJECTCLAS = 'VERKBELEG'.
CDHDR-OBJECTID = VBUK-VBELN.
PERFORM READHEADER.
PERFORM READPOS.
LOOP AT ITAB.
CASE ITAB-TABNAME.
WHEN 'VBPA'.
IF ITAB-FNAME = 'KUNNR' OR
ITAB-FNAME = 'LIFNR' OR
ITAB-FNAME = 'PARNR' OR
ITAB-FNAME = 'PERNR' OR
ITAB-FNAME IS INITIAL.
MOVE ITAB-TABKEY TO VBPA.
SELECT SINGLE * FROM TPART WHERE SPRAS = SY-LANGU
AND PARVW = VBPA-PARVW.
IF SY-SUBRC = 0.
REPLACE '&' WITH TPART-VTEXT INTO ITAB-INDTEXT.
ENDIF.
ENDIF.
WHEN 'VBAP'.
IF ITAB-FNAME IS INITIAL.
REPLACE '&' WITH 'Item' INTO ITAB-INDTEXT.
ENDIF.
WHEN 'KONVC'.
MOVE ITAB-TABKEY TO KONVC.
SELECT SINGLE * FROM T685T WHERE SPRAS = SY-LANGU
AND KVEWE = 'A'
AND KAPPL = 'V'
AND KSCHL = KONVC-KSCHL.
IF SY-SUBRC = 0.
REPLACE '&' WITH T685T-VTEXT INTO ITAB-INDTEXT.
ENDIF.
ENDCASE.
IF ITAB-INDTEXT(1) EQ '&'.
REPLACE '&' WITH ITAB-FTEXT(40) INTO ITAB-INDTEXT.
ENDIF.
IF ITAB-CHNGIND = 'I'.
REPLACE '%' WITH ITEXT INTO ITAB-INDTEXT.
ELSEIF ITAB-CHNGIND = 'U'.
REPLACE '%' WITH UTEXT INTO ITAB-INDTEXT.
ELSE.
REPLACE '%' WITH DTEXT INTO ITAB-INDTEXT.
ENDIF.
CONDENSE ITAB-INDTEXT.
MODIFY ITAB.
ENDLOOP.
ENDSELECT.
IF SUDATE = 'X'.
SORT ITAB BY UDATE VBELN POSNR ETENR.
ELSEIF SOBID = 'X'.
SORT ITAB BY VBELN POSNR ETENR UDATE.
ELSE.
SORT ITAB BY USERNAME VBELN POSNR ETENR UDATE.
ENDIF.
LOOP AT ITAB.
CLEAR WFLAG.
IF SUDATE = 'X'.
IF WUDATE NE ITAB-UDATE.
SKIP.
WRITE:/001 ITAB-UDATE,
023 ITAB-USERNAME,
037(10) ITAB-VBELN.
WFLAG = 'X'.
WUDATE = ITAB-UDATE.
WCHANGENR = ITAB-CHANGENR.
ENDIF.
ELSEIF SOBID NE 'X'.
IF WVBELN NE ITAB-VBELN.
SKIP.
WRITE:/001 ITAB-VBELN.
WVBELN = ITAB-VBELN.
ENDIF.
ELSE.
IF WNAME NE ITAB-USERNAME.
SKIP.
WRITE:/001 ITAB-USERNAME.
WNAME = ITAB-USERNAME.
ENDIF.
ENDIF.
IF WCHANGENR NE ITAB-CHANGENR.
WRITE:/023 ITAB-USERNAME,
037(10) ITAB-VBELN.
WFLAG = 'X'.
WCHANGENR = ITAB-CHANGENR.
ENDIF.
IF WFLAG = 'X'.
WRITE: 013 ITAB-CHNGIND,
049 ITAB-POSNR,
057 ITAB-ETENR,
065 ITAB-INDTEXT(60).
ELSE.
WRITE: /013 ITAB-CHNGIND,
049 ITAB-POSNR,
057 ITAB-ETENR,
065 ITAB-INDTEXT(60).
ENDIF.
WRITE:/065 ITAB-F_OLD.
WRITE:/065 ITAB-F_NEW.
ENDLOOP.
FORM READHEADER.
CALL FUNCTION 'CHANGEDOCUMENT_READ_HEADERS'
EXPORTING
DATE_OF_CHANGE = CDHDR-UDATE
OBJECTCLASS = CDHDR-OBJECTCLAS
OBJECTID = CDHDR-OBJECTID
TIME_OF_CHANGE = CDHDR-UTIME
USERNAME = CDHDR-USERNAME
TABLES
I_CDHDR = ICDHDR
EXCEPTIONS
NO_POSITION_FOUND = 1
OTHERS = 2.
CASE SY-SUBRC.
WHEN '0000'.
WHEN '0001'.
MESSAGE S311.
LEAVE.
WHEN '0002'.
MESSAGE S311.
LEAVE.
ENDCASE.
ENDFORM.
FORM READPOS.
LOOP AT ICDHDR.
CHECK ICDHDR-UDATE
IN XUDATE.
CHECK ICDHDR-USERNAME
IN XNAME.
CALL FUNCTION 'CHANGEDOCUMENT_READ_POSITIONS'
EXPORTING
CHANGENUMBER = ICDHDR-CHANGENR
TABLEKEY = CDPOS-TABKEY
TABLENAME = CDPOS-TABNAME
IMPORTING
HEADER = CDHDR
TABLES
EDITPOS = ICDSHW
EXCEPTIONS
NO_POSITION_FOUND = 1
OTHERS = 2.
CASE SY-SUBRC.
WHEN '0000'.
LOOP AT ICDSHW.
CHECK ICDSHW-CHNGIND NE 'E'.
CLEAR ITAB.
MOVE-CORRESPONDING ICDHDR TO ITAB.
MOVE-CORRESPONDING ICDSHW TO ITAB.
CASE ITAB-TABNAME.
WHEN 'KONVC'.
MOVE ICDHDR-OBJECTID TO ITAB-VBELN.
MOVE ICDSHW-TABKEY(6) TO ITAB-POSNR.
WHEN OTHERS.
MOVE ICDSHW-TABKEY+3(10) TO ITAB-VBELN.
MOVE ICDSHW-TABKEY+13(6) TO ITAB-POSNR.
MOVE ICDSHW-TABKEY+19(4) TO ITAB-ETENR.
ENDCASE.
MOVE '& %' TO ITAB-INDTEXT.
APPEND ITAB.
CLEAR ITAB.
ENDLOOP.
WHEN OTHERS.
MESSAGE S311.
LEAVE.
ENDCASE.
ENDLOOP.
ENDFORM.
TOP-OF-PAGE.
WRITE:/ SY-DATUM,SY-UZEIT,
50 'SALES ORDER CHANGE HISTORY',
120 'Page', SY-PAGNO.
WRITE: / SY-REPID,
60 'SALES ORDERS STATISTICS'.
SKIP.
ULINE.
IF SUDATE = 'X'.
WRITE:/001 'Change Date',
013 'Time',
023 'User Name',
037 'Sale Order',
049 'Line',
057 'Sch No',
065 'Changes'.
ELSEIF SOBID = 'X'.
WRITE:/001 'Sale Order',
013 'Line',
021 'Sch No',
029 'Change Date',
041 'Time',
051 'User Name',
065 'Comment'.
ELSE.
WRITE:/001 'User Name',
015 'Time',
025 'Change Date',
037 'Sale Order',
049 'Line',
057 'Sch No',
065 'Changes'.
ENDIF.
ULINE.
Monday, November 9, 2009
Sales Order Changed History Display
Labels:
SAP SD ABAP Reports
Subscribe to:
Post Comments (Atom)
Archives
-
▼
2009
(359)
-
▼
November
(115)
- Supplementary Invoice in SD SAP
- Cin /excise invoice in sales and distribution
- Assign Invoice List Type to Billing Type
- Important Tips for Interview for SAP SD
- SAP SD Interview Questions
- Interview Question and Answers on SAP SD
- Some SAP SD Interview Questions I
- Some SAP SD Interview Questions II
- SAP Sales and Distribution Frequently Asked Question
- Link Between SAP SD, MM & FI
- Why Do We Assign Division to Sales Organisation
- SAP SD resume
- SAP SD Interview tips and tricks
- Basic Process of how Packing Works
- The "Packing Process" with an Example
- SAP SD Deleted deliveries
- SAP SD Consolidation route and delivery routes
- Define SD Tax condition type
- Customizing Customer Hierarchy in SD
- How sales document is structured?
- SAP SD Customer Groups
- SAP SD Picking of Goods
- Creating a Sales Document in SAP R/3
- Line item: SD Header information is missing
- SAP SD ALE distribution model for customers master
- SAP SD Define Incompleteness procedures
- SAP SD Partner determination and control
- SAP SD Enterprise structure
- SAP SD Credit Management How To Do Configuration F...
- SAP SD Credit Management MRP block for Credit limi...
- SAP SD Credit Management Credit Mgmt Dynamic checking
- SAP SD Credit Management Difference Between Simple...
- SAP SD Credit Management Sales value field in not ...
- SAP SD Credit Management Set Up for Credit Card Pa...
- SD Credit Management Dunning Process In Credit Man...
- SD Dunning Process In Credit Management
- The "SD Packing Process" with an Example
- Sales Order Management Transactions
- SD Display/change data in credit management
- SD Configuration For Credit Management
- SAP SD Variant Configuration
- SD Customer hierarchy
- What is purpose of maintaining common SD distribut...
- What is the difference between SD ERB and ERU acco...
- SD What and where types of copy controls we change
- Line item: SD incorrect account information in header
- SD Line item: branch items missing
- What is meant by transfer of data from legacy code
- Steps to transport a SD Configuration Request
- Free SD EDI Configuration guide
- SD Define Rule for Date Determination
- Define SD Scheduling by Sales Document Type
- SD Configuring Pricing Control
- Define Reasons for SD Rejection
- Define SD Sales Document Types
- SD Pricing Procedure Configuration
- SAP SD Data Migration
- SAP SD CIN Configuration
- CIN /excise invoice in sales and distribution
- CIN-FI Entries
- Apply support package for CIN version ECC 5.0
- SAP 4.6C : SAINT: CIN
- Export Billing Configuration with CIN and Foreign ...
- Regarding fileds in CIN
- SAP SD CIN Issues
- SAP SD Billing cannot be Release to Accounting
- SAP SD Princing Default Start Variant for VF04
- SAP SD Billing Condition Exclusion which will be d...
- SAP SD Billing Steps for creating a new or changin...
- SD Billing Block will not worked if you did not as...
- SAP SD Billing Plan for Milestone Billing
- SAP SD Billing - Combine Billing for deliveries wi...
- SD Billing Spilt by Item Category
- SAP SD Billing Maximum number of items in FI reach...
- SAP SD Billing Prepaid process possible
- SD Billing Restricting Number Of Items In Billing Doc
- M/SD: automatic transfer of cancellation billing d...
- What are the Steps for the End-user Training in SA...
- User-Exits in the SD In- and Outbound Processing o...
- FREE SAP SD GOODS
- SAP SD Intercompany Sales Processing & Billing
- The SD Delivery Process
- If we dont give the horizan period in dynamic SD c...
- SD Billing and Material Determination
- SAP out abt SD and MM ISSUES
- Availability Check on Quotation
- SD material Determination based on availability check
- Creating Multiple Materials in Material Determination
- Backward and Forward Scheduling
- Issue free goods to selected Customers
- SD Availability check
- Avaialbility check 01 (Daily requirement) and 02 (...
- SD Availability Check
- Settlement Downpayment with Installment payment Term
- SD What r the 5 imp fields to be maintained in a/c...
- Special Processing Indicator
- Sales and Distribution - Upload Condition Pricing
- Sales Order Changed History Display
- SAP SD Reports
- SD Questions on Corporate Structure
-
▼
November
(115)
No comments:
Post a Comment