Welcome to Scribd, the world's digital library. Read, publish, and share books and documents. See more
Download
Standard view
Full view
of .
Look up keyword
Like this
73Activity
0 of .
Results for:
No results containing your search query
P. 1
Abap Syntax

Abap Syntax

Ratings: (0)|Views: 3,076 |Likes:
Published by api-3856831

More info:

Published by: api-3856831 on Oct 19, 2008
Copyright:Attribution Non-commercial

Availability:

Read on Scribd mobile: iPhone, iPad and Android.
download as PDF, TXT or read online from Scribd
See more
See less

03/18/2014

pdf

text

original

 
 1
SYNTAX-CHECKBasic form
SYNTAX-CHECK FOR DYNPRO h f e m ...MESSAGE f1 ...LINEf2...WORD f3.
Additions
1. ... OFFSET f12. ... TRACE-TABLE t1
Effect
Syntax check for screenThe screen description is taken from the field string h and theinternal tables f , e and m . The field string h (screen header)should correspond to the structure D020S , the internal tablef (field list) to the structure D021S , the internal table e (flowlogic) to the structure D022S and the internal table m(matchcode information) to the structure D023S .
Example
DATA: DHEAD LIKE D020S, "screenheaderDFIELDS LIKE D021S OCCURS 20, "field listDFLOWL LIKE D022S OCCURS 20, "flow logicMCINFO LIKE D023S OCCURS 20."matchcode informationIf a syntax error is detected during the check, the fields f1 ,f2 and f3 are filled as follows:- f1 contains the error message text- f2 contains the screen line where the error occurred- f3 contains the incorrect word in the screenThe return code value is set as follows:SY-SUBRC = 0 The screen contains no syntax errors.SY_SUBRC = 4 The screen contains syntax errors.
Addition 1
... OFFSET f1
Effect
When a systax error occurs, this field contains the position of the incorrect word in the incorrect line.
Addition 2
... TRACE-TABLE t1
Effect
Any trace output is stored in this table. Trace output isautomatically switched on when you specify this addition.ADD-CORRESPONDING
Basic form
ADD-CORRESPONDING rec1 TO rec2.
Effect
Interprets rec1 and rec2 as field strings. If, for example, rec1and rec2 are tables, executes the statement for their headerlines.Searches for all sub-fields which occur both in rec1 and rec2and then, for all relevant field pairs corresponding to the sub-fields ni , generates statements of the formADD rec1-ni TO rec2-ni.The other fields remain unchanged.With complex structures, the complete names of thecorresponding fieldpairs must be textually identical.
Example
DATA: BEGIN OF VECTOR,X TYPE I,Y TYPE I,LENGTH TYPE I,END OF VECTOR,BEGIN OF CIRCLE,VOLUME TYPE PY TYPE P,RADIUS TYPE I,X TYPE I,END OF CIRCLE....ADD-CORRESPONDING VECTOR TO CIRCLE.The sub-fields X and Y occur in both the field strings VECTORand CIRCLE . Therefore, the ADD-CORRESPONDING statementis equivalent to both the following statements:ADD VECTOR-X TO CIRCLE-X.ADD VECTOR-Y TO CIRCLE-Y.
Note
All fields with the same name are added, whethernumeric or not. The same conversions are performedas with
and similar runtime errors to thosepossible with ADD can also occur.
Related
 
 
 
 
 ASSIGN
Variants
1. ASSIGN f TO <fs>.2. ASSIGN (f) TO <fs>.3. ASSIGN TABLE FIELD (f) TO <fs>.4. ASSIGN LOCAL COPY OF MAIN TABLE FIELD (f) TO <fs>.5. ASSIGN COMPONENT idx OF STRUCTURE rec TO <fs>.6. ASSIGN COMPONENT name OF STRUCTURE rec TO <fs>.
 
 2
Variant 1
ASSIGN f TO <fs>.
Additions
1. ... TYPE typ2. ... DECIMALS dec3. ... LOCAL COPY OF ...
Effect
Assigns the field f to the field symbol <fs>. The field symbol<fs> "points to" the contents of the field f at runtime, i.e.every change to the contents of f is reflected in <fs> and viceversa. If the field symbol <fs> is not typed (seeFIELD-SYMBOLS), the field symbol adopts the type and atrributes of the field f at runtime, particularly the conversion exit.Otherwise, when the assignment is made, the system checkswhether the type of the field f matches the type of the fieldsymbol <fs>.
Note
With the ASSIGN statement, the offset and lengthspecifications in field f (i.e. f+off , f+len or f+off(len) ) have aspecial meaning:
 
They may be variable and thus not evaluated untilruntime.
 
The system does not check whether the selectedarea still lies within the field f .
 
If an offset is specified, but no length, for the field f ,the field symbol <fs> adopts the length of the field f . Caution: <fs> also points to an area behind thefield f . If you do not want this, the offset and lengthspecifications can be in the form ASSIGN f+off(*) TO<fs>. . This means that the field symbol <fs> is setso that the field limits of f are not exceeded.
 
In the ASSIGN statement, you can also use offsetand length specifications to access field symbols,FORM and function parameters.
 
