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

how to create internal type

Former Member
0 Likes
727

Hi all,

I created a normal table 'ZNLMEVENTS' with 4 fields. I entered data. Now i created a function module with below code. Problem i have is i get only one record inspite of having more rows. How to get all rows shown.. i came to know its possible thru making the table as internal. I dont know how to do that. kinldy help me.

FUNCTION ZNLM_ALARAMEVENTS.

*"----


""Local Interface:

*" EXPORTING

*" VALUE(ALARMEVENTS) TYPE ZNLMEVENTS

*"----


select * from znlmevents into table alarmevents.

ENDFUNCTION.

I am very new to ABAP language.

Thanks,

Raghavendra

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
699

You should change the EXPORTING interface parameter to a TABLES parameter (and call it that way too).

Rob

6 REPLIES 6
Read only

Former Member
0 Likes
700

You should change the EXPORTING interface parameter to a TABLES parameter (and call it that way too).

Rob

Read only

0 Likes
699

Hi Rob,

I changed it as you told but still i get only one record. Please see the code below. kindly let me know where i am doing wrong.

FUNCTION ZNLM_ALARAMEVENTS.
*"----------------------------------------------------------------------
*"*"Local Interface:
*"  TABLES
*"     VALUE(ALARMEVENTS) TYPE  ZNLMEVENTS
*"----------------------------------------------------------------------
select * from znlmevents into alarmevents.
endselect.

ENDFUNCTION.

Thanks,

Raghavendra

Read only

0 Likes
699

Leave the TABLES parameter as Rob suggested, and now change your SELECT statement to this.

select * from znlmevents into TABLE alarmevents.

Regards,

Rich Heilman

Read only

0 Likes
699

Just FYI, the above will work, but the TABLES parameter is obselete. The correct way of so it now, is to create a table type in the ABAP dictionary which would have a line type of your transparent table name, then you would use an EXPORT parameter as you have done initially, and use the table type to describe the parameter instead of the table name, and you would leave the SELECT statement as it was with the INTO TABLE.....

Regards,

Rich Heilman

Read only

0 Likes
699

Thanks Rich,

Unfortunately i only know how to create table but dont know how to create a line type of my transparent table. I guess, it means to create a new table with a field of type my transaparent table rt?

thanks for your answers..

Thanks,

Raghavendra

Read only

0 Likes
699

No, just go to SE11, enter the name of the table type, maybe <your_table_name_TT>. Enter this in the data type field on the SE11 screen, and select that radiobutton, then click create, in the dialog choose table type, and hit enter, in the next screen, give the description, and below, enter the name of the "Z" table as the line type, save and activate. That's it.

Regards,

Rich Heilman