What is the difference between collect and sum?
SAP ABAP questions and answers
(Continued from previous question...)
What is the difference between collect and sum?
SUM.
When processing an internal table in a block starting with LOOP and concluded by ENDLOOP , SUM calculates the control totals of all fields of type I , F and P (see also ABAP/4 number types ) and places them in the LOOP output area (header line of the internal table or an explicitly specified work area).
When you use SUM in a LOOP with an explicitly specified output area, this output area must be compatible with the line type of the internal table.When using LOOP to process a sorted extract (see SORT ), the control total
of f at the end of the group appears in the field SUM(f) - - if f is type I , F or P .
COLLECT.
COLLECT is used to create unique or compressed datsets. The key fields are the default key fields of the internal table itab .
If you use only COLLECT to fill an internal table, COLLECT makes sure that the internal table does not contain two entries with the same default key fields.
If, besides its default key fields, the internal table contains number fields,the contents of these number fields are added together if the internal table already contains an entry with the same key fields.
If the default key of an internal table processed with COLLECT is blank, all the values are added up in the first table line.
If you specify wa INTO , the entry to be processed is taken from the explicitly specified work area wa . If not, it comes from the header line of the internal table itab .
After COLLECT , the system field SY-TABIX contains the index of the - existing or new - table entry with default key fields which match those of the entry to be processed.
COLLECT can create unique or compressed datasets and should be used precisely for this purpose. If uniqueness or compression are unimportant, or two values with identical default key field values could not possibly occur in your particular task, you should use APPEND instead. However, for a unique or compressed dataset which is also efficient, COLLECT is the statement to use.
If you process a table with COLLECT , you should also use COLLECT to fill it. Only by doing this can you guarantee that the internal table will actually be unique or compressed, as described above and COLLECT will run very efficiently.
If you use COLLECT with an explicitly specified work area, it must be compatible with the line type of the internal table.
(Continued on next question...)
Other Interview Questions
- What is an ABAP?
- What is an ABAP data dictionary?
- What are domains and data element?
- What is foreign key relationship?
- Describe data classes.
- What are indexes?
- Difference between transparent tables and pooled tables.
- What is an ABAP/4 Query?
- What is BDC programming?
- What are the functional modules used in sequence in BDC?
- What are internal tables?
- What is ITS?
- What is DynPro?
- What are screen painter and menu painter?
- What are the components of SAP scripts?
- What is ALV programming in ABAP? When is this grid used in ABAP?
- What are the events in ABAP/4 language?
- What is CTS and what do you know about it?
- What are logical databases? What are the advantages/ dis-advantages of logical databases?
- What is a batch input session?
- How to upload data using CATT ?
- What is Smart Forms?
- How can I make a differentiation between dependent and independent data?
- What is the difference between macro and subroutine?
- What is the differrences between structure and table in data dictionary in ABAP?
- What is the difference between collect and sum?
- How we format the data beofore before write statment in report ?
- What is the difference between Table and Template?
- When do we use End-of-selection?
- In evevts start-of-selection is default event. When we have to use this event explicitly? Why?
- What is the differences between ABAP and OOABAP. In which situation we use OOABAP?
- What is table buffer? Which type of tables used this buffer?
- What is the use of pretty printer ? Exactly where can we link the functional module to abap coding.
- What is the difference between SAP memory and ABAP memory?
- What is the difference between Type and Like?
- What is Tcode SE16. For what is it used. Explain briefly?
- What are different ABAP/4 editors? What are the differences?
- What is difference between dialog program and a report?
- How do you connect to the remote server if you are working from the office for the client in remote place.
- Explain about roll area , Dispatcher, ABAP-Processor.
- Which one is not an exit comand ? (Exit, cencle, stop, back)
- What is Field sysmbol ?
- What is lock object ?
- Why BAPI need then BDC ?
- What are the advantages and disadvantages of using views in ABAP porgramming ?
- How data is stored in cluster table?
- Have you used performance tuning? What major steps will you use for these?
- How to create client independent tables?
- What type of user exits have you written?
- How can you debugg a script form?
- How do we debug sapscript?
- What are the different types of data dictionary objects?
- What is the step by step process to create a table in data dictionary?
- Can a transparent table exist in data dictionary but not in the data base physically?
- What are the domains and data elements?
- What is a collect statement? How is it different from append?
- On ABAP: Did you set up a workflow? Are you familiar with all steps for setting up a workflow?
- In the ‘select’ statement what is “group by”?
- How can I copy a standard table to make my own z_table?
- From Excel to ABAP - Is batch mode possible ?
- Q: Is there any standard SAP report which gives a count of the number of times a program is executed ?
- Q: When we create a customer the information is updated in structure RF02D and the some tables like KNA1 are updated. How can we find the tables for master data transactions?
- Q: How can we use CAD with SAP ?
- Q: How can I access SAP through Internet?
- Q: How can we transport the standard text?
- Q: How to find what transactions a particular user was running for a given period in the past (Eg: from 1st of a month )
- Q: We want protect/lock a field so that only selected people can change the value while others can only read. How to set the authorizations?
- Q: How to lock an user defined transaction for some time during which no user can access the same?
- Q: Our ABAP program is working properly in Foreground. Can I schedule it for background processing on the weekend?
- Q: How can we send a mail to the user intimating him that his report/BDC is completed in background?
- We get the total number of pages as expected by using 'SAPSCRIPT-FORMPAGES' in a duplex layout....
- Q: Can I Print a logo on an Invoice?
- We want to move a SAP table to an Access table using TABLE_EXPORT_TO_MSACCESS_RFC Importing parameters are ...
- Q: We want an RFC do the following transactions - MB1A, MB1C,>MB01 (goods receipt/issue).
- Q: In a Dev instance, we want to transport a modification to a layout set from one client to another. What is the best way?
- Q: We need to keep track of the transports that need to flow through to other systems (ie, DEV, TST, TRN, PRD etc). Is there a way do this?
- How can we want to add this additional field from a different table?
- We need to download an internal table to the Presentation Server(local workstation) ....
- We are calling transaction VL01 in batch input to create deliveries using a program for delivery due list ...
- Q: What are some sample Direct input data transfer programs?
|