ALLInterview.com :: Home Page            
 Advertise your Business Here     
Browse  |   Placement Papers  |   Company  |   Code Snippets  |   Certifications  |   Visa Questions
Post Question  |   Post Answer  |   My Panel  |   Search  |   Articles  |   Topics  |   ERRORS new
   Refer this Site  Refer This Site to Your Friends  Site Map  Bookmark this Site  Set it as your HomePage  Contact Us     Login  |  Sign Up                      
Google
   
 
Categories >> Software >> ERP CRM >> SAP >> SAPScript
 
 


 

 
 Basis interview questions  Basis Interview Questions (814)
 ABAP interview questions  ABAP Interview Questions (2427)
 SAPScript interview questions  SAPScript Interview Questions (127)
 SD interview questions  SD Interview Questions (1953)
 MM interview questions  MM Interview Questions (352)
 QM interview questions  QM Interview Questions (8)
 PP interview questions  PP Interview Questions (136)
 PM interview questions  PM Interview Questions (21)
 PS interview questions  PS Interview Questions (20)
 FI CO interview questions  FI CO Interview Questions (1657)
 HR interview questions  HR Interview Questions (434)
 SAP CRM interview questions  SAP CRM Interview Questions (262)
 SRM interview questions  SRM Interview Questions (12)
 APO interview questions  APO Interview Questions (18)
 Business Warehouse interview questions  Business Warehouse Interview Questions (622)
 Business Workflow interview questions  Business Workflow Interview Questions (9)
 SAP Security interview questions  SAP Security Interview Questions (336)
 SAP Interfaces interview questions  SAP Interfaces Interview Questions (4)
 Netweaver interview questions  Netweaver Interview Questions (144)
 SAP ALE IDocs interview questions  SAP ALE IDocs Interview Questions (48)
 SAP B1 interview questions  SAP B1 Interview Questions (58)
 SAP AllOther interview questions  SAP AllOther Interview Questions (92)
Question
HOw to Call Subroutine in 
Sap Script?
 Question Submitted By :: SAPScript
I also faced this Question!!     Answer Posted By  
 
Answer
# 1
The example defines a subroutine FORM CALLED_FROM_SAPSCRIPT
in the ABAP ZDEMO_SAPSCRIPT_PERFORM . This subroutine is
called from the SapScript form when the respective element

/E PERFORM_ABAP
is executed. The syntax of the call is like

/: PERFORM CALLED_FROM_SAPSCRIPT IN PROGRAM zsapscriptexits
/: USING &invar1&
/: USING &invar2&
...
/: CHANGING &outvar1&
/: CHANGING &outvar2&
...
/: ENDPERFORM

The subroutine must be defined in the ABAP/4 report as
follows:

FORM form TABLES IN_TAB STRUCTURE ITCSY
OUT_TAB STRUCTURE ITCSY.
...
ENDFORM.
 
Is This Answer Correct ?    13 Yes 3 No
K.nagalakshmi
 
Answer
# 2
Calling ABAP Subroutines: PERFORM


You can use the PERFORM command to call an ABAP subroutine
(form) from
any program, subject to the normal ABAP runtime
authorization
checking. You can use such calls to subroutines for
carrying out
calculations, for obtaining data from the database that is
needed at
display or print time, for formatting data, and so on.

PERFORM commands, like all control commands, are executed
when a
document is formatted for display or printing.
Communication between a
subroutine that you call and the document is by way of
symbols whose
values are set in the subroutine.

The system does not execute the PERFORM command within
SAPscript
replace modules, such as TEXT_SYMBOL_REPLACE or
TEXT_INCLUDE_REPLACE.
The replace modules can only replace symbol values or
resolve include
texts, but not interpret SAPscript control commands.

Syntax in a form window:

/: PERFORM <form> IN PROGRAM <prog>
/: USING &INVAR1&
/: USING &INVAR2&
......
/: CHANGING &OUTVAR1&
/: CHANGING &OUTVAR2&
......
/: ENDPERFORM

INVAR1 and INVAR2 are variable symbols and may be of any of
the four
SAPscript symbol types.

OUTVAR1 and OUTVAR2 are local text symbols and must
therefore be
character strings.

