TREX: delete single records in an index
Hey guys,
is there a way to delete one single record on a TREX index?
I am using function module TREX_EXT_UPDATE_DOC_ATTRIBUTES.
I don't want to delete the whole index because it takes to much time to build it up again. Therefore i want delete single records. I have the doc-key to identify the record but how to delete it?
thx,
Ming
You set the field doc_action = 'D' for deindexing records, and set doc_action = 'I' for indexing records, and then call the function module
ls_doc-doc_key = "enter doc key here
ls_doc-doc_action = 'D'. "for deindexing
"set other fields similarly
APPEND ls_doc TO lt_docs.
CALL FUNCTION 'TREX_EXT_INDEX'
EXPORTING
I_INDEX_ID = gs_trex_doc-index_id
I_RFC_DESTINATION = lc_rfc_destn
I_INDEX_DOCUMENT_LIST = lt_docs
IMPORTING
E_RETURN_CODE = lv_return_code
E_RETURN_TEXT = lv_return_text
EXCEPTIONS
CONVERSION_ERROR = 1
RFCSERVER_ERROR = 2
ERROR = 3
OTHERS = 4.
if you want to delete attributes use the function module "TREX_EXT_DELETE_ATTRIBUTE"
hope this helps
Similar Messages
-
Is there any solution to Delete Single Record in Delta Queue 2LIS_08TRFKZ
Hi,
Is there any solution to Delete the Single Record in Delta Queue at R/3 -(RSA7) for Datasoure 2LIS_08TRFKZ
A wrong posting has been posted at R/3, its has been deleted once they came to know its wrong at R/3.
Now the Problem is wrong data has come into Delta Queue RSA7.
We are unable to extract the data in BW. Its not even coming till PSA also so that we can delete at PSA itself that particular record.
Is there any solution to delete the Single Record in Delta Queue at R/3 -RSA
Thanks & Regards
Ashfaq>
Ashfaq Shaik wrote:
>
> Record 166 :Contents <000000000.00000000 from field ZZVOLUME cannot be converted in type DEC RSAR 197
Sorry I didnot see this error before.
I guess you didnot try error handling hence you get this error BW side.Try error handling first.
If this doesn't work then you can go with above method. -
Hi Experts,
I want to delete a single row from DBTAB ( KLAH )
WHERE KLAHKLART = '2' and KLAHCLINT = '241'.
Please advice
KarthikHi ,
Try this code To delete single record from DB table- -
DATA : t_klah LIKE TABLE OF klah,
fs_klah LIKE klah.
SELECT * FROM klah INTO TABLE t_klah
WHERE klart = '2' AND
clint = '241'.
LOOP AT t_klah INTO fs_klah.
DELETE klah FROM fs_klah .
EXIT.
ENDLOOP.
Regards
Pinaki -
Iphone4 to 6.3.1, not single delete personal records Even deleted
Why update my iphone4 to 6.3.1, not single delete personal records
Even deleted, not when the machine is flash back
I delete the phone number will appear simply no way to single delete records of calls reopenPlease post in your native language. This makes very little sense in English.
-
Delete a single record of specific Master Data
Hello Experts,
We have this InfoObject '0FUND' which is time-dependent. For a specific Master Data, exp: 40002, we have a list of records, that vary in 'Valid from' and 'Valid To'. Example:
FMArea__Fund____ValidTo____ValidFrom____Attribute...
CM______40002__31.12.2001__01.01.1000_____MOD
CM______40002__31.12.2002__01.01.2002_____MOD
CM______40002__31.12.2003__01.01.2003_____MOD
This master data as no transactional data in any InfoProvider. When we try to delete a single record, the system delete all the records for 0FUND=40002.
Is there possible to make a selective deletion, in order to choose a single record?
At same time, we delete from the InfoCube all transactional data assign to a specific Master Data in a particular year. Exp (0FUND=40022; 0FISCYEAR=2004). When we try to delete this specific record:
FMArea__Fund____ValidTo____ValidFrom____Attribute...
CM_____40022___31.12.2004__01.01.2004_____MOD
The BW System doesn't allow deleting this specific record. Why this occur, its necessary delete all the transactional data assigned to 40022 Master Data??
Best Regards,
IBHi IB,
Yes. It is necessary to delete the transacton data where the master data is referred before deleting the master data. This because the master data value in the Cube/ODS looks up at the SID table for the master data.
Bye
Dinesh -
How to delete the single record from the ODS
HI,
I want to DELETE the particular record from ODS.. how to delete that..
plz give me the solution.. it's urgent..
with regards
@jayHi Prakash,
You can delete a particular record from ODS by specifying the key field name in Selective deletion button available in Contents tab in the manage screen of ODS. But it will only delete the record from the active data table and not from the Change log and new data table . You should be very carefull if you are doing in Production system as there is chance of deleting other records accidentally.
Go to Selective deletion button - > Click on delete selection -> Enter the key field values of the record you want to delete-> Press save button to save as Variant -> Go back and click on selection button -> Chosse the background job type -> Click on start button.
Regards,
Prakash -
Trying to delete a record from an entity-based VO in ADF
We are using J-Developer 9.0.5.2
This is a web app using struts and ADF BC
Click the link below to view part of the struts diagram that relates to this question
http://home.earthlink.net/~katie1les/images/delete.gif
1. We have a DataPage that displays a list of items (catalogItemLIsting.jsp). This is a view of all items in a particular category based on the ItemsVO. Each item has a delete icon beside it.
2. The user clicks the delete icon which forwards to the bindDeleteItem DataAction that will bind that item number (through custom method in the AM) to an entity-based DeleteItemVO (the only record that will be in the DeleteItemVO is the item they selected to delete). This step corresponds to the deleteItem Data Page as seen in the image link above).
We do this step (step 2) because we want to show the user a confirmation page with additional item information before they actually delete the item. Otherwise, we could just perform the delete from the original page.
3. On the deleteItem data page there is a Delete (">Select</a>) link beside the single item in the view that when clicked should set the current row (the only row in the view object) and forward to the setDeleteItemDA Data Action.
4. I dragged the setCurrentRowWithKey method from the DeleteItemVO onto the setDeleteItemDA data action.
5. I forwarded that data action to the deleteItemDA data action where I dragged the Delete method from the DeleteItemVO.
6. This action forwards to a deleteItemDP data page where I dropped a Commit action from the AM which owns the DeleteItemVO.
The result of executing these steps brings it back to itself (deleteItem.do) and tries to rebind the single record view object producing a ORA-01008: not all variables bound error and not forwarding to the setDeleteItemDA data action.
Are we using the right approach here?
I tried following the example located at: http://otn.oracle.com/products/jdev/collateral/tutorials/9050/bizcomp_jsp_tut.html#delete, but there are some differences between the two. We are using data pages and a single view object, while the example is using regular jsp pages and a master detail view relationship.Thanks Steve for the reply. We dowloaded the following example (http://otn.oracle.com/products/jdev/tips/muench/DeleteEmpWithConfirm.zip) and tried to make it work for us. We set everything exactly the same (as far as we could tell). There is one difference though between what you have in this example and ours and that is that the VO that is dropped on the first data page is first bound by a custom method through a preceeding data action. When the page is rendered we see the item we choose (and that was bound in the data action) correctly on the page.
The problem comes in when we click on the delete link on that page, it does not seem to be posting back properly - it appears to be ignoring the "confirmDelete" event, which is part of the url (and it's corresponding forward named the same) and instead ends up trying to rebind the VO on the same page which produces a "not all variables bound" error. Error listed below.
Why is the Datapage seeking to rebind the VO again, when it was already bound previously? Shouldn't the setCurrentRowKey method simply set the current row on the VO without having to requery the VO again?
*** error page ***
You must correct the following error(s) before proceeding:
JBO-29000: Unexpected exception caught: oracle.jbo.SQLStmtException, msg=JBO-27122: SQL error during statement preparation. Statement: SELECT DeleteItemInfoEntityObject.RETAILER_NUMBER, DeleteItemInfoEntityObject.AUTH_ITEM_CODE, DeleteItemInfoEntityObject.UPC, DeleteItemInfoEntityObject.ITEM_DESCRIPTION, DeleteItemInfoEntityObject.PACK, DeleteItemInfoEntityObject.RETAIL_SIZE, DeleteItemInfoEntityObject.UNIT_COST, DeleteItemInfoEntityObject.AWI_DEPT_NAME, DeleteItemInfoEntityObject.RETAILER_CATALOG_NAME, DeleteItemInfoEntityObject.RETAILER_CATEGORY_NAME, DeleteItemInfoEntityObject.RETAIL_PRICE, DeleteItemInfoEntityObject.QUANTITY_AT FROM DELETEITEMINFOVIEW DeleteItemInfoEntityObject WHERE AUTH_ITEM_CODE = :1 AND RETAILER_NUMBER = :2
JBO-27122: SQL error during statement preparation. Statement: SELECT DeleteItemInfoEntityObject.RETAILER_NUMBER, DeleteItemInfoEntityObject.AUTH_ITEM_CODE, DeleteItemInfoEntityObject.UPC, DeleteItemInfoEntityObject.ITEM_DESCRIPTION, DeleteItemInfoEntityObject.PACK, DeleteItemInfoEntityObject.RETAIL_SIZE, DeleteItemInfoEntityObject.UNIT_COST, DeleteItemInfoEntityObject.AWI_DEPT_NAME, DeleteItemInfoEntityObject.RETAILER_CATALOG_NAME, DeleteItemInfoEntityObject.RETAILER_CATEGORY_NAME, DeleteItemInfoEntityObject.RETAIL_PRICE, DeleteItemInfoEntityObject.QUANTITY_AT FROM DELETEITEMINFOVIEW DeleteItemInfoEntityObject WHERE AUTH_ITEM_CODE = :1 AND RETAILER_NUMBER = :2
ORA-01008: not all variables bound
*** error ***
Les, here's a minimal working sample:
http://otn.oracle.com/products/jdev/tips/muench/Delete
mpWithConfirm.zip
It uses just two data pages and leverages the
built-in event-handling features of ADF described in
the ADF Data Binding Primer and ADF/Struts Overview.
The pages use the post-back pattern to handle their
own events before forwarding.
http://otn.oracle.com/products/jdev/collateral/papers/
0g/ADFBindingPrimer/index.html -
How to store as single record data coming from different ods to cube
Hi All,
we have the scenario like .
Same contract values are uploaded from 3 ods to cube.In the cube this information is stored as 3 different records.
Is there any option having same contract no and same fiscal period values should be stored as single record in cube.
Thanks in advance.
Regards,
Shradda.Hi Shradda,
On Performance Side .....consider below points
1. Indexes on Cube ( That delete indexes before load and create them after Load ).
2. Aggregate Design ( Decision on Base Aggregates, roll up Hierarchy , BW Statistics etc ).
3. Partition of InfoCube ( Basically decision on No. of Partition )
4. Data Package Size ( Always try to have larger Data Package so that preaggreation will reduce the no. of Data Records ).
Best is Service.sap.com on BI page u will find material for performance . THat will help you .
To assign points on the left of screen u will get radio buttons for assigning points for each person who has responded .
Regards,
Vijay -
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 -
Hi,
I am having one scenario like,in one database table one field like payment run date is there it is up dated when the payment made.from based on this date we need calculate the no of days to system date.if the days is greater than 125 days i need to be delete that record from db table.could you please provide the logic please.
Thanks.
harinathhi Hari,
do this way..
loop at itab.
lv_tabix = sy-tabix.
if itab-field1 GT '125'.
delete <table> index lv_tabix.
else.
< Do Something>
endif.
endloop. -
Getting error " Incomplete update due to error in single records"
Dear All,
We are loading data from DSO to Cube using full load and the load is failing giving an error message Collection in the source system ended and when checked the error message button it is showing as " Incomplete update due to error in single records" . and also one more message "Messages (type E) for data records with record number 0
Message no. RSM2714". Can any one tell us the reason for the failure of this load ? and how to resolve it ?.
When we click on the help button of the error message it is displaying the message as below
Incomplete update due to errors in single records --> Long text
Message no. RSM2712
Diagnosis
In the update rules, one InfoSource record was used to create several records in the data target. These records must be handled in the same way to enable tracking into the PSA and the treatment of errors in individual records.
In the previous case, one record was updated in this kind of group generated by update rules, whereas other records in the same group were rejected. If you updated the PSA data record again, the records that were already updated would be updated again. Duplicate records would appear in the data target and the data target would thus be inconsistent.
System Response
The data record with errors was highlighted in the PSA. However, no error request was generated.
Procedure
Delete the request in the data target and, after removing the error, update all records for the request to the data target again.
Regards,
JayaKrishnahi,
Can you please check out the PSA error record and check this out in Source DSO as this load is for DSO -> Cube....
Please correct it in PSA if this is not correct as per DSO ....prior correcting data in PSA pls delete the request from Cube.....then it will allow to correct or delete record in PSA and then further push data from PSA to Target Cube...
If its correct as per DSO then run load in DSO sometime few records wrongly updated by end user and they correct it by evening for Submission....So u will get the corrected record and then run manually further load to Cube...
Hope this will help....
Regards,
Mahesh -
Getting Problem after Deleting a record from Record Store
I am trying to create a simple application for mobile device. This application storing some records. I used RMS for this. These records i show in a list. But i tried to show list of records after deleting any record then list shows only prior records of deleted records n then shows exception as
Recordsjavax.microedition.rms.InvalidRecordIDException
The code i written as follows
For storing data
public void storeExercise(String EName, String Etime)
try
//System.out.println("AAAA");
recordstore = RecordStore.openRecordStore("Test3",true);
catch (Exception error)
//System.out.println("EEEE");
System.out.println("Exception"+error);
try
byte[] outputRecord;
ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
DataOutputStream outputdataStream = new DataOutputStream(outputStream);
outputdataStream.writeUTF(EName);
outputdataStream.writeUTF(Etime);
outputdataStream.flush();
outputRecord = outputStream.toByteArray();
recordstore.addRecord(outputRecord, 0, outputRecord.length);
outputStream.reset();
outputStream.close();
outputdataStream.close();
zlist.append(EName+Etime, null);
display.setCurrent(zlist);
catch (Exception error)
System.out.println("Exception in writing Records"+error);
for getting records
public void getExercise(ZimList zlist)
this.zlist = zlist;
try
//System.out.println("AAAA");
recordstore = RecordStore.openRecordStore("Test3",true);
//recordstore.closeRecordStore();
catch (Exception error)
//System.out.println("EEEE");
System.out.println("Exception"+error);
try
//System.out.println("Hello");
String Ename = null;
String Etime = null;
byte[] byteInputData = new byte[100];
ByteArrayInputStream inputStream = new ByteArrayInputStream(byteInputData);
DataInputStream inputDataStream = new DataInputStream(inputStream);
for (int x=1; x<= recordstore.getNumRecords() ; x++ )
System.out.println("Record Id ="+x);
//if (x != InvalidRecordID)
recordstore.getRecord(x, byteInputData, 0);
Ename = inputDataStream.readUTF();
Etime = inputDataStream.readUTF();
inputStream.reset();
Final = Ename + Etime;
System.out.println("Insert" + Final);
zlist.insert(x-1,Final,null);
inputStream.close();
inputDataStream.close();
//recordstore.closeRecordStore();
catch (Exception error)
System.out.println("Exception in Reading Records"+error);
/*if (recordstore.listRecordStores() != null)
try
recordstore.deleteRecordStore("My Record Store");
catch (Exception error)
System.out.println("Exception"+error);
And for deleting records I write
public void deleteExercise(int index)
try
//System.out.println("AAAA");
recordstore = RecordStore.openRecordStore("Test3",true);
//recordstore.closeRecordStore();
catch (Exception error)
//System.out.println("EEEE");
System.out.println("Exception"+error);
if (recordstore.listRecordStores() != null)
try
byte[] byteInputData = new byte[100];
ByteArrayInputStream inputStream = new ByteArrayInputStream(byteInputData);
DataInputStream inputDataStream = new DataInputStream(inputStream);
for (int x=1; x<= recordstore.getNumRecords() ; x++ )
recordstore.getRecord(x, byteInputData, 0);
if (x == index)
recordstore.deleteRecord(index);
//x--;
inputStream.reset();
break;
inputStream.close();
inputDataStream.close();
catch (Exception error)
System.out.println("Exception in Deleting Records"+error);
Please Help me bcz i am new in j2me development n having no experienceOk ...
When you add records in you store, the J2ME implementation create an ID.
In the database, there is a list like that with ID <--> ]byte[ ]
You can get back a record with a this ID.
When you delete a record, it deletes the row. Lets say you have stored 3 records and that the ID are 1, 2, 3 ... if you delete the second one, then you have still in the database IDs 1 and 3.
That's why you have this exception : you are iterating with an ID 1, 2, 3, 4, 5 ... if one is delete there is no reorganization. (If you add an other record, it could be stored with ID 2).
To read all the records, you should get a list of existing IDs. Take a look at the API. Here is a piece of code, that you work but I have not tested :
RecordStore rs;
RecordEnumeration re = rs.enumerateRecords(null, null, false);
while (re.hasNextElement()) {
String str = new String(re.nextRecord());
System.out.println("Record: " + str);
} Hope it will help you.
Regards -
Delete Multiple records in Table?
Hi ..
I need to perform delete operation in my table with multiple selection.
My coding is..
for(int i=wdContext.nodeDetails2().size()-1;i>=0;i--)
if(wdContext.nodeDetails2().isMultiSelected(i) || wdContext.nodeDetails2().getLeadSelection()==i)
wdContext.nodeDetails2().removeElement(wdContext.nodeDetails2().getDetails2ElementAt(i));
When i delete first record, It works fine and multiple selection also works fine.
But when i select last record(only one) to delete, Then All the records get deleted. ???? Why this happens???
Anybody help to solve this probelm..
Thnx in advance..
Regards,
GSHi Sathish,
Store the node size in a variable then try. To avoid problems with the index, the context is executed in reverse. Suppose in a table you have 10 rows and you are deleting row 2 the after deletion of row 2 row 3 will come to row 2,row 4 will come in row 3 in this way process will be continue up to last row.
Try this.
int n = wdContext.nodeDetails2().size();
int leadSelected = wdContext.nodeDetails2().getLeadSelection();
// loop backwards to avoid index troubles
for (int i = n - 1; i >= 0; --i) {
if (wdContext.nodeDetails2().isMultiSelected(i) || leadSelected == i) {
wdContext.nodeDetails2().removeElement(wdContext.nodeDetails2().getDetails2ElementAt(i));
Regards,
Mithu -
Delete all record in a table, the insert speed is not change.
I have an empty table, and i insert a record need 100ms,
when this table has 40,0000 record, i insert a record need 1s, this is ok, because i need do a compare based an index before insert a record, so more record, need more time.
The problem is when i delete all record in this table, the insert time is still 1s, not reduce to 100ms.Why?Hello,
Read through this portion of oracle documentation
http://download.oracle.com/docs/cd/B19306_01/server.102/b14220/logical.htm#CNCPT004
The reason is still taking 1s, because when you inserted 400K record because HWM (The high water mark is the boundary between used and unused space in a segment.) moved up. And when you deleted all the records your HWM still at the same marker and didn't get to reset to 0. So when you insert 1 record it lookings for free space and after finding (generally a regular inserts got 6 steps it inserts data). If you truncate your table you and try it again it will be faster as your HWM is reset to 0.
Regards -
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
Maybe you are looking for
-
The volume on my Zen only goes up to 31. It is not loud enough for me to hear it if there is any external noise around me. Makes the player useless. I assume this is some kind of government safety regulation that has been required. However, If there
-
Deleting photos from iphoto and hard drive
I'm new to macs and have been reading a lot about this subject but I still don't get it. When I got this new macbook I dumped all my photos from the old PC onto the new hard drive. When I import photos into iPhoto, I left the advanced tab "copy item
-
i accidentally deleted my iMovie off my mac, anyone know how to get it back because it came for free and is now 15 dollars to buy back??? pls help
-
IPhone 3G running 3.1.2 still having intermittent loss of data services
My wife's 3G is randomly indicating that she has no internet connection, so she can't get data and/or send SMS messages. Even though she's in a spot at work where it used to always work fine. Her 3G has the latest 3.1.2 firmware and has gotten all of
-
Function Module for updating Username( last changed by field)-
Hi, Do we have any standard RFC function modules/BAPI available for updating a field in R/3 ( for eg:"last changed by field" of an item of a notification(plant maintenance). As the FM is an RFC FM, it always updates this field with the RFC user name.