‎2005 Jul 28 6:47 PM
Hi all,
Here i have some doubts, Please clarify these....
1. What are ranges? What are number ranges?
2. What is the "component idx of structure" clause with field groups?
Thanks in advance.
‎2005 Jul 29 4:49 AM
Hi,
Check this link for details about ranges and FieldGroups.
http://www.sts.tu-harburg.de/teaching/sap_r3/ABAP4/abapindx.htm
‎2005 Jul 28 7:06 PM
Ranges are like select-options on the selection screen. The function the same way without the selection screen. You can use the IN statement with ranges as you can with select-options. Number ranges are pre-defined ranges of numbers setup to be assigned to certain documents in the system. For example. SD Documents have a specific number range set up that when an order is created, it assigns that next available number in the range to the SD document. You can see these via transaction SNRO.
compoent idx of structure is used with field symbols for accessing certain parts or components of something else. More used when you are dealing with dynamic tables and structures.
Regards,
Rich Heilman
‎2007 Nov 23 1:59 AM
Hi, Rich Heilman.
This question <u>Have you used "component idx of structure" clause with field groups? </u> puzzles me. After reading your answer, I think this question should be '<b>with field symbols</b>'. Am I right?
Regards,
feng.
Message was edited by:
feng zhang
‎2005 Jul 29 4:49 AM
Hi,
Check this link for details about ranges and FieldGroups.
http://www.sts.tu-harburg.de/teaching/sap_r3/ABAP4/abapindx.htm
‎2005 Jul 29 7:08 AM
Hi ,
use assign component for big structures like bseg
(e.g. for that transfer)
LOOP AT itab.
clear str.
DO.
ASSIGN COMPONENT sy-index OF STRUCTURE itab TO <fw>.
IF sy-subrc <> 0. EXIT. ENDIF.
CONCATENATE str <fw> INTO str SEPARATED BY space.
ENDDO.
transfer str to file.
ENDLOOP.
‎2005 Jul 29 7:56 AM
Hi,
A hint on Number Ranges:
Tcode SNRO us used for maintaining number ranges.
The 'NUMBER_GET_NEXT' FM Gets the next unique number in a number range.
While Range is:
RANGES sel FOR f.
Which is similar to:
DATA: BEGIN OF sel OCCURS 10,
SIGN(1),
OPTION(2),
LOW LIKE f,
HIGH LIKE f,
END OF sel.Regards,
Anjali
‎2006 Jun 29 7:35 AM
‎2006 Jun 29 7:52 AM
Hai Surya
Check the following Document
Basic form
RANGES sel FOR f.
Effect
Defines an internal table similar to a selection criterion sel defined using the SELECT-OPTIONS sel FOR f statement.
The above statement is identical to:
DATA: BEGIN OF sel OCCURS 10,
SIGN(1),
OPTION(2),
LOW LIKE f,
HIGH LIKE f,
END OF sel.
Note
If you use the IN operator in conjunction with SUBMIT , CHECK , IF , WHILE or SELECT , always define the associated internal table using SELECT-OPTIONS or RANGES (never directly).
Addition
... OCCURS occ
Effect
Changes the OCCURS value 10 to the value of occ .
Field Groups
Basic form
FIELD-GROUPS fg.
Effect
Defines a field group.
A field group combines several existing fields together under one name. You use the INSERT statement to determine which fields belong to a field group at runtime.
Example
FIELD-GROUPS: HEADER, ORDER, PRODUCT.
Note
Neither defining a field group (statically) using FIELD-GROUPS nor filling a field group (dynamically) with INSERT generates more memory. Rather, there exists for each field group element a pointer to an (existing) field.
Example
LOOP AT itab.
clear str.
DO.
ASSIGN COMPONENT sy-index OF STRUCTURE itab TO <fw>.
IF sy-subrc <> 0. EXIT. ENDIF.
CONCATENATE str <fw> INTO str SEPARATED BY space.
ENDDO.
transfer str to file.
ENDLOOP.
Thanks & regards
Sreenivasulu P