Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

scripts ?

Former Member
0 Likes
369

plzz forward the one example of script ?with steps plz ?

3 REPLIES 3
Read only

Former Member
0 Likes
330

Hi,

For the SAPScript to work, we need to create a print program and a form.

Print program is nothing but the ABAP program we develope using tcode SE38. Print program is used to pass the required/extracted data to the form through the text elements.Then the data is displayed with the help of the form.

Sample and simple Print program:

Selection-Screen:

selection-screen begin of block b1.

parameters : name(20) type c.

selection-screen end of block b1.

start-of-selection.

call function 'OPEN_FORM'

exporting

form = 'Z_FORM1'

language = sy-langu.

call function 'START_FORM'

exporting

form = 'Z_TESTING1'

language = 'E'

startpage = 'PAGE1' .

call function 'WRITE_FORM'

exporting

element = 'MAIN'

type = 'BODY'

window = 'MAIN'.

call function 'END_FORM'.

call function 'CLOSE_FORM'.

Sample Form:

Using tcode:SE71, create a form.

Click on Pages button, create a page using the menu Edit->Create Element.Give the page description etc.

By defaulth Main Window will be there.

Using Page Windows, assing the Main window to the page you just created.

Assing the margins, width and height.

Now, go to Main Window and click on text elements and then enter the following:

/E MAIN "E is the text element

AS &NAME& "AS is the paragraph

At last save and activate.Now execute the print program.

So, what ever you enter in the selection screen, that will be displayed in the form.

Note: You can create the paragraph formats and character formats in the same way as you create Pages, Windows etc.

Hope this helps.

Please reward if useful.

Thanks,

Srinivasa

Read only

Former Member
0 Likes
330

Check these links on scripts and smartforms.

Check these step-by-step links

https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/uuid/ccab6730-0501...

https://sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/uuid/8fd773b3-0301-001...

https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/uuid/3c5d9ae3-0501...

Scripts:

http://www.henrikfrank.dk/abapuk.html

http://esnips.com/doc/1ff9f8e8-0a4c-42a7-8819-6e3ff9e7ab44/sapscripts.pdf

http://esnips.com/doc/1e487f0c-8009-4ae1-9f9c-c07bd953dbfa/script-command.pdf

http://esnips.com/doc/64d4eccb-e09b-48e1-9be9-e2818d73f074/faqss.pdf

http://esnips.com/doc/cb7e39b4-3161-437f-bfc6-21e6a50e1b39/sscript.pdf

http://esnips.com/doc/fced4d36-ba52-4df9-ab35-b3d194830bbf/symbols-in-scripts.pdf

http://esnips.com/doc/b57e8989-ccf0-40d0-8992-8183be831030/sapscript-how-to-calculate-totals-and-sub...

http://sappoint.com/abap/

Smart forms:

http://www.sap-basis-abap.com/sapsf001.htm

http://help.sap.com/printdocu/core/Print46c/de/data/pdf/BCSRVSCRSF/BCSRVSCRSF.pdf

http://www.sap-img.com/smartforms/smartforms-faq-part-two.htm

http://smoschid.tripod.com/How_to_do_things_in_SAP/How_To_Build_SMARTFORMS/How_To_Build_SMARTFORMS.h...

http://www.esnips.com/doc/13b7ae7a-b32c-4b96-b588-881859d4ac99/Template,Table,Loop,Command-in-Smartf...

http://www.esnips.com/doc/97acb00a-e513-4611-91f0-c626f460bfc5/Smart_Form_Overview.pdf

http://www.esnips.com/doc/77a981b9-8fe3-4fbb-8101-67745c1fe60c/SMART-FORMS_shail.ppt

http://www.sap-basis-abap.com/sapsf001.htm

http://www.sap-press.com/downloads/h955_preview.pdf

http://www.ossincorp.com/Black_Box/Black_Box_2.htm

http://www.sap-img.com/smartforms/sap-smart-forms.htm

Link for SAP Scripts (step by step procedure)

http://smoschid.tripod.com/How_to_do_things_in_SAP/How_To_Create_A_SAPSCRIPT_Form/How_to_Create_SAPS...

step by step good ex link is....

http://smoschid.tripod.com/How_to_do_things_in_SAP/How_To_Build_SMARTFORMS/How_To_Build_SMARTFORMS.h...

SAP SCRIPT FIELDS

http://help.sap.com/saphelp_erp2005vp/helpdata/en/d1/8033ea454211d189710000e8322d00/content.htm

SMARTFORMS

Go through the following Links, here u can find example with step

by step.

http://smoschid.tripod.com/How_to_do_things_in_SAP/How_To_Build_SMARTFORMS/How_To_Build_SMARTFORMS.h...

Check these links also.

http://www.sap-basis-abap.com/sapsf001.htm

http://www.sap-press.com/downloads/h955_preview.pdf

http://www.ossincorp.com/Black_Box/Black_Box_2.htm

http://www.sap-img.com/smartforms/sap-smart-forms.htm

http://www.sap-img.com/smartforms/smartform-tutorial.htm

http://www.sapgenie.com/abap/smartforms.htm

for Smartforms material

http://www.sap-basis-abap.com/sapsf001.htm

http://www.sap-press.com/downloads/h955_preview.pdf

http://www.ossincorp.com/Black_Box/Black_Box_2.htm

http://www.sap-img.com/smartforms/sap-smart-forms.htm

http://www.sap-img.com/smartforms/smartform-tutorial.htm

http://www.sapgenie.com/abap/smartforms.htm

How to trace smartform

http://help.sap.com/saphelp_47x200/helpdata/en/49/c3d8a4a05b11d5b6ef006094192fe3/frameset.htm

