Finding Sum of a field
Hello Friends,
I am working on a BIP report and preparing an RTF file.
In my table (in the report) there is a field by the name 'SALARY_PAID' which shows the salary paid against all the employee Id.
I need to show the sum of all the salary paid at the bottom of the table.
Can anyone please let me know how do I get it done in the RTF.
Regards
Hawker
Use <?sum(SALARY_PAID)?>
Similar Messages
-
Finding sum for time field in alv
hi gurus.,
i need to find total hours.. i am using field of data type 'TIMS' ... i converted the value to decimal in ALV and founfd total hours .. i need the total hours in Time format .. how can i achieve this in alv .. its very urgent ...
thanks®ards.,
S.SivakumarHi Shivakumar,
I suggest you not to convert TIMS to Decimal
because it won't give you correct result..
Eg...
Time1 = '11:56:32'
Time2 = '11:50:10'
now add these two times...
u will get the sum of these as 23:06:42
but in real life... you want the result as 23:46:42
So the better way for getting accurate result is to convert this
HH:MM:SS to Seconds
and then sum these seconds
then again convert it to HH:MM:SS
1 hr = 3600 sec
1 min = 60 sec
Hope it will solve your problem...
Reward points if useful...
Thanks & Regards
ilesh 24x7 -
Dump when summing up CURR field in ALV GRID display
Hi All,
I am getting dump when I try to sum the CURR field in my ALV Grid Display. The field is of CURR 23. I am using classes and methods to display alv grid.
I tried passing <fs_fieldcat>-do_sum = 'X'. When I did this, it is dumping without even displaying the alv grid.
Here is the part it is throwing dump:
ls_lvc_data-value = space.
clear ls_lvc_data-style.
loop at it_fcat_local assigning <ls_fcat>
where tech ne 'X' and no_out ne 'X'.
if l_invisible eq 'X'.
clear l_invisible.
if <ls_fcat>-do_sum is initial.
continue.
else.
clear ls_lvc_data-col_pos.
endif.
endif.
add 1 to ls_lvc_data-col_pos.
assign component <ls_fcat>-fieldname
of structure <ls_data> to <l_field_value>.
_if sy-subrc ne 0.
message x000(0k).
endif._
Regards,
GuruThomas,
Here is the dump:
Runtime Errors MESSAGE_TYPE_X
Date and Time 10/22/2010 23:30:53
Short text
The current application triggered a termination with a short dump.
What happened?
The current application program detected a situation which really
should not occur. Therefore, a termination with a short dump was
triggered on purpose by the key word MESSAGE (type X).
Error analysis
Short text of error message:
Long text of error message:
Technical information about the message:
Message class....... "0K"
Number.............. 000
Variable 1.......... " "
Variable 2.......... " "
Variable 3.......... " "
Variable 4.......... " "
How to correct the error
Probably the only way to eliminate the error is to correct the program.
If the error occures in a non-modified SAP program, you may be able to
find an interim solution in an SAP Note.
If you have access to SAP Notes, carry out a search with the following
keywords:
"MESSAGE_TYPE_X" " "
"SAPLSLVC" or "LSLVCF36"
"FILL_DATA_TABLE"
If you cannot solve the problem yourself and want to send an error
notification to SAP, include the following information:
1. The description of the current problem (short dump)
To save the description, choose "System->List->Save->Local File
(Unconverted)".
2. Corresponding system log
Display the system log by calling transaction SM21.
Restrict the time interval to 10 minutes before and five minutes
after the short dump. Then choose "System->List->Save->Local File
(Unconverted)".
3. If the problem occurs in a problem of your own or a modified SAP
program: The source code of the program
In the editor, choose "Utilities->More
Utilities->Upload/Download->Download".
4. Details about the conditions under which the error occurred or which
actions and input led to the error.
Source Code Extract
Line
SourceCde
2708
is_subtottxt_info = ls_subtot_info
2709
ip_subtot_line = lr_data
2710
changing
2711
c_subtottxt = l_subtottxt.
2712
ls_lvc_data-value = l_subtottxt.
2713
2714
append ls_lvc_data to ct_lvc_data.
2715
endif.
2716
2717
2718
Column per Fieldcat Entry
2719
2720
ls_lvc_data-value = space.
2721
clear ls_lvc_data-style.
2722
loop at it_fcat_local assigning <ls_fcat>
2723
where tech ne 'X' and no_out ne 'X'.
2724
if l_invisible eq 'X'.
2725
clear l_invisible.
2726
if <ls_fcat>-do_sum is initial.
2727
continue.
2728
else.
2729
clear ls_lvc_data-col_pos.
2730
endif.
2731
endif.
2732
2733
add 1 to ls_lvc_data-col_pos.
2734
2735
assign component <ls_fcat>-fieldname
2736
of structure <ls_data> to <l_field_value>.
2737
if sy-subrc ne 0.
>>>>>
message x000(0k).
2739
endif.
2740
2741
*... work on average
2742
if <ls_fcat>-do_sum eq 'C'.
2743
Initialize average result and entries
2744
<l_field_value> = 0.
2745
clear l_entries.
2746
2747
retrive unit from fieldcatalog
2748
assign space to <l_unit>.
2749
if not <ls_fcat>-cfieldname is initial.
2750
assign component <ls_fcat>-cfieldname
2751
of structure <ls_data> to <l_unit>.
2752
endif.
2753
if not <ls_fcat>-qfieldname is initial.
2754
assign component <ls_fcat>-qfieldname
2755
of structure <ls_data> to <l_unit>.
2756
endif.
2757 -
Hi,
Have written the select query as
SELECT lifnr gjahr belnr buzei bldat zfbdt zbd1t dmbe2 shkzg
INTO TABLE gt_bsik
FROM bsik FOR ALL ENTRIES IN gt_lfb1
WHERE bukrs EQ p_bukrs
AND lifnr EQ gt_lfb1-lifnr
AND umsks EQ space
AND umskz EQ space
AND augbl EQ space
AND zfbdt LE p_nedat.
next i have to find the sum of buzei field.How to do this.Please helpHi.
Here is s sample code. make it change according to ur need
TYPES: BEGIN OF t_for_all,
matnr LIKE mbew-matnr,
bwkey LIKE mbew-bwkey,
END OF t_for_all.
TYPES: BEGIN OF t_mbew,
bwkey LIKE mbew-bwkey,
matnr LIKE mbew-matnr,
salk3 TYPE p,
END OF t_mbew.
DATA: it1_mbew TYPE STANDARD TABLE OF t_mbew WITH HEADER LINE,
it2_mbew TYPE STANDARD TABLE OF t_mbew WITH HEADER LINE,
it_for_all TYPE STANDARD TABLE OF t_for_all,
wa_it_for_all TYPE t_for_all.
wa_it_for_all-matnr = '000000002001000111'.
APPEND wa_it_for_all TO it_for_all.
wa_it_for_all-matnr = '000000000000000042'.
APPEND wa_it_for_all TO it_for_all.
CLEAR: wa_it_for_all.
wa_it_for_all-bwkey = '3000'.
APPEND wa_it_for_all TO it_for_all.
SELECT matnr bwkey bwtar salk3 FROM mbew
INTO CORRESPONDING FIELDS OF it1_mbew
FOR ALL ENTRIES IN it_for_all
WHERE matnr = it_for_all-matnr.
COLLECT it1_mbew INTO it1_mbew. " Use Collect in this way it will solve out your problem
ENDSELECT.
SELECT bwkey bwtar salk3 FROM mbew
INTO CORRESPONDING FIELDS OF it2_mbew
FOR ALL ENTRIES IN it_for_all
WHERE bwkey = it_for_all-bwkey
AND salk3 NE '0.00'.
COLLECT it2_mbew INTO it2_mbew. " Use Collect in this way it will solve out your problem
ENDSELECT.
U just view the select and in select view the collect statement and make it change according to ur table -
In Report Painter, need to find out how a field is defined.
I'm trying to find out how a field used in a current report is defined. For example, columns 2-13 are monthly columns. Double clicking on the column name (April), for example, brings up the box "Element Definition: April;$Year. The Value Field is Net Sales. Clicking the drop down box brings up a group of fields, including Net Sales.
The Field Name for Net Sales is MA0001. How do I find out how this field is defined and what accounts are included in it?
Thanks for any help you can give.Hi,
Thank you for your answer. I was able to track 'Net Sales' as a part of a Key Figure Structure and as an element of Key Figure 'Net Sales'. However, when I get into CO-PA, Information System, there is no line for 'Report Components'.
There are the following lines/folders: Display Line Item List, Define Report,Current Settings, Background Processing. I looked at all the possibilities in those line items/folders and nothing was there. Is there another way to get at it?
Thanks again. -
Hello Guys,
I'm using 'REUSE_ALV_GRID_DISPLAY' in my prog.
There is a field in output table which is of type P(8) Decimals 3.
When I'm trying to get the sum of this field in ALV Display it gives the message " Desired operation cannot be performed for column 'Converted Quantity' ".
I have also tried do_sum = 'X'.
But it is not working. Please help guys.
Regards,
AbhinavThanks a lot guys for your inputs.
The program is working now.
Now I'm using :
CLEAR wa_fieldcat.
wa_fieldcat-fieldname = 'QUAN'.
* wa_fieldcat-ref_tabname = 'I_OUT2'.
* wa_fieldcat-tabname = 'I_OUT2'.
wa_fieldcat-qfieldname = 'MEAS'.
wa_fieldcat-qtabname = 'I_OUT2'.
wa_fieldcat-outputlen = '15'.
wa_fieldcat-seltext_l = text-052.
APPEND wa_fieldcat TO i_fieldcat.
The program is working fine now.
I have commented tabname and -ref_tabname , and the program is working fine now.
Thanks a lot. -
Hello Guys,
CAn any one tell me how to do the SUM for a particular column in ALV.It should display at the End of the records.The column field is TYPE N(4).
My CODE is like this:
CLEAR fc_tmp.
fc_tmp-col_pos = 5.
fc_tmp-reptext_ddic = 'POINTS'.
fc_tmp-fieldname = 'POINTS'.
fc_tmp-tabname = 'ITAB'.
fc_tmp-outputlen = 15.
fc_tmp-key = 'X'.
fc_tmp-do_sum = 'X'.
APPEND fc_tmp TO fieldcat.
This is not working.
Thanks in Advance,
Take careHi,
populate the IT_SORT internal table of REUSE_ALV_GRID_DISPLAY provided in the importing parameters.
fieldname = Company Code
append fieldname to it_sort.
fieldname = division.
append fieldname to it_sort.
If you explicitly need subtotals then add the following line
subtot = 'X'
For obtaining sum you have an attribute "do_sum" in fieldcatalog , set it to 'X' and you should be able to do sum on that field.
<b>Ensure that these should be numeric / currency or quantity datatypes only.</b>
wa_fieldcat-datatype = 'CURR'. or
wa_fieldcat-datatype = 'QUAN'.
Hope this solves your problem
Cheers,
Simha.
PS : Please reward points if solution is helpful -
How do I find what table a field is in?
Hi,
If I know a field name, how would I search the Data Dictionary to find the table (or tables) that the field is found in?
For example, I have a program spec that that says field AZSUB is in table MARM, but it is not. How can I find what table this field is actualkly in?
Thanks for your help!
AndyHi Andrew,
Just goto se11, enter the data element of that field and clisk on the where used list on the application tool bar. You will get all the tables in which the field appears.
You got find out which would be your appropriate table may be using by the description of the table or the contents or by the links..
Regards,
Vinod Kumar -
How to find out the manditary fields in an IDOC
Hi,
How to find out the manditary fields in an IDOC.
For example MATMAS05 .
For this 2 segments I want to find out the manditary fields.
E1MARA
E1MAKTMHi,
go to transaction WE30 and give the corresponding IDoc type and enter. Then you will get all segments for that IDoc type then double click on segment. A popup box will come in that it will show a check box whether it is a mandatory segment or not. And segment editor button will give all the field details.
Regards -
How to find out Last Changed Fields for a line item of a PO
Dear All,
Pls let me know is there any FM or procedure to find the last changed fields for each line item of a PO. I should be able to get the details on the basis of Last changed Date. Can u pls guide me in this?Hello,
Check the table CDHDR,CDPOS for PO items,
Check this code:
REPORT ZV_GET_LATEST_SO .
DATA: BEGIN OF ITAB OCCURS 0,
OBJECTCLAS TYPE CDHDR-OBJECTCLAS,
OBJECTID TYPE CDHDR-OBJECTID,
CHANGENR TYPE CDHDR-CHANGENR,
USERNAME TYPE CDHDR-USERNAME,
UDATE TYPE CDHDR-UDATE,
UTIME TYPE CDHDR-UTIME,
TCODE TYPE CDHDR-TCODE,
TABNAME TYPE CDPOS-TABNAME,
TABKEY TYPE CDPOS-TABKEY,
FNAME TYPE CDPOS-FNAME,
CHNGIND TYPE CDPOS-CHNGIND,
END OF ITAB.
TABLES: CDHDR,CDPOS.
DATA: LT_CDHDR LIKE CDHDR OCCURS 0 WITH HEADER LINE,
LT_CDPOS LIKE CDPOS OCCURS 0 WITH HEADER LINE.
*REFRESH AUSG.
CLEAR CDHDR.
CLEAR CDPOS.
CDHDR-OBJECTCLAS = 'EINKBELEG'.
CDHDR-OBJECTID = '0000001784'. " Purchase order number
**SELECT A~OBJECTCLASS A~OBJECTID A~CHANGENR A~USERNAME A~UDATE A~UNAME
**B~TCODE
**B~TABNAME B~TABKEY B~FNAME B~CHNGIND INTO TABLE ITAB FROM CDHDR AS A
**INNER JOIN CDPOS AS B ON A~OBJECTCLASS = B~OBJECTCLASS
** A~OBJECTID = B~OBJECTID
** A~CHANGENR = B~CHANGENR
** WHERE OBJECTCLAS = 'VERKBELEG'
** AND OBJECTID = '0000001784'.
*SELECT * FROM CDPOS INTO TABLE LT_CDPOS WHERE OBJECTCLAS = 'VERKBELEG'
* AND OBJECTID = '0000001784'.
*IF NOT LT_CDPOS[] IS INITIAL.
* SELECT *
* INTO TABLE LT_CDHDR
* FROM CDHDR
* FOR ALL ENTRIES IN LT_CDPOS
* WHERE OBJECTCLAS = LT_CDPOS-OBJECTCLAS
* AND OBJECTID = LT_CDPOS-OBJECTID
* AND CHANGENR = LT_CDPOS-CHANGENR.
*ENDIF.
** SORT ITAB BY OBJECTCLAS ODJECTID DESCENDING.
*LOOP AT ITAB.
* WRITE: ITAB-UDATE."ITAB-UNAME.
*ENDLOOP.
*--- Interne Tabellen -------------------------------------------------
DATA: BEGIN OF ICDSHW OCCURS 50. "Ausgabeaufbereitung
INCLUDE STRUCTURE CDSHW. "Zwischendatei
DATA: END OF ICDSHW.
CALL FUNCTION 'CHANGEDOCUMENT_READ_HEADERS'
EXPORTING
DATE_OF_CHANGE = CDHDR-UDATE
OBJECTCLASS = CDHDR-OBJECTCLAS
OBJECTID = CDHDR-OBJECTID
TIME_OF_CHANGE = CDHDR-UTIME
USERNAME = CDHDR-USERNAME
TABLES
I_CDHDR = LT_CDHDR
EXCEPTIONS
NO_POSITION_FOUND = 1
OTHERS = 2.
LOOP AT LT_CDHDR.
CALL FUNCTION 'CHANGEDOCUMENT_READ_POSITIONS'
EXPORTING
* ARCHIVE_HANDLE = 0
CHANGENUMBER = LT_CDHDR-CHANGENR
* TABLEKEY = '00000000 '
* TABLENAME = ' '
* IMPORTING
* HEADER =
TABLES
EDITPOS = ICDSHW
* EDITPOS_WITH_HEADER =
* EXCEPTIONS
* NO_POSITION_FOUND = 1
* WRONG_ACCESS_TO_ARCHIVE = 2
* OTHERS = 3
IF SY-SUBRC <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
LOOP AT ICDSHW.
IF ICDSHW-TABKEY+3(10) = '0000001784'
AND ICDSHW-TABKEY+13(6) = '000001'.
ENDIF.
ENDLOOP.
ENDLOOP.
Vasanth -
Cannot find the Revision Level field in the item details
Hi All,
1) I have created a PR with 2 items in the R/3 Backend using the me51n transaction in which for one of the items i have updated the Revision Level field.
2) To transfer the purchase requisitions created in the above step to the SRM system(sourcing cockpit) i executed the report BBP_EXTREQ_TRANSFER with transaction SE38.
3) Now when i go to the SRM portal and navigate to find the external requirement in the sourcing cockpit, I am not able to find the Revision Level field entered in the backend.
Can some one help.
Regards
SamHi
Please go through this ->
Version Management in R/3
http://help.sap.com/saphelp_47x200/helpdata/en/8a/60b43bb7492147e10000000a114084/frameset.htm
Versioning in SRM
http://help.sap.com/saphelp_srm50/helpdata/en/42/c92d6e3ed16babe10000000a1553f6/frameset.htm
Prerequisites for Version Control in SRM
I) You have activated the version control so that the system creates historical versions.
See the path in the IMG: SRM Server ® Cross-Application Basic Settings ® Switch On Version Control for Purchasing Documents
II) You have set up and activated the workflow for the approval of changes to active purchasing documents. See also: Approval Workflows for Documents and Objects
( Related link -> http://help.sap.com/saphelp_srm50/helpdata/en/5a/af5efc85d011d2b42d006094b92d37/frameset.htm )
Some related SAP OSS Notes ->
Note 1030548 - Revision level in SRM 6.0 connected to ERP 2005
Note 1026021 - EXTREQ interface: Data transfer structures
Note 122105 - ME51, RM06BBI0: Revision level is not filled
Hope this will definitely help.
Regards
- Atul -
Material description filled automatically as the sum of two fields
Hello to all
We can automate the process of the creation a new material doing that the field material description(MAKT-MAKTX) can be filled by the system before saving(not by the user) as the sum of two fields in the MARA table that the users will be filled manually.
Is it possible using a user exit, field exit,....?
Thanks in advance.
RegardsHello to all
We can automate the process of the creation a new material doing that the field material description(MAKT-MAKTX) can be filled by the system before saving(not by the user) as the sum of two fields in the MARA table that the users will be filled manually.
Is it possible using a user exit, field exit,....?
Thanks in advance.
Regards -
[CR integrated in VS 2005] - sum of string fields
Hello,
i am discovering CR,
and i am trying to do the sum of a field (number) but declared as string. the declaration of the field cannot be changed (string in the database).
so i want to do the sum of this field.
i wonder if it is possible, and if yes, how.
maybe something like a formula.
I saw the functions: ToNumber () and Cdbl() for conversion, and Sum().
If someone has an idea, i will be very interested.
PS: sorry if my question is not understandable, i'm french. If you don't understand it, i would rewrite it.
thank you!thank you.
I could convert, but the problem is to make the sum of the conversion.
i would like to do something like:
Sum(ToNumber ()) but CR does not accept it.
Maybe by using a variable in a formula (but i don't know where):
shared numbervar total;
total = total+ToNumber({MyField});
and when printing a formula field at the bottom of the report to show the total:
shared numbervar total;
ToText (total); -
To find the date type fields in the row and validate those date fields
TYPES : BEGIN OF TY_MARA,
MATNR TYPE MARA-MATNR,
ERSDA TYPE MARA-ERSDA,
ERNAM TYPE MARA-ERNAM,
LAEDA TYPE MARA-LAEDA,
MTART TYPE MARA-MTART,
END OF TY_MARA.
DATA : it_mara TYPE STANDARD TABLE OF ty_mara,
it_mara1 TYPE STANDARD TABLE OF ty_mara,
wa_mara TYPE ty_mara.
loop at it_mara into wa_mara.
describe field wa_mara-ersda type c_data.
if c_data eq 'D'.
CALL FUNCTION 'DATE_CHECK_PLAUSIBILITY'
EXPORTING
date = wa_mara-ersda
EXCEPTIONS
PLAUSIBILITY_CHECK_FAILED = 1
OTHERS = 2
IF sy-subrc eq 0.
wa_mara-ersda = '00000000'.
append wa_mara to it_mara1.
write :wa_mara-matnr,wa_mara-ersda.
else.
wa_mara-ersda = '00000000'.
append wa_mara to it_mara1.
write :wa_mara-matnr,wa_mara-ersda.
ENDIF.
endif.
endloop.
This issue regarding how to find the date type fields in the row and validate those date fields.If its not a valid date ,i have to assign initial value to that.
I've tried that for single field using describe field.Please help me do that for all fields.Hi Sam,
I believe we had discussed the same issue in the below thread. Can you please refer the below one?
http://social.msdn.microsoft.com/Forums/sharepoint/en-US/d93e16ff-c123-4b36-b60b-60ccd34f6ca7/calculate-time-differences-in-infopath?forum=sharepointcustomizationprevious
If it's not helping you please let us know
Sekar - Our life is short, so help others to grow
Whenever you see a reply and if you think is helpful, click "Vote As Helpful"! And whenever
you see a reply being an answer to the question of the thread, click "Mark As Answer -
How to find where the screen field is stored in table
Hi all,
How to find where the screen field is stored in the table .
for some transactions if i press F1 on the field and after checking for the technical help.
I can only find the struture for the screen field, but whereas i need table name for it.
Can anybody help me how to find the table name where the field is stored.
Regards,
MadhaviHi,
Just hitting a F1 on screen field and getting structure name will not help in getting table name.
First you need to know the flow of data in the reqd module, which will help you know all the tables in that module with there most of the fields with the data flow, now you need to work on your own to figure out that in which actual tables that value is stored.
Hope this helps you.
Regards,
Tarun
Maybe you are looking for
-
Abstract class with set and get methods
hi how to write set and get methods(plain methods) in an abstartc class ex: setUsername(String) String getUsername() and one class is extending this abstract class and same methods existing in that sub class also..... how to write......plz provide so
-
Need help getting pdf's to open in browser?
I have Acrobat Standard 6.0 and Adobe Reader on my system. For some reason, now when I try to open a pdf in the browswer, specifically in IE - I get the message "the adobe acrobat reader that is running cannot be used to view pdf files in a web brow
-
PO OPEN QTY AT PARTICULAR DATE
Hi Experts I need to check the open qty of purchase order bcoz i have to upload the PO from old system to new system. so i want to get the Open Purchase order qty from particular date say 1st april . so that i can upload the same into new System with
-
hello, Just got my 30 gig Ipod video. I downloaded a few videos and 2 television shows. Then I had a problem with my computer and had to go back to an earlier time pre-downlaoding of the videos. I want back on to itunes and selected the menu which sa
-
EVERY TIME I TRY TO DOWNLOAD SKYPE IT ALWAYS SAY SKYPE TOOL BAR ERROR CODE 2738 HOW CAN I FIX THAT PROBLEM...