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

PASSING A GLOBAL VARIABLE TO A FUNCTION

Former Member
0 Likes
2,461

I have made a copy of the program that lists open orders.

It passes input parameters to a function named RV_Missing_Document_Data.

my user would like to select using date ranges . I have created input parameter for the field, but have no success passing the range to the function. rather than passing IBT2003010320030403 to the function, it passes IBT20030 (the field size of sy-datum).

How do I define this to pass the range information? please

11 REPLIES 11
Read only

Former Member
0 Likes
1,791

The way is to copy this FM, change the parameter's type from a date to the range of dates (tables) and tune this FM's code for the parameter's type.

Hope it helps.

Read only

0 Likes
1,791

Thanks, Roman

Would you give me an example of how to do this, please. Where do I place this definition in the function?

I use the transaction SE37 to edit the different areas of the function (global, interface, source code, and main program).

Thanks, again

Linda

Read only

0 Likes
1,791

In SM37 in Tables tab create a new parameter with a type that refers to a structure as a Select-Option/Range:

BEGIN OF ...

SIGN(1),

OPTION(2),

LOW LIKE SY-DATUM,

HIGH LIKE SY-DATUM,

END OF ...

or you can use a table with one field as a long string (30) should be enough:

BEGIN of ...

STR(30),

END of ...

(during assignment to a range it will move fields' values to the correct range's fields).

Inside of a function declare a Range and assign passed tables entries to it:

range[] = table[].

And in FM change code instead of "= date" it will be something like "IN range.".

Read only

0 Likes
1,791

In SM37 in Tables tab create a new parameter with a type that refers to a structure as a Select-Option/Range:

BEGIN OF ...

SIGN(1),

OPTION(2),

LOW LIKE SY-DATUM,

HIGH LIKE SY-DATUM,

END OF ...

or you can use a table with one field as a long string (30) should be enough:

BEGIN of ...

STR(30),

END of ...

(during assignment to a range it will move fields' values to the correct range's fields).

Inside of a function declare a Range and assign passed tables entries to it:

range[] = table[].

And in FM change code instead of "= date" it will be something like "IN range.".

Read only

0 Likes
1,791

In SM37 in Tables tab create a new parameter with a type that refers to a structure as a Select-Option/Range:

BEGIN OF ...

SIGN(1),

OPTION(2),

LOW LIKE SY-DATUM,

HIGH LIKE SY-DATUM,

END OF ...

or you can try a table with one field as a long string (30) should be enough:

BEGIN of ...

STR(30),

END of ...

(during assignment to a range it will move fields' values to the correct range's fields).

Inside of a function declare a Range and assign passed tables entries to it:

range[] = table[].

And in FM change code instead of "= date" it will be something like "IN range.".

Read only

0 Likes
1,791

In SM37 in Tables tab create a new parameter with a type that refers to a structure as a Select-Option/Range:

BEGIN OF ...

SIGN(1),

OPTION(2),

LOW LIKE SY-DATUM,

HIGH LIKE SY-DATUM,

END OF ...

or you can try a table with one field as a long string (30) should be enough:

BEGIN of ...

STR(30),

END of ...

(during assignment to a range it will move fields' values to the correct range's fields).

Inside of a function declare a Range and assign passed tables entries to it:

range[] = table[].

And in FM change code instead of "= date" it will be something like "IN range.".

Read only

0 Likes
1,791

In SM37 in Tables tab create a new parameter with a type that refers to a structure as a Select-Option/Range:

BEGIN OF ...

SIGN(1),

OPTION(2),

LOW LIKE SY-DATUM,

HIGH LIKE SY-DATUM,

END OF ...

or you can try a table with one field as a long string (30) should be enough:

BEGIN of ...

STR(30),

END of ...

(during assignment to a range it will move fields' values to the correct range's fields).

Inside of a function declare a Range and assign passed tables entries to it:

range[] = table[].

And in FM change code instead of "= date" it will be something like "IN range.".

Read only

0 Likes
1,791

> In SM37 in Tables tab create a new parameter with a

> type that refers to a structure as a

> Select-Option/Range:

> BEGIN OF ...

> SIGN(1),

> OPTION(2),

> LOW LIKE SY-DATUM,

> HIGH LIKE SY-DATUM,

> END OF ...

>

> or you can try a table with one field as a long

> string (30) should be enough:

> BEGIN of ...

> STR(30),

> END of ...

>

> (during assignment to a range it will move fields'

> values to the correct range's fields).

>

> Inside of a function declare a Range and assign

> passed tables entries to it:

> range[] = table[].

>

> And in FM change code instead of "= date" it will be

> something like "IN range.".

Hi Pavil:

Thank you for your input. I am going to try your suggestion. I let you know of my success.

Linda

Read only

0 Likes
1,791

> In SM37 in Tables tab create a new parameter with a

> type that refers to a structure as a

> Select-Option/Range:

> BEGIN OF ...

> SIGN(1),

> OPTION(2),

> LOW LIKE SY-DATUM,

> HIGH LIKE SY-DATUM,

> END OF ...

>

> or you can try a table with one field as a long

> string (30) should be enough:

> BEGIN of ...

> STR(30),

> END of ...

>

> (during assignment to a range it will move fields'

> values to the correct range's fields).

>

> Inside of a function declare a Range and assign

> passed tables entries to it:

> range[] = table[].

>

> And in FM change code instead of "= date" it will be

> something like "IN range.".

Hi Pavil:

Thank you for your input. I am going to try your suggestion. I let you know of my success.

Linda

Read only

0 Likes
1,791

> > In SM37 in Tables tab create a new parameter with

> a

> > type that refers to a structure as a

> > Select-Option/Range:

> > BEGIN OF ...

> > SIGN(1),

> > OPTION(2),

> > LOW LIKE SY-DATUM,

> > HIGH LIKE SY-DATUM,

> > END OF ...

> >

> > or you can try a table with one field as a long

> > string (30) should be enough:

> > BEGIN of ...

> > STR(30),

> > END of ...

> >

> > (during assignment to a range it will move fields'

> > values to the correct range's fields).

> >

> > Inside of a function declare a Range and assign

> > passed tables entries to it:

> > range[] = table[].

> >

> > And in FM change code instead of "= date" it will

> be

> > something like "IN range.".

>

> Hi Pavil:

>

> Thank you for your input. I am going to try your

> suggestion. I let you know of my success.

>

> Linda

Thanks, Guys, for your information and help. It is completed and It works beautifully.

I appreciate your help.

LInda

Read only

Former Member
0 Likes
1,791

In SM37 in Tables tab create a new parameter with a type that refers to a structure as a Select-Option/Range:

BEGIN OF ...

SIGN(1),

OPTION(2),

LOW LIKE SY-DATUM,

HIGH LIKE SY-DATUM,

END OF ...

or you can try a table with one field as a long string (30) should be enough:

BEGIN of ...

STR(30),

END of ...

(during assignment to a range it will move fields' values to the correct range's fields).

Inside of a function declare a Range and assign passed tables entries to it:

range[] = table[].

And in FM change code instead of "= date" it will be something like "IN range.".