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

ABAP Report with INCLUDE for subroutine.

Former Member
0 Likes
3,227

Dear All,

I have ABAP report list.

I have the following code:

SELECT-OPTIONS: s_date FOR oijne-astdtt.
PARAMETERS : p_time LIKE sy-uzeit DEFAULT sy-uzeit.
SELECT-OPTIONS : s_soldto FOR oijnomi-soldto.

in my program i have INCLUDE ZER0100F. as incude for subroutine form.

If i put the subroutine in the include and in side this subroutine i am using the s_date or s_soldto.

It gives me error.

The field "S_DATE" is unknown

Dear All,

I have ABAP report list.

I have the following code:

SELECT-OPTIONS: s_date FOR oijne-astdtt.
PARAMETERS : p_time LIKE sy-uzeit DEFAULT sy-uzeit.
SELECT-OPTIONS : s_soldto FOR oijnomi-soldto.

in my program i have INCLUDE ZER0100F. as incude for subroutine form.

If i put the subroutine in the include and in side this subroutine i am using the s_date or s_soldto.

It gives me error.

The field "S_DATE" is unknown

16 REPLIES 16
Read only

Former Member
0 Likes
2,442

Hi,

The scope of s_date is restricted to the ABAP List report it is declared in. You can write your subroutine in this report itself to use the same select option in it.

Regards,

Himanshu

Read only

0 Likes
2,442

HI Himanshu Kanekar

Is the there any way to access it from the include rether than from main progra?

BR,

Ali

Read only

0 Likes
2,442

In ur FORM .... ENDFORM use using or changing parameters for s_date in ur include and similarly in PERFORM also use using or changing according to ur FORM ...ENDFORM.

Read only

0 Likes
2,442

My Code as mentioned.

SELECT-OPTIONS: s_date FOR oijne-astdtt.
PARAMETERS : p_time LIKE sy-uzeit DEFAULT sy-uzeit.
SELECT-OPTIONS : s_soldto FOR oijnomi-soldto.

How i can use the S_Date in the paramters of the Form?

As u know S_DATE is and internal table.!!

BR,

Ali

Read only

0 Likes
2,442

use TABLES as parameter instead of USING....

Read only

0 Likes
2,442

what is the type i should use here for the selection option parameters.

Read only

0 Likes
2,442

use so_date in tables parameters of form ... endform.

Edited by: vijetasap on Apr 29, 2009 7:45 AM

Read only

0 Likes
2,442

better if u try the option of include that i have suggested earlier ..

i dnt think TABLES , USING etc will work....because ur subroutine will be in include.....

so even if u use parameters in FORM ...ENDFORM it still wont work....i guess

error is because ur include does not find the Select-option field....

so u have to declare it before the ur subroutine include.....

Read only

0 Likes
2,442

Hi,

There is no need to use Using or tables since the select option is global and will be accessible in your routine.

E.g:

TABLES kna1.

SELECT-OPTIONS: s_date FOR sy-datum.
PARAMETERS : p_time LIKE sy-uzeit DEFAULT sy-uzeit.
SELECT-OPTIONS : s_soldto FOR kna1-kunnr.

START-OF-SELECTION.
  PERFORM f_routine.


FORM f_routine.
  WRITE : 'low :' , s_soldto-low.
ENDFORM.                    "f_routine

Regards.

Edited by: Dev Parbutteea on Apr 29, 2009 8:05 AM

Read only

0 Likes
2,442

Hi,

Do the coding in this way :

tables but000.

SELECT-OPTIONS: s_date FOR sy-datum.

PARAMETERS : p_time LIKE sy-uzeit DEFAULT sy-uzeit.

SELECT-OPTIONS : s_soldto FOR but000-partner.

perform test.

include zero.

The subroutine is present in the include zero.

It would work fine.

regds,

deepika

Read only

RahulKeshav
Active Contributor
0 Likes
2,442

Hi,

this error is because u have written include statement before the selection-screen block...

if u write include after the selection screen it will solve ur problem...

or u cna do one more thing....

create another include for selection-screen and put that include before ur subroutine include...

thnx

Rohit

Read only

Former Member
0 Likes
2,442

Hello,

whenever you are using subroutine and the variable used in the subrutine is not defined locally (within the subroutine) it will give you an error saying its not defined though you must have done it before calling the subrutine but if they are not defined globally they become the local varaible and for the subroutine to access them you have to pass them to the subroutine.

Thanks,

Gunjan

Read only

Former Member
0 Likes
2,442

hi

the select-option is global to ur report

so any subroutine , whether it is in same report or in any include program , will have access to it

so you dont need to use any using or changing.

if the problem still exist then try to declear data first and then subroutine.

like:

INCLUDE Z_DATA.

INCLUDE Z_FORMS.

hope this help

Read only

Former Member
0 Likes
2,442

You have to declare the Include program after the selection-screen (select-options).

Regards,

Joan

Edited by: Joan Jesudasan on Apr 29, 2009 8:55 AM

Read only

RahulKeshav
Active Contributor
0 Likes
2,442

hi Ali Saleh AlAbbad ,

any break thru..????

Read only

Former Member
0 Likes
2,442

Hi Ali ,

Include the select options in top include.

SELECT-OPTIONS: s_date FOR oijne-astdtt.

PARAMETERS : p_time LIKE sy-uzeit DEFAULT sy-uzeit.

SELECT-OPTIONS : s_soldto FOR oijnomi-soldto.

With Regards,

Sudhir S