‎2008 Jul 16 6:35 AM
Hi Friends...,
Iam getting Error.....
> In "LOOP... WHERE..." the line type of the table must be statically defined.
For following code...
In function module sourse code...,
data: itab2 type standard table of <db>,
itab3 type standard table of <db>,
st1 type <db>,
st2 type <db>,
st3 type <db>.
perform sub_rt using st1
changing itab2
itab3
st2
st3.
In F1 include of that FM..,
form sub_rt using st1
changing itab2 type standard table
itab3 type standard table
st2 type <db>
st3 type <db>.
loop at itab2 into st2 where f1 = st3-f1
and f2 = st1-f1
/////////
endloop.
Plz let me know if any solutions for this..,
By removing this where conditon...
> not showing any error...
or By writing Check syntax for those two values...like
loop at itab2 into st2.
check st2-f1 = st3-f1 and st2-f2 = st1-f1.
//////
endloop.
> Also not showing any error.
Plz Let me know if u want any further clarification.
Thanks,
Naveen.I
‎2008 Jul 16 6:58 AM
Hi,
Try this modified code:
types : ty_<db> type standard table of <db>.
data: itab2 type ty_<db>,
itab3 type ty_<db>,
st1 type <db>,
st2 type <db>,
st3 type <db>.
perform sub_rt using st1
changing itab2
itab3
st2
st3.
In F1 include of that FM..,
form sub_rt using st1 type <db>
changing itab2 type ty_<db>
itab3 type ty_<db>
st2 type <db>
st3 type <db>.
loop at itab2 into st2 where f1 = st3-f1
and f2 = st1-f1
/////////
endloop.
endform.
Now ur code should work...
Regards,
Joy.
‎2008 Jul 16 6:58 AM
Hi,
Try this modified code:
types : ty_<db> type standard table of <db>.
data: itab2 type ty_<db>,
itab3 type ty_<db>,
st1 type <db>,
st2 type <db>,
st3 type <db>.
perform sub_rt using st1
changing itab2
itab3
st2
st3.
In F1 include of that FM..,
form sub_rt using st1 type <db>
changing itab2 type ty_<db>
itab3 type ty_<db>
st2 type <db>
st3 type <db>.
loop at itab2 into st2 where f1 = st3-f1
and f2 = st1-f1
/////////
endloop.
endform.
Now ur code should work...
Regards,
Joy.
‎2008 Jul 16 7:02 AM
Hi Thanx... I will try that....
And plz find changes in above code.... ( All DB are not equal )
Iam getting Error.....
>In "LOOP... WHERE..." the line type of the table must be statically defined.
For following code...
In function module sourse code...,
data: itab2 type standard table of <db2>,
itab3 type standard table of <db3>,
st1 type <db1>,
st2 type <db2>,
st3 type <db3>.
perform sub_rt using st1
changing itab2
itab3
st2
st3.
In F1 include of that FM..,
form sub_rt using st1
changing itab2 type standard table
itab3 type standard table
st2 type <db2>
st3 type <db3>.
loop at itab2 into st2 where f1 = st3-f1
and f2 = st1-f1
/////////
endloop.
Plz let me know if any solutions for this..,
By removing this where conditon...
not showing any error...
or By writing Check syntax for those two values...like
loop at itab2 into st2.
check st2-f1 = st3-f1 and st2-f2 = st1-f1.
//////
endloop.
Also not showing any error.
Plz Let me know if u want any further clarification.
Thanks,
Naveen.I
‎2008 Jul 16 7:12 AM
Hi Naveen,
Modify ur statements like below.
perform sub_rt using st1
changing st2 st3
TABLES itab2 itab3.
Here it will assign the structure dynamically
form sub_rt using st1
changing st2 st3
TABLES itab2 itab3.
loop at itab2 into st2 where f1 = st3-f1
and f2 = st1-f1
/////////
endloop.
Try above change and get back.
Thanks,
Vinod.
‎2008 Jul 16 7:12 AM
Try this code:
types : ty_<db2> type standard table of <db2>.
types : ty_<db3> type standard table of <db3>.
data: itab2 type ty_<db2>,
itab3 type ty_<db3>,
st1 type <db1>,
st2 type <db2>,
st3 type <db3>.
perform sub_rt using st1
changing itab2
itab3
st2
st3.
In F1 include of that FM..,
form sub_rt using st1 type <db1>
changing itab2 type ty_<db2>
itab3 type ty_<db3>
st2 type <db2>
st3 type <db3>.
loop at itab2 into st2 where f1 = st3-f1
and f2 = st1-f1
/////////
endloop.
endform.
in ur code u defined the interface for itab2,itab3 in subroutine generically thats why SAP does not able to understand its components when u use
loop at itab2 into st2 where f1 = st3-f1
and f2 = st1-f1 statement.
form sub_rt using st1
changing itab2 type standard table
itab3 type standard table
st2 type <db2>
st3 type <db3>.
loop at itab2 into st2 where f1 = st3-f1
and f2 = st1-f1
/////////
endloop.
u have to define the interface parameter as specific (as I done in my code) one so that SAP can understand its components...
Regards,
Joy.
‎2008 Jul 16 7:24 AM
Hi.. Vinod....
Thanx for ur attention.
Now the error message is....
> itab2 is not an intrenal table...
If i put Type standard table.... code for that.
Showing same error as b4.
Thanks,
Naveen.i
‎2008 Jul 16 7:36 AM
Hi..Joyjit,
> ty_<db2> is unknown....
showing error in my incude program....
Thanks,
Naveen.I
‎2008 Jul 16 8:09 AM
Try to activate the program and the include at the same time....
Regards,
Joy.
‎2008 Jul 16 8:34 AM
Hi..... Friends....
Still my problem not solved....
( joyjit... Thank you for ur attention... Iam activated as u said.. but still no use yaar )
Iam searching for another ways.
Plz get back to me if any solutions....,
Thanks,
Naveen.I
‎2008 Jul 16 11:20 AM
Hi,
Pl. check this code, it is working...
types : ty_mara type standard table of mara.
types : ty_makt type standard table of makt.
data: itab2 type ty_mara,
itab3 type ty_makt,
st1 type mara,
st2 type mara,
st3 type makt.
perform sub_rt using st1
changing itab2
itab3
st2
st3.
include z_abcd.
&----
*& Include Z_ABCD
&----
form sub_rt using st1 type mara
changing itab2 type ty_mara
itab3 type ty_makt
st2 type mara
st3 type makt.
loop at itab2 into st2 where matnr = st3-matnr.
endloop.
endform.
Regards,
Joy.
‎2008 Jul 16 11:25 AM
Hi.... Joyjit....
Good effort....
Yes... it will works... no need to check.. i solved problem with that only...
Thanks..,
Naveen.I
‎2008 Jul 16 8:42 AM
I modified the code i used <DB> as mara.
FUNCTION ztest_fun.
*"----------------------------------------------------------------------
*"*"Local Interface:
*"----------------------------------------------------------------------
DATA: itab2 TYPE STANDARD TABLE OF mara,
itab3 TYPE STANDARD TABLE OF mara,
st1 TYPE mara,
st2 TYPE mara,
st3 TYPE mara.
PERFORM sub_rt USING st1
CHANGING itab2
itab3
st2
st3.
ENDFUNCTION.and the include
FORM sub_rt USING p_st1 TYPE mara
CHANGING p_itab2 TYPE mara_tt
p_itab3
p_st2
p_st3 TYPE mara.
LOOP AT p_itab2 INTO p_st2 WHERE matnr = p_st3-matnr
AND matkl = p_st1-matkl.
ENDLOOP.
ENDFORM. " sub_rtCheck and let me know..
‎2008 Jul 16 8:45 AM
When you are creating the Subroutines mention the reference types it will solve your problem.
FORM sub_rt USING p_st1 TYPE mara
CHANGING p_itab2 TYPE mara_tt "This should table type
p_itab3 type mara_tt
p_st2 type mara
p_st3 TYPE mara.
*Since it is internal table you have to give the table type
LOOP AT p_itab2 INTO p_st2 WHERE matnr = p_st3-matnr
AND matkl = p_st1-matkl.
ENDLOOP.
‎2008 Jul 16 11:06 AM
Hi All thanks for ur replies...,
Get back to you very soon.. with the way i solved this problem...
Thanks,
Naveen.I