cancel
Showing results for 
Search instead for 
Did you mean: 

Getting error in the form

Former Member
0 Kudos

Hi friends ,

I am getting the following program in the form .

&t_work-desc&,,&t_work-desc1&,,&t_work-seconds&,,&w_amount&

Unknown symbol w_amount

,,&w_amount1&

Unknown symbol w_amount1.

In the print program i have defined it as follows .

DATA : w_amount(15) TYPE c ,

w_amount1(15) TYPE c.

Loop at t_work.

MOVE t_work-amount TO w_amount.

MOVE t_work-amount1 TO w_amount1.

CALL FUNCTION 'WRITE_FORM'

EXPORTING

element = 'savings'

window = 'MAIN'

EXCEPTIONS

window = 1

element = 2.

endloop.

Please tell me why it is not recognising the 2 other w_amount and w_amount1 elements .

Thanks ,

HARI

Message was edited by:

Hari G Krishna

Accepted Solutions (1)

Accepted Solutions (1)

RichHeilman
Developer Advocate
Developer Advocate
0 Kudos

I don't think this will solve the problem, but I really don't know what the problem is, so here is a guess. Try to capitalize the element in the function call.

CALL FUNCTION 'WRITE_FORM'
EXPORTING
element = 'SAVINGS'     "<-  Right here
window = 'MAIN'
EXCEPTIONS
window = 1
element = 2.

Regards,

RIch Heilman

Former Member
0 Kudos

Hi Rich ,

Thanks . I did that too . For some reason it is not recognising w_amount and w_amount1 . When I replace it with t_work-amount and t_work -amount1 . It is working fine . I am also puzzled .... Could it be the paragraph format ??

Thanks ,

Hari

RichHeilman
Developer Advocate
Developer Advocate
0 Kudos

I don't think so, but please post the exact code of the sapscript so I can take a look, please include exactly as it is with paragraph formats

Regards,

Rich Heilman

Former Member
0 Kudos

Paragraph format D1 : FONT 8.0

Actual code in the main window .

/ E SAVINGS

D1 &t_work-desc&,,&t_work-seconds&,,&t_work-rate&,,

= &w_amount&,,&w_amount1&

Error when checked for text

= &w_amount&,,&w_amount1&

Unknown symbol W-EARN_AMT

Unknown symbol W-EARN_YTD

In the print program .

Defn in the Main Program .

Data: w_amount(15) TYPE c,

w_amount1(15) TYPE c.

in the include program .

Loop at t_work.

w_amount = t_work-amt .

w_amount1 = t_work-ytd .

CALL FUNCTION 'WRITE_FORM'

EXPORTING

element = 'SAVINGS'

window = 'MAIN'

EXCEPTIONS

window = 1

element = 2.

endloop.

RichHeilman
Developer Advocate
Developer Advocate
0 Kudos

Well here it is saying that it doesn't recogize two other fields.

Unknown symbol W-EARN_AMT

Unknown symbol W-EARN_YTD

Where are these defined?

Regards,

Rich Heilman

Former Member
0 Kudos

These are defined in top of the program .

DATA : w_amount(15) TYPE C ,

w_amount1(!5) type c .

Thanks ,

Hari

Former Member
0 Kudos

Hi Friends ,

Finally it worked . There was no problem when I tested the form in the testing client . I think I should not be worried when I get error while doing TEXT check . Though it said undefined symbol still i got the value on the form . I would like to thank Rich and other friends to have guided me thru this issue . I think I am leaning the hard way

Regards,

Hari

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi,

All the variables used in SAPSCRIPT should be declared globally in the print program and not inside a subroutine..

Thanks,

Naren

RichHeilman
Developer Advocate
Developer Advocate
0 Kudos

When are you getting this error? Are the W_AMOUNT and W_AMOUNT1 defined in the top of the program(and not inside a FORM subroutine)?

Regards,

Rich Heilman

RichHeilman
Developer Advocate
Developer Advocate
0 Kudos

IF they are defined inside of a FORM.....ENDFORM, try defining them at the top of the program which will make them global varaibles.

Regards,

Rich Heilman

Former Member
0 Kudos

w_amount and w_amount1 are defined at the top of the program .

Thanks ,

Hari