4
Common Questions and Answers about ABAP/ 4 and Developments 1. What is the difference between eternal ! internal subroutine"  #. Wh$ do we use A%&"  '. Wh$ do we use ()* C+,-, and what is it"  4. Both the events A * -)%)C*0-C,))0 and A* +-),C22A0D are processed after user input. *hen what is the difference between these and when we should use what" -udeshna Answer 13 1) Internal subroutines in the sense ..subroutines which are defined and used in a same  program...external in the sense if you create a sub routine in one program and you're calling this subroutine in another program ..then this is external subroutine. 2) AL V gies many adantages than a list li!e sorting summing g etting graphics li!e that stuff ") #hile generating a interactie report we will use get cursor. .use is to get the alue of the fiel under the cursor.. $) At selection screen is used to alidate the fields in a selection screen...and at user command is used to modify t he screen in a selection scr een and in genarating secondary lists.. -arath ,edd$ Answer #3 1. %he name itself implies the internal subroutines defined by form &perform.. can be called within the same prog in which they were declared.....external subroutines can be called outside the program....... 2. A( LI% VI#* is A LV . its main adantage is by using AL V techni+ue we can find totals ,subtotals ,sort in any order etc there itself in the list output of course we need to write all those functionalities while using AL V ...also many functional modules are defined unde r AL V concept... ". -%/*0* is used to trace the position of the cursor in the list .. suppose we want to double clic! on any filled in the list and want to trace data using that field we use getcursor .....

Common Questions and Answers about ABAP.doc

  • Upload
    zaheer

  • View
    212

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Common Questions and Answers about ABAP.doc

8/19/2019 Common Questions and Answers about ABAP.doc

http://slidepdf.com/reader/full/common-questions-and-answers-about-abapdoc 1/4

Common Questions and Answers about ABAP/4 and

Developments 

1. What is the difference between eternal ! internal subroutine" 

#. Wh$ do we use A%&" 

'. Wh$ do we use ()* C+,-, and what is it" 

4. Both the events A* -)%)C*0-C,))0 and A* +-),C22A0D are

processed after user input.

*hen what is the difference between these and when we should use what"

-udeshna 

Answer 13 1) Internal subroutines in the sense ..subroutines which are defined and used in a same

 program...external in the sense if you create a sub routine in one program and you'recalling this subroutine in another program ..then this is external subroutine.

2) ALV gies many adantages than a list li!e sorting summing getting graphics li!e that

stuff

") #hile generating a interactie report we will use get cursor..use is to get the alue ofthe fiel under the cursor..

$) At selection screen is used to alidate the fields in a selection screen...and at usercommand is used to modify the screen in a selection screen and in genarating secondary

lists..

-arath ,edd$ 

Answer #3 

1. %he name itself implies the internal subroutines defined by form &perform.. can be

called within the same prog in which they were declared.....external subroutines can becalled outside the program.......

2. A( LI% VI#* is ALV . its main adantage is by using ALV techni+ue we canfind totals ,subtotals ,sort in any order etc there itself in the list output of course we need

to write all those functionalities while using ALV...also many functional modules aredefined under ALV concept...

". -%/*0* is used to trace the position of the cursor in the list ..

suppose we want to double clic! on any filled in the list and want to trace data using that

field we use getcursor .....

Page 2: Common Questions and Answers about ABAP.doc

8/19/2019 Common Questions and Answers about ABAP.doc

http://slidepdf.com/reader/full/common-questions-and-answers-about-abapdoc 2/4

$.A% L%I0* is used where you hae a seperate selection screen using

selectoptions or parameters where as A% /*033A4 is used where no selection

screen exists....at.usercommand is mainly used while setting pfstatus which meanscreating our own menu with function codes etc...

-hiva 

had seen some of the standard abap that the table name had 5 li6e e6po. What is

the meanin7" What is the difference between with and without "

It 5ust lets you use the table a second time. 6or example7

select single 8 from e!po where ebeln 9 '12"$:' and ebelp 9 '1'.

select single 8 from 8e!po where ebeln 9 ';<=>?' and ebelp 9 '1'.

@ou now hae two separate records, one in e!po and one in 8e!po.

Another way to do this is to simply use the 'into' argument in the 'select' statement to read

the second e!po record into some other field. %he '8' format can be confusing, I thin! itmay be left oer from earlier releases, li!e 2.2.

(0 is database table and 8(0 is internal table.

0nce you select into (0, you can use it the same way as 8(0.

8ow do use variables in the 9,2A* command"  

4A%A 0L0*I4 %@( I VAL/ $.60*3A% I%I6I4 0 0L0* 9 0L0*I4.

When usin7 CA%% :-;-*)2: id :C22A0D: field unicommand5 how does one

capture the results of the command" 9or eample5 if the unicommand were the

date" 

@ou capture the results in the table e.g %ABL, li!e this

4A%A7 B-I 06 %ABL 0/* ?,LIC:;?),

4 06 %ABL.

*6*D %ABL.

ALL '@%3' I4 '033A4' 6IL4 (A*03EL0I4 '%AB' 6IL4 %ABL8@8.

Page 3: Common Questions and Answers about ABAP.doc

8/19/2019 Common Questions and Answers about ABAP.doc

http://slidepdf.com/reader/full/common-questions-and-answers-about-abapdoc 3/4

am wor6in7 on a pro7ram that needs to show number of da$s between # dates.

When scanned the function librar$5 onl$ found a function to 7ive $ou the number

of $ears between dates. can probabl$ code this in ABAP but does an$one 6now if a

function eists to do this. 

I wrote this example for you. I thin! this is what you need.

4A%A7 4A%E1 LI @4A%/3,

4A%E2 LI @4A%/3.4A%A 4A@ %@( I.

4A%E1 9 @4A%/3.

4A%E2 9 @4A%/3 F ;:.

4A@ 9 4A%E2 4A%E1.#*I%7& '4A%E29',4A%E2,'4A%E19',4A%E1,'4A@9',4A@.

*un this code and then you will understand.

8ow do concatenate two strin7s in Abap/4"

6or all A( Versions%*EL-%D 9 %*LC %*I-1 ).

30V %*I-1 %0 %*I-".

#*I% %*I-2 %0 %*I-"F%*EL-%D.

6or A( Version ".? choose7

0A%A% %*I-1 %*I-2 I%0 %*I-".

If you want a space between both fields7

0A%A% %*I-1 %*I-2 I%0 %*I-" (A*A%4 B@ ' '.

6or A( Version 2.2 choose 6unctions7

%*I-E0A%A% for 2 trings and

%*I-E0A%A%E" for " trings.

8as an$one been successful in suppressin7 the selection screen that is automaticall$

displa$ed when usin7 lo7ical data bases. want to run a <ob in the bac67round usin7

a lo7ical database and do not want the user prompted for the parameters. want

to pass the parameters in the pro7ram. 

Page 4: Common Questions and Answers about ABAP.doc

8/19/2019 Common Questions and Answers about ABAP.doc

http://slidepdf.com/reader/full/common-questions-and-answers-about-abapdoc 4/4

%ry using the /B3I% rep /I- L%I0% 'ariant' #I%D ....

command in the report to pass the ariant thru the program

would li6e to 6now how to eecute from ABAP code an eternal +ni pro7ram and

chec6 for a return code"

%here are different ways to this7

C1) 0( 4A%A% GfileH 60* 0/%(/% 'unix command'

L0 4A%A% GfileH%his command executes the unix command and writes the output into GfileH

Loo! into 0 ote >">1.

C2) or try the following program but unfortunately the command ALL @%3 is

not supported by A(. If you are on *&" 2.1 2.2x you can get some idea's from the

 program A(30?.

*(0*% /IJ03 .

4A%A7 /E033A4C2??).

8 %able for system messages4A%A7 B-I 06 *% 0/* 1?? ,

LIC1??) ,

4 06 *% .

%A*%06L%I0 .

30V 'unix command' to /E033A4 .

*6*D *%.

ALL '@%3' I4 '033A4' 6IL4 /E033A4

I4 '%AB' 6IL4 *%8@8 .L00( A% *%.

#*I% 7 & *%LI .

4L00(.