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: 

Problem with an internal table

Former Member
0 Kudos

People, I have this code into a smartform but I don't know why the system give me this error. Any body can help me!!

This is the part of the select code.


SELECT SINGLE VERTN SGTXT PSWBT
  FROM BSID INTO IT_BSID.

LOOP AT IT_BSID INTO WA_BSID.

TEST = WA_BSID-SGTXT.

ENDLOOP.

This is the error of the system:

"IT_BSID" is neither specified under "TABLES" nor is it defined as an internal table.

Thanks for the help.

10 REPLIES 10

Former Member
0 Kudos

Hi,

You need to define the table IT_BSID in the global definitions.

Former Member
0 Kudos

IN THE GLOBAL DATA OF GLOBAL DEFINITION I DEFINE THE INTERNAL TABLE LIKE:


IT_BSID       STANDARD TABLE OF TY_BSID WITH HEADER LINE

0 Kudos

Hi,

Did you declared ty_bsid in global definition->Types Tab?

types: begin of ty_bsid,

...

end of ty_bsid.

And if you need only single record,then declare

workarea in Global definitions->Global Data.

wa_bsid like ty_bsid.

text type BSID-SGTXT.

In Program logic,

SELECT SINGLE VERTN SGTXT PSWBT

FROM BSID INTO wa_BSID.

TEST = WA_BSID-SGTXT.

Kindly reward points by clicking the star on the left of reply,if it helps.

Message was edited by: Jayanthi Jayaraman

Former Member
0 Kudos

Declare IT_BSID in the global def. of the smartforms.

former_member425121
Participant
0 Kudos

Carlos

Don't you need to set the INTO TABLE clause instead only INTO ?

select x x x from bsid INTO TABLE it_bsid

(In addition to declare it_bsid and wa_bsid with the same 3 fields you are using)

Regards

Frank

0 Kudos

Hi Carlos,

It looks like IT_BSID is declared correctly, referring to BSID.

You should use:

(Don't use SINGLE)

SELECT VERTN SGTXT PSWBT

FROM BSID INTO CORRESPONDING FIELDS OF TABLE IT_BSID.

(Or)

SELECT * FROM BSID INTO TABLE IT_BSID. "(If TY_BSID is exactly like BSID or has BSID as the first component)

LOOP AT IT_BSID INTO WA_BSID.

TEST = WA_BSID-SGTXT.

ENDLOOP.

If this helps, please remember to award the points and close the post.

Good luck,

Bhanu

Former Member
0 Kudos

The reason for your error is the omision of TABLE term in your select statement. Without this addition, you are trying to move your selected rows into the header of your ITAB, whereas your itab may not be having a header line.

So change your code as follows and it should work, if not please let us know.


SELECT VERTN SGTXT PSWBT FROM BSID 
                         INTO <b><u>TABLE</u></b> IT_BSID.
 
LOOP AT IT_BSID INTO WA_BSID.
  TEST = WA_BSID-SGTXT.
ENDLOOP.

Regards,

Srinivas

0 Kudos

Sorry, I just noticed that you have a header line for your internal table. Please ignore my previous message.

Former Member
0 Kudos

hi,

In the program lines specify the IT_BSTD and WA_BSTD in the Input parameters

cheers,

sasi

Former Member
0 Kudos

hi,

try this....

step 1 .

in the types tab declare as

types : begin of ty_itab,

"required fields ,

end of ty_itab.

types : t_itab type table of ty_itab.

step 2.

in the global data declare

it_itab like t_itab .

now u can use the table it_itab.