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

select statement in Logical Database

Former Member
0 Likes
1,855

hi,

i need to select particular fields(not select * )

from bsis table in my Logical database. how can i write code for this?

for eg,

In Ordinary report , we can write (select belnnr into

itab_bsis-belnr) like this.

but in Logical Database how can i write the code ?

Neptune.M

13 REPLIES 13
Read only

Former Member
0 Likes
1,518

Hi,

you can write the same as in case of report.

no difference. for refrence check PNP ldb.

check the include <b>DBPNPF01</b> this is used in PNP.

regards

vijay

Read only

Former Member
0 Likes
1,518

Hi neptune,

1. If these fields are not provided

by the ldb,

then u can just use simple select

(select *, fields from BSIS etc)

(just like normal report)

regards,

amit m.

Read only

0 Likes
1,518

hi ,

sorry for the late reply.

In my report , i wrote the code like this

select belnr hkont from bsis into ibsis

where hkont eq s_hkont.

if i execute ,

'ibsis is not defined in logical database'

error was displayed.

i already declared ibsis as

Data : begin of ibsis occurs 0,

hkont like bsis-hkont,

belnr like bsis-belnr,

end of ibsis.

then

what is my actual problem? and where it is?

how can i select particular fields?

Thanks

Neptune.M

Read only

0 Likes
1,518

Hi neptune,

1 select belnr hkont from bsis into TABLE ibsis.

-- use the word TABLE

2. Also, the definition of the table

must be before using the sql.

regards,

amit m.

Read only

0 Likes
1,518

hi Amit,

Thanks for your reply.

i have changed my cod as yours.

but still now also error is coming. The Error is

"IBSis is not a Logical Database Table'

How can i correct it ?

Read only

0 Likes
1,518

Hi,

You can use GET BSIS FILEDS BELNR HKONT.

Regards,

Suresh Datti

Read only

0 Likes
1,518

hi,

if i geive get bsis fields belnr hkont, then

'bsis is not specified for field selection' error was displayed.

plz tell me what is the way to correct ?

Read only

0 Likes
1,518

HI

BSIS should part of your Logical database. Only then you can use it in the GET event.

Regards,

Suresh Datti

Read only

andreas_mann3
Active Contributor
0 Likes
1,518

Hi,

try this in ldb-program:

form put_bsis.

...

select bukrs belnr gjahr... into i_bsis

from bsis...

put i_bsis.

...

endform.

Andreas

Read only

SnezhinaV
Product and Topic Expert
Product and Topic Expert
0 Likes
1,518

Hi,

I am not exactly sure if this might help:

http://help.sap.com/saphelp_nw04s/helpdata/en/9f/db9be035c111d1829f0000e829fbfe/frameset.htm

You can look up also the whole chapter on logical databases.

Regards,

Snezhi

Read only

Former Member
0 Likes
1,518

Hi again,

1. What logical datbase name

have u specified in the attributres of the program?

2. If ur code is short/medium,

pls give so that we can know further !

regards,

amit m.

Read only

0 Likes
1,518

Hi,

I am new to ABAP.Currently I'm practicing logical database. I am facing a similar problem like what Neptune is having.

I have created a logical database 'Z03_SAMPLEDB5' using tables KNA1, KNB1,KNB4,KNB5 and KNKK.

I have defined the Database program and selections.Now I would like to use this logical database in one of my programs.

Please find the code of the program in which I'm using this logical datbase :

REPORT Z03_SAMPLELDB5.

tables : kna1.

data: begin of t occurs 0,

kunnr like kna1-kunnr,

land1 like kna1-land1,

bukrs like knb1-bukrs,

end of t.

start-of-selection.

get kna1.

clear t.

move-corresponding kna1 to t.

append t.

end-of-selection.

write: /20 'Customer No.', 40 'Country code', 55 'Company Code'.

ULINE.

loop at t.

write: /20 t-kunnr, 40 t-land1, 55 t-bukrs.

endloop.

In the output screen I could get data for only 'Customer No' and 'Country code' .'Company Code' is blank.

Please let me know what I need to do to get data for 'Company Code' as well.

Thanks,

Prasuna

Read only

Former Member
0 Likes
1,518

Hi,

U just follow the program demo_seltab_get_event.

Regards,

Naveen M.