on 01-31-2012 1:38 PM
Hi can you please explain me how to transfer data in change log table of dso to z-table using abap code ,with out using Function module concept
REPORT.
TYPES : BEGIN OF TY_DSO,
F1 TYPE /BIC/XXXX-/BIC/CID,
F2 TYPE /BIC/XXXX-/BIC/PID,
END OF TY_DSO.
/**** INTERNAL TABLE DECLARATIONS******
DATA IT_DSO TYPE TABLE OF TY_DSO.
DATA WA_DSO TYPE TABLE OF ZTABLE.
/***WORK AREA DECLARATIONS*********
DATA IT TYPE TY_DSO.
DATA WA TYPE ZTABLE.
SELECT /BIC/CID /BIC/PID FROM /BIC/ASD00 INTO TABLE IT_DSO.
LOOP AT IT_DSO INTO IS_DSO.
WA-/BIC/CID1 = IT-F1.
WA-/BIC/PID1 = IT-F1.
APPEND WA TO WA_DSO
ENDLOOP.
INSERT /BIC/XXX FROM TABLE WA_DSO
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
**
PROGRAM NAME: ZBW_DELTA_TO_GSTAR **
report ZBW_DELTA_TO_GSTAR no standard page heading
line-size 120
line-count 75
message-id ZBW_MSG_CLS.
tables: ZGIV_DLTA_EBV_BB,
ZGIV_DLTA_EM2_BL,
ZGIV_DLTA_EM2_BK.
.
----
Selection Screen Definitions
----
SELECTION-SCREEN: BEGIN OF BLOCK INNER WITH FRAME TITLE TEXT-001.
SELECTION-SCREEN: SKIP 1.
PARAMETERS: EBVBB RADIOBUTTON GROUP ROLL,
EM2BL RADIOBUTTON GROUP ROLL,
EM2BK RADIOBUTTON GROUP ROLL.
SELECTION-SCREEN: END OF BLOCK INNER.
Data: WS_UPDATE_FLAG Type C,
UCounter(9) Type N,
ICounter(9) Type N.
DATA: T_ZGIV_DLTA_EBV_BB Type Standard Table of ZGIV_DLTA_EBV_BB,
s_ZGIV_DLTA_EBV_BB LIKE line of T_ZGIV_DLTA_EBV_BB.
DATA: T_ZGIV_DLTA_EM2_BK Type Standard Table of ZGIV_DLTA_EM2_BK,
s_ZGIV_DLTA_EM2_BK LIKE line of T_ZGIV_DLTA_EM2_BK.
DATA: T_ZGIV_DLTA_EM2_BL Type Standard Table of ZGIV_DLTA_EM2_BL,
s_ZGIV_DLTA_EM2_BL LIKE line of T_ZGIV_DLTA_EM2_BL.
----
Standard Internal Tables - Describe usage.
----
*
data: begin of i_AEPSD_O0140 occurs 0.
include structure /BIC/AEPSD_O0140.
data: end of i_AEPSD_O0140.
data: begin of i_AEPSD_O0240 occurs 0.
include structure /BIC/AEPSD_O0240.
data: end of i_AEPSD_O0240.
data: begin of i_AEPSD_O0340 occurs 0.
include structure /BIC/AEPSD_O0340.
data: end of i_AEPSD_O0340.
*
data: begin of i_GIV_DLTA_EBV_BB occurs 0.
include structure ZGIV_DLTA_EBV_BB.
data: end of i_GIV_DLTA_EBV_BB.
data: begin of i_GIV_DLTA_EM2_BK occurs 0.
include structure ZGIV_DLTA_EM2_BK.
data: end of i_GIV_DLTA_EM2_BK.
data: begin of i_GIV_DLTA_EM2_BL occurs 0.
include structure ZGIV_DLTA_EM2_BL.
data: end of i_GIV_DLTA_EM2_BL.
*
----
Miscellaneous Program Variables and Constants.
----
************************************************************************
************************************************************************
**
TOP-OF-PAGE
**
************************************************************************
************************************************************************
top-of-page.
************************************************************************
************************************************************************
**
START-OF-SELECTION
**
************************************************************************
************************************************************************
start-of-selection.
Clear: i_GIV_DLTA_EBV_BB,
i_GIV_DLTA_EM2_BK,
i_GIV_DLTA_EM2_BL,
UCounter, ICounter.
IF EBVBB = 'X'.
PERFORM 100_EXTRACT_EBV_BB_DELTA_RECS.
ELSEIF EM2BK = 'X'.
PERFORM 100_EXTRACT_EM2_BK_DELTA_RECS.
ELSE.
PERFORM 100_EXTRACT_EM2_BL_DELTA_RECS.
ENDIF.
*----
**
FORM 100_EXTRACT_EBV_BB_DELTA_RECS
**
*----
FORM 100_EXTRACT_EBV_BB_DELTA_RECS.
Refresh: i_AEPSD_O0140,
i_GIV_DLTA_EBV_BB.
Clear: UCounter, ICounter, s_ZGIV_DLTA_EBV_BB .
Select * From /BIC/AEPSD_O0140
Into TABLE i_AEPSD_O0140.
IF SY-Subrc = 0.
LOOP AT i_AEPSD_O0140.
MOVE-CORRESPONDING i_AEPSD_O0140 TO s_ZGIV_DLTA_EBV_BB.
MOVE SY-DATUM to s_ZGIV_DLTA_EBV_BB-create_dt.
INSERT ZGIV_DLTA_EBV_BB FROM s_ZGIV_DLTA_EBV_BB.
IF SY-Subrc = 0.
ICounter = ICounter + 1.
ELSE.
UPDATE ZGIV_DLTA_EBV_BB FROM s_ZGIV_DLTA_EBV_BB.
IF SY-Subrc = 0.
UCounter = UCounter + 1.
ELSE.
Message E067 with SY-DATUM ' ' SY-UZEIT ' '.
ENDIF.
ENDIF.
ENDLOOP.
ENDIF.
ENDFORM. "100_EXTRACT_EBV_BB_DELTA_RECS
*----
**
FORM 100_EXTRACT_EM2_BK_DELTA_RECS
**
*----
FORM 100_EXTRACT_EM2_BK_DELTA_RECS.
Refresh: i_AEPSD_O0240,
i_GIV_DLTA_EM2_BK.
Clear: UCounter, ICounter, s_ZGIV_DLTA_EM2_BK .
Select * From /BIC/AEPSD_O0240
Into TABLE i_AEPSD_O0240.
IF SY-Subrc = 0.
LOOP AT i_AEPSD_O0240.
MOVE-CORRESPONDING i_AEPSD_O0240 TO s_ZGIV_DLTA_EM2_BK.
MOVE SY-DATUM to s_ZGIV_DLTA_EM2_BK-create_dt.
INSERT ZGIV_DLTA_EM2_BK FROM s_ZGIV_DLTA_EM2_BK.
IF SY-Subrc = 0.
ICounter = ICounter + 1.
ELSE.
UPDATE ZGIV_DLTA_EM2_BK FROM s_ZGIV_DLTA_EM2_BK.
IF SY-Subrc = 0.
UCounter = UCounter + 1.
ELSE.
Message E067 with SY-DATUM ' ' SY-UZEIT ' '.
ENDIF.
ENDIF.
ENDLOOP.
ENDIF.
ENDFORM. "100_EXTRACT_EM2_BK_DELTA_RECS
*----
**
FORM 100_EXTRACT_EM2_BL_DELTA_RECS
**
*----
FORM 100_EXTRACT_EM2_BL_DELTA_RECS.
Refresh: i_AEPSD_O0340,
i_GIV_DLTA_EM2_BL.
Clear: UCounter, ICounter, s_ZGIV_DLTA_EM2_BL .
Select * From /BIC/AEPSD_O0340
Into TABLE i_AEPSD_O0340.
IF SY-Subrc = 0.
LOOP AT i_AEPSD_O0340.
MOVE-CORRESPONDING i_AEPSD_O0340 TO s_ZGIV_DLTA_EM2_BL.
MOVE SY-DATUM to s_ZGIV_DLTA_EM2_BL-create_dt.
INSERT ZGIV_DLTA_EM2_BL FROM s_ZGIV_DLTA_EM2_BL.
IF SY-Subrc = 0.
ICounter = ICounter + 1.
ELSE.
UPDATE ZGIV_DLTA_EM2_BL FROM s_ZGIV_DLTA_EM2_BL.
IF SY-Subrc = 0.
UCounter = UCounter + 1.
ELSE.
Message E067 with SY-DATUM ' ' SY-UZEIT ' '.
ENDIF.
ENDIF.
ENDLOOP.
ENDIF.
ENDFORM. "100_EXTRACT_EM2_BL_DELTA_RECS
************************************************************************
************************************************************************
**
END-OF-SELECTION
**
************************************************************************
************************************************************************
end-of-selection.
perform D1000_REPORT_DATA.
************************************************************************
************************************************************************
**
D1000_REPORT_DATA
**
************************************************************************
************************************************************************
form D1000_REPORT_DATA.
*Display the title of the program
write: /25 SY-TITLE.
skip.
Diaplay the details of the user and time
write: /1 'Executed by', 15 SY-UNAME, 30 'Date',
38 SY-DATUM, 53 'Time', 60 SY-UZEIT.
skip 2.
write: / 'Delta Records have been extracted ',
/ 'Updates : ', UCounter,
/ 'Inserts : ', ICounter.
skip.
skip 3.
write: /20 'End of the report'.
endform. "D1000_REPORT_DATA
*
*
chgeck it out this also may hep you
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
you can get the name of the Change Log of a DSO by going to RSA1 -> Double click on the DSO, Go to Extras menu on top -> DB/Dictionary Status-> Change Log name
Now write a ABAP program (executable program) with the following logic:
Data: IT_TABLE TYPE TABLE OF /BIC/000xxxxx. "/BIC/000xxxxx = Change log table name
"I'm assuming there is a Z table with same structure
SELECT * FROM /BIC/000xxxxx INTO IT_TABLE
WHERE <CONDITION>.
REFRESH ZTABLE[]. "Deleting Contents of Z table
ZTABLE[] = IT_TABLE[]. "Transferring contents of changelog to z table.
"Or if you want to append/change records in the ztable, use the following
MODIFY ZTABLE FROM IT_TABLE. "Modify the contents for same key
APPEND ZTABLE FROM IT_TABLE. "Append the records to the ztable
This should be helpful
Regards,
Joe
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi.
Write an executable program (tcode se38).
In the program, write logic to pick up the data from the change log and insert it into your z-table.
Run the program.
regards
Jacob
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
86 | |
10 | |
10 | |
9 | |
6 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.