This website is not affiliated with, sponsored by, or approved by SAP AG.

SQ01/Infoset Query suppress zeros

Development (ABAP Development WorkBench, ABAP/4 programming)

Moderators: Snowy, thx4allthefish, YuriT, Gothmog

SQ01/Infoset Query suppress zeros

Postby rpinxt » Wed Dec 07, 2016 6:57 am

Can it be done in an easy way?

So when we run the query the output is fine.
Only it also shows lines for which quantities are 0.
Of course the total at the bottom will still be ok, but all these 0 lines are only waste.

Know I can make an extra field which sums the 2 quantity field.
Take that field in the selection screen and when running the report tell it that the new field should not be 0.

But surely there must be a more clever and elegant way?
Some coding or setting maybe in the infoset?
Thanks.
rpinxt
 
Posts: 146
Joined: Mon Jul 23, 2012 8:02 am

Re: SQ01/Infoset Query suppress zeros

Postby Gothmog » Wed Dec 07, 2016 8:09 am

In the infoset, in the Extras, in tab Code, add a code section 5 (Record Processing), and check the quantities are not zero.
For example:
Code: Select all
CHECK quantity1 <> 0 OR quantity2 <> 0.
68 74 74 70 3a 2f 2f 74 69 6e 79 75 72 6c 2e 63 6f 6d 2f 62 64 6f 37 6d 77 67
Gothmog
 
Posts: 1942
Joined: Wed Sep 12, 2007 4:46 am
Location: Probably not home

Re: SQ01/Infoset Query suppress zeros

Postby rpinxt » Wed Dec 07, 2016 10:05 am

Ok, would love to try that.

But what if you not have a section 5....? :shock: :?

I have 1 to 4 and 6 to 13.....wtf...
rpinxt
 
Posts: 146
Joined: Mon Jul 23, 2012 8:02 am

Re: SQ01/Infoset Query suppress zeros

Postby Gothmog » Wed Dec 07, 2016 10:33 am

Oh... You're using a logical database, I see.
You could put your code in the GET event of the appropriate node, and use the REJECT [node] instruction to filter out the line.
68 74 74 70 3a 2f 2f 74 69 6e 79 75 72 6c 2e 63 6f 6d 2f 62 64 6f 37 6d 77 67
Gothmog
 
Posts: 1942
Joined: Wed Sep 12, 2007 4:46 am
Location: Probably not home

Re: SQ01/Infoset Query suppress zeros

Postby rpinxt » Wed Dec 07, 2016 10:59 am

Ok I put the CHECK code in the node for which I took the quantity fields.

But I did not get the part of the reject.

As a second line I put REJECT <nodename> but then you get "xxxx" must be a character-type field error.
rpinxt
 
Posts: 146
Joined: Mon Jul 23, 2012 8:02 am

Re: SQ01/Infoset Query suppress zeros

Postby Gothmog » Wed Dec 07, 2016 11:15 am

You need the name of the node between quotes :
Code: Select all
IF quantity1 = 0 AND quantity2 = 0.
  REJECT 'MYNODENAME'.
ENDIF.
68 74 74 70 3a 2f 2f 74 69 6e 79 75 72 6c 2e 63 6f 6d 2f 62 64 6f 37 6d 77 67
Gothmog
 
Posts: 1942
Joined: Wed Sep 12, 2007 4:46 am
Location: Probably not home

Re: SQ01/Infoset Query suppress zeros

Postby rpinxt » Thu Dec 08, 2016 9:22 am

ahhh I was missing the ' ' around the node name.

Thanks it works perfectly! :)
No more redundant lines in my report.
rpinxt
 
Posts: 146
Joined: Mon Jul 23, 2012 8:02 am

Re: SQ01/Infoset Query suppress zeros

Postby aimeusdietger » Tue Feb 21, 2017 5:04 am




It's interesting to see how simple mistakes in coding can bring about multiple errors. I missed = and used - instead and the result was unbelievable.
aimeusdietger
 
Posts: 1
Joined: Fri Feb 10, 2017 2:11 pm


Return to ABAP

Who is online

Users browsing this forum: No registered users and 7 guests





loading...


This website is not affiliated with, sponsored by, or approved by SAP AG.