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: 

can i use the ranges in smartforms

Former Member
0 Kudos

TYPES: BEGIN OF TY_KSCHL,

         SIGN(1)   TYPE C,

         OPTION(2) TYPE C,

         LOW       TYPE KSCHL,

         HIGH      TYPE KSCHL,

       END OF TY_KSCHL.


hi i have declared like this in  smartforms 

  WA_KSCHL-SIGN = 'I'.

   WA_KSCHL-OPTION = 'EQ'.

   WA_KSCHL-LOW   'PB00'.

   APPEND WA_KSCHL TO IT_KSCHL.

mentioned in smartforms shall i do like this i have did only the hardcoded  is it possible here



With thanks ,

Maha.


12 REPLIES 12

archanapawar
Contributor
0 Kudos

Hi Mahalakshmi,

Can you please elaborate why you need range declaration? What is your actual requirement?

0 Kudos

hi archana ,

i want to hardcode using this  Range . It  requires for my program so i am just trying to use this one in smartforms is it possible to use there . I have declared like this one

1. In types column i mentioned this one.

       BEGIN OF TY_KSCHL,

         SIGN(1)   TYPE C,

         OPTION(2) TYPE C,

         LOW       TYPE KSCHL,

         HIGH      TYPE KSCHL,

       END OF TY_KSCHL.

2. In global data  i have created a table for this one

it_kschl type table of ty_kschl,

wa_kschl type ty_kschl.

3. in initialization am using this

WA_KSCHL-SIGN = 'I'.

   WA_KSCHL-OPTION = 'EQ'.

   WA_KSCHL-LOW   'PB00'.

   APPEND WA_KSCHL TO IT_KSCHL.


WA_KSCHL-LOW   = 'PBXX'.

  APPEND WA_KSCHL TO IT_KSCHL.


i will use this one in select statement is it possible to do like this in smartforms

WIth thaks,

Maha

0 Kudos

Hi Mahalakshmi,

its possible and pass the ranges in where condition of the select statement and get the data. write this logic in program lines node or initialization.

Thanks,

Sree

0 Kudos

Hi Mahalakshmi,

Yes, it is possible to declare range. But, in this case you will need to fetch your data in your smartform itself. It is good practice to fetch your data in print program and then pass that data to smartform.

0 Kudos

hi sreedevi i just tried it

it showing error like this : Field "WA_KSCHL-SIGN" is unknown

It is neither in one of the specified tables nor defined by a "DATA" statement. "DATA" statement

thanks ,

Maha

0 Kudos

You need to define work area in global data:

WA_KSCHL type ty_kschl.

0 Kudos

Hi mahalakshmi,

declare like below.

data: it_kschl type table of ty_kschl,

wa_kschl type ty_kschl.

dont use global data.

Thanks,

Sree


0 Kudos

hi sreedevi :

THanks it works . Having one more doubt that is when u declare internal table u have to specify in types colum as well as initialization both needed or any one itself k

Regards ,

Maha

0 Kudos

You have to provide the name of internal table in Input parameters in Initialization.

0 Kudos

Hi Mahalakshmi,

I Think here you are missing to define the work area and internal table in input parameter tab.

Please follow the below screen shot.

And one more thing it will work for both(Defining range declaration locally or globally ).

0 Kudos

k

0 Kudos

Please close the thread if your question is answered.