Posts

Showing posts with the label change document data element

Change Logs For ZTables Using SCDO Transaction Code - 7 (SAP ABAP).

Image
Submitted By: Shilpa Gunjan (LnT Infotech) 15) Now go to SM30. And enter the table name and click on change. 16) Now let’s change the 3rd record‘s discount from 10.00 to 15.00 and save it. On saving the event 01 gets triggered when we have inserted our logic and used the change document function module to update the change log in CDPOS and CDHDR sap log tables. 17) Now let’s check whether the changes has been logged in CDHDR table CDHDR Log Entry as shown: The corresponding entry in CDPOS Table is: In case if you want the complete log for the ZTABLE then you can now create a ZREPORT and fetch all the relevant details to display the LOG in a particular format. <<PREVIOUS PAGE                                                                               ...

Change Logs For ZTables Using SCDO Transaction Code - 6 (SAP ABAP).

Image
Submitted By: Shilpa Gunjan (LnT Infotech) 14) Click On editor and make the following changes as shown: COMPLETE CODE: FORM change_log. DATA : it_zptp_3rd_dis_tes TYPE STANDARD TABLE OF zptp_3rd_dis_tes, wa_old_zptp_3rd_dis_tes TYPE zptp_3rd_dis, wa_new_zptp_3rd_dis_tes TYPE zptp_3rd_dis. DATA: tabix type c. DATA: it_log_table TYPE TABLE OF cdtxt, wa_log_table TYPE cdtxt. SELECT * FROM zptp_3rd_dis_tes INTO TABLE it_zptp_3rd_dis_tes. LOOP AT total. IF <action> IS ASSIGNED AND <vim_total_struc> IS ASSIGNED AND <action> NE space. MOVE <vim_total_struc> TO wa_new_zptp_3rd_dis_tes. READ TABLE it_zptp_3rd_dis_tes INTO wa_old_zptp_3rd_dis_tes WITH KEY ekorg = wa_new_zptp_3rd_dis_tes-ekorg lifnr = wa_new_zptp_3rd_dis_tes-lifnr. tabix = sy-tabix. concatenate 'TE' tabix into wa_log_table-textart separated by '_' . wa_log_table-teilobjid = 'ZPTP_3RD_DIS_TES'. wa_log_table-textart = 'TEST'. wa_log_...

Change Logs For ZTables Using SCDO Transaction Code - 5 (SAP ABAP).

Image
Submitted By: Shilpa Gunjan (LnT Infotech) 11) Now go to SE37 and check the change document function module created. Now this change document object function module is ready to capture all the changes made to the records of the ZTABLE. NOW we need to do some coding so as to capture any changes in sap log tables CDPOS & CDHDR. 12) Consider table ZPTP_3RD_DIS_TES. Generate the table maintenance generator so that user can make new entries, update or delete entries. Go to SE11 --> Table Maintenance Generator. In The modifications Options available on the top of the line, Click EVENTS. 13) We will have to create an event 01 which gets triggered before saving the data in the database as shown: <<PREVIOUS PAGE                                                                        ...

Change Logs For ZTables Using SCDO Transaction Code - 4 (SAP ABAP).

Image
Submitted By: Shilpa Gunjan (LnT Infotech) 8. Now you will see a screen with all the details of the object that will get generated as shown: 9. Click On "SAVE" to complete the program generation for the change document object. You will receive a success message as shown below: 10. Here we can see an update function module gets created which can be used for logging the changes in the SAP standard tables CDPOS & CDHDR. Change logs should be in totality i.e. operations like Insert, Delete & Update functionalities done on the records should get tracked. In order to achieve all the operations we need to add a new variable (or say a flag) of type CHAR1 in the import parameters of the function module. When the value is passed as 'X' and the operation to be performed is 'D' (delete), then the current record will be logged for deletion in CDHDR. <<PREVIOUS PAGE                             ...

Change Logs For ZTables Using SCDO Transaction Code - 3 (SAP ABAP).

Image
Submitted By: Shilpa Gunjan (LnT Infotech) 5. Maintain the text for change document object and the table name, for which the change document object has been created. Then press enter to continue. You will get a screen as shown: 6. Now go to ‘Utilities’ and select ‘Generate Update PGM’. 7. A new screen will be displayed wherein the function group name has to be maintained. Incase if you have a function group name directly maintain it, or else you can create one as shown below: Enter the function group name. In this case we have taken “ZPTP_3RD_DIS_TEST” After entering the function group name press enter, you will get a pop up screen as shown below: Click on “YES” to generate a new function group. <<PREVIOUS PAGE                                                                       ...

Change Logs For ZTables Using SCDO Transaction Code - 2 (SAP ABAP).

Image
Submitted By: Shilpa Gunjan (LnT Infotech) STEP-BY-STEP ANALYSIS – CREATION OF CHANGED DOCUMENT OBJECT: 1. Enter Transaction code SCDO. Click on ‘Create’ button to start the creation of change document object. 2. Enter the name of the change document object in the pop-up screen. Take any name; in this case we have taken ‘ZPTP_3RD_DIS_TE’. Click the Continue button. 3. You get a pop-up screen to confirm the activity is displayed. Select Yes. 4. After pressing YES button, you will be asked to enter the package and the request number to save the object. A new screen appears as shown below: <<PREVIOUS PAGE                                                                                       NEXT PAGE>> ALSO READ: - Change Logs For ZTable...

Change Logs For ZTables Using SCDO Transaction Code - 1 (SAP ABAP).

Image
Submitted By: Shilpa Gunjan (LnT Infotech) In SAP implementation for a business, not all the requirements are covered in the standard SAP tables. Hence, there are possibilities wherein custom tables (ZTABLES) are used to hold important data. This article will help you explain how to track data changes in custom tables (ZTABLES) through standard SAP change tables (CDPOS & CDHDR) . Standard change tables C DHDR and CDPOS are used for tracking the changes made to the standard SAP objects. In case there is a requirement, wherein we need to track the changes made to custom tables i.e. ztables, we need to log those changes in standard SAP change tables (CDPOS & CDHDR). Two major processes involved in tracking the changes of custom tables are – 1) Change document object 2) Function module for the change document object Here we will see step-by-step procedure involved to achieve the same. SCENARIO: In this case we have a ztable wherein discounts are maintaine...