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

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

Re: [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

Reply from R. N. Wilhite on Feb 7 at 1:50 AM
I'd do an additional itab and collect. It's very simple even if not the
most efficient.

Neal

---------------Original Message---------------
From: sachin gaur
Sent: Tuesday, February 07, 2012 1:19 AM
Subject: How to Get the Total in SAP Script

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
R. N. Wilhite  
Senior Project Manager
20 achievements
 
Mark as helpful
View this online
Ask a new question
 
In the Spotlight
Become a blogger at Toolbox.com and share your expertise with the community. Start today.

_.____.__

0 comments:

Post a Comment

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