Who deleted the records
Hi,
How can i find the user who deleted the record when auditing is not enabled in the database?
Perhaps something like this should work ->
select a.sid,
a.serial#,
a.username,
a.ownerid,
b.sql_text,
a.status,
a.schemaname,
a.osuser,
a.process,
a.machine,
a.terminal,
a.program,
a.type,
a.module,
a.logon_time,
a.event,
a.service_name
from (
select sid,
serial#,
username,
ownerid,
status,
schemaname,
osuser,
process,
machine,
terminal,
program,
type,
module,
logon_time,
event,
service_name,
sql_id
from v$session as of timestamp(sysdate - 1/1440) -- 60/1440 indicates 1 hour before
) a,
select sql_text,
sql_id
from (select * from v$sqltext as of timestamp(sysdate - 1/1440))
where sql_text like '%delete from emp_n%'
) b
where a.sql_id = b.sql_id
and a.schemaname = upper('scott');I personally felt that - if you are DBA then you should blame it on yourself and not to any other developer. After all, this is your mistake - no matter the developer has done it intentionally or not. It's up to you people to maintain a proper security and not by them. And, you should take responsibility. Anyway, it's your matter. And, this is my opinion.
Regards.
Satyaki De.
Similar Messages
-
How to delete the record in Table
Hi Guru's,
i have Table which contain no.of Records.
i want to deleted one record. if i go to Table maint.Generator....from table itself..
how to do that... when we deleting the record. can we create new TR for that?
can anybody tell me.
Thanks in Advance,
venkatHi,
it is answered, here for my table there is no Table Maint.Generator.
i just explained how i have done it.
i just simply gone into Debug mode. there
code = Dele.
i have given. then i came out from debug mode to Table. there i just got Delete button on application tool bar.
i selected the record then icliked on Delete button.
it is got deleted.
But it is not asking for any new Transport Request.
Regards,
Venkat -
How to delete the record in the file present in the application server?
Hi,
I have two questions.
i) How can I delete a record based on some condition in the recordx in the file that is present in the application server?
ii) How can I lock the users whiel one user is accessing the file on the application server?
Thanks in advance.
SuvanHi,
If u want a frequent deletion this approach to delete a record from a file will havee unnecesary copy of records from one file to another and deletion of one file and renaming activities.
Instead what u can do is Add and field del_flag to ur record structure.
If u want to delete the record from a file just mark this del_flag as 'X'.
While processing u can have a loop like
loop at it_XXX where del_flag <> 'X'.
endloop.
This will logically delete the record.
When u r to finish the application at that time only perform this copying / deleting / and renaing activity
Hope this helps.
Cheers,
Nitin -
HOW to delete the records in CO1P?
Hi all:
When i close the PO,i find the PO have CO1P records.However ,the PO has been settled. Then how can i delete the records in CO1P for this PO.Dear,
CO1P:
Normally the Goods Movement errors are updated in Table AFFW - Goods Movements with Errors from Confirmations and in transaction COGI.
If the table is locked during background using update control for the confirmation then the errors are recorded in CO1P.
COFC:
Used for Reprocessing of errors in confirmation related to actual cost calculations.
Please run CORUPROC Program.
Please check this link also for further help
http://help.sap.com/saphelp_46c/helpdata/en/e3/7cd32396f611d1b5a60000e8359890/frameset.htm
Regards,
R.Brahmankar -
How to refresh after delete the records in ALV report ?
Hi Friends,
How to refresh after delete the records in ALV report.
I am deleting records in ALV report .
After successful delete the screen should refresh.
u201C Deleted records should not appear in the screen u201C.
Please guide me.
Regards,
SubashHi subhash,
FORM user_command USING r_ucomm LIKE sy-ucomm rs_selfield TYPE slis_selfield.
WHEN 'BACK'.
Refresh the internal table from the ALV grid
PERFORM update_alv_tab.
ENDFORM. "user_command
FORM update_alv_tab .
DATA : e_grid TYPE REF TO cl_gui_alv_grid.
CALL FUNCTION 'GET_GLOBALS_FROM_SLVC_FULLSCR'
IMPORTING
e_grid = e_grid.
CALL METHOD e_grid->check_changed_data.
"update_alv_tab
CALL METHOD e_grid->refresh_table_display.
ENDFORM. " UPDATE_ALV_TAB
Then see in Debug mode is it updating or not..
Please confirm .
And please paste the code if you can.
Regards. -
Regarding how to delete the record in internal table
Hi experts ,
how to delete the record in intarnal table after validating the data,
if record contains invalid fields?
i am giving my code see this and give me the answer?
loop at it_data into wa_data .
Validate Cost Center
READ TABLE it_kostl INTO wa_kostl WITH KEY kostl = wa_data-kostl BINARY SEARCH.
IF sy-subrc NE 0.
PERFORM update_error_log USING wa_data
text-004.
ENDIF.
Validate source file material ( material number )
loop at it_mara into wa_mara .
read table it_ausp into wa_ausp with key atwrt = wa_data-i_matnr .
if sy-subrc NE 0 .
PERFORM update_error_log USING wa_data
text-002.
delete it_data-objek .
else.
read table it_mara into wa_mara with key matnr = wa_ausp-objek .
if sy-subrc EQ 0 .
wa_data-objek = wa_mara-matnr.
wa_data-matkl = wa_mara-matkl.
ENDIF.
Modify it_data from wa_data .
endif.
*endloop.
Validate unit of measure (unit)
READ TABLE it_t006 INTO wa_t006 WITH KEY msehi = wa_data-unit .
IF sy-subrc NE 0.
PERFORM update_error_log USING wa_data
text-003.
endif.
Validate delivery location ( storage location )
READ TABLE it_lgort INTO wa_lgort WITH KEY del_loc = wa_data-del_loc.
IF sy-subrc NE 0.
PERFORM update_error_log USING wa_data
text-001.
if wa_data-flag ='x' .
delete it_data from wa_data .
endif.
ENDIF.
endloop.Hi Naren,
First get the index number of the IT_data table and store it in one variable whose declaration like this.
data: tabix type sy-tabix.
while reading the internal table it_data set the tabix variable.
tabix = sy-tabix.
Instead of the above use below one.
Delete it_data-objek
Use the Below statement it will delete the row from the internal table.
Delete it_data-objek index tabix
Thanks,
Chidanand -
How to delete the record of saved HRA Details...
Hi Experts,
I have put the details of HRA Correctly.But while updating HRA In 0008 Infotype i wrongly updated the wagetype,How should i change the Wagetype.
When i m trying to delete it is showing RECORD CAN NOT BE DELETED (TIME CONSTRAINT 1).
How can delete the record.
Thanking u .
SaiHi
Hope doing well ........ No need to delete any infotype but u can go to PA30 and in change mode their u can delete the wagetype which is wrongly entered
Rajeshk -
How to find out who deleted the central person ID of a pernr.
Hi,
I have a pernr 100 whose central person ID is deleted. I would like to know how can i find out who deleted it. Which table gives this information.
Thanks & Regards,
Soumya.It is stored as a relationship in HRP1001 & unless you have table logging turned on for this db table, I don't think you will be able to find out who deleted the Central Person. You can try running the Report RHCDOC_DISPLAY .
~Suresh -
How to find out who deleted the standard table enteries
Hi,
Somebody has deleted entire KNA1 in one of our systems. Is there any way to find out who deleted the entries?
Thanks & Regards,
Kumaran Duraiswamy.Hi
Look for help from an ABAPer. Go to SE11 for KNA1, use 'where-used list (ctrlshiftF3) and search for report that begin with Z* or Y* (perhaps LZ* or LY*, ie: function modules). See the ABAP coding if there is any instructions type:
DELETE kna1 FROM xxx.
Check too if the option &SAP_EDIT in tcode SE16N works in your system (see SAP Note 1420281 - CO-OM tools: SE16N: Deactivating &SAP_EDIT for instance)
I hope this helps you
Regards
Eduardo
PD: I forgot it, if option &SAP_EDIT works in SE16N, check the tables SE16N_CD_DATA and SE16N_CD_KEY.
Edited by: E_Hinojosa on Jun 24, 2011 11:04 AM -
How to track the user who deleted the info object.
Dear Gurus,
In our BI system one info object has got deleted. If I need to track the user who has deleted that how can I track it(in which DBtable). And the complication is one user ID is being used by many people, in this case how can I track that from which machine the Info Object has been deleted(if there is any possibility to track the machines by IP address).
Kindly let me know if there is any procedure to find it out. Your help will be rewarded with a great honour.
Regards
Mohan KumarHi dear,
you have to go in SLG1 transaction, and then select
Object: RSD
Subobject: IOBJ_DEL
External ID: (put here the name of your deleted IO)
Then choose a time range...and voilà, you can find the user who deleted the IO...
Hope it helps!
Bye,
Roberto
About the IP...look at USR41 table, but I think it's a bit difficult fo find data referred to the past...
If you haven't activated logon auditing in SM19... -
How to find the user who deleted the contents of DSO.
Dear friends,
Can u please tell me ,how to find the user who deleted the contents of the DSO.
The user has deleted the complete contents of the DSO. We need to find the user ,date and time.
regards,
VijaiHi,
If the user has used the manage option to delete the contents of the DSO then the changed by field will be updated by the users name. In case a program is used for the deletion then it wont be the case.
Regards
Govind. -
Sending email after deleting the records in a table
Hi
I am deleting the records in a table. After deleting the records,
i want to send an email to another person. I am planning to follow this steps.
1. Create a trigger on the table(AFTER DELETE ON table FOR EACH ROW)
to copy the deleted records to temporary table.
2. Read the temporary table and send an email.
Is there any other way we can do with out creating temporary table ?.
GovindI don't know what you plan to use to send the mail but here's a solution that would work.
-- Create a send mail procedure
create or replace procedure send_mail (
sender IN VARCHAR2,
recipient IN VARCHAR2,
message IN VARCHAR2)
IS
mailhost VARCHAR2(30) := 'localhost';
mail_conn utl_smtp.connection;
BEGIN
mail_conn := utl_smtp.open_connection(mailhost, 25);
utl_smtp.helo(mail_conn, mailhost);
utl_smtp.mail(mail_conn, sender);
utl_smtp.rcpt(mail_conn, recipient);
utl_smtp.data(mail_conn, message);
utl_smtp.quit(mail_conn);
END;
/-- Create the trigger to email deleted rows
create or replace trigger email_del_rows
after delete on <table>
for each row
declare
msg varchar2(2000);
begin
msg := 'COL1 COL2 COMPANY NAME DATE'||chr(10);
msg := msg||:old.col1||' '||:old.col2||' '||:old.company_name||' '||:old_date|| chr(10);
msg := msg||'END OF FILE';
send_mail('SENDER','[email protected]',msg);
end;
/You can make it look pretty but you get the basic idea. -
Problem after deleting the records........
Hi Folks,
Kindly help me with this report.
At one point I am deleting the itfinal internal table w.r.t
to HKONT.Before deleting I am having all the values for
LIFNR and AWKey,but once deleting(as mentioned earlier) I
am not getting these two values.The same Awkey is getting repeated
again and again.
Where I am going wrong.
REPORT zf14 no standard page heading line-size 134. .
TABLES: bkpf,bseg,lfa1,t001.
type-pools:slis.
TYPES : BEGIN OF x_bkpf,
bukrs TYPE bkpf-bukrs, " Company Code
belnr TYPE bkpf-belnr, " Document Number
gjahr TYPE bkpf-gjahr, " Fiscal year
awkey TYPE bkpf-awkey, " Object Key
bldat TYPE bkpf-bldat,
budat TYPE bkpf-budat,
END OF x_bkpf.
TYPES : BEGIN OF x_bseg,
bukrs TYPE bseg-bukrs, " Company Code
belnr TYPE bseg-belnr, " Document Number
gjahr TYPE bseg-gjahr, " Fiscal Year
koart TYPE bseg-koart,
hkont TYPE bseg-hkont, " G/L Account
ebeln TYPE bseg-ebeln, " Purchasing Document
lifnr TYPE bseg-lifnr, " Vendor Code
name1 type lfa1-name1,
ort01 type lfa1-ort01,
END OF x_bseg.
TYPES : BEGIN OF x_bseg1,
bukrs TYPE bseg-bukrs, " Company Code
belnr TYPE bsak-belnr, " Document Number
gjahr TYPE bsak-gjahr, " Fiscal Year
hkont TYPE bseg-hkont, " G/L Account
ebeln TYPE bseg-ebeln, " Purchasing Document
lifnr TYPE bseg-lifnr, " Vendor Code
wrbtr TYPE bseg-wrbtr, " Amt.in Doc.Curr
END OF x_bseg1.
types:begin of x_ven,
name1 type lfa1-name1,
ort01 type lfa1-ort01,
end of x_ven.
TYPES : BEGIN OF x_final,
bukrs TYPE bkpf-bukrs, " Company Code
belnr TYPE bkpf-belnr, " Document Number
gjahr TYPE bkpf-gjahr, " Fiscal year
blart TYPE bkpf-blart, " Document Type
awkey TYPE bkpf-awkey, " Object Key
bldat TYPE bkpf-bldat,
budat TYPE bkpf-budat,
mwskz TYPE bseg-mwskz,
qsskz TYPE bseg-qsskz,
wrbtr TYPE bseg-wrbtr, " Amount in Doc Curr
werks TYPE bseg-werks, " Recv Facility Code
hkont TYPE bseg-hkont, " G/L Account
ebeln TYPE bseg-ebeln, " Purchasing Document
ebeln1 type bseg-ebeln,
lifnr TYPE bseg-lifnr, " Vendor Code
lifnr1 type bseg-lifnr,
dmbtr TYPE bseg-dmbtr,
wrtbr type bseg-wrbtr,
vbill type bseg-wrbtr,
tdsamt type c,
tdsrate(4),
shkzg TYPE bseg-shkzg,
name1 TYPE lfa1-name1, "vendor Name
ort01 TYPE lfa1-ort01, "City
j_1icstno TYPE j_1imovend-j_1icstno, "CST
j_1ilstno TYPE j_1imovend-j_1ilstno ,"LST
END OF x_final.
DATA : it_bkpf TYPE TABLE OF x_bkpf WITH HEADER LINE .
DATA : it_bseg TYPE TABLE OF x_bseg WITH HEADER LINE .
DATA : it_bseg1 TYPE TABLE OF x_bseg1 WITH HEADER LINE .
DATA : itfinal TYPE TABLE OF x_final WITH HEADER LINE.
DATA : month_names LIKE t247 OCCURS 0 WITH HEADER LINE.
DATA :i(2), "month
y TYPE int4, "year
c(4),
v_bill LIKE bseg-dmbtr. " bill value
DATA : pos TYPE sy-tabix,
month(99),
month1(99).
data:sl_no(3) value 0.
*Alv
DATA:itfieldcat TYPE slis_t_fieldcat_alv WITH HEADER LINE.
DATA:itrepid TYPE sy-repid.
itrepid = sy-repid.
DATA:itevent TYPE slis_t_event.
DATA:itlistheader TYPE slis_t_listheader.
DATA:walistheader LIKE LINE OF itlistheader.
DATA:itlayout TYPE slis_layout_alv.
DATA:top TYPE slis_formname.
DATA:itsort TYPE slis_t_sortinfo_alv WITH HEADER LINE.
DATA:itprintparams TYPE slis_print_alv.
DATA:itvariant TYPE disvariant.
SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
PARAMETERS : p_bukrs LIKE t001-bukrs OBLIGATORY. "Company code
SELECT-OPTIONS : s_lifnr FOR lfa1-lifnr, "Vendor name
s_budat for sy-datum obligatory, "bkpf-budat OBLIGATORY, "Date
s_gjahr FOR bseg-gjahr NO-DISPLAY.
SELECTION-SCREEN END OF BLOCK b1.
AT SELECTION-SCREEN.
SELECT SINGLE bukrs
INTO t001-bukrs
FROM t001
WHERE bukrs = p_bukrs.
IF sy-subrc <> 0.
MESSAGE e000(z_ma) WITH 'Invalid Company Code'.
ENDIF.
IF NOT s_lifnr[] IS INITIAL.
SELECT SINGLE lifnr
INTO lfa1-lifnr
FROM lfa1
WHERE lifnr IN s_lifnr.
IF sy-subrc <> 0.
MESSAGE e000(z_ma) WITH 'Invalid Vendor'.
ENDIF.
ENDIF.
START-OF-SELECTION.
*13
if s_budat is not initial.
if s_budat-high is not initial.
while s_budat-low le s_budat-high.
i = s_budat+7(2).
if i > 3.
s_gjahr = s_budat+3(4).
append s_gjahr.
else.
c = s_budat+3(4).
S_GJAHR = C - 1.
append s_gjahr.
endif.
s_budat-low = s_budat-low + 1.
endwhile.
else.
i = s_budat+7(2).
if i > 3.
s_gjahr = s_budat+3(4).
append s_gjahr.
else.
c = s_budat+3(4).
S_GJAHR = C - 1.
append s_gjahr.
endif.
endif.
endif.
*13
SELECT bukrs belnr gjahr awkey bldat budat
INTO TABLE it_bkpf
FROM bkpf
WHERE bukrs = p_bukrs
AND budat IN s_budat
and gjahr = s_gjahr. "13
IF NOT it_bkpf[] IS INITIAL.
SELECT bukrs belnr dmbtr wrbtr hkont ebeln lifnr
FROM bseg
INTO CORRESPONDING FIELDS OF TABLE it_bseg
FOR ALL ENTRIES IN it_bkpf
WHERE bukrs = it_bkpf-bukrs
and belnr = it_bkpf-belnr
AND gjahr = s_gjahr "13-it_bkpf-gjahr
AND koart = 'K'.
ENDIF.
IF NOT it_bseg[] IS INITIAL.
SELECT belnr gjahr dmbtr wrbtr hkont ebeln lifnr
FROM bseg
INTO CORRESPONDING FIELDS OF TABLE it_bseg1
FOR ALL ENTRIES IN it_bkpf
WHERE bukrs = it_bkpf-bukrs "13it_bkpf-bukrs
AND belnr = it_bkpf-belnr "13it_bkpf-belnr
AND gjahr = s_gjahr. "13-it_bkpf-gjahr.
ENDIF.
LOOP AT it_bkpf.
MOVE-CORRESPONDING it_bkpf TO itfinal.
APPEND itfinal.
ENDLOOP.
LOOP AT it_bseg.
MOVE-CORRESPONDING it_bseg TO itfinal.
append itfinal.
select single name1 ort01 from lfa1 into (itfinal-name1 , itfinal-ort01) where lifnr = it_bseg-lifnr.
select single j_1icstno j_1ilstno into (itfinal-j_1icstno , itfinal-j_1ilstno) from j_1imovend
where lifnr = it_bseg-lifnr.
ENDLOOP.
LOOP AT it_bseg1.
MOVE-CORRESPONDING it_bseg1 TO itfinal.
APPEND itfinal.
ENDLOOP.
loop at it_bseg1.
itfinal-ebeln1 = it_bseg1-ebeln.
append itfinal.
endloop.
*Deleting the records from ITFINAL w.r.t HKONT.
<b>LOOP AT itfinal.
IF itfinal-hkont NE '0020106230' AND
itfinal-hkont NE '0020106330'.
DELETE itfinal.
endif.
clear itfinal.
ENDLOOP.</b>
*Caluculating Bill Value
loop at itfinal.
if itfinal-hkont = '0020106230'.
itfinal-tdsrate = '2%'.
itfinal-vbill = itfinal-wrbtr * 100 / 2.
modify itfinal.
elseif itfinal-hkont = '0020106330'.
itfinal-tdsrate = '4%'.
itfinal-vbill = itfinal-wrbtr * 100 / 4.
modify itfinal.
endif.
endloop.
sort itfinal by belnr.
delete adjacent duplicates from itfinal comparing belnr.
format reset.
format color col_normal.
LOOP AT itfinal.
sl_no = sl_no + 1.
write:/ sy-vline,
2 sl_no,
7 sy-vline,
10 itfinal-ebeln1,
21 sy-vline,
23 itfinal-awkey,
44 sy-vline,
45 itfinal-bldat,
57 sy-vline,
60 itfinal-vbill,
75 sy-vline,
76 itfinal-tdsrate,
85 sy-vline,
89 itfinal-wrbtr,
106 sy-vline,
109 itfinal-belnr,
121 sy-vline,
124 itfinal-budat,
134 sy-vline.
ENDLOOP.
write:/ sy-uline.
top-of-page.
data : name1(60).
data : month_text(127),
string(99).
call function 'MONTH_NAMES_GET'
exporting
language = sy-langu
IMPORTING
RETURN_CODE =
tables
month_names = month_names[]
exceptions
month_names_not_found = 1
others = 2
if sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
endif.
format reset.
format color col_positive.
if not s_budat-low is initial .
read table month_names with key mnr = s_budat-low+4(2).
if sy-subrc = 0.
month = month_names-ltx.
string = 'Details of TDS (2% / 4%) On Works Contract Deducted'.
concatenate string 'for the Month of' month into month_text
separated by space.
write :/ month_text.
skip 1.
endif.
endif.
concatenate itfinal-name1 ',' itfinal-ort01
into name1 separated by space.
write :/ 'Vendor Code :', itfinal-lifnr.
write :/ 'Vendor Name and City :', name1.
skip 1.
write :/ 'TNGST Registration No :', itfinal-j_1ilstno,
/ 'CST Registration No :', itfinal-j_1icstno.
skip 1.
Display the coloumn headings
format reset.
format color col_heading.
write :/ sy-uline.
write:/ sy-vline,
2 'Sl_no',
7 sy-vline,
10 'P.O. No',
21 sy-vline,
22 'Invoice No',
44 sy-vline,
45 'Inv Date',
57 sy-vline,
60 'Bill value',
75 sy-vline,
76 'TDS Rate',
85 sy-vline,
89 'TDS Amount' ,
106 sy-vline,
108 'Doc.No.',
121 sy-vline,
125 'Pos Date',
134 sy-vline,
sy-uline.
K.Kiran.Kiran,
I am pasting code here and i am sure that the code should work now
REPORT zf14 no standard page heading line-size 134. .
TABLES: bkpf,bseg,lfa1,t001.
type-pools:slis.
TYPES : BEGIN OF x_bkpf,
bukrs TYPE bkpf-bukrs, " Company Code
belnr TYPE bkpf-belnr, " Document Number
gjahr TYPE bkpf-gjahr, " Fiscal year
awkey TYPE bkpf-awkey, " Object Key
bldat TYPE bkpf-bldat,
budat TYPE bkpf-budat,
END OF x_bkpf.
TYPES : BEGIN OF x_bseg,
bukrs TYPE bseg-bukrs, " Company Code
belnr TYPE bseg-belnr, " Document Number
gjahr TYPE bseg-gjahr, " Fiscal Year
koart TYPE bseg-koart,
hkont TYPE bseg-hkont, " G/L Account
ebeln TYPE bseg-ebeln, " Purchasing Document
lifnr TYPE bseg-lifnr, " Vendor Code
name1 type lfa1-name1,
ort01 type lfa1-ort01,
END OF x_bseg.
TYPES : BEGIN OF x_bseg1,
bukrs TYPE bseg-bukrs, " Company Code
belnr TYPE bsak-belnr, " Document Number
gjahr TYPE bsak-gjahr, " Fiscal Year
hkont TYPE bseg-hkont, " G/L Account
ebeln TYPE bseg-ebeln, " Purchasing Document
lifnr TYPE bseg-lifnr, " Vendor Code
wrbtr TYPE bseg-wrbtr, " Amt.in Doc.Curr
END OF x_bseg1.
types:begin of x_ven,
name1 type lfa1-name1,
ort01 type lfa1-ort01,
end of x_ven.
TYPES : BEGIN OF x_final,
bukrs TYPE bkpf-bukrs, " Company Code
belnr TYPE bkpf-belnr, " Document Number
gjahr TYPE bkpf-gjahr, " Fiscal year
blart TYPE bkpf-blart, " Document Type
awkey TYPE bkpf-awkey, " Object Key
bldat TYPE bkpf-bldat,
budat TYPE bkpf-budat,
mwskz TYPE bseg-mwskz,
qsskz TYPE bseg-qsskz,
wrbtr TYPE bseg-wrbtr, " Amount in Doc Curr
werks TYPE bseg-werks, " Recv Facility Code
hkont TYPE bseg-hkont, " G/L Account
ebeln TYPE bseg-ebeln, " Purchasing Document
ebeln1 type bseg-ebeln,
lifnr TYPE bseg-lifnr, " Vendor Code
lifnr1 type bseg-lifnr,
dmbtr TYPE bseg-dmbtr,
wrtbr type bseg-wrbtr,
vbill type bseg-wrbtr,
tdsamt type c,
tdsrate(4),
shkzg TYPE bseg-shkzg,
name1 TYPE lfa1-name1, "vendor Name
ort01 TYPE lfa1-ort01, "City
j_1icstno TYPE j_1imovend-j_1icstno, "CST
j_1ilstno TYPE j_1imovend-j_1ilstno ,"LST
END OF x_final.
DATA : it_bkpf TYPE TABLE OF x_bkpf WITH HEADER LINE .
DATA : it_bseg TYPE TABLE OF x_bseg WITH HEADER LINE .
DATA : it_bseg1 TYPE TABLE OF x_bseg1 WITH HEADER LINE .
DATA : itfinal TYPE TABLE OF x_final WITH HEADER LINE.
DATA : month_names LIKE t247 OCCURS 0 WITH HEADER LINE.
DATA :i(2), "month
y TYPE int4, "year
c(4),
v_bill LIKE bseg-dmbtr. " bill value
DATA : pos TYPE sy-tabix,
month(99),
month1(99).
data:sl_no(3) value 0.
*Alv
DATA:itfieldcat TYPE slis_t_fieldcat_alv WITH HEADER LINE.
DATA:itrepid TYPE sy-repid.
itrepid = sy-repid.
DATA:itevent TYPE slis_t_event.
DATA:itlistheader TYPE slis_t_listheader.
DATA:walistheader LIKE LINE OF itlistheader.
DATA:itlayout TYPE slis_layout_alv.
DATA:top TYPE slis_formname.
DATA:itsort TYPE slis_t_sortinfo_alv WITH HEADER LINE.
DATA:itprintparams TYPE slis_print_alv.
DATA:itvariant TYPE disvariant.
SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
PARAMETERS : p_bukrs LIKE t001-bukrs OBLIGATORY. "Company code
SELECT-OPTIONS : s_lifnr FOR lfa1-lifnr, "Vendor name
s_budat for sy-datum obligatory, "bkpf-budat OBLIGATORY, "Date
s_gjahr FOR bseg-gjahr NO-DISPLAY.
SELECTION-SCREEN END OF BLOCK b1.
AT SELECTION-SCREEN.
SELECT SINGLE bukrs
INTO t001-bukrs
FROM t001
WHERE bukrs = p_bukrs.
IF sy-subrc <> 0.
MESSAGE e000(z_ma) WITH 'Invalid Company Code'.
ENDIF.
IF NOT s_lifnr[] IS INITIAL.
SELECT SINGLE lifnr
INTO lfa1-lifnr
FROM lfa1
WHERE lifnr IN s_lifnr.
IF sy-subrc <> 0.
MESSAGE e000(z_ma) WITH 'Invalid Vendor'.
ENDIF.
ENDIF.
START-OF-SELECTION.
*13
if s_budat is not initial.
if s_budat-high is not initial.
while s_budat-low le s_budat-high.
i = s_budat+7(2).
if i > 3.
s_gjahr = s_budat+3(4).
append s_gjahr.
else.
c = s_budat+3(4).
S_GJAHR = C - 1.
append s_gjahr.
endif.
s_budat-low = s_budat-low + 1.
endwhile.
else.
i = s_budat+7(2).
if i > 3.
s_gjahr = s_budat+3(4).
append s_gjahr.
else.
c = s_budat+3(4).
S_GJAHR = C - 1.
append s_gjahr.
endif.
endif.
endif.
*13
SELECT bukrs belnr gjahr awkey bldat budat
INTO TABLE it_bkpf
FROM bkpf
WHERE bukrs = p_bukrs
AND budat IN s_budat
and gjahr = s_gjahr. "13
IF NOT it_bkpf[] IS INITIAL.
SELECT bukrs belnr dmbtr wrbtr hkont ebeln lifnr
FROM bseg
INTO CORRESPONDING FIELDS OF TABLE it_bseg
FOR ALL ENTRIES IN it_bkpf
WHERE bukrs = it_bkpf-bukrs
and belnr = it_bkpf-belnr
AND gjahr = s_gjahr "13-it_bkpf-gjahr
AND koart = 'K'.
ENDIF.
IF NOT it_bseg[] IS INITIAL.
SELECT belnr gjahr dmbtr wrbtr hkont ebeln lifnr
FROM bseg
INTO CORRESPONDING FIELDS OF TABLE it_bseg1
FOR ALL ENTRIES IN it_bkpf
WHERE bukrs = it_bkpf-bukrs "13it_bkpf-bukrs
AND belnr = it_bkpf-belnr "13it_bkpf-belnr
AND gjahr = s_gjahr. "13-it_bkpf-gjahr.
ENDIF.
LOOP AT it_bkpf.
MOVE-CORRESPONDING it_bkpf TO itfinal.
APPEND itfinal.
ENDLOOP.
LOOP AT it_bseg.
MOVE-CORRESPONDING it_bseg TO itfinal.
append itfinal.
select single name1 ort01 from lfa1 into (itfinal-name1 , itfinal-ort01) where lifnr = it_bseg-lifnr.
select single j_1icstno j_1ilstno into (itfinal-j_1icstno , itfinal-j_1ilstno) from j_1imovend
where lifnr = it_bseg-lifnr.
ENDLOOP.
LOOP AT it_bseg1.
MOVE-CORRESPONDING it_bseg1 TO itfinal.
APPEND itfinal.
ENDLOOP.
loop at it_bseg1.
itfinal-ebeln1 = it_bseg1-ebeln.
append itfinal.
endloop.
*Deleting the records from ITFINAL w.r.t HKONT.
LOOP AT itfinal.
IF itfinal-hkont NE '0020106230' AND
itfinal-hkont NE '0020106330'.
DELETE itfinal.
clear itfinal.
continue.
else.
clear itfinal.
endif.
ENDLOOP.
*Caluculating Bill Value
loop at itfinal.
if itfinal-hkont = '0020106230'.
itfinal-tdsrate = '2%'.
itfinal-vbill = itfinal-wrbtr * 100 / 2.
modify itfinal.
elseif itfinal-hkont = '0020106330'.
itfinal-tdsrate = '4%'.
itfinal-vbill = itfinal-wrbtr * 100 / 4.
modify itfinal.
endif.
endloop.
sort itfinal by belnr.
delete adjacent duplicates from itfinal comparing belnr.
format reset.
format color col_normal.
LOOP AT itfinal.
sl_no = sl_no + 1.
write:/ sy-vline,
2 sl_no,
7 sy-vline,
10 itfinal-ebeln1,
21 sy-vline,
23 itfinal-awkey,
44 sy-vline,
45 itfinal-bldat,
57 sy-vline,
60 itfinal-vbill,
75 sy-vline,
76 itfinal-tdsrate,
85 sy-vline,
89 itfinal-wrbtr,
106 sy-vline,
109 itfinal-belnr,
121 sy-vline,
124 itfinal-budat,
134 sy-vline.
ENDLOOP.
write:/ sy-uline.
top-of-page.
data : name1(60).
data : month_text(127),
string(99).
call function 'MONTH_NAMES_GET'
exporting
language = sy-langu
IMPORTING
RETURN_CODE =
tables
month_names = month_names[]
exceptions
month_names_not_found = 1
others = 2
if sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
endif.
format reset.
format color col_positive.
if not s_budat-low is initial .
read table month_names with key mnr = s_budat-low+4(2).
if sy-subrc = 0.
month = month_names-ltx.
string = 'Details of TDS (2% / 4%) On Works Contract Deducted'.
concatenate string 'for the Month of' month into month_text
separated by space.
write :/ month_text.
skip 1.
endif.
endif.
concatenate itfinal-name1 ',' itfinal-ort01
into name1 separated by space.
write :/ 'Vendor Code :', itfinal-lifnr.
write :/ 'Vendor Name and City :', name1.
skip 1.
write :/ 'TNGST Registration No :', itfinal-j_1ilstno,
/ 'CST Registration No :', itfinal-j_1icstno.
skip 1.
Display the coloumn headings
format reset.
format color col_heading.
write :/ sy-uline.
write:/ sy-vline,
2 'Sl_no',
7 sy-vline,
10 'P.O. No',
21 sy-vline,
22 'Invoice No',
44 sy-vline,
45 'Inv Date',
57 sy-vline,
60 'Bill value',
75 sy-vline,
76 'TDS Rate',
85 sy-vline,
89 'TDS Amount' ,
106 sy-vline,
108 'Doc.No.',
121 sy-vline,
125 'Pos Date',
134 sy-vline,
sy-uline.
Thanks
seshu -
Delete the Record in Webdynpro java
Hi Gurus
I had one issue in webdynpro java , I need to delete row in Table if I delete the row in webdynpro java table at the same time the row it needs to delete in Back end table also .
We are useing NWDS 7.2 and we are using Adaptive Web Service model for to consume function module
Guys it's a urgent requirement for me please share your knowledge
ThanksHi
ABAPERS already they given one funtion module , for that in back end they written a querry for to delete the record ,
So now I want to Import that Adaptive webservice into webdynpro java , I will create a button in webdynpro java for Delete
here what code I neeed to mention , If I Delete the record in Table it has to delete in the backend also.
Guys please share your ideas
Thanks
Sony -
Can you tell me how to know who deleted the user?
Hi
In my system, one user ID was deleted,
Can I know who deleted this User ID?
Is there any table or Function Module to know it ?
Regards,Hi,
i think There is no way to find the user who deleted the user id.For more details see the link below:
http://sap.ittoolbox.com/groups/technical-functional/sap-basis/how-to-find-deleted-sap-jobs-1815715.
Regards,
Rahul
Maybe you are looking for
-
I created an Apple ID on my iPhone, but I can not download any application because a message appears saying that iTunes store can not login. The strange thing is that my Apple ID works perfectly when I try to access my icloud browser on my iMac and e
-
Digital Signatures and Workshop Papers
Guys, Also posted [here|http://www.sapfans.com/forums/viewtopic.php?f=7&t=317491] Has anyone used digital signatures in PM workshop papers? If so, how do we load the digital signatures, and what code is used to import them into the workshop papers Th
-
I recieved an iPad mini as gift this past spring (2013). I tried to upate my iPad to the new iOS 7.0.4 software. It seemed work fine, but when it reboted it got stuck on the connect to itunes screen. I've connected my iPad to itunes and it does not r
-
Are N97 Owners being "Blagged"?I
I think i really am at the end of my tether. Having had four replacement N97's i was kind of hoping that v.20 may be the saving grace,in allowing me to own a phone that works. Nokia knew that certain "Sites" were running countdown's, towards the offi
-
Does a phone automatically syncronise with a new c...
I plugged my phone into my friend's laptop the other day in order to charge it but am a bit worried that my notes and messages will have syncronised with her computer because she backs up her own text messages from her phone onto her computer. My pho