cancel
Showing results for 
Search instead for 
Did you mean: 

define range in smartform in global data

Former Member
0 Kudos

I encounter problems when i try to define a range in the global data.

someone know the correct definitions to define a range and the corresponding work-area because i don't want to use header-lines anymore.

I tried this:

tab types: ty_range type range of mara-matnr.

global data: mat_range type range of ty_range

wa_mat_range like line of mat_range

initialization: wa_mat_range-sign = 'I'.

I have no check-error on the tabpages of types and global data but when i check the code in the initialization the error: " field mat_range is unknown. it is neither in one of the specified tabels nor defined with a DATA statement...." is coming. I have declared the mat_range and wa_mat_range in the in/outparameters of the initialization.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

in your global data :

Types Tab

types :

begin of r_matnr,

sign TYPE c LENGTH 1,

option TYPE c LENGTH 2,

low LIKE mara-matnr,

high LIKE mara-matnr,

end of r_matnr.

Global data : declare workarea of type r_matnr (types)

Initialization tab:

fs_ranges-sign = 'I'.

fs_ranges-option = 'BT'.

fs_ranges-low = '000000000000001410'.

fs_ranges-high = '000000000000001411'.

Now use fs_range in your select query :

select * from mara into table itab where matnr in fs_ranges

regards

padma

Former Member
0 Kudos

Yes, this will work, but then i'm not using the "range declaration", but maybe this is the way to do it in smartforms. not satisfying, but it will do for now.

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi,

Please change like below in Global defination.

tab types: ty_range type range of mara-matnr.

global data: mat_range type range of ty_range

wa_mat_range type mat_range

initialization: wa_mat_range-sign = 'I'.

Regards

jana

Edited by: Janardhan Reddy on Sep 17, 2008 4:53 PM

Edited by: Janardhan Reddy on Sep 17, 2008 4:53 PM

Former Member
0 Kudos

this does not work.

when i use TYPE in the global data then the error comes already when i do a check on this tabpage.

when i use LIKE a different error occurs in the initialization: " wa_mat_range is a table without a header line and ......."

Former Member
0 Kudos

Hi

have you checked with my code, Just now i have seen in my system , it is not giving any error, please check once again.

Regards

jana

Former Member
0 Kudos

No , it really doesn't work. we are using SAP ECC 6.0

as a bypass i define the range in the global definition and define the work-area in the coding when i have to fill an entry of the table. when using it in a loop node i can just use the global definition so it will work.

just wonder what the correct code could be when defining the work-area also in the global definition.......