Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

Can we call a subroutine in a script? If so, how?

Answer Posted / kiran kumar v

Yes. Subroutine can be called using ITCSY structure.

Sample Code:
/: PERFORM SUM IN PROGRAM ZPROGRAM
/: USING &VAR1&
/: USING &VAR2&
/: CHANGING &RESULT&
/: ENDPERFORM

In the program(ZPROGRAM), we need to write the form ....

FORM SUM TABLES INTAB STRUCTURE ITCSY
OUTTAB STRUCTURE ITCSY.
data: field1 type i,
field2 type i,
result type i.

TO read the values from the ITAB you have to use this logic.
READ TABLE INTAB WITH KEY NAME = 'VAR1'.
IF SY-SUBRC = 0.
FIELD1 = INTAB-VALUE.
ENDIF.

READ TABLE INTAB WITH KEY NAME = 'VAR2'.
IF SY-SUBRC = 0.
FIELD2 = ITAB-VALUE.
ENDIF.


RESULT = V_FIELD1 + V_FIELD2.
READ TABLE OUTTAB INDEX 1.
IF SY-SUBRC = 0.
OTAB-VALUE = RESULT.
MODIFY OUTTAB INDEX 1 .
ENDIF.
ENDFORM.

Is This Answer Correct ?    6 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How do we assign dynamic views while creating material master and generating bdc? : abap bdc

1093


What is the use of at new statement ?

1736


What is abap dictionary or data dictionary? What is the transaction to access abap dictionary? : abap data dictionary

923


What is repository info. Systems?

1053


Normally how many and what files get created when a transaction program is written?

973


How do you find the information on the current screen?

1011


What’s value table?

987


What is the length of function code at user-command?

1246


Can we control the sequence in which multiple implementations of a multiple use BADI are called? If yes, how?

1293


What is a table cluster? : abap data dictionary

1115


What data is contained? : abap data dictionary

1061


Suppose there is a secondary index on 4 non-key fields A,B,C & D. There are 3 select queries :- a) one on basis of A, B, C , D b) Second on basis of A, B, C c) Third on basis of D, C,B, A In which all situations , the above secondary index will be used?

1466


Where do you use help views?

924


how to Create reports in SD module such as sales order report, which covers all organization levels, delivery status, invoice status, shipping details and partner function details. The data will be extracted from VBAP, VBPA, VBAK, VBUP, VBFA, KNA1, LIPS, VBRP, MARA, VBEP and KONV tables. plz mention the detail coding Tahnks, Rahul

3280


What is size category?

960