2013 Jun 16 4:04 PM
HI Experts ,
I've the following issue.
I've created a FM in which it_char is import parameter
data : it_char type ztest
where ztest is table type .
now the issue is that when I run code inspector I get an error has bellow when I do this,
SORT it_char by atnam.
READ TABLE it_char INTO lv_chara WITH KEY atnam = lwa_allocvaluesnum-charact .
ERROR is
you may only read from table "it_char".
now how can I remove this error ???
Regards,
Suhas
2013 Jun 16 4:41 PM
it_char is an import parameter. So you can't change it's value. If you sort a table, you're changing it. If you want to change it, make it a changing parameter.
it_char is an import parameter. So you can't change it's value. If you sort a table, you're changing it. If you want to change it, make it a changing parameter.
2013 Jun 16 4:41 PM
it_char is an import parameter. So you can't change it's value. If you sort a table, you're changing it. If you want to change it, make it a changing parameter.
2013 Jun 16 4:47 PM
Hi Suhas,
I think its coming because you have put it in importing parameters which is used for variables or structures only. Try putting the table it_Char in changing parameters or better in Tables parameters.
It should work.
BR.
2013 Jun 16 7:26 PM
No it isn't. You can quite happily pass tables in the importing, exporting or changing parameters. In fact, if you try to use TABLES, you'll get a warning about them being obsolete.
The problem is with the SORT. I just created a test, and it's syntax error in 7.01.
2013 Jun 17 4:22 AM
2013 Jun 16 4:58 PM
Hi,
Define table type ztest in fm and assign Import value to that and do any operation on that.
Regards,
Sreenivas.
2013 Jun 16 6:44 PM
Hi
I remember, when we use READ table WITH KEY option, then the it_table should be defined with Key..
So, I would suggest
1. Pass the internal table as table parameter,
2. Inside the function, crete another it_table with key option
3. assign the pased table parameter it table to this above defined it_table.
4. then use the REad statement on the newly defined it_table
Regards,
Venkat
2013 Jun 16 7:27 PM
2013 Jun 16 7:43 PM
I agree with Matthew Billingham, you cannot execute any sort/modify statement on an import parameter, so either define it as a changing parameter or copy its data to a local internal table that you will be allowed to sort/modify.
Regards,
Raymond
2013 Jun 17 12:21 PM
Hi,
Please pass the required parameter as "Changing" parameter tab.Hope it will solve your problem.Thanks!
Regards,
Ravi Shankar L
| User | Count |
|---|---|
| 3 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |