Application Development and Automation 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: 
Read only

how to use FORM syntax?

Former Member
0 Likes
1,605

I wrote a short program about FORM syntax and planned to test this.

But when I built it, have an error message. Would you help me check the program where is the mistake.

The display message is “statement is not accessible”.

The cursors focus the “PERFORM TABTEST1.”.


*&---------------------------------------------------------------------*
*& Module Pool       ZSKY0614INCOM
*&
*&---------------------------------------------------------------------*
*&
*&
*&---------------------------------------------------------------------*

PROGRAM  ZSKY0614INCOM.
TABLES SFLIGHT.
PERFORM TABTEST1.
WRITE : / SFLIGHT-PLANETYPE , SFLIGHT-PRICE.

FORM TABTEST1.
  LOCAL SFLIGHT.
  SFLIGHT-PLANETYPE = 'A310'.
  SFLIGHT-PRICE = '100.00'.
  WRITE : / SFLIGHT-PLANETYPE, SFLIGHT-PRICE.
ENDFORM.

Regards,

tom

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,571

please cut and paste i changes the program of you ...

change is <b>PROGRAM into REPORT</b> .....

REPORT  ZSKY0614INCOM.
TABLES SFLIGHT.
PERFORM TABTEST1.
WRITE : / SFLIGHT-PLANETYPE , SFLIGHT-PRICE.
 
FORM TABTEST1.
  LOCAL SFLIGHT.
  SFLIGHT-PLANETYPE = 'A310'.
  SFLIGHT-PRICE = '100.00'.
  WRITE : / SFLIGHT-PLANETYPE, SFLIGHT-PRICE.
ENDFORM.

reward points if it is usefull ....

Girish

I wrote a short program about FORM syntax and planned to test this.

But when I built it, have an error message. Would you help me check the program where is the mistake.

The display message is “statement is not accessible”.

The cursors focus the “PERFORM TABTEST1.”.


*&---------------------------------------------------------------------*
*& Module Pool       ZSKY0614INCOM
*&
*&---------------------------------------------------------------------*
*&
*&
*&---------------------------------------------------------------------*

PROGRAM  ZSKY0614INCOM.
TABLES SFLIGHT.
PERFORM TABTEST1.
WRITE : / SFLIGHT-PLANETYPE , SFLIGHT-PRICE.

FORM TABTEST1.
  LOCAL SFLIGHT.
  SFLIGHT-PLANETYPE = 'A310'.
  SFLIGHT-PRICE = '100.00'.
  WRITE : / SFLIGHT-PLANETYPE, SFLIGHT-PRICE.
ENDFORM.

Regards,

tom

16 REPLIES 16
Read only

Former Member
0 Likes
1,570

hi,

i've tried your code in SE38 and it's working...can you try it again

Read only

0 Likes
1,570

I am so Sorry, it can't still pass. My program in ecc.60.

Read only

0 Likes
1,570

Hello Tom,

It is working at my system.

did you create perform and form in same program or diffrenr program ?

check it out .

Read only

0 Likes
1,570

Hello , Seshu

I create perform in same program, but I don't know if I am right?

Read only

0 Likes
1,570

hi,

i tried to change the type to module pool yet there are no syntax errors. try to make your program an Executable one...

Read only

Former Member
0 Likes
1,570

I don't know if the problem has much to do with the program type is Module Pool.

So, what shall I do?

Read only

0 Likes
1,570

create one report with same perform routine and form routine ,see the results.

if you get same results ,let me know.

Reward Points if it is helpful

Thanks

Seshu

Read only

Former Member
0 Likes
1,572

please cut and paste i changes the program of you ...

change is <b>PROGRAM into REPORT</b> .....

REPORT  ZSKY0614INCOM.
TABLES SFLIGHT.
PERFORM TABTEST1.
WRITE : / SFLIGHT-PLANETYPE , SFLIGHT-PRICE.
 
FORM TABTEST1.
  LOCAL SFLIGHT.
  SFLIGHT-PLANETYPE = 'A310'.
  SFLIGHT-PRICE = '100.00'.
  WRITE : / SFLIGHT-PLANETYPE, SFLIGHT-PRICE.
ENDFORM.

reward points if it is usefull ....

Girish

Read only

former_member189059
Active Contributor
0 Likes
1,570

Ok i just tried it myself in an ecc6 server

Go to the prrogram's attributes from the SE38 screen and change it from Module Pool to executable

and change the word PROGRAM to REPORT

Read only

Former Member
0 Likes
1,570

Thanks for everybody, I create perform in same program and the type is report. The program is ok, but I want to know what reason is. Would you tell me what happened?

Regards,

tom

Read only

Former Member
0 Likes
1,570

i think you have to use start-of-selection or event name for getting the output in module pool.

PROGRAM ZSKY0614INCOM.

TABLES SFLIGHT.

<b>start-of-selection.</b>

PERFORM TABTEST1.

WRITE : / SFLIGHT-PLANETYPE , SFLIGHT-PRICE.

FORM TABTEST1.

LOCAL SFLIGHT.

SFLIGHT-PLANETYPE = 'A310'.

SFLIGHT-PRICE = '100.00'.

WRITE : / SFLIGHT-PLANETYPE, SFLIGHT-PRICE.

ENDFORM.

just try that it may work.

regards

shiba dutta

Read only

Former Member
0 Likes
1,570

hi ,

try like this,

TABLES SFLIGHT. [ declare this as a global one in includes ]

PROGRAM ZSKY0614INCOM.

write all this code in pbo event...............

PERFORM TABTEST1.

WRITE : / SFLIGHT-PLANETYPE , SFLIGHT-PRICE.

FORM TABTEST1.

LOCAL SFLIGHT.

SFLIGHT-PLANETYPE = 'A310'.

SFLIGHT-PRICE = '100.00'.

WRITE : / SFLIGHT-PLANETYPE, SFLIGHT-PRICE.

ENDFORM.

if useful reward some points.

with regards,

suresh.

Regards,

suresh.

Read only

Former Member
0 Likes
1,570

hi,

i'am also wondering about this...i've tried the 1st code tom posted yet there are no errors even i didn't change anything...i only change the program from module pool to executable...and even i made it a module pool..still no syntax errors found in the same code...

Read only

Former Member
0 Likes
1,570

for me it is working fine

Read only

Former Member
0 Likes
1,570

Hi Tom,

From the code you have posted, what i can make out is that its a Module pool Program.

In Module pool program there has to be PBO and PAI. In PBO and PAI a very few set of commands can be used and PERFORM and FORM does not belong to this set.

Create a module and inside the module write this perform and its form and then check it. It will definately work.

Reply back for further queries.

Thanks and Regards,

Kunjal Patel

Read only

Former Member
0 Likes
1,570

Thanks for everybody!