Do we have pointers in abap?
Hi experts,
do we have pointers in abap as in C or C++.
my requirements is something like..
i have dynamic data i have to store that in an internal table's field , which is also decided at runtime.
all the suggestions are welcome.
Thanks,
Ashish
Hi Ashish,
Field symbols are similar to dereferenced pointers in C (that is, pointers to which the content operator * is applied). However, the only real equivalent of pointers in ABAP, that is, variables that contain a memory address (reference) and that can be used without the contents operator, are reference variables in ABAP Objects. (For more information, see Data References).
All operations programmed with field symbols are applied to the field assigned to it. For example, a MOVE statement between two field symbols moves the contents of the field assigned to the first field symbol to the field assigned to the second field symbol. The field symbols themselves point to the same fields after the MOVE statement as they did before.
You can create field symbols either without or with type specifications. If you do not specify a type, the field symbol inherits all of the technical attributes of the field assigned to it. If you do specify a type, the system checks the compatibility of the field symbol and the field you are assigning to it during the ASSIGN statement.
Field symbols provide greater flexibility when you address data objects:
If you want to process sections of fields, you can specify the offset and length of the field dynamically.
You can assign one field symbol to another, which allows you to address parts of fields.
Assignments to field symbols may extend beyond field boundaries. This allows you to address regular sequences of fields in memory efficiently.
You can also force a field symbol to take different technical attributes from those of the field assigned to it.
The flexibility of field symbols provides elegant solutions to certain problems. On the other hand, it does mean that errors can easily occur. Since fields are not assigned to field symbols until runtime, the effectiveness of syntax and security checks is very limited for operations involving field symbols. This can lead to runtime errors or incorrect data assignments.
While runtime errors indicate an obvious problem, incorrect data assignments are dangerous because they can be very difficult to detect. For this reason, you should only use field symbols if you cannot achieve the same result using other ABAP statements.
Before you can work with a field symbol, you must assign a data object to it. If you attach a structure to a field symbol, you assign a data object to it in the declaration. Untyped field symbols point to the predefined data object SPACE once the program starts. SPACE has type C and length 1. Typed field symbols do not point to any field before a data object is assigned to them.
During a program, you can assign data objects to field symbols at any time. You can also assign a series of different data objects to the same field symbol during a program.
To assign a data object to a field symbol, use the ASSIGN statement. The ASSIGN statement has several variants and parameters.
check this link for detailed description..
http://help.sap.com/saphelp_bw31/helpdata/en/fc/eb38c8358411d1829f0000e829fbfe/frameset.htm
regards,
Manikandan R
Similar Messages
-
hello all,
can any one plz tell me what are pointers in ABAP n how they can be used in report?
thanks for help.
regards,
vikasin ABAP Pointers call as Field symbols and see the example programs :
REPORT CHAP2401.
Defining a Field Symbol
FIELD-SYMBOLS <FS>.
Variable for later use
DATA FIELD VALUE 'X'.
Assigning a field to a Field Symbol
ASSIGN FIELD TO <FS>.
Using a Field Symbol which has an assigned field
WRITE <FS>.
Another one :
REPORT zfield_symbols .
TYPES: BEGIN OF t_p0121,
pernr TYPE pa0121-pernr,
rfp01 TYPE pa0121-rfp01,
rfp02 TYPE pa0121-rfp02,
rfp03 TYPE pa0121-rfp03,
rfp04 TYPE pa0121-rfp04,
END OF t_p0121.
DATA: it_p0121 TYPE STANDARD TABLE OF t_p0121 INITIAL SIZE 0,
wa_p0121 TYPE t_p0121.
DATA: gd_index TYPE string,
gd_rfp0 TYPE string.
FIELD-SYMBOLS: <fs1>, <fs2>.
*Start-of-selection.
START-OF-SELECTION.
SELECT pernr
rfp01
rfp02
rfp03
rfp04
UP TO 10 ROWS
FROM pa0121
INTO TABLE it_p0121.
*End-of-selection.
END-OF-SELECTION.
WA_P0121-RFP01 = '1234'.
CONCATENATE 'WA_P0121-RFP01' gd_index INTO gd_rfp0.
Now watch how the values change as you loop around the table fields
LOOP AT it_p0121 INTO wa_p0121.
write:/.
write:/ wa_p0121-pernr.
CLEAR: gd_index.
DO.
gd_index = gd_index + 1.
CONCATENATE 'WA_P0121-RFP0' gd_index INTO gd_rfp0.
assign with brackets
ASSIGN (gd_rfp0) TO <fs1>. "assigns the value of field name contained in variable
fs1 value would be the value of the field WA_P0121-RFP01..21
i.e. if index 1 and WA_P0121-RFP01 = 1234 then fs1 would = 1234
assign without brackets
ASSIGN gd_rfp0 TO <fs2>. " assigns the exact value contained in the field
fs1 value would literally be the same as the field WA_P0121-RFP01..21
i.e. if index 1 then fs2 would = 'WA_P0121-RFP01'
index 2 then fs2 would = 'WA_P0121-RFP02' etc...
you may also notice that once assigned any change made to the field gd_rfp0
is instantly reflected in the field symbol (fs2) so technically you could perform
the assign command once outside of the loop, but i have left it here to aid
readability.
write:/ <fs2>, <fs1>.
IF gd_index GE 21. "exit once last field has been read
EXIT.
ENDIF.
ENDDO.
ENDLOOP.
Thanks
Seshu -
We have problems in abap rules when migrate the infosource
We are having problems to do the migration of some objects of version
3.x to version 7.
There are some objects standard like Update Rule, InfoSource and
Datasource that when we migrated the rules ABAPS contained in the
Update Rule and Infosource are not migrate properly.
We are using the method of automatic migration that when clicking the
right button on the object, choosing the option additional functions,
create transformation and input the name of the new infosource. The
same way is necessary to migrate the transfer structure. After this we
migrated the Datasource and we tried to activate all objects, but
several erros happened in the abap rules.
Example: In the new Transformation based n Upadate Rule 0PS_C08 in the
key figure 0AMOUNT, the routine show me the follow error:
E:Field "COMM_STRUCTURE" is unknown. It is neither in one of the
specified tables nor defined by a "DATA" statement. "DATA" statement
"DATA" statement.
This is one example, but this conversion happened for several
transformations with abap rules.
Which is the recommendation for the standard objects in this case and
the others cases ? For objects Z* there some recommendation too?
Old Routine in Upadte Rule:
"PROGRAM UPDATE_ROUTINE.
$$ begin of global - insert your declaration only below this line -
TABLES: ...
DATA: ...
$$ end of global - insert your declaration only before this line -
FORM compute_data_field
TABLES MONITOR STRUCTURE RSMONITOR "user defined monitoring
RESULT_TABLE STRUCTURE /BI0/V0PS_C08T
USING COMM_STRUCTURE LIKE /BIC/CS0CO_OM_NAE_1
RECORD_NO LIKE SY-TABIX
RECORD_ALL LIKE SY-TABIX
SOURCE_SYSTEM LIKE RSUPDSIMULH-LOGSYS
ICUBE_VALUES LIKE /BI0/V0PS_C08T
CHANGING RETURNCODE LIKE SY-SUBRC
ABORT LIKE SY-SUBRC. "set ABORT <> 0 to cancel update
$$ begin of routine - insert your code only below this line -
type-pools: PSBW1.
data: l_psbw1_type_s_int1 type psbw1_type_s_int1.
data: lt_spread_values type PSBW1_TYPE_T_ACT_SPREAD.
field-symbols: .
füllen Rückgabetabelle !
move-corresponding to RESULT_TABLE.
check not RESULT_TABLE-amount is initial.
append RESULT_TABLE.
endloop.
if the returncode is not equal zero, the result will not be updated
RETURNCODE = 0.
if abort is not equal zero, the update process will be canceled
ABORT = 0.
$$ end of routine - insert your code only before this line -
ENDFORM.
New Routine - Based on Update - DTP:
"PROGRAM trans_routine.
CLASS routine DEFINITION
CLASS lcl_transform DEFINITION.
PUBLIC SECTION.
Attributs
DATA:
p_check_master_data_exist
TYPE RSODSOCHECKONLY READ-ONLY,
*- Instance for getting request runtime attributs;
Available information: Refer to methods of
interface 'if_rsbk_request_admintab_view'
p_r_request
TYPE REF TO if_rsbk_request_admintab_view READ-ONLY.
PRIVATE SECTION.
TYPE-POOLS: rsd, rstr.
Rule specific types
$$ begin of global - insert your declaration only below this line -
... "insert your code here
$$ end of global - insert your declaration only before this line -
ENDCLASS. "routine DEFINITION
$$ begin of 2nd part global - insert your code only below this line *
$$ end of rule type
TYPES:
BEGIN OF tys_TG_1_full,
InfoObject: 0CHNGID ID de execução de modificação.
CHNGID TYPE /BI0/OICHNGID,
InfoObject: 0RECORDTP Categoria de registro.
RECORDTP TYPE /BI0/OIRECORDTP,
InfoObject: 0REQUID ID requisição.
REQUID TYPE /BI0/OIREQUID,
InfoObject: 0FISCVARNT Variante de exercício.
FISCVARNT TYPE /BI0/OIFISCVARNT,
InfoObject: 0FISCYEAR Exercício.
FISCYEAR TYPE /BI0/OIFISCYEAR,
InfoObject: 0CURRENCY Código da moeda.
CURRENCY TYPE /BI0/OICURRENCY,
InfoObject: 0CO_AREA Área de contabilidade de custos.
CO_AREA TYPE /BI0/OICO_AREA,
InfoObject: 0CURTYPE Tipo de moeda.
CURTYPE TYPE /BI0/OICURTYPE,
InfoObject: 0METYPE Tipo de índice.
METYPE TYPE /BI0/OIMETYPE,
InfoObject: 0VALUATION Perspectiva de avaliação.
VALUATION TYPE /BI0/OIVALUATION,
InfoObject: 0VERSION Versão.
VERSION TYPE /BI0/OIVERSION,
InfoObject: 0VTYPE Ctg.valor para reporting.
VTYPE TYPE /BI0/OIVTYPE,
InfoObject: 0WBS_ELEMT Elemento do plano da estrutura do projeto
*(elemento PEP).
WBS_ELEMT TYPE /BI0/OIWBS_ELEMT,
InfoObject: 0COORDER Nº ordem.
COORDER TYPE /BI0/OICOORDER,
InfoObject: 0PROJECT Definição do projeto.
PROJECT TYPE /BI0/OIPROJECT,
InfoObject: 0ACTIVITY Tarefa do diagrama de rede.
ACTIVITY TYPE /BI0/OIACTIVITY,
InfoObject: 0NETWORK Diagrama de rede.
NETWORK TYPE /BI0/OINETWORK,
InfoObject: 0PROFIT_CTR Centro de lucro.
PROFIT_CTR TYPE /BI0/OIPROFIT_CTR,
InfoObject: 0COMP_CODE Empresa.
COMP_CODE TYPE /BI0/OICOMP_CODE,
InfoObject: 0BUS_AREA Divisão.
BUS_AREA TYPE /BI0/OIBUS_AREA,
InfoObject: 0ACTY_ELEMT Elemento operação diagram.rede.
ACTY_ELEMT TYPE /BI0/OIACTY_ELEMT,
InfoObject: 0STATUSSYS0 Status do sistema.
STATUSSYS0 TYPE /BI0/OISTATUSSYS0,
InfoObject: 0PS_OBJ Tipo de objeto do PS.
PS_OBJ TYPE /BI0/OIPS_OBJ,
InfoObject: 0VTSTAT Código estatístico para ctg.valor.
VTSTAT TYPE /BI0/OIVTSTAT,
InfoObject: 0AMOUNT Montante.
AMOUNT TYPE /BI0/OIAMOUNT,
Field: RECORD Nº registro de dados.
RECORD TYPE RSARECORD,
END OF tys_TG_1_full.
Additional declaration for update rule interface
DATA:
MONITOR type standard table of rsmonitor WITH HEADER LINE,
MONITOR_RECNO type standard table of rsmonitors WITH HEADER LINE,
RECORD_NO LIKE SY-TABIX,
RECORD_ALL LIKE SY-TABIX,
SOURCE_SYSTEM LIKE RSUPDSIMULH-LOGSYS.
global definitions from update rules
TABLES: ...
DATA: ...
FORM routine_0001
CHANGING
RETURNCODE LIKE sy-subrc
ABORT LIKE sy-subrc
RAISING
cx_sy_arithmetic_error
cx_sy_conversion_error.
init variables
not supported
icube_values = g.
CLEAR result_table. REFRESH result_table.
type-pools: PSBW1.
data: l_psbw1_type_s_int1 type psbw1_type_s_int1.
data: lt_spread_values type PSBW1_TYPE_T_ACT_SPREAD.
field-symbols: .
füllen Rückgabetabelle !
move-corresponding to RESULT_TABLE.
check not RESULT_TABLE-amount is initial.
append RESULT_TABLE.
endloop.
if the returncode is not equal zero, the result will not be updated
RETURNCODE = 0.
if abort is not equal zero, the update process will be canceled
ABORT = 0.
ENDFORM. "routine_0001
$$ end of 2nd part global - insert your code only before this line *
CLASS routine IMPLEMENTATION
CLASS lcl_transform IMPLEMENTATION.
*$*$ begin of routine - insert your code only below this line *-*
Data:
l_subrc type sy-tabix,
l_abort type sy-tabix,
ls_monitor TYPE rsmonitor,
ls_monitor_recno TYPE rsmonitors.
REFRESH:
MONITOR.
Runtime attributs
SOURCE_SYSTEM = p_r_request->get_logsys( ).
Migrated update rule call
Perform routine_0001
CHANGING
l_subrc
l_abort.
*-- Convert Messages in Transformation format
LOOP AT MONITOR INTO ls_monitor.
move-CORRESPONDING ls_monitor to MONITOR_REC.
append monitor_rec to MONITOR.
ENDLOOP.
IF l_subrc <> 0.
RAISE EXCEPTION TYPE cx_rsrout_skip_val.
ENDIF.
IF l_abort <> 0.
RAISE EXCEPTION TYPE CX_RSROUT_ABORT.
ENDIF.
$$ end of routine - insert your code only before this line -
ENDMETHOD. "compute_0AMOUNT
Method invert_0AMOUNT
This subroutine needs to be implemented only for direct access
(for better performance) and for the Report/Report Interface
(drill through).
The inverse routine should transform a projection and
a selection for the target to a projection and a selection
for the source, respectively.
If the implementation remains empty all fields are filled and
all values are selected.
METHOD invert_0AMOUNT.
$$ begin of inverse routine - insert your code only below this line-
... "insert your code here
$$ end of inverse routine - insert your code only before this line -
ENDMETHOD. "invert_0AMOUNT
Please, HELP!!!!
Thanks,
Mateus.Hi,
I checked the code and as I saw you're using return tables. This feature is not yet implemented in transformations! You have to find a workaoround for a code in start- or endroutines that appends the data.
In general you have to replace comm_structure and icube_Values by new class attributes/variables.
On which SP are you currently?
Regards,
JUergen -
Pointers on ABAP documentations (Database/Respositories/Structures/Tables/
Hi ABAP Gurus/Experts,
I am basically a SAP Functional consultant, but recently taken a new assignment on SAP Net Weaver MDM, where in i require lot of ABAP knowledge mainly in Database area, like Structure, Tables, Data Objects etc,
I am looking for an good ABAP documentations on Database/Repositories/Structures/Tables/Data Objects etc.
Good pointers will be Fully Rewarded.
Regards
RehmanHi,
Go thru this link for ABAP Programming,
http://help.sap.com/printdocu/core/Print46c/en/data/pdf/BCABA/BCABA.pdf
To start with you should use book....
[bTeach yourself ]ABAP in 21 Days...by SAMS publication.
this book will fundamentally stat up with basics of SAP and ABAP..
it will b the best to start with...
you can get it here...
http://www.allfreetech.com/EBook_index.asp?CategoryID=1
ABAP has so many contents. start learning one by one;
First pay attention to basic chapters like REPORTS, SCRIPTS, TRANSACTIONS, and BDC's,.Once you become perfect start learning other chapters. To learn Netweaver Java is very useful
go through the links:
Start with this.Refer this
http://www.sapbrain.com/FAQs/TECHNICAL/SAP_ABAP_DATADICTIONARY_FAQ.html
http://www.****************/InterviewQ/interviewQ.htm
http://help.sap.com/saphelp_46c/helpdata/en/35/2cd77bd7705394e10000009b387c12/frameset.htm
Reports
http://www.sapgenie.com/abap/reports.htm
http://www.allsaplinks.com/material.html
http://www.sapdevelopment.co.uk/reporting/reportinghome.htm
http://www.sapfans.com/forums/viewtopic.php?t=58286
http://www.sapfans.com/forums/viewtopic.php?t=76490
http://www.sapfans.com/forums/viewtopic.php?t=20591
http://www.sapfans.com/forums/viewtopic.php?t=66305 - this one discusses which way should you use - ABAP Objects calls or simple function modules.
ALE/ IDOC
http://help.sap.com/saphelp_erp2004/helpdata/en/dc/6b835943d711d1893e0000e8323c4f/content.htm
http://www.sapgenie.com/sapgenie/docs/ale_scenario_development_procedure.doc
http://edocs.bea.com/elink/adapter/r3/userhtm/ale.htm#1008419
http://www.netweaverguru.com/EDI/HTML/IDocBook.htm
http://www.sapgenie.com/sapedi/index.htm
http://www.sappoint.com/abap/ale.pdf
http://www.sappoint.com/abap/ale2.pdf
http://www.sapgenie.com/sapedi/idoc_abap.htm
http://help.sap.com/saphelp_erp2005/helpdata/en/0b/2a60bb507d11d18ee90000e8366fc2/frameset.htm
http://help.sap.com/saphelp_erp2005/helpdata/en/78/217da751ce11d189570000e829fbbd/frameset.htm
http://www.allsaplinks.com/idoc_sample.html
http://www.sappoint.com/abap.html
http://help.sap.com/saphelp_erp2004/helpdata/en/dc/6b835943d711d1893e0000e8323c4f/content.htm
http://www.sapgenie.com/sapgenie/docs/ale_scenario_development_procedure.doc
http://edocs.bea.com/elink/adapter/r3/userhtm/ale.htm#1008419
http://www.netweaverguru.com/EDI/HTML/IDocBook.htm
http://www.sapgenie.com/sapedi/index.htm
http://www.allsaplinks.com/idoc_sample.html
Check these step-by-step links
https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/uuid/ccab6730-0501-0010-ee84-de050a6cc287
https://sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/uuid/8fd773b3-0301-0010-eabe-82149bcc292e
https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/uuid/3c5d9ae3-0501-0010-0090-bdfb2d458985
for Smartforms material
http://www.sap-basis-abap.com/sapsf001.htm
http://www.sap-press.com/downloads/h955_preview.pdf
http://www.ossincorp.com/Black_Box/Black_Box_2.htm
http://www.sap-img.com/smartforms/sap-smart-forms.htm
http://www.sap-img.com/smartforms/smartform-tutorial.htm
http://www.sapgenie.com/abap/smartforms.htm
How to trace smartform
http://help.sap.com/saphelp_47x200/helpdata/en/49/c3d8a4a05b11d5b6ef006094192fe3/frameset.htm
http://www.help.sap.com/bp_presmartformsv1500/DOCU/OVIEW_EN.PDF
http://www.sap-img.com/smartforms/smart-006.htm
http://www.sap-img.com/smartforms/smartforms-faq-part-two.htm
Re: Need FAQ's
check most imp link
http://www.sapbrain.com/ARTICLES/TECHNICAL/SMARTFORMS/smartforms.html
step by step good ex link is....
http://smoschid.tripod.com/How_to_do_things_in_SAP/How_To_Build_SMARTFORMS/How_To_Build_SMARTFORMS.html
SAPScripts
http://esnips.com/doc/1ff9f8e8-0a4c-42a7-8819-6e3ff9e7ab44/sapscripts.pdf
http://esnips.com/doc/1e487f0c-8009-4ae1-9f9c-c07bd953dbfa/script-command.pdf
http://esnips.com/doc/64d4eccb-e09b-48e1-9be9-e2818d73f074/faqss.pdf
http://esnips.com/doc/cb7e39b4-3161-437f-bfc6-21e6a50e1b39/sscript.pdf
http://esnips.com/doc/fced4d36-ba52-4df9-ab35-b3d194830bbf/symbols-in-scripts.pdf
http://esnips.com/doc/b57e8989-ccf0-40d0-8992-8183be831030/sapscript-how-to-calculate-totals-and-subtotals.htm
SAP SCRIPT FIELDS
http://help.sap.com/saphelp_erp2005vp/helpdata/en/d1/8033ea454211d189710000e8322d00/content.htm
scripts easy material
http://www.allsaplinks.com/sap_script_made_easy.html
Debugging Document.
http://www.cba.nau.edu/haney-j/CIS497/Assignments/Debugging.doc
http://help.sap.com/saphelp_47x200/helpdata/en/c6/617ca9e68c11d2b2ab080009b43351/content.htm
http://www.cba.nau.edu/haney-j/CIS497/Assignments/Debugging.doc
http://help.sap.com/saphelp_erp2005/helpdata/en/b3/d322540c3beb4ba53795784eebb680/frameset.htm
http://help.sap.com/saphelp_nw04/helpdata/en/84/1f624f4505144199e3d570cf7a9225/frameset.htm
http://help.sap.com/saphelp_bw30b/helpdata/en/c6/617ca9e68c11d2b2ab080009b43351/content.htm
http://help.sap.com/saphelp_erp2005/helpdata/en/b3/d322540c3beb4ba53795784eebb680/frameset.htm
Regards,
Padmam. -
hi all
i hav internal table call it_itab1 so there has som several equal record. so i want to get yhe som of all equal item. i can shaw u to so example.
it_itab1 table
code item value
001 4k 120
001 4k 100
001 4k 80
002 5h 200
002 5h 100
003 6y 500
003 6y 400
i ant to get som of each equl feild
code item value
001 4k 300
002 5h 300
003 6y 900
i think u can understand wot me want.. i want to sum of each equal feild value...(001 4k =(12010080) ... this is my requrement so how should i write the code. if u can please help me...
regard
nawaHi
U can do it using COLLECT
Basic form
COLLECT [wa INTO] itab.
Addition: ... SORTED BY f
In an ABAP Objects context, a more severe syntax check is performed that in other ABAP areas. See Short forms of line operations not allowed.
Effect
COLLECT allows you to create unique or summarized datasets. The system first tries to find a table entry corresponding to the table key (see Key definition for internal tables ). The key values are taken either from the header line of the internal table itab, or from the explicitly-specified work area wa. itab must have a flat structure, that is, it may not contain other internal tables. All components that are not part of the key must be have numeric types (see ABAP numeric types).
If the system finds an entry, the numeric fields that are not part of the table key (see ABAP number types) are added to the sum total of the existing entries. If it does not find an entry, the system creates a new entry instead.
The way in which the system finds the entries depends on the type of the internal table:
STANDARD TABLE:
The system creates a temporary hash administration for the table to find the entries. This means that the runtime required to find them does not depend on the number of table entries. The administration is temporary, since it is invalidated by operations like DELETE, INSERT, MODIFY, or SORT. A subsequent COLLECT is then no longer independent of the table size, because the system has to use a linear search to find entries. For this reason, you should only use COLLECT to fill standard tables.
SORTED TABLE:
The system uses a binary search to find the entries. There is a logarithmic relationship between the number of table entries and the search time.
HASHED TABLE:
The system uses the internal hash administration of the table to find records. Since (unlike standard tables), this remains intact even after table modification operations, the search time is always independent of the number of table entries.
For standard tables and SORTED TABLEs, the system field SY-TABIX contains the number of the existing or newly-added table entry after the APPEND. With HASHED TABLEs, SY-TABIX is set to 0.
Notes
COLLECT allows you to create a unique or summarized dataset, and you should only use it when this is necessary. If neither of these characteristics are required, or where the nature of the table in the application means that it is impossible for duplicate entries to occur, you should use INSERT [wa INTO] TABLE itab instead of COLLECT. If you do need the table to be unique or summarized, COLLECT is the most efficient way to achieve it.
If you use COLLECT with a work area, the work area must be compatible with the line type of the internal table.
If you edit a standard table using COLLECT, you should only use the COLLECT or MODIFY ... TRANSPORTING f1 f2 ... statements (where none of f1, f2, ... may be in the key) enthalten sein). Only then can you be sure that:
-The internal table actually is unique or summarized
-COLLECT runs efficiently. The check whether the dataset
already contains an entry with the same key has a constant
search time (hash procedure).
If you use any other table modification statements, the check for entries in the dataset with the same key can only run using a linear search (and will accordingly take longer). You can use the function module ABL_TABLE_HASH_STATE to test whether the COLLECT has a constant or linear search time for a given standard table.
Example
Summarized sales figures by company:
TYPES: BEGIN OF COMPANY,
NAME(20) TYPE C,
SALES TYPE I,
END OF COMPANY.
DATA: COMP TYPE COMPANY,
COMPTAB TYPE HASHED TABLE OF COMPANY
WITH UNIQUE KEY NAME.
COMP-NAME = 'Duck'. COMP-SALES = 10. COLLECT COMP INTO COMPTAB.
COMP-NAME = 'Tiger'. COMP-SALES = 20. COLLECT COMP INTO COMPTAB.
COMP-NAME = 'Duck'. COMP-SALES = 30. COLLECT COMP INTO COMPTAB.
Table COMPTAB now has the following contents:
NAME | SALES
Duck | 40
Tiger | 20
Addition
... SORTED BY f
Effect
COLLECT ... SORTED BY f is obsolete, and should no longer be used. It only applies to standard tables, and has the same function as APPEND ... SORTED BY f, which you should use instead. (See also obsolete statements.)
Note
Performance:
Avoid unnecessary assignments to the header line when using internal tables with a header line. Whenever possible, use statements that have an explicit work area.
For example, "APPEND wa TO itab." is approximately twice as fast as "itab = wa. APPEND itab.". The same applies to COLLECT and INSERT.
The runtime of a COLLECT increases with the width of the table key and the number of numeric fields whose contents are summated.
Note
Runtime errors:
COLLECT_OVERFLOW: Overflow in an integer field during addition
COLLECT_OVERFLOW_TYPE_P: Overflow in a type P field during addition.
TABLE_COLLECT_CHAR_IN_FUNCTION: COLLECT on a non-numeric field.
Regards,
Prasanth
Reward all helpful answers -
HAI IF ANY ONE HAVE FAQS ON ABAP-HR
HELLO ,
IAM TRYING FOR JOB ON SAP-ABAPHR SO ANY ONE HAVE FAQ'S WITH ANS PLZ SEND ME. ANY OPENING PLZ SEND THE INFORMATION.
THANKS IN ADVhttp://www.sap-img.com/human/hr-faq.htm
http://www.sapgenie.com/faq/hr.htm
these links will help you for good questions.
Just checkout the below sites.
www.KnowledgeStorm.com
www.onestopsap.com/interview-Question/hr/
Check these.
http://help.sap.com/printdocu/core/Print46c/en/data/pdf/PAPA/PAPA.pdf
http://help.sap.com/printdocu/core/Print46c/en/data/pdf/PAPD/PAPD.pdf
http://help.sap.com/printdocu/core/Print46c/en/data/pdf/PYINT/PYINT_BASICS.pdf
http://www.atomhr.com/training/Technical_Topics_in_HR.htm
http://www.planetsap.com/hr_abap_main_page.htm
you can see some Standard Program examples in this one..
http://www.sapdevelopment.co.uk/programs/programshr.htm
http://searchsap.techtarget.com/originalContent/0,289142,sid21_gci1030179,00.html?Offer=SAlgwn12604#Certification
These are the FAQ's that might helps you
http://www.sap-img.com/human/hr-faq.htm
http://www.sapgenie.com/faq/hr.htm
http://www.erpgenie.com/faq/hr.htm.
www.sap-img.com
http://www.planetsap.com/hr_abap_main_page.htm
http://www.sapbrain.com/TUTORIALS/FUNCTIONAL/HR_tutorial.html
HR
http://www.sapfans.com/forums/viewtopic.php?p=498530&sid=d7ec5866e3fb26880da129de45ce79de
http://www.sapcookbook.com/preview_hr_questions.htm
http://www.atomhr.com/library_full.htm
http://www.sapdevelopment.co.uk/hr/hrhome.htm
http://www.planetsap.com/hr_abap_main_page.htm
http://expertanswercenter.techtarget.com/eac/knowledgebaseAnswer/0,295199,sid63_gci983590,00.html
Plz go through this links.......................
http://www.allsaplinks.com/HRmaterial.html
http://www.allsaplinks.com/timemanagement.html
http://www.allsaplinks.com/payrollcompletefunctional.html -
Anyone have pointers on Parental controls? (also, must I move to V3.0)
I recently bought ipod touch units for some tweens and I'm faced the the whole parental control thing for the first time.
I've done the standard stuff, turning off YouTube and Safari completely but what else can I do?
I don't want to restrict full access to the app store because I want them to be able to download your typical Nintendo DS type games.
I did find one app that I think folks would find potentially offensive, Pic of the Day. Now while this might seem cute to an adult, many photos there contain sexual innuendos if not outright offensive material.
Any suggestions or pointers to good URLS on the subject would be appreciated.
Thanks.If you do upgrade to OS 3.0, you gain some additional restriction capabilities.
"Set content restrictions: Tap Ratings For, then select a country from the list. You can
then set restrictions using that country’s ratings system for the following categories
of content: Music & Podcasts, Movies, TV Shows, and Apps
In the United States for example, to allow only movies rated PG or below, tap Movies,
then select PG from the list."
See more here: http://www.apple.com/iphone/how-to/#settings.restrictions -
How can I insert C structures that have character pointers into DBD file
Hello~
I am changing from a file system I made into DBD.
And I had no choice to convert structures that have character point members
to insert them into the DBD file
for examble,
If there is a structure as below
typedef struct
int IndexKey;
int groupID;
char* name;
char* pNum;
char* pAddr;
char* pMemo;
} TsomeRec;
I made a structure to convert as below
typedef struct
int IndexKey;
int groupID;
char name[MAX_NAME_LEN];
char pNum[MAX_NUM_LEN];
char pAddr[MAX_ADDR_LEN];
char pMemo[MAX_MEMO_LEN];
} TsomeRec2;
But, there are too many structures to convert.
So, I am seeking for the most efficient way to insert these structures into DBD files, considering Performance.
Frankly speaking, I'am not proficient.
please describe as specific as possible.
Thank you~Hi,
Review the documentation section title Using C Structures with DB, in particular the subsection called C Structures with Pointers. It will explain the way to store structures that have pointers.
Regards,
Andrei -
ABAP query not returning correct number of records
Hi,
I have created an ABAP Query using logical database VFV and nodes VBRK, VBUK and VBRP.
But, after entering values for Sales Organisation ( VBRK-VKORG ), Distribution channel ( VBRK-VTWEG ) and Date ( VBRK-FKDAT), the number of records that I get are very less in number as compared to the actual number in the database.
Please give some pointers to the reason. I have set Lines 60 and Columns length - 83 and selected ALV List.
Regards,
Garima.Hi Garima,
Please Check whether you are selecting all the Key fields in your Query.
Thanks & Regards,
Ashok kumar. -
WAS ABAP - Keep prompting for credentials
Hi All,
We have couple WD ABAP applications deployed and running in our ECC backend. These are integrated in our Portal environment as well.
At times, whenever user click on WD ABAP applications it keep prompting the user to enter ECC credentials. Pls check this [screenshot|http://wiki.sdn.sap.com/wiki/download/attachments/113246549/WAS-ABAPpromptingforuserid.JPG].
Ideally, this dialog box shouldn't be prompt to the user, instead load the application start page. Our SSO with ECC & Portal works fine.
But, for certain users it keep asking to enter the credentials for the first time and if the user enters it - dialog window vanishes and takes to the start page.
Please share any pointers regarding the same.
Regards,
Anil KumarHi Anil,
We had the same issue.
In our case the issue was related to IE configuration of pop-up blocker settings and cookies settings -> Internet options, privacy tab, Sites button and settings button. When you allow your site cookies and allow pop-up sites, the IE wouldn't be asking for credentials, but it will give you time-out screens. If necessary try increasing the timeout.
Hope this helps you.
Best regards,
Martina -
Abap XSLT Exception block messages in SMQ2
Hello Community,
I have a XSLT ABAP transformation calling some ABAP objects and it's working well. I just need to handle some applications exceptions.
I wrote an ABAP Class that raise an exception in this way:
RAISE EXCEPTION TYPE cx_mapping_fault
EXPORTING
error_text = l_error.
The problem is that the message appears canceled in SMQ2 and I need to show the error status in the Integration Engine
I have tried with the <xsl:message>:
<xsl:message terminate="yes">Error</xsl:message>
But it didn't work. Exception isn't thrown in the Integration Engine. The message status is processed successfully.
Your help would be appreciated.
Regards,
Yuván>Hello VJ,
Thanks for your answer. I'm not using BPM in this scenario. I don't understand why messages that throw some exception in XSLT ABAP lock SMQ2. Because this doesn't happen when I use an ABAP-CLASS or message mapping as mapping programs. The lock is just using XSLT ABAP.
Is this normal...?....is there anyway to avoid the lock and change the status to error in the integration engine..?
Regards.
Yuvan, -
ABAP source code is written "by hand" or automatically?
Hi all,
I would like to modify the report "Open Items - Vendor Due Date Forecast" created by T. S_ALR_87012084.
With SE93 i found the name of the program RFKOFW00, which are referring to the T. S_ALR_87012084. T. S_ALR_87012084. (Parameter: D_SREPOVARI-REPORT = RFKOFW00) and with SE38 i have seen the ABAP source code of the program RFKOFW00.
My questions are:
1) The ABAP source code of the program RFKOFW00 is written "by hand", or automatically by one of the SAP tools, for example Report Painter/Writer, SAP queryu2026..? It seems to me that it is written "by hand". Is this true?
2) In general, how can i tell if a SAP ABAP program is written "by hand" or automatically by one of SAP tools? I know that one way to understand is that source code, written by hand is more clear.
Is there a way to understand, more accurate, more secure?
Thanks in advance
SerenaHi ,
if the code is automatically created, there will be a comment line in the beginning of the code which says
Generated function module for ..........
Please do not modify or copy this function module
Regards -
Sometimes RSCRM ABAP program is taking much time
Hi,
I am working in SAP BW 3.1 system. We have one RSCRM Abap program to send the data to Data stage team.
We kept this process in process chain. Some times it takes much time. If i cancel that job and repeat this process it will complete in few minutes.
Please suggest me what would be the reason.
ThanksYou may want to take a look at the following OSS Notes:
[OSS Note 605213 - RSCRM: Performance|https://websmp130.sap-ag.de/sap(bD1lbiZjPTAwMQ==)/bc/bsp/spn/sapnotes/index2.htm?numm=605213]
[OSS Note 989461 - RSCRM:code for improving performance in VALUES_READ|https://websmp130.sap-ag.de/sap(bD1lbiZjPTAwMQ==)/bc/bsp/spn/sapnotes/index2.htm?numm=989461]
[OSS Note 1137302 - RSCRM: Memory usage optimization|https://websmp130.sap-ag.de/sap(bD1lbiZjPTAwMQ==)/bc/bsp/spn/sapnotes/index2.htm?numm=1137302] -
Advanced certification in ABAP
Hi All
I am a ABAP programmer with 3 yrs of ABAP experience and currently working on EDI / IDOC technologies. I wanted to go for ABAP certification but I was advised by many not to do it as exam has got very simple ABAP questions, mainly on Basic ABAP
I just wanted to know how true it is and is there any other certification for Advanced ABAPPERS ? ( Like Sun has for Java ).
Are there any certification exams for ALE Idoc , BW programming.
AmolHi Amol,
Your question amused me. I am also a certified ABAPer, having a rootless existance in SAP. I was working on Web technologies till last Aug and got Certified then and have been an ABAPer ever since. Unfortunately, there is no advanced certification program for ABAP but a certified ABAPer is always considered to have it all.
You are right about the exam questions. It is all basic ABAP, but you see, high rises stand on great foundations. To learn advanced topics, may be you should approach SAPLABS at b'lore as you have over 3 yes of exp and that too on hot technologies like EDI/IDOC.
I would suggest anyone to go for the certification, not to get their 2-3 lakhs spent, but for the face that you will be globally accessible being a certified ABAPer and will have great demand abroad and in India.
Good luck.
If you think this helped you, please reward me
Karthik Potharaju -
How to open a Promotion from an ABAP report/program?
Hello SDN,
I have a normal ABAP report and would like to open a specific promotion (markteing project) after a PAI event.
I know it is the OBJTYPE=BUS2010030 (the businesspartner is objtype BUS1006), but how can I open it?
Regards from Germany,
FriederikeThe solution:
DATA: lt_time TYPE crmt_mktpl_cldr_time_ranges,
lo_tpm TYPE REF TO cl_crm_mktpl_cldr_data,
prom_guid TYPE cgpl_guid16.
CREATE OBJECT lo_tpm
EXPORTING
im_add_periods = lt_time.
Jump to the Marketing Planner
CALL METHOD lo_tpm->navigate_to_object
EXPORTING
im_data_object = promotion_guid.
Maybe you are looking for
-
HardDisk almost full suddenly on a Desktop 3000 S200 Vista
Would someone be kind enough to give me a hand? My Desktop is Lenovo 3000 S200 (9684-A24) running on a Win Vista. The system was purchased 5 months ago. I haven't kept many files or install much software. But the hard disk, originally having a 32
-
HT204406 I have downloaded soe albums but some of the songs do not play. Help!
I downloaded 5 albums on my iPhone which work fine. When I downloaded them onto my PC, several of the tracls across all of the albums don't appera to have downloaded correctly. The file size is correct but there is no sound. Also when I try to create
-
Custom UI or editor for input-parameter
I think I need to implement a custom UI editor for an input-paramenter. My input parameter is really a HashTable. I'd like to present a dialog that allows the user to enter any number of key value pairs. The optional "editor" element looks promisi
-
Print two objects without Report Gen Toolkit
Okay, I do not have the RGTK and I only need to print two items. A serial number text box with multiple entries and a chart. Is there a was to do this? I have been unable to find any examples that don't use a special tool... Thanks! Solved! Go to
-
I'm sorting many, many dozens of pictures into folders. When I move pics from the "Last 12 Months" view into a folder, the view switches to that folder. To resume sorting, I have to go back to the 12-month view, re-find the pics I left off on, select