<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic sap script in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/sap-script/m-p/2695899#M623967</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;i am new to sap script. i want to make a print  program for vf03.&lt;/P&gt;&lt;P&gt;can any one give an idea how to start.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 27 Aug 2007 06:39:15 GMT</pubDate>
    <dc:creator>former_member510894</dc:creator>
    <dc:date>2007-08-27T06:39:15Z</dc:date>
    <item>
      <title>sap script</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sap-script/m-p/2695899#M623967</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;i am new to sap script. i want to make a print  program for vf03.&lt;/P&gt;&lt;P&gt;can any one give an idea how to start.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 27 Aug 2007 06:39:15 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sap-script/m-p/2695899#M623967</guid>
      <dc:creator>former_member510894</dc:creator>
      <dc:date>2007-08-27T06:39:15Z</dc:date>
    </item>
    <item>
      <title>Re: sap script</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sap-script/m-p/2695900#M623968</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SAPScripts&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Link for SAP Scripts (step by step procedure)&lt;/P&gt;&lt;P&gt;&lt;A href="http://smoschid.tripod.com/How_to_do_things_in_SAP/How_To_Create_A_SAPSCRIPT_Form/How_to_Create_SAPSCRIPT.html" target="test_blank"&gt;http://smoschid.tripod.com/How_to_do_things_in_SAP/How_To_Create_A_SAPSCRIPT_Form/How_to_Create_SAPSCRIPT.html&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://esnips.com/doc/1ff9f8e8-0a4c-42a7-8819-6e3ff9e7ab44/sapscripts.pdf" target="test_blank"&gt;http://esnips.com/doc/1ff9f8e8-0a4c-42a7-8819-6e3ff9e7ab44/sapscripts.pdf&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://esnips.com/doc/1e487f0c-8009-4ae1-9f9c-c07bd953dbfa/script-command.pdf" target="test_blank"&gt;http://esnips.com/doc/1e487f0c-8009-4ae1-9f9c-c07bd953dbfa/script-command.pdf&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://esnips.com/doc/64d4eccb-e09b-48e1-9be9-e2818d73f074/faqss.pdf" target="test_blank"&gt;http://esnips.com/doc/64d4eccb-e09b-48e1-9be9-e2818d73f074/faqss.pdf&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://esnips.com/doc/cb7e39b4-3161-437f-bfc6-21e6a50e1b39/sscript.pdf" target="test_blank"&gt;http://esnips.com/doc/cb7e39b4-3161-437f-bfc6-21e6a50e1b39/sscript.pdf&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://esnips.com/doc/fced4d36-ba52-4df9-ab35-b3d194830bbf/symbols-in-scripts.pdf" target="test_blank"&gt;http://esnips.com/doc/fced4d36-ba52-4df9-ab35-b3d194830bbf/symbols-in-scripts.pdf&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://esnips.com/doc/b57e8989-ccf0-40d0-8992-8183be831030/sapscript-how-to-calculate-totals-and-subtotals.htm" target="test_blank"&gt;http://esnips.com/doc/b57e8989-ccf0-40d0-8992-8183be831030/sapscript-how-to-calculate-totals-and-subtotals.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SAP SCRIPT FIELDS&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://help.sap.com/saphelp_erp2005vp/helpdata/en/d1/8033ea454211d189710000e8322d00/content.htm" target="test_blank"&gt;http://help.sap.com/saphelp_erp2005vp/helpdata/en/d1/8033ea454211d189710000e8322d00/content.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;scripts easy material&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.allsaplinks.com/sap_script_made_easy.html" target="test_blank"&gt;http://www.allsaplinks.com/sap_script_made_easy.html&lt;/A&gt; &lt;/P&gt;&lt;P&gt;DIFFERENCE BETWEEN SMARTFORMS AND SAPSCRIPTS ARE:&lt;/P&gt;&lt;P&gt;1. script is client dependent one while smartform is client independent.&lt;/P&gt;&lt;P&gt;2. In scripts we have to write print program while in smart forms it is not necessary.&lt;/P&gt;&lt;P&gt;3. In scripts we can print background logo while in smartforms we cant print background logo&lt;/P&gt;&lt;P&gt;4. In scripts we have 99 main windows while in smartforms we have only 1 main window.&lt;/P&gt;&lt;P&gt;5. In scripts we should write paragraph format otherwise we cant execute program while in smartforms no need to create paragraph formats .&lt;/P&gt;&lt;P&gt;6. In scripts we can print the text in only two character formats.&lt;/P&gt;&lt;P&gt;while in smartforms we can do with more.&lt;/P&gt;&lt;P&gt;7. In scripts we dont have line types while in smartforms we have linetypes. &lt;/P&gt;&lt;P&gt;8.Multiple page formats are possible in smartforms which is not the case in SAPScripts &lt;/P&gt;&lt;P&gt;9.It is possible to have a smartform without a main window . &lt;/P&gt;&lt;P&gt;10.Labels cannot be created in smartforms. &lt;/P&gt;&lt;P&gt;11.Routines can be written in smartforms tool. &lt;/P&gt;&lt;P&gt;12.Smartforms generates a function module when activated. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SAPscript technology is based on a mainframe product from the 1980s, while Smart Forms have only been around since (roughly) 2001. With that sort of time gap, there are bound to be significant differences between the two tools. Client dependence is a fundamental one. Although SAPscript has had some incremental improvements over time, its forms have always been -- under the hood -- relatively ... &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;also refer&lt;/P&gt;&lt;P&gt;&lt;A class="jive_macro jive_macro_message" href="https://community.sap.com/" __jive_macro_name="message" modifiedtitle="true" __default_attr="3000244"&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A class="jive_macro jive_macro_message" href="https://community.sap.com/" __jive_macro_name="message" modifiedtitle="true" __default_attr="2171545"&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A class="jive_macro jive_macro_message" href="https://community.sap.com/" __jive_macro_name="message" modifiedtitle="true" __default_attr="3139710"&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Whenever a smartform is created, a funciton module gets generated. So, we can access the smartform in different clients. But in case of scripts, it is not so.. So, scripts are client dependent.&lt;/P&gt;&lt;P&gt;Smart Forms are implemented using the Function Module SSF*, and all the logic lies in the FM. Function Modules are client independent objects, so Smart forms are also client independent&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SAP Scripts are the Layout Forms that you design and there are aviable in the client in which you have created them, for making them available you have to copy across the clients.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Because, Sapscripts are saved in ITF format as text in client dependant tables STXH and STXL. smartforms are not saved in client dependant tables and visible across clients.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SAPscript technology is based on a mainframe product from the 1980s, while Smart Forms have only been around since (roughly) 2001. With that sort of time gap, there are bound to be significant differences between the two tools. As you have noted correctly, client dependence is a fundamental one. &lt;/P&gt;&lt;P&gt;Although SAPscript has had some incremental improvements over time, its forms have always been -- under the hood -- relatively passive objects, with minimal embedded logic. These forms were designed to be driven and controlled by ABAP programs, much in the way ABAP programs read in database tables to produce reports; if you ever download a SAPscript form (e.g., via utility program RSTXSCRP), and look at the portable text file it produces you'll see what I mean. Many text objects (e.g., invoice header texts) are bound directly to documents which are client-dependent, so it makes sense for these text objects to also be client-dependent. From a complexity standpoint, SAPscript forms are close enough to these text objects where I can see how it made sense at the time to make them client-dependent too.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Conversely, a Smart Form is significantly more robust and complex. For instance, it can contain program nodes and nested tables with patterns. When a Smart Form is compiled, it generates an ABAP function module &amp;#150; and these are always client-independent. This is appropriate, given that this form has more in common with an ABAP program than its predecessor. For instance, when a print program calls a Smart Form, the form itself takes over to produce output, without any further direction from the print program. In fact, the join is so seamless that I often find myself using a Smart Form's Initialization section for logic to handle any data gathering not handled by the print program. I would never even think to attempt this with SAPscript.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I suspect several factors figured into SAP's decision to make Smart Forms client-independent, including customer feedback. There are significant advantages to client-independence. For instance, a change made in one development client happens immediately across all development clients. Among other things, this means we don't have to waste time figuring which client contains the most recent version -- they all do! In addition, transporting Smart Forms is easier, since we can safely bundle them together in the same transport as their client-independent print programs (no worry about mixing client-dependent and independent objects). &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Structure of a print program&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;OPEN_FORM function&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CLOSE_FORM function&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;WRITE_FORM&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;START_FORM function&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;END_FORM function&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CONTROL_FORM function&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The print program is used to print forms. The program retieves the necesary data from datbase tables, defines the order of in which text elements are printed, chooses a form for printing and selects an output device and print options. &lt;/P&gt;&lt;P&gt;Function modules in a printprogram:&lt;/P&gt;&lt;P&gt;&amp;#149; When you print a form you must used the staments OPEN_FORM and CLOSE_FORM. To combine forms into a single spool request use START_FORM and END_FORM. &lt;/P&gt;&lt;P&gt;&amp;#149; To print textelements in a form use WRITE_FORM. The order in which the textelements are printed, is determined by the order of the WRITE_FORM statements. Note: for printing lines in the body, you can also use the WRITE_FORM_LINES function module. &lt;/P&gt;&lt;P&gt;&amp;#149; To transfer control command to a form use CONTROL_FORM. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Structure of a print program&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Read data&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;Tables: xxx.&lt;/P&gt;&lt;P&gt;SELECT *&lt;/P&gt;&lt;P&gt;FROM xxx.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Open form printing - Must be called before working with any of the other form function modules.&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Must be ended with function module CLOSE FORM &lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;call function 'OPEN_FORM'.....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;To begin several indentical forms containing different data within a single spool request, begin each form using START_FORM, and end it using END_FORM&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;call funtion 'START_FORM'.....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Write text elements to a window of the form&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;call function 'WRITE_FORM'.....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Ends spool request started with START_FORM&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;call funtion 'END_FORM'.....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Closes form printing&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;call function 'CLOSE_FORM'...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;OPEN_FORM function&lt;/P&gt;&lt;P&gt;Syntax:&lt;/P&gt;&lt;P&gt;CALL FUNCTION 'OPEN_FORM'&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;EXPORTING&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;APPLICATION = 'TX'&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;ARCHIVE_INDEX =&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;ARCHIVE_PARAMS =&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;DEVICE = 'PRINTER'&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;DIALOG = 'X'&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;FORM = ' '&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;LANGUAGE = SY-LANGU&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;OPTIONS =&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;MAIL_SENDER =&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;MAIL_RECIPIENT =&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;MAIL_APPL_OBJECT =&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;RAW_DATA_INTERFACE = '*'&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;IMPORTING&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;LANGUAGE =&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;NEW_ARCHIVE_PARAMS =&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;RESULT =&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;EXCEPTIONS&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;CANCELED = 1&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;DEVICE = 2&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;FORM = 3&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;OPTIONS = 4&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;UNCLOSED = 5&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;MAIL_OPTIONS = 6&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;ARCHIVE_ERROR = 7&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;INVALID_FAX_NUMBER = 8&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;MORE_PARAMS_NEEDED_IN_BATCH = 9&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;SPOOL_ERROR = 10&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;OTHERS = 11&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;.&lt;/P&gt;&lt;P&gt;IF sy-subrc &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;Some important parameters:&lt;/P&gt;&lt;P&gt;FORM Name of the form&lt;/P&gt;&lt;P&gt;DEVICE &amp;#149; PRINTER : Print output using spool &lt;/P&gt;&lt;P&gt;&amp;#149; TELEFAX: Fax output &lt;/P&gt;&lt;P&gt;&amp;#149; SCREEN: Output to screen &lt;/P&gt;&lt;P&gt;OPTIONS Used to control attrubutes for printing or faxing (Number of copies, immediate output....&lt;/P&gt;&lt;P&gt;The input for the parameter is structure ITCPO.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CLOSE_FORM function&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CALL FUNCTION 'CLOSE_FORM'&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;IMPORTING&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;RESULT =&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;RDI_RESULT =&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;TABLES&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;OTFDATA =&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;EXCEPTIONS&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;UNOPENED = 1&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;BAD_PAGEFORMAT_FOR_PRINT = 2&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;SEND_ERROR = 3&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;SPOOL_ERROR = 4&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;OTHERS = 5&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;.&lt;/P&gt;&lt;P&gt;IF sy-subrc &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;Paramerters:&lt;/P&gt;&lt;P&gt;RESULT Returns status information and print/fax parameters after the form has been printed. RESULT is of structure ITCPP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;WRITE_FORM function&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CALL FUNCTION 'WRITE_FORM'&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;EXPORTING&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;ELEMENT = ' '&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;FUNCTION = 'SET'&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;TYPE = 'BODY'&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;WINDOW = 'MAIN'&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;IMPORTING&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;PENDING_LINES =&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;EXCEPTIONS&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;ELEMENT = 1&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;FUNCTION = 2&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;TYPE = 3&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;UNOPENED = 4&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;UNSTARTED = 5&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;WINDOW = 6&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;BAD_PAGEFORMAT_FOR_PRINT = 7&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;SPOOL_ERROR = 8&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;OTHERS = 9&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;.&lt;/P&gt;&lt;P&gt;IF sy-subrc &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;Some important parameters:&lt;/P&gt;&lt;P&gt;ELEMENT Specifies which textelement is printed&lt;/P&gt;&lt;P&gt;WINDOW Specifies which window is printed&lt;/P&gt;&lt;P&gt;TYPE Specifies the output area of the main window. This can be:&lt;/P&gt;&lt;P&gt;&amp;#149; TOP - Used for headers &lt;/P&gt;&lt;P&gt;&amp;#149; BODY &lt;/P&gt;&lt;P&gt;&amp;#149; BOTTOM - Used for footers &lt;/P&gt;&lt;P&gt;FUNCTION Specifies whether text is to be appended, replaced or added&lt;/P&gt;&lt;P&gt;Example of how to use the WRITE_FORM function module together with a script.&lt;/P&gt;&lt;P&gt;Form layout of the MAIN window&lt;/P&gt;&lt;P&gt;/E INTRODUCTION&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Dear Customer&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;...........................&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/E ITEM_HEADER&lt;/P&gt;&lt;P&gt;IH Carrier, Departure&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/E ITEM_LINE&lt;/P&gt;&lt;P&gt;IL &amp;amp;SBOOK-CARRID&amp;amp;, &amp;amp;SPFLI-DEPTIME&amp;amp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/E CLOSING_REMARK&lt;/P&gt;&lt;P&gt;The print program&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Writing INTRODUCTION&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;CALL FUNCTION 'WRITE_FORM'&lt;/P&gt;&lt;P&gt;EXPORTING&lt;/P&gt;&lt;P&gt;ELEMENT = 'INTRODUCTION'&lt;/P&gt;&lt;P&gt;FUNCTION = 'SET'&lt;/P&gt;&lt;P&gt;TYPE = 'BODY'&lt;/P&gt;&lt;P&gt;WINDOW = 'MAIN'&lt;/P&gt;&lt;P&gt;EXCEPTIONS&lt;/P&gt;&lt;P&gt;OTHERS = 8&lt;/P&gt;&lt;P&gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Writing ITEM_HEADER&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;CALL FUNCTION 'WRITE_FORM'&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;EXPORTING&lt;/P&gt;&lt;P&gt;ELEMENT = 'ITEM_HEADER'&lt;/P&gt;&lt;P&gt;FUNCTION = 'SET'&lt;/P&gt;&lt;P&gt;TYPE = 'BODY'&lt;/P&gt;&lt;P&gt;WINDOW = 'MAIN'&lt;/P&gt;&lt;P&gt;EXCEPTIONS&lt;/P&gt;&lt;P&gt;OTHERS = 8&lt;/P&gt;&lt;P&gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Set ITEM_HEADER into TOP area of main window for subsequent pages&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;CALL FUNCTION 'WRITE_FORM'&lt;/P&gt;&lt;P&gt;EXPORTING&lt;/P&gt;&lt;P&gt;ELEMENT = 'ITEM_HEADER'&lt;/P&gt;&lt;P&gt;FUNCTION = 'SET'&lt;/P&gt;&lt;P&gt;TYPE = 'TOP'&lt;/P&gt;&lt;P&gt;WINDOW = 'MAIN'&lt;/P&gt;&lt;P&gt;EXCEPTIONS&lt;/P&gt;&lt;P&gt;OTHERS = 8&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Write ITEM_LINE&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;LOOP AT .....&lt;/P&gt;&lt;P&gt;CALL FUNCTION 'WRITE_FORM'&lt;/P&gt;&lt;P&gt;EXPORTING&lt;/P&gt;&lt;P&gt;ELEMENT = 'ITEM_LINE'&lt;/P&gt;&lt;P&gt;FUNCTION = 'SET'&lt;/P&gt;&lt;P&gt;TYPE = 'BODY'&lt;/P&gt;&lt;P&gt;WINDOW = 'MAIN'&lt;/P&gt;&lt;P&gt;EXCEPTIONS&lt;/P&gt;&lt;P&gt;OTHERS = 8.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ENDLOOP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Delete ITEM_HEADER from TOP area of main window&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;CALL FUNCTION 'WRITE_FORM'&lt;/P&gt;&lt;P&gt;EXPORTING&lt;/P&gt;&lt;P&gt;ELEMENT = 'ITEM_HEADER'&lt;/P&gt;&lt;P&gt;FUNCTION = 'DELETE'&lt;/P&gt;&lt;P&gt;TYPE = 'TOP'&lt;/P&gt;&lt;P&gt;WINDOW = 'MAIN'&lt;/P&gt;&lt;P&gt;EXCEPTIONS&lt;/P&gt;&lt;P&gt;OTHERS = 8&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Print CLOSING_REMARK&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;CALL FUNCTION 'WRITE_FORM'&lt;/P&gt;&lt;P&gt;EXPORTING&lt;/P&gt;&lt;P&gt;ELEMENT = 'CLOSING_REMARK'&lt;/P&gt;&lt;P&gt;FUNCTION = 'SET'&lt;/P&gt;&lt;P&gt;TYPE = 'BODY'&lt;/P&gt;&lt;P&gt;WINDOW = 'MAIN'&lt;/P&gt;&lt;P&gt;EXCEPTIONS&lt;/P&gt;&lt;P&gt;OTHERS = 8&lt;/P&gt;&lt;P&gt;START_FORM function&lt;/P&gt;&lt;P&gt;CALL FUNCTION 'START_FORM'&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;EXPORTING&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;ARCHIVE_INDEX =&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;FORM = ' '&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;LANGUAGE = ' '&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;STARTPAGE = ' '&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;PROGRAM = ' '&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;MAIL_APPL_OBJECT =&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;IMPORTING&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;LANGUAGE =&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;EXCEPTIONS&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;FORM = 1&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;FORMAT = 2&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;UNENDED = 3&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;UNOPENED = 4&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;UNUSED = 5&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;SPOOL_ERROR = 6&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;OTHERS = 7&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;.&lt;/P&gt;&lt;P&gt;IF sy-subrc &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;END_FORM function&lt;/P&gt;&lt;P&gt;CALL FUNCTION 'END_FORM'&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;IMPORTING&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;RESULT =&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;EXCEPTIONS&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;UNOPENED = 1&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;BAD_PAGEFORMAT_FOR_PRINT = 2&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;SPOOL_ERROR = 3&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;OTHERS = 4&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;.&lt;/P&gt;&lt;P&gt;IF sy-subrc &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CONTROL_FORM function&lt;/P&gt;&lt;P&gt;The CONTROL_FORM function module alows you to create SapScript control statements from within an APAB program.&lt;/P&gt;&lt;P&gt;Syntax:&lt;/P&gt;&lt;P&gt;CALL FUNCTION 'CONTROL_FORM'&lt;/P&gt;&lt;P&gt;EXPORTING&lt;/P&gt;&lt;P&gt;command =&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;EXCEPTIONS&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;UNOPENED = 1&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;UNSTARTED = 2&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;OTHERS = 3&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;.&lt;/P&gt;&lt;P&gt;IF sy-subrc &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;Example:&lt;/P&gt;&lt;P&gt;Protecting the text element ITEM_LINE&lt;/P&gt;&lt;P&gt;CALL FUNCTION 'CONTROL_FORM'&lt;/P&gt;&lt;P&gt;EXPORTING&lt;/P&gt;&lt;P&gt;COMMAND = 'PROTECT'.&lt;/P&gt;&lt;P&gt;CALL FUNCTION 'WRITE_FORM'&lt;/P&gt;&lt;P&gt;EXPORTING&lt;/P&gt;&lt;P&gt;TEXELEMENT = 'ITEM_LINE'.&lt;/P&gt;&lt;P&gt;CALL FUNCTION 'CONTROL_FORM'&lt;/P&gt;&lt;P&gt;EXPORTING&lt;/P&gt;&lt;P&gt;COMMAND = 'ENDPROTECT'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;Reward points for useful Answers&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Ravish Garg&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 27 Aug 2007 06:43:09 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sap-script/m-p/2695900#M623968</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-08-27T06:43:09Z</dc:date>
    </item>
  </channel>
</rss>

