Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

How to count Value based on a header level Characteristic?

Former Member
0 Likes
756

Hi

How to count Value based on a header level Characteristic???

Example:

Header shopping cart Item Count

10000 1 1

2 0(it shld not be 1 here as it is item level 2)

3 0 (it shld not be 1 here as it is item level 3)

result 1(as per header level ,Count is 1).

pls help me ASAP.

thnx a lot

as no one has got idea about it frm BW consultant...this for BW .

thnx

raj

Title was edited by:

Alvaro Tejada Galindo

Hi

How to count Value based on a header level Characteristic???

Example:

Header shopping cart Item Count

10000 1 1

2 0(it shld not be 1 here as it is item level 2)

3 0 (it shld not be 1 here as it is item level 3)

result 1(as per header level ,Count is 1).

pls help me ASAP.

thnx a lot

as no one has got idea about it frm BW consultant...this for BW .

thnx

raj

Title was edited by:

Alvaro Tejada Galindo

6 REPLIES 6
Read only

Former Member
0 Likes
737

You could loop through your table and count when you reach a new value of the first field, something like this:

LOOP AT ITAB.

AT NEW field1.

ADD 1 TO w_count.

ENDAT.

  • whatever processing you want here

ENDLOOP.

I hope this helps.

- April King

Read only

0 Likes
737

hi

Thnx a lot for ur immediate response...

Could u pls xplain me with my own scenario as I dont have any coding knowledge too..

Revert me ASAP.

thnx again

Read only

0 Likes
737

Somewhere in your program you must have a table that stores the data for your shopping cart. The table contains one record for each item, and each record contains the same fields (just with different data). The first field (what you're calling the header) has the same value for multiple records. So you can loop through your table and each time the value of the first field changes you would add 1 to your count. In the below example, itable is the table where you are storing your data, field1 is that first field that you want to count unique occurrences of, and w_count is your count. You would put this code in the program wherever you want to calculate the count.

LOOP AT itable.

AT NEW field1.

ADD 1 TO w_count.

ENDAT.

ENDLOOP.

I hope that is clearer. I can't give you the exact table and field names you will need to use because I don't know your program. Your BW person should be able to help with that.

- April

Read only

0 Likes
737

hi

thnx a lot for ur help.. Some what understood..Below tht first value all r the item level where I want the count value to be Zero.

How do I do this???

Pls help

thnx

Read only

0 Likes
737

Why do you need the count to be zero at the item level? Are you displaying the count with every record? You should be able to only display it when you want to. Or is the count being used somewhere else? I don't understand what your requirements are.

- April

Read only

0 Likes
737

COUNT VALUE SCENARIO BASED ON CHARACTERISTIC WHICH IS AT HEADER LEVEL:

PO ID ITEM %VALUE COUNT

ARMY 100000034 1 44.45 1

2 55.67 0

3 22.56 0

4 100 0

RESULT 1

ARMY 100000034 1 44.45 1----


Header & item level both in same line which shld have count as one asper ID 100000034

1 44.45 1

2 55.67 0

3 22.56 0

4 100 0

Above r item leve but 1st record is along with header level where value equals 1

& below 2,3,4 r other line item where Count value shld be 0.

thnx for ur effort

..bye for now

Hope this is fine for the Explanation…