Count of lines
Hi
The following is the scenario.
For EX:
Plant............Article............Count
P100............A100............1
P100............A200............1
P100............A300............1
P400.............A400...........-1
P500.............A500...........1
Overall Result ...................5
The above data is in the cube.
I created a condion in the report to display the stock in -ve QTY (Keyfigure HIDE mode)
when i exeucte the query the following is the result
Report Data
Plant............Article............Count
P100............A200.............1
P100............A300............1
P400.............A400............1
Overall Result..................3
Now My client dont want to see the articles in the report, they just want to see the number of line items which are in negative so i want the following thig in the report
Plant----
Count
P100................3
P200................10
. So on...Can we achieve this?
REgards
Annie
Hi
Hi my final out put should only dispaly SITE(PLANT) and TOTAL COUNT (-ve ones)
If i hide the article, i am getting the result but the problem is i am getting the counter for articles like
P100 ---COUNT1
..........COUNT2
..........COUNT3
..........COUNT4
..........COUNT5
overall res 5.
But i want only
P100.......5.
If i put the Article in the free characteristics...The condion is not running and in count its displaying all the aricles (+ and -ve) count
Regards
Annie
Similar Messages
-
How to count Command-Line Arguments ?
How do you count Command-Line Arguments ?
For example,
java program argument1 arguement2
I would like to be able to count how many arguements the user inputed
It should result as 2 for the bold line above
Thank you for your helppublic static void main(String[] args) {
int numArgs = args.length; // args holds argument1 and argument2
} -
HasMoreTokens detecting and counting empty line
Hi programmers!
how can i count empty line in a text file which has the data?
suppose the text file with data is as follows:
=====================
c 500
c 2100
// <== empty line
p 550
c 5950
c 3000
=====================
I want to display "Invalid record" when that empty line comes
I tried following to execute "IO.print("Invalid record") line
if(str.equals(" ")) / / also/ if (str.nextToken == false) /also / if (string.hasMoreTokens())
IO.print("Invalid record");
}If (line.equals(""))
or
if (line.trim().length() == 0) -
Hi,
How can I obtain the count of lines of code in all the custom objects such as z programs, z functions, z methods, user exits etc?
THank you,
Mikecheck fm RPY_FUNCTIONMODULE_READ
Check how it reads the source code and returns it.
Use a describe statement to the return table
or try this syntax
itab must hold a field of char72.
READ REPORT 'Y123' INTO ITAB.
lines_r = lines( itab ).
also check in se37 for rpy*
Also check the f1 for read report, there are many other options -
How to Count schedule lines in IDoc ORDERS05 using XSLT Mapping
Hi Experts,
In a Scenario where we are sending Purchase order (ORDERS05) to SAP SNC using XSLT Mapping,
where in we need to count the no. of schedule lines against the Purchase Order line.
As in Schedule line segment there is no such provision, so it needs to be handle in XSLT mapping to count the schedule lines.
Can you all please guide me how to go about the same.
Regards,
Nitin PHi Satish,
Thank you very much for the reply,
as there is only Quantity and other information is maintained against schedule lines how we can count the schedule line repeatation against PO line ? Is that very simple as you suggested or some other consideration also needs to be taken.
Please clarify the same and let me also know if there are some standard documents also for the same.
Regards,
Nitin P -
Pls Help about counting the lines of the file in java
private int GrepPBArequestLog(String STRexpression) throws IOException
int totalnum = 0;
try {
String[] cmd = {"grep", "-ic", STRexpression, src};
System.out.println("grep, cmd " STRexpression" "+src);
Process grepProc = Runtime.getRuntime().exec(cmd);
String line = "";
BufferedReader br = new BufferedReader(new InputStreamReader(grepProc.getInputStream()));
line = br.readLine();
System.out.println("read: "+line);
while (line != null)
System.out.println("Line: "+line);
line = line.substring(line.indexOf(":") + 1, line.length());
System.out.println("Substring: "+line);
try
int temp = Integer.parseInt(line);
totalnum = totalnum + temp;
catch(NumberFormatException e)
System.out.println("String: "+line);
System.out.println("NumberFormatException Occured"+e.getMessage());
}//end while
the output is:
service No: 209
Wapdate: 07/Jul/2003
Went inside: GrepPBArequestLog
grep cmd .*07/Jul/2003.*GET.*209.* /var/log/httpd/access_log*
Line:
read: null
totalnum: 0
wap 07/Jul/2003:
wap 209:
total hits 209: 0
+++++++++++++++++++++++++++++++++
the read: should not be null because there is a number of lines and
totalnum shouldn't be 0.You don't want to simply:
import java.io.*;
public class CountEm {
private static BufferedReader br;
private static int count;
private static String fileName, record;
public static void main(String[] argv) {
switch(argv.length) {
case 1: { fileName = argv[0]; break; }
default: { System.out.println("Usage: java CountEm [filename]"); System.exit(-1); }
try { countEm(); }
catch(IOException ioe) { System.out.println("ERROR doing countEm()\n"+ioe); }
finally { System.out.println("Count: "+count); }
public static void countEm() throws IOException {
br = new BufferedReader(new FileReader(fileName));
while ( ( record = br.readLine() ) != null ) { count++; }
}~Bill -
How to increment counter for line items.
Hi,
Please see the code below:
LOOP AT T_MAT INTO W_MAT.
perform bdc_dynpro using 'SAPMM07M' '0421'.
perform bdc_field using 'BDC_CURSOR'
'MSEG-ERFMG(i)'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'MSEG-MATNR(i)'
W_MAT-MATNR.
perform bdc_field using 'MSEG-ERFMG(i)'
W_MAT-ERFMG.
i = i+1.
ENDLOOP.
In the above code I'm updating the line items thru BDC. Here I'm having a counter ' i '. I'm incrementing it for every loop cycle. When I run the BDC I get the error "Field MSEG-ERFMG does not exist in the screen"
Please help.
regards,
SriramHi Sriram,
you code as to be changed slightly:
DATA l_counter(2) TYPE n.
DATA l_fieldname TYPE string.
loop at t_mat into w_mat.
MOVE i TO counter.
CONCATENATE 'MSEG-ERFMG(' counter ')' INTO l_fieldname.
PERFORM bdc_field USING 'BDC_CURSOR'
l_fieldname.
i = i+1.
ENDLOOP.data l_counter(2) type n.
Regards
REA
Edited by: Ramy EL-ARNAOUTY on Jul 28, 2009 10:29 AM -
Counting Requirement (Counting PO line items wrt PO No)
Hi All,
We have a requirement here . Suppose there are 2 Purchase orders Y & Z . "Y" purchase order has 5 line items as 10,20,30,40,50 . "Z" purchase order has 7 line items as 10,20,30,40,50,60,70 . now i want to count the number of purchase orders & no of line items . I.e output should be , for a particular month there are 2 purchase orders & 12 line items .
Point will be awarded .
Thanks,
DeadlocksHi Priya,
thnx for the reply, just a small thing i wanted to ask,
inside those two CKFs should i create a formula variable on PO header & PO item no ?
Before this what i did was i created a CKF with constant 1 in it and then i applied exception aggregation as "total" and refrence characteristic as "PO header" & and "PO item".
so instead of bringing item count as 12 it is bring 7 .
Regards,
Deadlocks -
Record Count of Lines in the Reciever Txt file
Hi,
I am Working with File to Idoc Scenarion. Where I have field "Record Count in the reciever. Where the total number of lines in the reciever file has to mapped with the field and the file to be recieved to the destination.
eg:Each Idoc that we receive, 2 lines are written out, one starts with BATHDR, the other is SECPTY.
There is also then 1 extra line, the header line. I looked at a bunch of iFiles, and it seems to be if we knew the total # of idocs for a given payment run, the total # of lines we would output is:
( ( #ofIDOCS * 2) + 1).
With this observation can you advise on the action to be taken for the out put.
Thanks ,
ManojHi,
I am Working with Idoc to File Scenarion. Where I have field "Record Count in the reciever. Where the total number of lines in the reciever file has to mapped with the field and the file to be recieved to the destination.
eg:Each Idoc that we receive, 2 lines are written out, one starts with BATHDR, the other is SECPTY.
There is also then 1 extra line, the header line. I looked at a bunch of iFiles, and it seems to be if we knew the total # of idocs for a given payment run, the total # of lines we would output is:
( ( #ofIDOCS * 2) + 1).
With this observation can you advise on the action to be taken for the out put.
Thanks ,
Manoj -
Group by and count of line items
Hi
I have a requirement to implement group by part # and count of the line items
I was able to do group by at the node level and how to do the count
Thanks
New BIPHi Alex
sorry did not check until now glad some one came out to help me
Can i send you the template, xml and output to your email please
Thanks
NewBIP -
Counting words, lines and char
i want a program which counts the number of lines,words and characters in a file.....................
please help meOne thread is enough.Continue there, please.
[http://forums.sun.com/thread.jspa?threadID=5367866]
I'm locking this one. -
Disconnect counter output line
Hello,
I have a question that has been bothering me for awhile. I'm using an M-series DAQ card which allows the ctr0 output to be placed on any PFI line. Is there any way to disconnect the ctr0 output from all the PFI lines? I'm only using the ctr0InternalOutput and I don't want it routed to an external pin.
The reason I ask is because the ctr0InternalOutput was being used as timing for several acquisitions, but the output was also appearing on it's default output pin. However, this DIO/PFI line was being used as a digital output for relay control and every time the counter was used, the relay would switch. I "fixed" it by routing the counter output to an unused PFI line, but I would like it not to appear externally at all.
Thank you for your help,
JonThanks, I will give that a try. Seems so obvious now...
Jon -
Read Counter/Position Line or Volume Counter
I have the iPod Nano 4 GB.
Serial # YM538AJCTK3
It used to show the read counter or position line that shows at which point on the song/podcast I'm on; or the.
Now, it's not showing it. Instead it's showing 5 small circles that doesn't indicate the position of the song/podcast nor the volume counter.
I can't seem to change this setting back.
Please help.Sometimes, if you don't allow the screen to refresh before pressing another button, it gets stuck.
See this for help.
iPod "stuck" on the artwork or rating screen.
As you will see, updating the software can cure this. -
I wants to count number of blank lines in a java program using io package. Please give your logic or code.
regards
YOGESHI think this class will help you:
http://www.cs.arizona.edu/people/reges/teachers/TextReader.html
This class has methods to readLine(), which reads a line until it gets to a "\n" (end line character). If you want to do, what I thought you want to do, you could readLine(), which returns a string, then say
String line = (input.readLine()).trim();
if(line.equals(""))
blankLines ++;
Anyway, I hope this helps, and another thing that would probably help you too, is if I actually showed you where to get the TextReader class :-) , so... here is where to get it:
http://www.cs.arizona.edu/people/reges/
then just click on TextReader which will be on the frame to your left. From there you can download the source and use it.
good luck -
ALV Output - Need to show count of line items based on 1 key field.
Hi All,
In my prog i need to show an ALV ouput which is having Matnr,Material type and Division . MATNR is the key field. I need to show how many line items are present against a particular MATNR in that ALV ouput itself. Not in the top of page. I think there might be some field in SLIS which can be use for the same. If any one has come across such a requirement then please revert back.
thanx,
Shyam.
PS: Useful answers will be rewarded.Ok, so we are back to using the COUNT field and now using the SORT functionaity, the SORT will allow us to subtotal by MATNR.
REPORT zrich_0001.
* Global ALV Data Declarations
TYPE-POOLS: slis.
* Internal Tables
TYPES: BEGIN OF talv ,
matnr TYPE mara-matnr,
mtart TYPE mara-mtart,
spart TYPE mara-spart,
count TYPE i,
END OF talv.
DATA: ialv TYPE TABLE OF talv WITH HEADER LINE.
DATA: fieldcat TYPE slis_t_fieldcat_alv.
DATA: sort TYPE slis_t_sortinfo_alv.
DATA: layout TYPE slis_layout_alv.
START-OF-SELECTION.
PERFORM get_data.
PERFORM call_alv.
* Form GET_DATA
FORM get_data.
SELECT matnr mtart spart INTO TABLE ialv
FROM mara UP TO 500 ROWS.
ENDFORM. "GET_DATA
* CALL_ALV
FORM call_alv.
PERFORM build_field_catalog.
PERFORM build_sort.
layout-countfname = 'COUNT'. "<----- HERE
* Call ABAP List Viewer (ALV)
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
it_sort = sort
is_layout = layout
it_fieldcat = fieldcat
TABLES
t_outtab = ialv.
ENDFORM. "CALL_ALV
* BUILD_FIELD_CATALOG
FORM build_field_catalog.
CLEAR: fieldcat. REFRESH: fieldcat.
DATA: tmp_fc TYPE slis_fieldcat_alv.
tmp_fc-reptext_ddic = 'Material'.
tmp_fc-fieldname = 'MATNR'.
tmp_fc-tabname = 'IALV'.
tmp_fc-outputlen = '18'.
APPEND tmp_fc TO fieldcat.
tmp_fc-reptext_ddic = 'Material Type'.
tmp_fc-fieldname = 'MTART'.
tmp_fc-tabname = 'IALV'.
tmp_fc-outputlen = '4'.
APPEND tmp_fc TO fieldcat.
tmp_fc-reptext_ddic = 'Division'.
tmp_fc-fieldname = 'SPART'.
tmp_fc-tabname = 'IALV'.
tmp_fc-outputlen = '2'.
APPEND tmp_fc TO fieldcat.
tmp_fc-reptext_ddic = 'Count'.
tmp_fc-fieldname = 'COUNT'.
tmp_fc-tabname = 'IALV'.
tmp_fc-outputlen = '5'.
tmp_fc-do_Sum = 'X'.
append tmp_fc to fieldcat.
ENDFORM. "build_field_catalog
*& Form build_sort
* text
FORM build_sort.
DATA: tmp_sort TYPE LINE OF slis_t_sortinfo_alv.
CLEAR sort. REFRESH sort.
CLEAR tmp_sort.
tmp_sort-fieldname = 'MATNR'.
tmp_sort-tabname = 'IALV'.
tmp_sort-up = 'X'.
tmp_sort-subtot = 'X'.
APPEND tmp_sort TO sort.
ENDFORM. "build_sort
Regards,
Rich Heilman
Maybe you are looking for
-
Problem while updating a database table
Hi experts, I've used the FM 'HR_INFOTYPE_OPERATION' to update the database table. In that i used the MOD operation to update the Infotype PA0315. But it return an error message like "Infotype does not exist". What could be the
-
When would be Visual Composer NetWeaver 2004s available?
Hi Friends, Could you anyone(may be forum author - greg) tell me when would be Visual Composer 2004s available for use on production. I found couple of download pieces in the service.sap.com. It is said as Base, Flex, etc. Thanks, Raghavendra P
-
When I do a package my adobe-id is sign in and is the default account. How can I fix so that no account is sign in when creating package. Regards Daniel
-
HT201317 Shared Photo Stream on iPhone 4S??
I have updated my phone to iOS6 & I wanna turn on my shared photo stream service on my iphone but when i go to iCloud settings and tap on photo stream, there is only one option and that is "My photo stream" and I can't find shared photo stream!! but
-
Just installed the drivers for Sound Blaster li've LS and everything is working except that my Audio HQ will not open. I am ruuning xp. I disabled my old sound device and applied the new sb li've in the drop down box, clicked apply. I installed this