09-18-2008 11:49 AM
Hi,
I have a function module.
FUNCTION z_read.
.
.
.
.
RANGES zmfrpn FOR zp-mfrpn.
CONCATENATE mfrpn '*' INTO zmfrpn-low.
zmfrpn-sign = 'I'.
zmfrpn-option = 'CP'.
APPEND zmfrpn.
CLEAR zmfrpn.
.
.
.
.
ENDFUNCTION.
FORM stock.
SELECT mfrpn matnr meins normt
INTO (tp-mfrpn, tpmatnr,tp-meins, tp-normt)
FROM mara WHERE mfrpn IN zmfrpn.
ENDSELECT.
ENDFORM.
And i receive following error: The IN operator with "ZMFRPN" is followed neither by an internal table nor by a value list.
What should i do?
Thank you!
09-18-2008 11:50 AM
hi
i tink u have to use the field name for the ranges as its an internal table.
09-18-2008 11:52 AM
09-18-2008 11:55 AM
Hi
use these two
zmfrpn-high = '100'.
zmfrpn-low = '001'.
append.
regards,
kaushik
09-18-2008 11:59 AM
09-18-2008 12:01 PM
hi,
now check it.
RANGES zmfrpn FOR zp-mfrpn.
zmfrpn-low = '100'
zmfrpn-high = '200'.
zmfrpn-sign = 'I'.
zmfrpn-option = 'CP'.
APPEND zmfrpn.
CLEAR zmfrpn.
FORM stock.
SELECT mfrpn matnr meins normt
I NTO (tp-mfrpn, tpmatnr,tp-meins, tp-normt)
FROM mara WHERE IN zmfrpn .
ENDSELECT.
ENDFORM.
Regards,
Mahesh,
Edited by: Mahesh Reddy .Pocha on Sep 18, 2008 1:04 PM
09-18-2008 12:01 PM
Hello
If you fill ranges in functional module, then you need:
1. before select statement declare new ranges like ranges in FM
2. before select statement call FM
3. FM must return filled ranges to your new ranges.
4. use in select statement new ranfes.
09-18-2008 12:04 PM
Hi,
Please check for 2 things in your code....
Must: Pass the range as passing param in the Subroutine...
1. How is the range declared?
2. Insert [] after the range in the SELECT statement.
Hope this solves your problem.
Regards,
Kunjal
09-18-2008 12:02 PM
please you let me know use of
CONCATENATE mfrpn '*' INTO zmfrpn-low.
zmfrpn-sign = 'I'.
zmfrpn-option = 'CP'.
APPEND zmfrpn.
CLEAR zmfrpn.
09-18-2008 12:06 PM
Hi,
How are the function module and the Subroutine joined???
You have declared the ranges in FM and trying to use that in a form I guess in a different program.
If the form stock is with in the FM then declare the ranges in the TOP include of the Function group.
santhosh
09-18-2008 12:09 PM
This is a question of scope.
You've defined zmfrpn in the Function Module. You are attempting to use it in form stock. Data declared in a function module is local to the function module - i.e. the bits between FUNCTION... ENDFUNCTION.
You could define zmfrpn in the global data of the function group (don't do this though, it's REALLY BAD programming, to deal with global data in subroutines, unless you really have to )
What you should do is pass zmfrpn to the form stock as a parameter.
Further, can I suggest that you adopt a more meaningful naming convention for your variable names. E.g. it's a range, start it with the prefix rng_ for example.
Also, you are using SELECT ... ENDSELECT to select a single row from the database. Why not use SELECT SINGLE. Or SELECT ... UP TO 1 ROWS?
matt
09-19-2008 2:23 PM
Further, can I suggest that you adopt a more meaningful naming convention for your variable names. E.g. it's a range, start it with the prefix rng_ for example.
OK.
Also, you are using SELECT ... ENDSELECT to select a single row from the database. Why not use SELECT SINGLE. Or SELECT ... UP TO 1 ROWS?
No, that select does not select a single row ...
Thank you for your advices ... .
09-19-2008 2:21 PM
FORM stock TABLES tp STRUCTURE zp.
ENDFORM. "stock
Thank you to all... i have made it