Application Development 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: 

ABAP Report with INCLUDE for subroutine.

Former Member
0 Kudos

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

Former Member
0 Kudos

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

0 Kudos

HI Himanshu Kanekar

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

BR,

Ali

0 Kudos

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.

0 Kudos

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

0 Kudos

use TABLES as parameter instead of USING....

0 Kudos

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

0 Kudos

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

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

0 Kudos

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.....

0 Kudos

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

0 Kudos

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

former_member187457
Active Contributor
0 Kudos

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

Former Member
0 Kudos

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

Former Member
0 Kudos

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

Former Member
0 Kudos

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

former_member187457
Active Contributor
0 Kudos

hi Ali Saleh AlAbbad ,

any break thru..????

former_member182546
Contributor
0 Kudos

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