‎2007 Oct 17 7:52 AM
Create a new report to display contract document changes
I got an assignment to create a new report which must show the document changes in Functional Areas SD
Requirements are
1. create customised report that will allow them to list the changes made in contract documents with more
ranges options on the report selection parameters
Basically this customised report will retrive all the changes made in sales contract documents within a plant,date ranges and other selection parameters.
Testing scenarios
Test 1 : create a new contract document. Make changes to the contract line item information such as order qty, add in a new line item , apply rejection code, etc.
The report layout must shows
Sales offcie from __________ to __________
contract document number from ______________ to ______________
change Date from _______________ to __________________
change by < username >
-
Contract Doument Number
DATE Changes (Header Item) old value new value user
-
<sales Office code > < Sales_office_Description>
+ 400000600
08/10/2007 Customer purchase order date 00/00/0000 08/10/2007 user01
09/10/2007 10 Item credit price 330.00 323.40 user02
09/10/2007 30 Reason for rejection of
quotations and sales order
+ 400000601
08/10/2007 Customer Purchase order XYZ-111 ABC-123 USER03
08/10/2007 10 Item credit price 100.00 95.50 AUD USER03
Like above whoever made changes for the document the report must display as above
can anyone help me or give idea how to proceed with the codes
regards
Piroz
‎2007 Oct 17 7:57 AM
Hi piroz,
If you are a functional consultant, ask ur abaper to try coding.
if u are an abaper, try coding some what and ask help where u r feeling tough.
but if u r feeling tough to start coding itself, then it is not meanigfull.
any way dont mind,
ur report should have
slection screen which should be with parameters/select-options.
after that retrive data from dbtable using
select statements.
and display data using write statements.
‎2007 Oct 18 2:17 AM
Hi Hymavathi
I have little idea about the ABAP reports but your help will be more appriciable
I had gone through the tables there are CDHDR and CDPOS , from this tables
the following items have to be retrive to display the report as in attachement
These standards reports are taken from RVSD100 and RVSD200 reports which allow viewing changes on a single sales document in online mode howver the selection paratmeters for these two standard reports does not allow the selection parameters by plant code, document number, date ranges and also does not allow multiple sales document to be listed at the same time
I need a report that will allow them to list the changes made in the contract documents with more ranges options on the report selection parameters
basically this customised report will retrive all the changes made in sales contract documents within a plat , date ragne and other selection paramters
The report must allow ALV display also
sales office code and sales office description
+ contract document number
sort by date, header data filed name <01> with old and new values changes and username
sort by date, header data field name <02> with old and new values changes and username
etc....
etc...
can you please help me how to start the program and some coding if you have do we required funtional module etc.,I know it is easy but i need some push to start.
regards
Piroz
‎2007 Oct 18 2:25 AM
To get changes made to a Contract in a specified time frame, goto CDHDR table, enter OBJECTCLAS = 'VERKBELEG' (For Contracts), UDATE = Date range you are looking for.
This will give you list of all contracts changed on a particular day. Using this list, you can check data of CDPOS to see what exactly is changed in those Contracts.
You need to use Keys OBJECTCLAS, OBJECTID and CHANGENR values to retrieve data from CDPOS.
Please check this with some examples i your system using transaction SE16.
Hope this helps to start with.
ashish
‎2007 Oct 22 3:12 AM
Hey Ashish
Below is the report for document changes for 2 tables CDPOS, CDHDR
I need some modification for how to add the ranges
Plant from ________ to ___________
Udate from __________ to ___________-
Document No from ________ to __________
Change date from ____________ to _____________
username by __________
If i don't enter anything the it should display all the records esle the ranges defined.
I even want to add plant code from and to but not getting idea from which table it has to be taken? I want this to be display in ALV Gride format too.
Please could anyone help me in modification please urgent.........v urgent
REPORT ZCHGDOC.
TABLES: CDHDR,
CDPOS.
DATA: BEGIN OF itab occurs 0,
UDATE TYPE sy-datum,
end of itab.
SELECT-OPTIONS udate for sy-datum .
SELECTION-SCREEN BEGIN OF BLOCK DOCUMENT WITH FRAME TITLE TEXT-701.
PARAMETER: CHANGENR LIKE CDHDR-CHANGENR.
SELECTION-SCREEN END OF BLOCK DOCUMENT.
END-OF-SELECTION.
DATA: BEGIN OF IT_CDHDR OCCURS 0,
OBJECTCLAS LIKE CDHDR-OBJECTCLAS,
OBJECTID LIKE CDHDR-OBJECTID,
CHANGENR LIKE CDHDR-CHANGENR,
USERNAME LIKE CDHDR-USERNAME,
UDATE LIKE CDHDR-UDATE,
UTIME LIKE CDHDR-UTIME,
VALUE_NEW LIKE CDPOS-VALUE_NEW,
VALUE_OLD LIKE CDPOS-VALUE_OLD,
END OF IT_CDHDR.
DATA: WA LIKE LINE OF IT_CDHDR.
DATA: WA LIKE LINE OF IT_CDPOS.
DATA: BEGIN OF IT_CDPOS OCCURS 0,
OBJECTCLAS LIKE CDHDR-OBJECTCLAS,
OBJECTID LIKE CDHDR-OBJECTID,
CHANGENR LIKE CDHDR-CHANGENR,
TABNAME LIKE CDPOS-TABNAME,
FNAME LIKE CDPOS-FNAME,
VALUE_NEW LIKE CDPOS-VALUE_NEW,
VALUE_OLD LIKE CDPOS-VALUE_OLD,
END OF IT_CDPOS.
SELECT OBJECTCLAS
OBJECTID
CHANGENR
USERNAME
UDATE
UTIME INTO CORRESPONDING FIELDS OF TABLE IT_CDHDR
FROM CDHDR
WHERE OBJECTCLAS = 'VERKBELEG'.
IF IT_CDHDR[] IS NOT INITIAL.
SELECT OBJECTCLAS
OBJECTID
CHANGENR
VALUE_NEW
VALUE_OLD
FNAME
TABNAME
INTO CORRESPONDING FIELDS OF TABLE IT_CDPOS FROM CDPOS
FOR ALL ENTRIES IN IT_CDHDR
WHERE
OBJECTCLAS = IT_CDHDR-OBJECTCLAS
AND OBJECTID = IT_CDHDR-OBJECTID
AND CHANGENR = IT_CDHDR-CHANGENR.
SORT IT_CDPOS BY OBJECTCLAS OBJECTID CHANGENR.
ENDIF.
Add tables CDPOS DATA TO CDHDR.
DATA: INDEX TYPE i.
LOOP AT IT_CDHDR.
INDEX = SY-TABIX.
READ TABLE IT_CDPOS WITH KEY OBJECTCLAS = IT_CDHDR-OBJECTCLAS
OBJECTID = IT_CDHDR-OBJECTID
CHANGENR = IT_CDHDR-CHANGENR BINARY SEARCH.
IF SY-SUBRC = 0.
IT_CDHDR-VALUE_NEW = IT_CDPOS-VALUE_NEW.
IT_CDHDR-VALUE_OLD = IT_CDPOS-VALUE_OLD.
MODIFY IT_CDHDR INDEX index TRANSPORTING value_new value_old.
ENDIF.
LOOP AT IT_CDHDR INTO WA.
WRITE: WA-OBJECTID.
WRITE: / WA-UDATE,WA-CHANGENR,WA-USERNAME,WA-VALUE_NEW,WA-VALUE_OLD.
WRITE: / WA-CHANGENR,WA-VALUE_NEW,WA-VALUE_OLD.
ENDLOOP.
ENDLOOP.
‎2007 Oct 22 3:20 AM
I have just answered to this question in another thread. Please close this thread as there is another similar thread active in sdn.
ashish
‎2007 Oct 22 3:21 AM
Hi Ashish
How can I check the source code of the programe in se16
regards
Piroz
‎2007 Oct 22 3:23 AM
SE16 transaction is used to check data of a database table. You need to use transaction SE38 to check your program.
If you want to see if your select statement coded in program correct, go to se16, enter table name, give selection criteria (same as you mentioned in your code), if you get entries in the output, then your select statement is correct.
ashish
‎2007 Oct 17 8:13 AM
Hi,
You will get changed data for a document from the history tables like CDHDR and CDPOS.
Thanks!
Brunda
'Reward if useful'.