We have added search box. Key in SAP issue keyword to search
TopBottom

Announcement: wanna exchange links? contact me at sapchatroom@gmail.com.

[sap-dev] How to Get the Total in SAP Script

Posted by Admin at
Share this post:
Ma.gnolia DiggIt! Del.icio.us Yahoo Furl Technorati Reddit

Question from sachingaur21 on Feb 7 at 1:18 AM
I use this code to do the total of the qty for every GR.

SELECT-OPTIONS : gr FOR mkpf-mblnr OBLIGATORY.
data: v_index type i.

clear; v_index
LOOP AT itab1_item.
v_index = sy-tabix.
IF sy-subrc = 0 .
TOTAL = TOTAL + itab1_item-qty.
ENDIF.
ENDLOOP.

This works fine, but thing is that when in the select option I enter multiple entries to print GR.

this do the sum of all of the GR qty.
exp: input : 1001 to 1010
1001--- qty-- 10
1002 --- qty--20
1003 --- qty --30
-
-
1010-- qty--- 220

My requirement is for every GR no. it will the the total of that particular GR qty only GR may have multiple item no.

but in my case this shows the total of all the item qty that GR have.
this sum up all of the GR qty.
10+20.+30.----22. = XXX
this gives this o/p.

but is need for every GR it will the total of only that GR qty total.

I also try the controlling event.
AT NEW gr.
v_ind = 'X'.
IF v_ind = 'X'.
CLEAR v_ind.
LOOP AT itab1_item WHERE GR = ITAB1_HEADER-GR.
v_index = sy-tabix.
IF sy-subrc = 0 .
TOTAL = TOTAL + itab1_item-qty.
ENDIF.
ENDLOOP.
endif.
endat.

Thanks in advance.

Sachin Gaur
ABAP consultant
 
Reply to this email to post your response.
 
__.____._
Manage Settings | Unsubscribe | Create FAQ | Send Feedback
  
Copyright © 2012 Toolbox.com and message author.
Toolbox.com 4343 N. Scottsdale Road Suite 280, Scottsdale, AZ 85251
sachingaur21  
Sachingaur21
 
View this online
Ask a new question
 
In the Spotlight
Toolbox.com for iPhone & Android: Ask Questions & Get Answers Anywhere. Download the Free App

_.____.__

0 comments:

Post a Comment

T r a n s l a t e to your language