cancel
Showing results for 
Search instead for 
Did you mean: 

sap script query (urgent)

Former Member
0 Kudos

hi all,

the following are my query reg scripts. plz answer it.

i will reward ur effort.

1.Can you assign your own form to a standard print program?how?

2.What is the use of PROTECT & ENDPROTECT?

3.How to add extra functionality to a standard print program without touching the print program?

4.what is sub routine pool in sap script? when it is used?

5.How to read text in sapscripts?

6.When we need to modify standard scripts(eg:medruck) given by sap?

7.How many main windows can be created for a script ?

thanks and regards

sanjeev

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hello, hope this helps!!!

1.Can you assign your own form to a standard print program?how?

Yes you can, each form can be customized by the functional people on tcod spro, any ways depending on the customization you can assign smartforms or sapsript.

2.What is the use of PROTECT & ENDPROTECT?

I dont know.

3.How to add extra functionality to a standard print program without touching the print program?

You can make a copy over the standard form, and add the functionality you need, sometimes its hard but you can do it.

4.what is sub routine pool in sap script? when it is used?

It is the same thing as always, it is just an include with the functions used to make the sapscript to work.

5.How to read text in sapscripts?

You can call the fm READ_TEXT. To know how to call you can do it like this...

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.

6.When we need to modify standard scripts(eg:medruck) given by sap?

You can modify them when you need a diferent form layout, it ussually happens.

7.How many main windows can be created for a script ?

You can create as many as you need, but if you make to many it will be hard to manage.

This a link where you can find more info about sapscript.

http://help.sap.com//saphelp_470/helpdata/EN/d1/802d7d454211d189710000e8322d00/frameset.htm

Hope this helps,

Dont foreget to reward

Gabriel

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi Sanjeev,

Protect Endprotect is Like if you are having 2 paragraphs and the second paragraph is having 10 line. When printing if you r getting 4 lines in one page and 6 lines in second page it don't look decent. So inorder to avoid this thing If u give Protect and End protect The paragraph will not break up It will print as one paragraph itself.

You can have 99 main Windows in a page.

And Remaining Some of our friends Have Given.

Bye

Murthy

Message was edited by: Ramana Murthy

raguraman_c
Active Contributor
0 Kudos

1.Can you assign your own form to a standard print program?how?

Try Tcode <b>NACE</b>. Values get stored in TNAPR table.

--Ragu

messier31
Active Contributor
0 Kudos

Hi suresh,

<b>1.Can you assign your own form to a standard print program?how?</b>

Yes definitely we can assign custom form to standard print program.

But this is not a single place settings that needs to be done.

For different application area there are different places where this setting can be changed from standard form to custom form.

<b>2.What is the use of PROTECT & ENDPROTECT?</b>

To allow you to define the areas to be protected against a page break on an individual basis, SAPscript provides the PROTECT.. ENDPROTECT command pair.

If you enclose the text to be protected in these commands, then SAPscript will ensure that each line of this text is printed together on the same page.

If the complete text fits in the space remaining on the

current page, then it is printed on this page just as it would be if no PROTECT command had been used.

If, however, the remaining space is not sufficient for the text, then the PROTECT command has the same effect as a NEW-PAGE command and text is printed on a new page.

<b>3.How to add extra functionality to a standard

print program without touching the print program?</b>

There is no way of doing this... You can either modify std program with access key or create a copy of the std and make the necessary changes...

<b>4.what is sub routine pool in sap script? when

it is used?</b>

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.

Syntax in a form window:

/: PERFORM <form> IN PROGRAM <prog>

/: USING &INVAR1&

/: USING &INVAR2&

......

/: CHANGING &OUTVAR1&

/: CHANGING &OUTVAR2&

......

/: ENDPERFORM

<b>5.How to read text in sapscripts?</b>

Do you mean to say reading standard text?

Go to ur form layout -> insert -> text -> standard

<b>6.When we need to modify standard scripts(eg:medruck) given by sap?</b>

We modify the standard script obviously when the look and feel, details provided in form etc are not as per the one that is required by client.

<b>7.How many main windows can be created for a script ?</b>

I guess, there is no such constraint

Enjoy SAP.

Pankaj Singh