The ABAP subroutine called via the command line stated
above must be
defined in the ABAP report prog as follows:

FORM <form> TABLES IN_TAB STRUCTURE ITCSY
OUT_TAB STRUCTURE ITCSY.
...
ENDFORM.

The values of the SAPscript symbols passed with /: USING...
are now
stored in the internal table IN_TAB . Note that the system
passes the
values as character string to the subroutine, since the
field Feld
VALUE in structure ITCSY has the domain TDSYMVALUE (CHAR
80). See the
example below on how to access the variables.

The internal table OUT_TAB contains names and values of the
CHANGING
parameters in the PERFORM statement. These parameters are
local text
symbols, that is, character fields. See the example below
on how to
return the variables within the subroutine.

From within a SAPscript form, a subroutine GET_BARCODE in
the ABAP
program QCJPERFO is called. Then the simple barcode
contained there
('First page', 'Next page', 'Last page') is printed as
local variable
symbol.

Definition in the SAPscript form:

/: PERFORM GET_BARCODE IN PROGRAM QCJPERFO
/: USING &PAGE&
/: USING &NEXTPAGE&
/: CHANGING &BARCODE&
/: ENDPERFORM
/
/ &BARCODE&

Coding of the calling ABAP program:

REPORT QCJPERFO.

FORM GET_BARCODE TABLES IN_PAR STUCTURE ITCSY
OUT_PAR STRUCTURE ITCSY.

DATA: PAGNUM LIKE SY-TABIX, "page number

NEXTPAGE LIKE SY-TABIX. "number of next page

READ TABLE IN_PAR WITH KEY 'PAGE'.
CHECK SY-SUBRC = 0.
PAGNUM = IN_PAR-VALUE.

READ TABLE IN_PAR WITH KEY 'NEXTPAGE'.
CHECK SY-SUBRC = 0.
NEXTPAGE = IN_PAR-VALUE.

READ TABLE OUT_PAR WITH KEY 'BARCODE'.
CHECK SY-SUBRC = 0.
IF PAGNUM = 1.
OUT_PAR-VALUE = '|'. "First page

ELSE.
OUT_PAR-VALUE = '||'. "Next page

ENDIF.

IF NEXTPAGE = 0.
OUT_PAR-VALUE+2 = 'L'. "Flag: last page
ENDIF.

MODIFY OUT_PAR INDEX SY-TABIX.

ENDFORM.
 
Is This Answer Correct ?    12 Yes 4 No
K.nagalakshmi
 
 
 

 
 
 
Other SAPScript Interview Questions
 
  Question Asked @ Answers
 
5. What are the difference between BADI and user Exit.   3
/: ADDRESS PARAGRAPH AS /: NAME &LFA1-NAME1& . . /: COUNTRY &LFA1-LAND1& THIS CODE IS NOT GENERATING ANY ADDRESS ON THE OUTPUT FORM. IF I NEED TO PRINT THE ADDRESS THEN,WAT CODE I NEED TO FOLLOW?EVEN I READ THE DATA THRU THE SELECT STATEMENT IN MY OWN DRIVER PROGRAM!   2
what is sap ? can i learn sap from home ? future of sap and freshers salary and experience salary ? carrer scope for sap and please tell me indepth details of company listings in chennai ? Thermax 2
how to get total price in sapscript form? TCS 1
What is the client concept in SAP? What is the meaning of client independent ?   1
The Logo Upaloaded got Inverted , then How you are going to handle this situation ?   1
HOw to Call Subroutine in Sap Script? TCS 2
how to define the total and sub total in smartform IBM 2
10. Tcode used fo complete documentation of BAPI data record online.   1
if we want add new window to standard script then we copy it into zform and then we will add the window.. how can we call the added window from driver program without change. we have to call the window with write form function module. where do we write the function module??? HCL 1
What is the most complex interactive report that was written by you ?   1
when debugging the script what is the functionality of f5,f6,f7 and f8? Wipro 2
 
For more SAPScript Interview Questions Click Here 
 
 
 
 
 


   
Copyright Policy  |  Terms of Service  |  Articles  |  Site Map  |  RSS Site Map  |  Contact Us
   
Copyright 2013  ALLInterview.com.  All Rights Reserved.

ALLInterview.com   ::  KalAajKal.com