2008 Jun 02 9:19 AM
hi gurus......
what is the use of sy-fdpos?
good points will be rewarded
2008 Jun 02 9:25 AM
Hi,
Its useful when you use SEARCH keyword
SEARCH dobj FOR pattern
This statement searches the data object dobj according to the search pattern specified in pattern. The additions allow to search subareas, shortened patterns and marking of places of finding.
The search ends at the first hit and sy-fdpos is set to the offset of the found pattern or to the word in the search area. If the pattern is not found, then sy-fdpos is set to value 0.
Reward if helpful.
hi gurus......
what is the use of sy-fdpos?
good points will be rewarded
2008 Jun 02 9:22 AM
hi
check the below example
its offset position of the character
if we wnat to change the increment character for example 25 times we use the
data:letter type string value 'A'.
IF sy-abcde CA letter.
sy-fdpos = sy-fdpos + 25 .
letter = sy-abcde+sy-fdpos(1).
ENDIF.
write:/ letter.
regards
prasanth
2008 Jun 02 9:22 AM
Hi,
sy-fdpos details : FDPOS -INT4- 10 -Character strings -Offset incharacter strings.
This will take first two character s of string a.
DATA: f1(5) TYPE c VALUE <f1>,
f2(5) TYPE c VALUE <f2>.
IF f1 <operator> f2.
WRITE: / 'Vergleich wahr, SY-FDPOS=', sy-fdpos.
ELSE.
WRITE: / 'Vergleich falsch, SY-FDPOS=', sy-fdpos.
ENDIF.
Reward If Helpfull,
Naresh.
2008 Jun 02 9:24 AM
HI,
SY-FDPOS will give u the offset position where searching pattern is found in a string.
see this example.
DATA STRING(30) VALUE 'This is a little sentence.'.
WRITE: / 'Searched', 'SY-SUBRC', 'SY-FDPOS'.
ULINE /1(26).
SEARCH STRING FOR 'itt '.
WRITE: / 'itt ', SY-SUBRC UNDER 'SY-SUBRC',
SY-FDPOS UNDER 'SY-FDPOS' .
rgds,
bharat.
2008 Jun 02 9:28 AM
hi barath what is the output for that program??
good points will be rewarded
2008 Jun 02 9:33 AM
hi,
it searches for the string 'itt' in the sentence and gives its offset position
O/P
seached sy-subrc sy-fdopos
itt 0 11
regards
prasanth
2008 Jun 02 9:35 AM
2008 Jun 02 9:37 AM
Hi Diana,
The ouput of that program would be :
Searched Sy-subrc Sy-fdpos
itt 0 11
Sy-subrc is 0 b'coz the string(itt) searched is present in the string(This is a little sentence.)
Sy-Fdpos is 11. It gives ypu the position from where the string "itt" starts in "This is a little sentence".
Counting of position starts from 0.
Hope it helps.
Reward if helpful.
Regards
Hemant Khemani
2008 Jun 02 10:26 AM
Hi,
output would be
itt 0 11
Reward points if this helps,
Kiran
2008 Jun 02 9:25 AM
Hi,
Its useful when you use SEARCH keyword
SEARCH dobj FOR pattern
This statement searches the data object dobj according to the search pattern specified in pattern. The additions allow to search subareas, shortened patterns and marking of places of finding.
The search ends at the first hit and sy-fdpos is set to the offset of the found pattern or to the word in the search area. If the pattern is not found, then sy-fdpos is set to value 0.
Reward if helpful.
| User | Count |
|---|---|
| 3 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |