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
Thanks
Hi
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
Similar Messages
-
Need Sorter java file for sorting the records in webdynpro java
Hi Gurus
I had urgent requirement please give your inputs
In my webdynpro java i need to sort entire records in table
I now we need One sorter java class please provide that java file
please suggest the all the steps how to do
Thanks
renu.1. Implement class comparator wich will compare records according your sort preferencies,
like this:
public class record_Comparator implements Comparator{
public int compare(Object emp1, Object emp2){
// here is your code for return -1if 'before' or 0 if equal or 1if 'after'
int stepId_1 = ((record)emp1).get_someValue();
int stepId_2 = ((record)emp2).get_someValue();
if(stepId_1 > stepId_2)
return 1;
else if(stepId_1 < stepId_2)
return -1;
else
return 0;
than call method sort() with your collection of records,
like this:
Collections.sort(record_collection, new record_Comparator()); -
Hi Gurus,
Am able to insert , update records in EXCEL sheet using JDBC. But am unable to delete the record from EXCEL sheet. Please give me the solution how to delete the record from EXCEL sheet
Thanks in Advance
RaviThe excel odbc driver (which has nothing to do with java) doesn't do that. See "Excel Driver Limitations" in the following....
http://support.microsoft.com/kb/178717 -
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 -
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 -
How to delete the records with routine Z_AFRP4_DELETE as note [418584|
Hello Gurus,
I don't want to transfer data into HR and want to delete the records in table AFRP4 to business complete the Maintenance Orders
Component version- EHP7 for SAP ERP 6.0
Component-EA-APPL
Release-617
how can I delete these records
Thanks fro Help
AMHello All,
I found the solution, I copied the code in correction instruction number 0000282352 and create the report as programme Z_AFRP4_DELETEand the executed
*$*$----------------------------------------------------------------$*$*
*$ Correction Inst. 0120061532 0000282352 $*
*$--------------------------------------------------------------------$*
*$ Valid for : $*
*$ Software Component SAP_APPL SAP Application $*
*$ Release 40B All Support Package Levels $*
*$ Release 45B All Support Package Levels $*
*$ Release 46B All Support Package Levels $*
*$ Release 46C All Support Package Levels $*
*$ Release 470 All Support Package Levels $*
*$ Release 500 All Support Package Levels $*
*$ Release 600 All Support Package Levels $*
*$ Release 602 All Support Package Levels $*
*$ Release 603 All Support Package Levels $*
*$ Release 604 All Support Package Levels $*
*$ Release 605 All Support Package Levels $*
*$ Release 606 All Support Package Levels $*
*$--------------------------------------------------------------------$*
*$ Changes/Objects Not Contained in Standard SAP System $*
*$*$----------------------------------------------------------------$*$*
*& Object REPS Z_AFRP4_DELETE
*& Object Header PROG Z_AFRP4_DELETE
*& REPORT Z_AFRP4_DELETE
REPORT Z_AFRP4_DELETE .
* This report deletes confirmation records from table AFRP4 that are
* not longer needed. Run it without update flag first !!
tables: afrp4.
data: lt_afrp4 like afrp4 occurs 0,
ls_afrp4 like afrp4.
selection-screen begin of block order with frame.
select-options: zorders for afrp4-aufnr. "order number
selection-screen end of block order.
parameters: update as checkbox.
select * from afrp4 into table lt_afrp4
where aufnr in zorders.
if lt_afrp4[] is initial.
format color col_normal.
write: 'No HR confirmation background records read.'.
exit.
endif.
format color col_heading.
write: /5 'Order', 25 'Confirmation', 45 'Counter'.
skip. uline. skip.
* show corrections
loop at lt_afrp4 into ls_afrp4.
format color col_normal.
write: /5 ls_afrp4-aufnr, 25 ls_afrp4-rueck, 45 ls_afrp4-rmzhl.
endloop.
* update on data base table
if not update is initial.
skip. uline. skip.
delete afrp4 from table lt_afrp4.
if sy-subrc is initial.
format color col_positive.
write: 'HR-records deleted successfull'.
else.
format color col_negative.
write: 'Error when trying to update data base table AFRP4.'.
endif.
endif. -
Deleting the Records that are in odd position
Hi,
How to delete the records that are in the odd position.
This is my program. Plz correct me. Iam not able to delete the records.
REPORT ZMTSHPRG19 .
TYPES:
BEGIN OF TY_EMP,
EMPID(4) TYPE N,
ENAME(30) TYPE C,
DEPT(4) TYPE C,
SALARY TYPE I,
END OF TY_EMP.
DATA:
FS_EMP TYPE TY_EMP,
IT_EMP TYPE TABLE OF TY_EMP.
FS_EMP-EMPID = '1009'.
FS_EMP-ENAME = 'XX'.
FS_EMP-DEPT = 'D100'.
FS_EMP-SALARY = 10000.
APPEND FS_EMP TO IT_EMP.
FS_EMP-EMPID = '1007'.
FS_EMP-ENAME = 'YY'.
FS_EMP-DEPT = 'D100'.
FS_EMP-SALARY = '11000'.
APPEND FS_EMP TO IT_EMP.
FS_EMP-EMPID = 1008.
FS_EMP-ENAME = 'ZZ'.
FS_EMP-DEPT = 'D200'.
FS_EMP-SALARY = 12000.
APPEND FS_EMP TO IT_EMP.
FS_EMP-EMPID = 1001.
FS_EMP-ENAME = 'XY'.
FS_EMP-DEPT = 'D200'.
FS_EMP-SALARY = 10000.
APPEND FS_EMP TO IT_EMP.
FS_EMP-EMPID = 1003.
FS_EMP-ENAME = 'XZ'.
FS_EMP-DEPT = 'D300'.
FS_EMP-SALARY = 8000.
APPEND FS_EMP TO IT_EMP.
FS_EMP-EMPID = 1002.
FS_EMP-ENAME = 'YX'.
FS_EMP-DEPT = 'D300'.
FS_EMP-SALARY = 9500.
APPEND FS_EMP TO IT_EMP.
FS_EMP-EMPID = 1004.
FS_EMP-ENAME = 'YZ'.
FS_EMP-DEPT = 'D300'.
FS_EMP-SALARY = 9500.
APPEND FS_EMP TO IT_EMP.
FS_EMP-EMPID = 1005.
FS_EMP-ENAME = 'AA'.
FS_EMP-DEPT = 'D100'.
FS_EMP-SALARY = 10500.
APPEND FS_EMP TO IT_EMP.
FS_EMP-EMPID = 1006.
FS_EMP-ENAME = 'BB'.
FS_EMP-DEPT = 'D200'.
FS_EMP-SALARY = 12000.
APPEND FS_EMP TO IT_EMP.
FS_EMP-EMPID = 1010.
FS_EMP-ENAME = 'CC'.
FS_EMP-DEPT = 'D100'.
FS_EMP-SALARY = 15000.
APPEND FS_EMP TO IT_EMP.
LOOP AT IT_EMP INTO FS_EMP.
WRITE:/ FS_EMP-EMPID,FS_EMP-ENAME,FS_EMP-DEPT,FS_EMP-SALARY.
ENDLOOP.
ULINE.
DATA:
LINE_COUNT TYPE I,
W_REM TYPE I.
W_REM = LINE_COUNT MOD 2.
DESCRIBE TABLE IT_EMP LINES LINE_COUNT.
SORT IT_EMP BY EMPID.
IF W_REM = 0.
LOOP AT IT_EMP INTO FS_EMP.
WRITE:/ FS_EMP-EMPID,FS_EMP-ENAME,FS_EMP-DEPT,FS_EMP-SALARY..
ENDLOOP.
ENDIF.
Thanks.TYPES:
BEGIN OF TY_EMP,
EMPID(4) TYPE N,
ENAME(30) TYPE C,
DEPT(4) TYPE C,
SALARY TYPE I,
END OF TY_EMP.
DATA:
FS_EMP TYPE TY_EMP,
IT_EMP TYPE TABLE OF TY_EMP.
FS_EMP-EMPID = '1009'.
FS_EMP-ENAME = 'XX'.
FS_EMP-DEPT = 'D100'.
FS_EMP-SALARY = 10000.
APPEND FS_EMP TO IT_EMP.
FS_EMP-EMPID = '1007'.
FS_EMP-ENAME = 'YY'.
FS_EMP-DEPT = 'D100'.
FS_EMP-SALARY = '11000'.
APPEND FS_EMP TO IT_EMP.
FS_EMP-EMPID = 1008.
FS_EMP-ENAME = 'ZZ'.
FS_EMP-DEPT = 'D200'.
FS_EMP-SALARY = 12000.
APPEND FS_EMP TO IT_EMP.
FS_EMP-EMPID = 1001.
FS_EMP-ENAME = 'XY'.
FS_EMP-DEPT = 'D200'.
FS_EMP-SALARY = 10000.
APPEND FS_EMP TO IT_EMP.
FS_EMP-EMPID = 1003.
FS_EMP-ENAME = 'XZ'.
FS_EMP-DEPT = 'D300'.
FS_EMP-SALARY = 8000.
APPEND FS_EMP TO IT_EMP.
FS_EMP-EMPID = 1002.
FS_EMP-ENAME = 'YX'.
FS_EMP-DEPT = 'D300'.
FS_EMP-SALARY = 9500.
APPEND FS_EMP TO IT_EMP.
FS_EMP-EMPID = 1004.
FS_EMP-ENAME = 'YZ'.
FS_EMP-DEPT = 'D300'.
FS_EMP-SALARY = 9500.
APPEND FS_EMP TO IT_EMP.
FS_EMP-EMPID = 1005.
FS_EMP-ENAME = 'AA'.
FS_EMP-DEPT = 'D100'.
FS_EMP-SALARY = 10500.
APPEND FS_EMP TO IT_EMP.
FS_EMP-EMPID = 1006.
FS_EMP-ENAME = 'BB'.
FS_EMP-DEPT = 'D200'.
FS_EMP-SALARY = 12000.
APPEND FS_EMP TO IT_EMP.
FS_EMP-EMPID = 1010.
FS_EMP-ENAME = 'CC'.
FS_EMP-DEPT = 'D100'.
FS_EMP-SALARY = 15000.
APPEND FS_EMP TO IT_EMP.
LOOP AT IT_EMP INTO FS_EMP.
WRITE:/ FS_EMP-EMPID,FS_EMP-ENAME,FS_EMP-DEPT,FS_EMP-SALARY.
ENDLOOP.
ULINE.
DATA:
LINE_COUNT TYPE I,
W_REM TYPE I,
n type i value 1.
DESCRIBE TABLE IT_EMP LINES LINE_COUNT.
SORT IT_EMP BY EMPID.
LOOP AT IT_EMP INTO FS_EMP.
w_rem = n mod 2 .
if w_rem = 0 .
WRITE:/ FS_EMP-EMPID,FS_EMP-ENAME,FS_EMP-DEPT,FS_EMP-SALARY.
endif.
n = n + 1.
ENDLOOP.
<REMOVED BY MODERATOR>
Edited by: Alvaro Tejada Galindo on Apr 11, 2008 4:34 PM -
Hi folks,
I am trying to delete a record from pa0019. Of course I am not deleting the record directly but copying the existing record into the workarea and deletingit.
However, query of selecting the record from table is not working.
tables: pa0019.
data: wa_pa0019 like pa0019 occurs 0 with header line.
select single * from pa0019 into wa_pa0019 where pernr = 'v_pernr'
and tmart = 'Z9' and termn = '07/07/2005'.
delete pa0019 from wa_pa0019.
I see a record for this employeeid in the table pa0019. why is not retrieving any record? Am I missing something here?
I know this is simple, and have done this before too, but not able to recall what is the problem here?
Any thoughts,
Thanks,
SKGlobal variables inthe program
DATA : RETURN LIKE BAPIRETURN1.
DATA : KEY LIKE BAPIPAKEY.
DATA : RETURNE LIKE BAPIRETURN1.
data: begin of itab1 occurs 0,
employee(8),
reason_type(2),
reason_code(2),
return_date like sy-datum,
end of itab1.
I read the data into the internal table from an external text file, then I upload the record(RLOA) into actions infotype using BDC session, then I need to delete the record for the same employee in 0019.
I think I am missing the RECORD parameter, hwo can i get that?
loop at itab1.
*** check to see whether there is a RLOA record for the employee
select single * from pa0000 where pernr = itab1-employee and
massn = 'z7' and begda = itab1-return_date.
if sy-subrc = 0.
error-employee = itab1-employee.
error-reason = 'RLOA exists for the employee'.
append error.
continue.
else.
clear bdcdata.
refresh bdcdata.
perform load_data.
If the RLOA record is created in Actions infotype delete
the record in monitoring of tasks record in IT0019
if g_monitoringflag = 'X'.
format the date to mm/dd/yyyy
v_returndate = itab1-return_date.
concatenate v_returndate0(2) '/' v_returndate2(2) '/'
v_returndate+4(4) into v_formatdate.
CALL FUNCTION 'BAPI_EMPLOYEE_ENQUEUE'
EXPORTING
NUMBER = itab1-employee
IMPORTING
RETURN = RETURNE.
CALL FUNCTION 'HR_INFOTYPE_OPERATION'
EXPORTING
INFTY = '0019'
NUMBER = itab1-employee
SUBTYPE = 'Z9'
VALIDITYEND = itab1-return_date
VALIDITYBEGIN = itab1-return_date
TMART ='Z9'
TERMN = itab1-return_date
OPERATION = 'DEL'
TCLAS = 'A'
DIALOG_MODE = '0'
IMPORTING
RETURN = RETURN
KEY = KEY.
IF RETURN IS NOT INITIAL.
WRITE :/ 'Error Occurred'.
ENDIF.
CALL FUNCTION 'BAPI_EMPLOYEE_DEQUEUE'
EXPORTING
NUMBER = itab1-employee.
if sy-subrc = 0.
clear:g_monitoringflag, v_formatdate.
else.
error-employee = itab1-employee.
error-reason = 'No record created for RLOA'.
clear:v_formatdate.
endif.
endif.
endif.
endloop.
Thanks in advance for your help.
SK -
Customize the ESS in Webdynpro java
HI,
I am new to webdynpro for java.My requirement is to customize the ESS in Webdynpro java.Please give how to create in wd-java step by step document for the Payroll system event in ESS.How to upload the ess package in NWDS,how to mapp the FPM component to current component.Please provide me.
Thanking you,Hi,
go through this thread:[thread|Customize/Change ESS MSS WebDynpro Applications (ECC 5.0);
check this doc too:[https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/4598a190-0201-0010-a59f-820e3b31f854]
hpe it hlps u
Regards,
Khushboo
Maybe you are looking for
-
Hello, I found, what seems to be a nice login application for Flex. However, something is wrong and it is not working. I have check, and recheck the code over and over again and I can't seem to find what is wrong. I am using Flex 3.0, PHP and a MySQL
-
Before using iBooks, members of my family were able to share their books through "Shared Devices" in iTunes. Once I moved my library to iBooks, books are not available to other members of my family. Is there a means to share books on local networks w
-
Hi, While doing ALE/IDOC I am getting error. 'Error in ALE service - Entry in outbound table not found'. what it s mean????? Thanks & Regards. Balajee Jeyaraj.
-
Firefox freezes when i click add ons options
Also NONE of my add-ons are working... they dont do what their supposed to do. No add on i download works, i have firefox 7.0.1. For example these are some add ons i downloaded, Firebug, Personas, ImTranslator, Download helper. (Basicly when i click
-
Can't get SPAppWebUrl - SP 2013
I'm developing an auto-hosted asp.net app for Sharepoint 2013. I have to use the SPAppWebUrl token value for my requests. So I tried this : AppManifest.xml : <StartPage>~remoteAppUrl/Pages/Index.aspx?{StandardTokens}</StartPage> javascript : var appw