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

Basic ABAP queries

Former Member
0 Likes
696

Hi,

I am new to ABAP...kindly answer these queries...

1>Why Loop at doesnot work for windows other than MAIN in sap scripts ?

2>What is the best way to inner join multiple database(more than 6 or 7) tables? is there any direct method to inner join internal tables ?

3> Why do we have to activate ?? In which scenarios is activation not requried .

6 REPLIES 6
Read only

andrea_galluccio2
Contributor
0 Likes
665

Hi,

try to answer to your questions .

1>Why Loop at doesnot work for windows other than MAIN in sap scripts ?

Loop instruction, is called in the program that commands the sapscript (the control program). So in script u declare an element to print on the form, and in the control program, u give the instruction (with a particular CALL FUNCTION) to print it.

The MAIN window is different from other kind of windows because is able to resize itself depends on how elements u print in it: more elements you print, more MAIN window will be big on the page. The other windows have a standard size.

2>What is the best way to inner join multiple database(more than 6 or 7) tables? is there any direct method to inner join internal tables ?

Usually, u can use nested select clausole for example:

select * from vbak where

select * from vbap where vbeln = vbak-vbeln ...

endselect.

endselect.

Or u can use "inner join" instruction for example

select * from vbak as a

inner join vbap as b

on a~vbeln = b~vbeln....

endselect.

Or u can use internal tables with select

select * from vbak into table ivbak.

loop at ivabk.

select * from vbap where vbeln = ivbak-vbeln.

..

endloop.

endselect.

Usually, is the programmer that decide what is the best way to perform the selection based on the business requirements.

3> Why do we have to activate ?? In which scenarios is activation not requried .

Activation is ALWAYS necessary and implies saving data.

Each object in SAP must be activated. Development packages (like $tmp for example), not requiring the activation process.

Hope it helps.

Bye

Andrea

Pls reward if it helps

Read only

Former Member
0 Likes
665

Hi,

Thanks for the reply ...its of great help..however addtional

doubts rise...

1> is there ne direct way to inner join two internal tables ?

(as we cant use inner join on two internal with select statement and even for using for all enteries, atleast one database table is required )

2> is activation just a mere combination of save and check ??

Read only

0 Likes
665

> Hi,

>

> Thanks for the reply ...its of great help..however

> addtional

> doubts rise...

>

> 1> is there ne direct way to inner join two internal

> tables ?

> (as we cant use inner join on two internal with

> select statement and even for using for all enteries,

> atleast one database table is required )

>

No you cannnot join the internal tables the way you do the database tables.

>

> 2> is activation just a mere combination of save and

> check ??

It also compiles the code converts that into executable format internally.

Regards,

Ravi

Read only

Former Member
0 Likes
665

hi,

3) After coding, we should Activate because during Activation, the system creates a Run Time object. When we execute, the system executes this Run Time Object.

REgards,

Sailaja.

Read only

Former Member
0 Likes
665

Hi,

Thanks Andrea ,Sailaja and Ravi ..thanks for the reply ..

I am not able to put rewards points for you guys..it says some forum error...

Ravi ,

Then watz the best way to inner join two internal tables ...other than looping wrt one table and using read statement on other....

Read only

0 Likes
665

That is the best option available, you don't have a choice. You can use SORTED / HASHED tables, so that the performance impact will not be there.

Regards,

Ravi