How to count the values to identify the record instead of previous record
Hi friends i have to identify the record, my table is like this, S means sale, from 56 -> 8 sale, and 48 is new, now i have to update the 8 as ->S in table2 i dont no how to do coding for this, and i have inserted a column as is_identify default as N, if there s a partial sale, then i make it as Y, so if there is a Y for 56, then i have to update the new record 48 in table 2, in this i dont no how to do it... so Have to count X+C=N, then i have to set the flag as Y, then for tht record i have to insert new 48 N record in table2, now its not inserting into table2.... how to write coding for this any1 can help me
table1 Table2
lot_id quantity rec_type lot_id quantity activity_type
1256 10 N 1256 10
1234 56 X 1234 56 --------S
1234 48 N
1234 -8 C
Hello,
this is the forum for the tool {forum:id=260}. Please ask in {forum:id=75} and mark this question as answered so others can spend their time on answering open questions.
Best Regards
Marcus
Similar Messages
-
How to count the records?
Hi,
My data in the report is like below:
INVOICE# DATE QTY
==============================
111 07/03/03 1
RT1 07/05/03 1
222 07/08/03 2
333 07/09/03 2
RT2 07/10/03 1
Is there any way that I can sum the QTY OF all the 'RT' invoice#?
Thanks,
JunHi
Just put a Reports lavl summary column that sums the QTY column. You can have the summary column at the page and group level also.
Thanks
Rohit -
How to count the number of lines dynamically,
In the below code am trying to read the lines which are selected using a check box, also am categorizing the contents depending on the follow up material.
after displaying one category contents am displaying a line
which also counts to a line in the internal table.
My question is how to count the number of lines(ULINE) displayed dynamically.
FORM GET_LINES .
DATA: LV_LINES TYPE I,
LV_TIMES TYPE I,
LV_TABIX TYPE SY-TABIX.
DESCRIBE TABLE IT_REC LINES LV_LINES.
DO LV_LINES TIMES.
LV_TIMES = SY-INDEX .
READ LINE LV_TIMES FIELD VALUE IT_REC-CHECK INTO GV_CHECK.
IF SY-SUBRC EQ 0 AND GV_CHECK IS NOT INITIAL.
LV_TABIX = LV_TIMES.
READ TABLE IT_REC INDEX LV_TABIX INTO GWA_UPDATE.
IF SY-SUBRC EQ 0.
APPEND GWA_UPDATE TO GT_UPDATE.
ENDIF.
ENDIF.
ENDDO.
ENDFORM. " GET_LINESIn the below code am trying to read the lines which are selected using a check box, also am categorizing the contents depending on the follow up material.
after displaying one category contents am displaying a line
which also counts to a line in the internal table.
My question is how to count the number of lines(ULINE) displayed dynamically.
FORM GET_LINES .
DATA: LV_LINES TYPE I,
LV_TIMES TYPE I,
LV_TABIX TYPE SY-TABIX.
DESCRIBE TABLE IT_REC LINES LV_LINES.
DO LV_LINES TIMES.
LV_TIMES = SY-INDEX .
READ LINE LV_TIMES FIELD VALUE IT_REC-CHECK INTO GV_CHECK.
IF SY-SUBRC EQ 0 AND GV_CHECK IS NOT INITIAL.
LV_TABIX = LV_TIMES.
READ TABLE IT_REC INDEX LV_TABIX INTO GWA_UPDATE.
IF SY-SUBRC EQ 0.
APPEND GWA_UPDATE TO GT_UPDATE.
ENDIF.
ENDIF.
ENDDO.
ENDFORM. " GET_LINES
The display function is:
FORM DISPLAY_DATA .
ULINE.
WRITE : /1 SY-VLINE, 'check',
10 SY-VLINE, 'Plant',
20 SY-VLINE, 'Material number',
50 SY-VLINE, 'Follow up material',
70 SY-VLINE, 'Safety stock',
100 SY-VLINE, 'Partc'.
ULINE.
LOOP AT IT_MARC.
MOVE: IT_MARC-WERKS TO IT_REC-WERKS,
IT_MARC-MATNR TO IT_REC-MATNR,
IT_MARC-NFMAT TO IT_REC-NFMAT,
IT_MARC-EISBE TO IT_REC-EISBE,
IT_MARC-PARTC TO IT_REC-PARTC .
APPEND IT_REC.
CLEAR IT_MARC.
ENDLOOP.
DATA: GV_TABIX TYPE SY-TABIX.
LOOP AT IT_REC.
GV_TABIX = SY-TABIX.
READ TABLE GT_TOTAL WITH KEY WERKS = IT_REC-WERKS
NFMAT = IT_REC-NFMAT.
IF SY-SUBRC EQ 0.
IT_REC-PARTC = GT_TOTAL-PARTC.
MODIFY IT_REC INDEX GV_TABIX TRANSPORTING PARTC.
ENDIF.
ENDLOOP.
LOOP AT IT_REC.
WRITE : /1 SY-VLINE, IT_REC-CHECK AS CHECKBOX,
10 SY-VLINE, IT_REC-WERKS,
20 SY-VLINE, IT_REC-MATNR,
50 SY-VLINE, IT_REC-NFMAT,
70 SY-VLINE, IT_REC-EISBE,
100 SY-VLINE, IT_REC-PARTC.
AT END OF NFMAT.
ULINE.
ENDAT.
ENDLOOP.
ULINE.
ENDFORM. " DISPLAY_DATA
Solved -
How to count the number or rows in file
Hi Experts,
I am file as source and Oracle as target. My file containing the some data which is going to load to the target.
My requirement is that I want to count the number of rows which my file contains. Please help me how to count the total number of rows in file.
Thx,
Sahadeva.Hi,
You won't give a name DEST_USER_NAME:ODI will get these information.
it is important Command on source and Command on Source side .
-Pls write jython code on Command on Source side
-And Command On Target side Choose technology as Oracle and set logical schema to HR_logical
Sorry my mistake.İt is related jython syntax.Here is code:
import java.lang as lang
import java.sql as sql
import java.lang.String
import os
lang.Class.forName("<%=snpRef.getInfo("DEST_JAVA_DRIVER")%>")
cons=sql.DriverManager.getConnection("<%=snpRef.getInfo("DEST_JAVA_URL")%>", "<%=snpRef.getInfo("DEST_USER_NAME")%>", "<%=snpRef.getInfo("DEST_PASS")%>")
dblinks= cons.createStatement()
file1=open('EMP.txt','r')
count=0
line=file1.readline()
while line !='':
count+=1
line=file1.readline()
file1.close()
sqlQuery = "insert into HR.ETL_FILE_LOG (FILE_COUNT) values (count)"
rqQuery= dblinks.execute(sqlDBLink)
cons.close()
Regards -
How to count the number of rows in a resultser object?
hi there
how to count the number of rows in a resultser object which may contains millions of rows? besides using a while loop? thanksYou don't, you execute a query whose result is the record count of those records that match the search and then you execute the actual query to create your record set. Typically you do
select count(id) from YourTable where [filter]
from the resulting ResultSet do
int res.getInt(1);
which gives you the count and then
select id from YourTable where [filter]
to produce the actual result set.
in the second query the id part can be substituted with the actual fields you want. -
How to count the no of digits entered in the NumericField & print the same
Hi!
How to count the no of digits entered in the Numberic Field and print the content of Numberic Field.
Thanks.Hi Venkat,
To check the number of digits, just convert it to a string and use the length() method. to get the number of characters. However, I am not getting your second point of printing the number?
Kindly explain in detail.
Regards,
Poojith MV -
How to edit the records value fetched by select statement query in sqldever
How to edit the records value fetched by select statement query in sqldever 2.1.1.
EX-
SELECT * FROM emp WHERE ename like 'Jaga%'
Edited by: user9372056 on Aug 31, 2010 2:16 AMHi,
Although some forum members may be using that tool, there is still a dedicated forum for SQL Developer.
SQL Developer
Maybe your chances are better there.
Regards
Peter -
How to return the record count of a query to a number variable
How would I get the record count from a query without using a cursor to step through the query and count the records individually?
query: select * from table1 where column1 = column2
How would I get the record count of the query above?
thanks,
michelleI figured it out
select count(*) into theCount
from ( select * from table1 where column1=column2 );
thanks,
michelle -
How to count the number of wins?
I have a tic tac toe simulator that simulates a game of tic tac toe (obviously). I press the 'play' button, and 1 random X and O is placed in 9 of the labels. Then the application says if X or O wins, or if the game was a tie/no winner. So,
what I want to do is when I click the 'exit' button, I want a message box telling the user how many times X won, O won, and how many ties there were. I am not too sure how to count the number of wins.
-ThanksThanks for the reply. I could be wrong, but I do not think that is exactly what I am looking for. Here is the code that I have that determines the winner:
switch (checkWinner())
case 'T':
winnerLabel.Text = "It was a tie!";
break;
case 'O':
winnerLabel.Text = "O Wins!";
break;
case 'X':
winnerLabel.Text = "X Wins!";
break;
private char checkWinner()
char WinnerChar = ' ';
int winning_line = 0;
if (GameBoardCellChar[0].Equals(GameBoardCellChar[1]) && GameBoardCellChar[0].Equals(GameBoardCellChar[2]))
WinnerChar = GameBoardCellChar[0];
winning_line++;
if (GameBoardCellChar[3].Equals(GameBoardCellChar[4]) && GameBoardCellChar[3].Equals(GameBoardCellChar[5]))
WinnerChar = GameBoardCellChar[3];
winning_line++;
if (GameBoardCellChar[6].Equals(GameBoardCellChar[7]) && GameBoardCellChar[6].Equals(GameBoardCellChar[8]))
WinnerChar = GameBoardCellChar[6];
winning_line++;
if (GameBoardCellChar[0].Equals(GameBoardCellChar[3]) && GameBoardCellChar[0].Equals(GameBoardCellChar[6]))
WinnerChar = GameBoardCellChar[0];
winning_line++;
if (GameBoardCellChar[1].Equals(GameBoardCellChar[4]) && GameBoardCellChar[1].Equals(GameBoardCellChar[7]))
WinnerChar = GameBoardCellChar[1];
winning_line++;
if (GameBoardCellChar[2].Equals(GameBoardCellChar[5]) && GameBoardCellChar[2].Equals(GameBoardCellChar[8]))
WinnerChar = GameBoardCellChar[2];
winning_line++;
if (GameBoardCellChar[0].Equals(GameBoardCellChar[4]) && GameBoardCellChar[0].Equals(GameBoardCellChar[8]))
WinnerChar = GameBoardCellChar[0];
winning_line++;
if (GameBoardCellChar[2].Equals(GameBoardCellChar[4]) && GameBoardCellChar[2].Equals(GameBoardCellChar[6]))
WinnerChar = GameBoardCellChar[2];
winning_line++;
if (winning_line == 0 || winning_line > 1)
WinnerChar = 'T';
return WinnerChar;
Do I have to include something extra in here to get the count or no?
The code I posted is the coding in my play button. -
How to count the number of text boxes that are data entered
How to count the number of text boxes that are data entered in visual basic form.
Here is an Iterator that expands on my previous response:
''' <summary>
''' Iterator for form controls
''' </summary>
''' <param name="onlyControlsOfType">specify type if a certain type of controls needed</param>
''' <param name="onlyTopLevel">if true don't search containers within the form</param>
''' <returns></returns>
''' <remarks></remarks>
Private Iterator Function AllControls(Optional onlyControlsOfType As Type = Nothing, _
Optional onlyTopLevel As Boolean = False) As IEnumerable(Of Control)
Dim ctrl As Control = Me.GetNextControl(Me, True)
Do Until ctrl Is Nothing
If onlyControlsOfType Is Nothing OrElse ctrl.GetType = onlyControlsOfType Then
If TypeOf ctrl.Parent Is Form OrElse Not onlyTopLevel Then
Yield ctrl
End If
End If
ctrl = Me.GetNextControl(ctrl, True)
Loop
End Function
Some sample uses:
For Each
For Each c As Control In AllControls()
Debug.WriteLine(c.Name)
Next
List of all controls, including controls in containers i.e. Groupbox
Dim l As List(Of Control) = AllControls().ToList
List of all Textbox controls, including Textboxes in containers i.e. Groupbox
l = AllControls(GetType(TextBox)).ToList
List of all Textbox controls, don't include Textboxes in containers i.e. Groupbox
l = AllControls(GetType(TextBox), True).ToList
'Those who use Application.DoEvents() have no idea what it does and those who know what it does never use it.' JohnWein
Multics
My Serial Port Answer -
How to count the number of AAA clients
Hi,
As we know, ACS5.2 is required with a base license-- supporting 500 network devices.
Sometimes there are lots of AAA clients or network devices that are authenticating simultanious. So my question is, how to count the network devices allowed to auth on ACS5.2? Does that only include network devices, or including both any network devices or AAA clients?
Rgds,
Laowu5017Hi,
ACS 5.x counts the number of AAA clients that are configured on the ACS.
Please note that AAA clients and networks devices is the same and they comply switches, routers, WLCs, or whatever other device configured under
Network Resources >
... >
Network Devices and AAA Clients
AAA Clients are NOT the AAA suplicants.
The end user clients PCs are the AAA suplicants, and for this there is no limit number.
HTH,
Tiago
If this helps you and/or answers your question please mark the question as "answered" and/or rate it, so other users can easily find it. -
How to count the no of record in grid.
Hi Experts,
I have one database block & this is bolck has contain 4 non database item is there. In database block has contain the id and description is non database block item. While i m querying the data description is shown depends up on ID. It is in grid. How to count the no of record in grid. My code is
LV_CUR_ITM :=:SYSTEM.CURSOR_RECORD;
FOR I IN 1.. LV_CUR_ITM LOOP
LAST_RECORD;
SELECT NSN_NO INTO :ORD_DIS_NSN_ITEM_DET.NSN_NO
FROM NSN_MST WHERE NSN_ID= :ORD_DIS_NSN_ITEM_DET.NSN_ID;
SELECT FOB_PRICE INTO :ORD_DIS_NSN_ITEM_DET.FOB_PRICE
FROM PRODUCT_SUPPLIER WHERE PRD_ID_NUMBER= :ORD_DIS_NSN_ITEM_DET.PRD_ID_NUMBER
AND BAS_ORG_ID_NUMBER=:ORD_DIS_NSN_ITEM_DET.ORG_ID_NUMBER;
SELECT DESCRIPTION INTO :ORD_DIS_NSN_ITEM_DET.PRD_DESC
FROM PRODUCT WHERE ID_NUMBER= :ORD_DIS_NSN_ITEM_DET.PRD_ID_NUMBER;
SELECT FULL_NAME INTO :ORD_DIS_NSN_ITEM_DET.SUPP_NAME
FROM ORGANISATION WHERE ID_NUMBER=:ORD_DIS_NSN_ITEM_DET.ORG_ID_NUMBER;
NEXT_record;
END LOOP;
Thx in advance.Hai,
Add a Non database item to that block, and set the Calculation Mode as Summary, and Summary Function to Count.
Then u will get the total no of records from this text. ( You can hide this, so that the use won't see it. )
OR
go to the Last Record, then
LV_CUR_ITM :=:SYSTEM.CURSOR_RECORD; This will also work.
Regards,
Manu.
If this answer is helpful or correct, please mark it. Thanks. -
How to count Unique Values in BEx
Hi Guys,
Can anybody please let me know how to count unique values of a characteristic.
Thanx in advance
PeterI have a similar scenario. If i drill up on the characterstic that had a count of one in each record, the total number of records should be stay equal to the summarised results in the last screen.
Would someone know how to do that .
Arti -
How to do the Record Level commit in DB Adapter
Hi,
I am using Oracle JDeveloper 11.1.1.6.0 and SOA server 11.1.1.6
Problem Description_
I am fetching multiple records using File Adapter in BPEL process, After Fetching I am writing those records in Database using Database Adpter.
If any error records comes the database adpater rollback the complete transaction and none of the records is inserted into the Database.
**Can anyone please tell me how to do the record level commit in Database Adapter so that All the success records can be inserted into the database except the Failure record*.*
I dont want to call the Database adpater in loop multiple times to insert each record as it hampers the performance.
Thanks in Advance
SunilI believe you are polling a file and inside the BPEL, inserting the records into the database using the database adapter.
so according to your requirement you can do any one of the following things...
1. Instead of using the database adapter for inserting the record, you can call a Stored Procedure which it takes the record fields as input and it inserts the record into the table and does a commit at the end. when you follow this approach, make sure your data source is defined as Non-XA, otherwise you will face some errors.
2. If you are using the database adapter insert operation only, inside the BPEL, for the partnerlink of the database adapter, go to the properties and for the property "idempotent", give a value of false.
by doing this, what happens means, after calling the database adapter from BPEL through the invoke activity, the transaction is committed and from the next activity i mean after the invoke, a new transaction will be started but it will use the same thread though
3. If you are using the database adapter insert operation only, inside the BPEL, for the partnerlink of the database adapter, go to the properties and for the property "NonBlockingInvoke", give a value of true.
by doing this, what happens means, the database adapter insert operation will happen in a separate transaction and it will be committed, inside the BPEL after the invoke activity, a new thread and transaction will be started
4. Also, if you are using the database adapter insert operation, don't follow the steps as mentioned in either 2 or 3, you can simply put a dehydrate activity after the invoke activity.
According to your requirement, all the four approaches works. But my personal feeling, don't go for 4, instead 1 is better, 2 or 3 is also good.
Hope this helps,
N -
How to edit the records in error stock.
Hi Experts,
i have error records in error stack and the remaining records are loaded successfuly . here my doubt is how to edit the records in error stack because its not giving the edit option .
i want to get the edit option means i need to delete the request in target r wt ?
and there are two more targets is there below this process .
Advance Thanks.
Regards
SAPHI
If you have less number records in this request(which you extracted now), delete that request from all the targets and reload again with option Valid records update, reporting not possible.
this is the option which is recommended.
follow the below 2 docs as well.
http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/80dd67b9-caa0-2e10-bc95-c644cd119f46?QuickLink=index&overridelayout=true
http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/007f1167-3e64-2e10-a798-e1ea456ef21b?QuickLink=index&overridelayout=true
Regards,
Venkatesh
Edited by: Venkateswarlu Nandimandalam on Jan 24, 2012 4:35 PM -
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
Maybe you are looking for
-
Safari 6.0.2 Constantly Crashing
Safari has been constantly crashing over the last few weeks, every day, multiple times per day. Here's an clipped version of the crash log. I've got a Macbook Air from late last year. Anyone got any ideas? Process: WebProcess [71584] Path:
-
Which jar to use in order to write add-ons for IE
Hi, I don't know whether I am asking the correct question but I want to know can I use any jar in order to create add-ons for Internet explorer and, if any, which one? thanks
-
My kids disabled my ipad and I am connected to itunes but where do I go from here to enable my ipad
-
Dear All, I have an requirement for getting the closing balance as running total. Means I have the following fields as Debit Credit Balance ( Not there but want a calculation or formula from crystal reports ) 100 0 100 200
-
I'd like to learn if others are out there that are teaching with this book this semester and how you plan to use it. I'd like to 'compare notes' and perhaps steal some good ideas. I'm teaching with this book this semester. The class is mainly unde