Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

sy-fdpos??

Former Member
0 Kudos

hi guys,

what is sy-fdpos?? when can we use it in program??

how does it help??

Thanks

1 ACCEPTED SOLUTION

Former Member

Hi,

When you are using string operations like CS or CA or COetc then you need to check if letters in other variable are present in first variable or not and if present position of that point is given by sy-fdpos.

L1 = 'ABC?DGHI'

L2 = ' ? '

NOW if you check L1 CS L2 then

sy-fdpos will return as 4 bcoz ? is at fourth position.

Reward if useful.

Madhura

5 REPLIES 5

former_member404244
Active Contributor

Former Member
0 Kudos

The system field SY-FDPOS contains the length of Field.

pls follow the below code.

data:

l_values(11) type c value '0123456789.'.

if v_string co l_values.

"Then your string variable V_STRING contains only 0-9 or dot'

else.

"Then the string variable V_STRIN contains at least one some other value"

endif.

If the comparison is true, the system field SY-FDPOS contains the length of <f1>. If it is false, SY-FDPOS contains the offset of the first character of <f1> that does not occur in <f2>

reward if useful.

Former Member

Hi,

When you are using string operations like CS or CA or COetc then you need to check if letters in other variable are present in first variable or not and if present position of that point is given by sy-fdpos.

L1 = 'ABC?DGHI'

L2 = ' ? '

NOW if you check L1 CS L2 then

sy-fdpos will return as 4 bcoz ? is at fourth position.

Reward if useful.

Madhura

Former Member
0 Kudos

sy-fdpos for Character strings gives offset in character string.

Former Member

Hi

SY-FDPOS is used the search the string.

while searching in a string for a particular character, if that character is there in that strin sy-fdpos gives the position where that character is present in the string.

SY_FDPOS is a system field which maintains the current position for the characters.

for ex when u want to search a character or a string then sy-fdpos is useful for u.

if helpful reward some points.

plzz reard if it is useful....