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

Create a Ranges Table Type

Former Member
0 Likes
4,133

I tried to create a Ranges Table Type as per SAP Help. It does get created,

But the warning message occurs when create line type for this table type.

I had been through standard help of Creating a Ranges Table Type:

URL:

http://help.sap.com/saphelp_47x200/helpdata/en/4f/991f82446d11d189700000e8322d00/frameset.htm)

The warning message is as under:

Field name OPTION is reserved (Do not use structure as include in DB table)

I replaced this field with another name, then it asks for fieldname "OPTION".

Your valuable suggestions please!

16 REPLIES 16
Read only

Former Member
0 Likes
1,922

Hi,

the message is warning so you need not worry about this.

Regards

vijay

Read only

0 Likes
1,922

Hi

You can't do nothing there are some words are reserved and they can be used.

That message isn't a warning, the system don't generate the structure if it doesn't change the name.

What do you really want to do?

You can do the std structure SRANGE (has only field sign and option) or SELOPT (has all fields for a range).

Max

Read only

0 Likes
1,922

hi,

use structure SELOPT

A.

Read only

0 Likes
1,922

Hi Vijay,

If object is created with warning message, it shows an error message durinf transports.

Read only

0 Likes
1,922

Hi Max,

Thanx for valuable reply. I tried this way also.

Purpose why I am asking this ...

My report program is having select-options: s_matnr FOR mara-matnr. I need to pass this parameter to FM & in turn, the FM will give me the list of materials. Reason is I need to fetch materials from another R/3 System.

As you said I tried with SELOPT as line type, but I am not able to give "matnr" as data element while defining ranges table type.

Instead of ranges table type, I used "General Table Type" as FM type it shows run time dump message.

Please suggest.

With Regards,

Bapu Aher

Read only

0 Likes
1,922

Hi

Which fm are you using? Std or custom?

In dictionary try to create a structure like this:

.INCLUDE SRANGE

LOW MATNR

HIGH MATNR

Max

Read only

0 Likes
1,922

Hi Andreas,

I tried with SELOPT. please see my reply to Max.

Regards,

Bapu

Read only

Former Member
0 Likes
1,922

Hi,

OPTIONS is a key word because of which its throwing a warning. You need not worry about the same as its a part of the RANGES table.

Regards,

Ravi

Note : Please mark all the helpful answers and close the thread if the issue is resolved.

Read only

0 Likes
1,922

Hi Ravi,

If object is created with warning message, it shows an error message durinf transports.

Regards,

Bapu

Read only

Former Member
0 Likes
1,922

Hi,

Select-option and ranges are built on similar ground.

it used mainly for select query with in clause.

ur not allowed to rename the field of the ranges ; if u do it will not work with select query.

<b>how to declare ranges</b>.

data lit_range type ranges of <any_data type>

then internal table will have following field.

sign option low high

data type of low and high will same type; which u have used for creating ranges.

Mark helpfull answers

Regards

Message was edited by: Manoj Gupta

Read only

0 Likes
1,922

Thanx Manoj,

Purpose why I am asking this ...

My report program is having select-options: s_matnr FOR mara-matnr. I need to pass this parameter to FM & in turn, the FM will give me the list of materials. Reason is I need to fetch materials from another R/3 System.

Please suggest.

With Regards,

Bapu Aher

Read only

Former Member
0 Likes
1,922

HI,

*Range for Sales document type

RANGES: R_AUART FOR VBAK-AUART.

R_AUART-SIGN = 'I'.

R_AUART-OPTION = 'EQ'.

R_AUART-LOW = 'TA'. "Standard Order

APPEND R_AUART.

PLEASE SEE HOPE HELP.

RAMA

Read only

0 Likes
1,922

Hi Ram,

please see my reply which I given to max.

It's not working.

Regards,

Bapu

Read only

0 Likes
1,922

Hi

What is the function module? any way you can declare rangse as follows..

ranges: r_matnr for mara-matnr.

r_matnr[] = s_matnr[].

Regards,

Suresh Datti

Read only

0 Likes
1,922

Thanx Suresh,

But how do define Tables Parameter corresponding to "r_matnr". Because I need to pass it to FM. How do I define it?

With Regards,

Bapu Aher

Read only

0 Likes
1,922

Hi

Just I said in my prevoius answer you can define a dictionary structure like this:

FIELD DATA ELEMENT

-


.INCLUDE SRANGE

LOW MATNR

HIGH MATNR

In this way you have a structure like the range R_MATNR, and you can use it to define your paramenter in TABLE PARAMETER of Function:

FUNCTION ZTRANSFER_RANGES.

*"----


""Interfaccia locale:

*" TABLES

*" RMATNR STRUCTURE ZMATNR

*"----


DATA T_MARA LIKE STANDARD TABLE OF MARA.

SELECT * FROM MARA INTO TABLE T_MARA WHERE MATNR IN RMATNR.

ENDFUNCTION.

But you can also define a table parameter without definition:

FUNCTION ZTRANSFER_RANGES.

*"----


""Interfaccia locale:

*" TABLES

*" RMATNR

*"----


DATA T_MARA LIKE STANDARD TABLE OF MARA.

SELECT * FROM MARA INTO TABLE T_MARA WHERE MATNR IN RMATNR.

ENDFUNCTION.

Max