Warning: If the effect of the ASSIGN statement is toassign parts of other fields beyond the limits of thefield f , the changing of the contents via the fieldsymbol <fs> may mean that the data written tothese fields does not match the data type of thesefields and thus later results in a runtime error.
Note
Since the ASSIGN statement does not set any return codevalue in the system field SY-SUBRC , subsequent programcode should not read this field.
Example
DATA NAME(4) VALUE 'JOHN'.FIELD-SYMBOLS <F>.ASSIGN NAME TO <F>.WRITE <F>.Output: JOHN
Example
DATA: NAME(12) VALUE 'JACKJOHNCARL',X(10) VALUE 'XXXXXXXXXX'.FIELD-SYMBOLS <F>.ASSIGN NAME+4 TO <F>.WRITE <F>.ASSIGN NAME+4(*) TO <F>.WRITE <F>.Output: JOHNCARLXXXX JOHNCARL
Example
DATA: NAME(12) VALUE 'JACKJOHNCARL',X(10) VALUE 'XXXXXXXXXX'.FIELD-SYMBOLS <F>.ASSIGN NAME+4 TO <F>.WRITE <F>.ASSIGN NAME+4(*) TO <F>.WRITE <F>.Output: JOHNCARLXXXX JOHNCARL
Addition 1
... TYPE typ
Effect
With untyped field symbols, allows you to change the currenttype of the field symbol to the type typ. The output length of the field symbol is corrected according to its type.With typed field symbols, this addition should only be used if the type of the field f does not match the type of the fieldsymbol <fs> . The specified type type must be compatible withthe type of the field symbol. Since no conversion can beperformed (as withMOVE, the system must be able to interpretf as a field with this type type .The type specification is in the form of a literal or a field. Atpresent, only system types ( C, D, T, P, X, N, F, I or W ) areallowed; you can also specify type 's' for 2-byte integer fieldswith a sign and type 'b' for 1-byte integer fields without a sign(see alsoDESCRIBE FIELD).
Note
This statement results in a runtime error if the specified type isunknown or does not match the field to be assigned (due to amissing alignment or an inappropriate length).
Example
DATA LETTER TYPE C.FIELD-SYMBOLS <F>.ASSIGN LETTER TO <F>.The field symbol has the type C and the output length 1.ASSIGN LETTER TO <F> TYPE 'X'.The field symbol has the type X and the output length 2.
 
 3
Addition 2
... DECIMALS dec
Effect
This addition only makes sense when used with type P. Thefield symbol contains dec decimal places.
Example
Output sales in thousands:DATA SALES_DEC2(10) TYPE P DECIMALS 2 VALUE1234567.FIELD-SYMBOLS <SALES_DEC5>.ASSIGN SALES_DEC2 TO <SALES_DEC5> DECIMALS5.WRITE: / SALES_DEC2, / <SALES_DEC5>.Output:1,234,567.001,234.56700
Note
This statement results in a runtime error if the field symbolhas a type other than P at runtime or the specified number of decimal places is not in the range 0 to 14.
Addition 3
... LOCAL COPY OF ...
Effect
With LOCAL COPY OF , the ASSIGN statement can only beused in subroutines. This creates a copy of f which points tothe field symbol.
Note
The field symbol <fs> must also be defined locally in thesubroutine.
Example
DATA X(4) VALUE 'Carl'.PERFORM U.FORM U.FIELD-SYMBOLS <F>.ASSIGN LOCAL COPY OF X TO <F>.WRITE <F>.MOVE 'John' TO <F>.WRITE <F>.WRITE X.ENDFORM.Output: Carl John Carl
Variant 2
ASSIGN (f) TO <fs>.
Additions
1. ... TYPE typ2. ... DECIMALS dec3. ... LOCAL COPY OF ...
Effect
Assigns the field whose name is stored in the field f to the fieldsymbol.The statement " ASSIGN (f)+off(len) TO <fs> " is not allowed.
Notes
 
The search for the field to be assigned is performed asfollows:If the statement is in a subroutine or function module, thesystem first searches in this modularization unit. If thestatement lies outside any such modularization units or if thefield is not found there, the system searches for the field in theglobal data of the program. If the field is not found there, thesystem searches in the table work areas of the main program of the current program group declared withTABLES 
 
The name of the field to be assigned can also be thename of a field symbol or formal parameter (or even acomponent of one of these, if the field symbol or theparameter has a structure).
 
If the name of the field to be assigned is of the form"(program name)field name", the system searches inthe global fields of the program with the name"Program name" for the field with the name "Fieldname". However,it is only found if the program hasalready been loaded.Warning: This option is for internal use by specialistsonly. Incompatible changes or developments mayoccur at any time without warning or prior notice.The return code value is set as follows:SY-SUBRC = 0 The assignment was successful.SY_SUBRC = 4 The field could not be assigned to the fieldsymbol.
Example
DATA: NAME(4) VALUE 'XYZ', XYZ VALUE '5'.FIELD-SYMBOLS <F>.ASSIGN (NAME) TO <F>.WRITE <F>.Output: 5
Addition 1
... TYPE typ

Activity (73)

You've already reviewed this. Edit your review.
1 hundred reads
1 thousand reads
vikasbumca liked this
tabish24 liked this
gmircha liked this
Madhu Sudhan liked this
sarada_jitu liked this
sayko_99 liked this
bogdan2303 liked this
swadhin14 liked this

You're Reading a Free Preview

Download
scribd
/*********** DO NOT ALTER ANYTHING BELOW THIS LINE ! ************/ var s_code=s.t();if(s_code)document.write(s_code)//-->