cancel
Showing results for 
Search instead for 
Did you mean: 

reg.scripts

Former Member
0 Kudos

Hi Experts,

I am modyfing one script i want to add two fields one is contract number and second is storer. what is the process to add this fields and what code should i write for this script.

rewards are help ful answers.

Thanks & Regards,

Narasimha Rao.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Narayanadas Narasimha rao,

Generelly if u want to add the fields, u can directly add them in the required windows in SAP Script. Now to get the values for those fields u need to write code in the standard driver program or u need to create a driver program for ur script.

The other thing that we can do is writing SUBROUTINES in FORM.

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.

Please check this link

http://help.sap.com/saphelp_47x200/helpdata/en/d1/803279454211d189710000e8322d00/content.htm

Best regards,

raam

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi

U declare an internal table having two fields contract no and ]

storer

U write code in the editor as

/E &itab-contract no&,,&itab-storer&

Pass this the above text element /E in the write _form function module of the print prg....

thnx

Sravani

Plz reward if helpful

Former Member
0 Kudos

Hi

u declare two fields int the internal table that vis contract no and storer

U write the code in the editor as

/E &itab-contract no&,,&itab-storer&

In the print program, pass this text element in the write_ form

function module....

thnx

Sravani

plz reward if useful............

Former Member
0 Kudos

Hi,

Just mention these two filelds in the script with '&' on both the sides. e.g. &contract_number&. Define variable contract_number in the pgm, & get the value from your logic.

Regards

Raju Chitale