http://www.help.sap.com/bp_presmartformsv1500/DOCU/OVIEW_EN.PDF

http://www.sap-img.com/smartforms/smart-006.htm

http://www.sap-img.com/smartforms/smartforms-faq-part-two.htm

http://www.sap-img.com/smartforms/smart-006.htm

http://www.sap-img.com/smartforms/smartforms-faq-part-two.htm

Read only

Former Member
0 Likes
330

<b> SAPscript Tutorial

Introduction -</b>

Often there are instances where an output from a SAP program is required on a physical paper in a pre-designed format. Using normal ABAP code this is not possible. Instead SAP provides an object called SAPSCRIPT to generate such kind of documents which can contain logos, tables and other objects and which can look like pre-printed documents.

This article focuses on the design and use of Layout sets in ABAP programs to generate beautified output in SAP.

A layout set is a template designed in SAP to place the stream of data coming from a SAP program on different parts of a physical page. The designer needs to lay out the various elements that need to be printed on the page and store it as an object in the SAP system. An ABAP program will subsequently call this object to generate an instance of the template – thus generating an output document from the program.

In this 7 article tutorial we will cover subjects such as:

  • Main elements of SAPscript

  • Commands that can be used in a layout set

  • How to include a graphical image

  • Commands that can be used in SAPscript

  • Step-by-step walkthrough of example

  • Example layout set

  • Example SAPscript code

<b>sample code</b>

REPORT YDEMO_HELLOWORLD .

----


TABLES: VBAP.

PARAMETERS: FORM LIKE RSSCF-TDFORM DEFAULT 'YDEMO_HELLOWORLD'.

*ARAMETERS: form LIKE rsscf-tdform DEFAULT 'YDEMO_TALLY'.

START-OF-SELECTION.

************************************************************************

  • Open the SapScript Form with the "form" *

************************************************************************

CALL FUNCTION 'OPEN_FORM'

EXPORTING

  • APPLICATION = 'TX' " this is SapScript Appl

  • DEVICE = 'PRINTER' " allow output to printer

  • DIALOG = 'X' " printer dialog requested

FORM = FORM " name of form (SE71)

  • LANGUAGE = SY-LANGU

  • OPTIONS = ' '

EXCEPTIONS

CANCELED = 1

DEVICE = 2

FORM = 3

OPTIONS = 4

UNCLOSED = 5

MAIL_OPTIONS = 6

OTHERS = 7.

************************************************************************

  • Execute the element "HELLO" in window MAIN

  • - Nothing happens if /E HELLO is not declared in MAIN

************************************************************************

CALL FUNCTION 'WRITE_FORM'

EXPORTING

ELEMENT = 'HELLO' "execute element /E HELLO

  • FUNCTION = 'SET'

TYPE = 'BODY' "normal output

  • WINDOW = 'MAIN' "to window MAIN

  • IMPORTING

  • PENDING_LINES =

EXCEPTIONS

ELEMENT = 1

FUNCTION = 2

TYPE = 3

UNOPENED = 4

UNSTARTED = 5

WINDOW = 6

BAD_PAGEFORMAT_FOR_PRINT = 7

OTHERS = 8.

************************************************************************

  • Close the current SapScript Form

************************************************************************

CALL FUNCTION 'CLOSE_FORM'

EXCEPTIONS

UNOPENED = 1

BAD_PAGEFORMAT_FOR_PRINT = 2

OTHERS = 3.

<b>refer these links</b>

http://www.thespot4sap.com/articles/SAPscript_Introduction.asp

http://www.idocs.de/www3/cookbooks/sapscript/sapscript_1/example.htm

http://esnips.com/doc/1ff9f8e8-0a4c-42a7-8819-6e3ff9e7ab44/sapscripts.pdf

http://esnips.com/doc/1e487f0c-8009-4ae1-9f9c-c07bd953dbfa/script-command.pdf

http://esnips.com/doc/64d4eccb-e09b-48e1-9be9-e2818d73f074/faqss.pdf

http://esnips.com/doc/cb7e39b4-3161-437f-bfc6-21e6a50e1b39/sscript.pdf

http://esnips.com/doc/fced4d36-ba52-4df9-ab35-b3d194830bbf/symbols-in-scripts.pdf

http://esnips.com/doc/b57e8989-ccf0-40d0-8992-8183be831030/sapscript-how-to-calculate-totals-and-sub...

<b>SAP SCRIPT FIELDS</b>

http://help.sap.com/saphelp_erp2005vp/helpdata/en/d1/8033ea454211d189710000e8322d00/content.htm

<b>scripts easy material----->very good & important

http://www.allsaplinks.com/sap_script_made_easy.html</b>;

<b>Debugging Document.</b>

http://www.cba.nau.edu/haney-j/CIS497/Assignments/Debugging.doc

http://help.sap.com/saphelp_47x200/helpdata/en/c6/617ca9e68c11d2b2ab080009b43351/content.htm

http://www.cba.nau.edu/haney-j/CIS497/Assignments/Debugging.doc

http://help.sap.com/saphelp_erp2005/helpdata/en/b3/d322540c3beb4ba53795784eebb680/frameset.htm

http://help.sap.com/saphelp_nw04/helpdata/en/84/1f624f4505144199e3d570cf7a9225/frameset.htm

http://help.sap.com/saphelp_bw30b/helpdata/en/c6/617ca9e68c11d2b2ab080009b43351/content.htm

http://help.sap.com/saphelp_erp2005/helpdata/en/b3/d322540c3beb4ba53795784eebb680/frameset.htm

regards,

srinivas

<b>*reward for useful answers*</b>