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: 

Field Symbols

Former Member
0 Kudos

hi I am currently working on program where there should be screen parameters in such a way that they need to follow the ascending order

I want to do this using field symbols... I have 7 screen parameters.. and I have written the code like this



data: flname1(8),flname2(8), n type c value '1'.
FIELD-SYMBOLS: <fs1> type char8,
               <fs2> type char8.

do 6 times.

    CONCATENATE 'w_zfbdt' n into flname1.
    n = n + 1.
    CONCATENATE 'w_zfbdt' n into flname2.
    ASSIGN flname1 to <fs1> CASTING.
    ASSIGN flname2 to <fs2> CASTING.

    if NOT <fs1> < <fs2>.

      message e200 with 'Please enter in an ascending order'.

    ENDIF.

  enddo.

Now I need the value of Fieldname 1 to be assigned to FS1. Can you please help me in this regard asp.

Points will be awarded

1 ACCEPTED SOLUTION

Former Member
0 Kudos

try this

data: flname1(8),flname2(8), n type c value '1'.

FIELD-SYMBOLS: <fs1> type char8,

<fs2> type char8.

do 6 times.

CONCATENATE 'w_zfbdt' n into flname1.

n = n + 1.

CONCATENATE 'w_zfbdt' n into flname2.

ASSIGN <b>(</b>flname1<b>)</b> to <fs1> CASTING.

ASSIGN (flname2) to <fs2> CASTING.

if NOT <fs1> < <fs2>.

message e200 with 'Please enter in an ascending order'.

ENDIF.

enddo.

check whether 'w_zfbdt' will be in CAPS or not it may be W_ZFDBT in the qoutes.

regards

shiba dutta

5 REPLIES 5

Former Member
0 Kudos

try this

data: flname1(8),flname2(8), n type c value '1'.

FIELD-SYMBOLS: <fs1> type char8,

<fs2> type char8.

do 6 times.

CONCATENATE 'w_zfbdt' n into flname1.

n = n + 1.

CONCATENATE 'w_zfbdt' n into flname2.

ASSIGN <b>(</b>flname1<b>)</b> to <fs1> CASTING.

ASSIGN (flname2) to <fs2> CASTING.

if NOT <fs1> < <fs2>.

message e200 with 'Please enter in an ascending order'.

ENDIF.

enddo.

check whether 'w_zfbdt' will be in CAPS or not it may be W_ZFDBT in the qoutes.

regards

shiba dutta

0 Kudos

That worked thanks....

points as promised

Former Member
0 Kudos

hi,

first of all u will give message id to the message.

sanket.

Former Member
0 Kudos

i didn't get u

Former Member
0 Kudos

i think 'w_zfbdt' should b in capitals

and

if NOT <fs1> < <fs2>.

message e200 with 'Please enter in an ascending order'.

ENDIF.

condition is like

if NOT <fs1> < <fs2>. <-- Is is condition u r giving is correct ??/

will always gives error message na ??