cancel
Showing results for 
Search instead for 
Did you mean: 

HOW TO USE PERFORM STATEMENT IN SMARTFORMS

Former Member
0 Kudos

Hi,

Can anyone tell me how to use call subroutine in smartform?

Thanks & Regards,

Gauarv.

Accepted Solutions (0)

Answers (4)

Answers (4)

Former Member
0 Kudos

Hi Gaurav,

U dont need to use the perform statement in smartforms.U can directly create a program lines code in the smartform if the code u want to write manipulates the item data other wise u can use the global definitions - initialization tab for fetching or manipulating the header level data.U have mention the input and output parameters and u can also declare the formal data.

Reward points if useful.

Cheers,

Deepthee Kasal

KalC
Active Participant
0 Kudos

Hi ,

You can write the subroutines in the form routines tab of the global definition. Here write your form and endform.Later you can call that subroutine either in initialization tab or in any program lines node.

Hope this information helps.

Regards,

Kalyan.

Former Member
0 Kudos

Hi,

Hope this helps you..

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.

former_member188005
Contributor
0 Kudos

Gaurav,

No need of using PERFORM in Smartforms.

You can directly write the custom ABAP code in smartform itself.

Right click ---> create --> flowlogic -


> Program lines.

Here you can include the ABAPcode and then using import and export parameters you can access the processed data.

Hope things are little clear .

Regards..