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

passing values to include program

Former Member
0 Likes
2,408

HI,

Need help on following.

in my program A :

DATA: BEGIN OF it_qlqua OCCURS 0.

INCLUDE STRUCTURE lqua.

DATA: altbatch TYPE ausp-atwrt,

v_verme TYPE kwmeng.

DATA: END OF it_qlqua.

INCLUDE zprogramB.

perform check_lqua tables it_lqua.

Program B:

DATA: BEGIN OF it_qlqua OCCURS 0.

INCLUDE STRUCTURE lqua.

DATA: altbatch TYPE ausp-atwrt,

v_verme TYPE kwmeng.

DATA: END OF it_qlqua.

DATA: v_skzua1 TYPE lagp_skzua,

v_skzue1 TYPE lagp_skzue,

v_skzsa1 TYPE lagp_skzsa,

v_skzse1 TYPE lagp_skzse,

v_skzsi1 TYPE lagp_skzsi,

v_lvorm1 type mch1-lvorm,

v_zustd1 type mch1-zustd,

v1_skzue1 TYPE lein_skzue,

v_zskzua1 TYPE lein_skzua,

v_spgru1 TYPE lvs_spgru,

v_statu1 type lein-statu.

FORM zcheck_lqua tables p_it_lqua structure IT_QLQUA.

..

...

ENDFORM.

Error I get :

when trying activate :

statement is not accessible !!

May i know what have i done wrong?

What is the correct way to pass internal table to a include file?

Thanks

8 REPLIES 8
Read only

divya_nayudu
Participant
0 Likes
1,521

which stmt is not accessible???line no. would b specified..

Read only

Sm1tje
Active Contributor
0 Likes
1,521

before the perform check_lqua tables it_lqua.

try and use START-OF-SELECTION statement

Read only

Former Member
0 Likes
1,521

error point to row INCLUDE zprogramb.

yes, the perform is after start-of-selection. i extract part of it to show...

any example of passing internal tables to include prog?

Read only

Former Member
0 Likes
1,521

Hey Fren,

Try this,

PERFORM check_lqua in PROGRAM <program B>
                                      TABLES it_lqua

Because you are calling the subroutine in Include Program...

Read only

Former Member
0 Likes
1,521

Use START-OF_SELECTION after the statement

INCLUDE zprogramB.

ie,

INCLUDE zprogramB.

START-OF_SELECTION.

perform check_lqua tables it_lqua

Edited by: Rengith Skariah on Apr 16, 2008 11:41 AM

Read only

Former Member
0 Likes
1,521

Hi,

I have made it into simple test but it still fail ?

report ztest_hl7.

include zallocation_check2.

DATA: num TYPE i VALUE 5,

fac TYPE i VALUE 0.

PERFORM fact USING num CHANGING fac.

WRITE: / 'Factorial of', num, 'is', fac.

-


&----


*& Include ZALLOCATION_CHECK2

&----


FORM fact

USING f_num TYPE i

CHANGING f_fact TYPE i.

f_fact = 1.

WHILE f_num GE 1.

f_fact = f_fact * f_num.

f_num = f_num - 1.

ENDWHILE.

ENDFORM.

error : statement is not accessible - refer to row perform fact ...

Read only

Former Member
0 Likes
1,521

Hi,

when ever u get this error just click on the change button(the middle button in the error display part) it will take u to one line.just before that line place START-OF-SELECTION.then ur error will be rectified.

rgds,

bharat.

Read only

Former Member
0 Likes
1,521

Hi,

You are calling the routine check_lqua tables it_lqua in the program A and the definition is in program B. You are called the program B be fore the perform. It is wrong way. You have to include the program after the perform statement.

syntax in program A.

perform check_lqua tables it_lqua.

INCLUDE zprogramB.

Reward if helpful.