SlideShare ist ein Scribd-Unternehmen logo
1 von 20
SAPScript - Output Program
Dec-2008 SAPScript - Output Program |
Objectives
• The participants will :
– Analyze the Function Modules OPEN_FORM ,
WRITE_FORM , CLOSE_FORM etc. used in the
output program to work with the SAPScripts.
Dec-2008 SAPScript - Output Program | 2
Output Program - Overview
• Program retrieves the data to be printed in a SAPScript
Form.
• Structure of Programs
– Stand alone
– Transaction Triggered
• Communication in between program and SAPScript Form is
done via execution of function calls and communication
structures.
• Execution sequence of function calls
– A SAPScript Form must be opened before being able to output
data.
– Data can be transfer as often as required.
– At the end, the SAPScript Form has to be closed.
Dec-2008 SAPScript - Output Program | 3
Output Program - Function Call
• General Function calls:
– CALL FUNCTION ‘ OPEN_FORM ’.
– CALL FUNCTION ‘ WRITE_FORM ’.
– CALL FUNCTION ‘ CLOSE_FORM ’.
– CALL FUNCTION ‘ CONTROL_FORM ’.
– CALL FUNCTION ‘ READ_TEXT ’.
Dec-2008 SAPScript - Output Program | 4
Output Program - Function Call
‘OPEN_FORM’
Dec-2008 SAPScript - Output Program | 5
»CALL FUNCTION ‘ OPEN_FORM ’
EXPORTING
FORM = ..
LANGUAGE = ..
DEVICE = ..
OPTIONS = ..
DIALOG = ..
APPLICATION= ..
IMPORTING
LANGUAGE = ..
EXCEPTIONS …..
Output Program - Function Call
‘OPEN_FORM’
Dec-2008 SAPScript - Output Program | 6
 OPEN_FORM opens SAPScript Form for Printing .
 Parameters
 LANGUAGE defines the SAPScript Form language version .
 DEVICE specifies the output device type .( Example : PRINTER, SCREEN, TELEX,
TELEFAX)
 OPTIONS can be used to specify the print preview.
 DIALOG can request a pop-up screen on which user can enter spool information such
as printer name.
 FORM is used to specify the name of the SAPScript Form to be used.
Output Program - Function Call
‘OPEN_FORM’
• Possible Exceptions :
– DEVICE= Device type invalid
– FORM = SAPScript Form does not exist
– OPTIONS = Options invalid
– UNCLOSED = A SAPScript Form is still active
Dec-2008 SAPScript - Output Program | 7
Output Program - Function Call
‘WRITE_FORM’
Dec-2008 SAPScript - Output Program | 8
CALL FUNCTION ‘ WRITE_FORM ’
EXPORTING
ELEMENT = ..
TYPE = ..
FUNCTION = ..
WINDOW = ..
EXCEPTIONS …..
Output Program - Function Call
‘WRITE_FORM’
Dec-2008 SAPScript - Output Program | 9
 WRITE_FORM transfer the data to the SAPScript Form.
 Parameters
 Explicitly specify ELEMENT and WINDOW name to output data to a specific ELEMENT
with in a WINDOW.
 No specification of WINDOW name is necessary for MAIN window.
 TYPE defines area of the MAIN window, where data need to written. Possible values :
 TOP = MAIN window header.
 BOTTOM = MAIN window footer.
 BODY = MAIN window normal output area (Default).
Output Program - Function Call
‘WRITE_FORM’
• FUNCTION defines how the data specified in the text
element is to be written in the respective WINDOW.
– MAIN window
• SET = Append to preceding output.
• APPEND = Identical with SET.
• DELETE = Ineffective.
– OTHER window
• SET = Delete old contents and output new text.
• APPEND = Append to preceding output.
• DELETE = Delete the specified text element.
– Default is SET
Dec-2008 SAPScript - Output Program | 10
Output Program - Function Call
‘WRITE_FORM’
• Possible Exceptions :
– ELEMENT = Text does not exist.
– FUNCTION = Function is invalid.
– TYPE = Window area is invalid.
– WINDOW = Window does not exist.
– UNOPENED = SAPScript Form printing not
opened.
Dec-2008 SAPScript - Output Program | 11
Output Program - Function Call
‘CLOSE_FORM’• SAPScript Form opened with function
‘OPEN_FORM’ is closed.
• SAPScript must be closed before being
able to output the data on the screen
or printer.
• Possible exceptions :
– UNOPENED = No open SAPScript Form.
Dec-2008 SAPScript - Output Program | 12
CALL FUNCTION 'CLOSE_FORM'
* IMPORTING
* RESULT =
* RDI_RESULT =
* TABLES
* OTFDATA =
* EXCEPTIONS
* UNOPENED = 1
* BAD_PAGEFORMAT_FOR_PRINT = 2
* SEND_ERROR = 3
* SPOOL_ERROR = 4
* CODEPAGE = 5
* OTHERS = 6.
Output Program - Function Call
‘CONTROL_FORM’
• ‘CONTROL_FORM’ can execute SAPScript
control commands.
• Example : PROTECT … ENDPROTECT.
• Parameter COMMAND accept the SAPScript
command.
• Possible exceptions :
– UNOPENED = SAPScript Form printing has not
been opened.
– UNSTARTED = No SAPScript Form opened
Dec-2008 SAPScript - Output Program | 13
Output Program - Function Call
‘READ_TEXT’CALL FUNCTION ‘ READ_TEXT ’
EXPORTING
OBJECT = ..
NAME = ..
ID = ..
LANGUAGE = ..
IMPORTING
HEADER = ..
TABLES
LINES = ..
EXCEPTIONS …..
Dec-2008 SAPScript - Output Program | 14
Output Program - Function Call
‘READ_TEXT’
Dec-2008 SAPScript - Output Program | 15
 An application text can be read from text file. HEADER and LINES contain header
and text information after successful execution.
 Work area for header must be defined as a field string.
DATA BEGIN OF HEADER
INCLUDE STRUCTURE THEAD
DATA END OF HEADER
 Work area for text lines must be defined as an internal table.
DATA BEGIN OF LINES OCCURS ...
INCLUDE STRUCTURE TLINE
DATA END OF HEADER
Output Program - Function Call
‘READ_TEXT’
Dec-2008 SAPScript - Output Program | 16
 Possible Exceptions :
 ID = Text ID invalid.
 LANGUAGE = Language invalid.
 NAME = Text name invalid.
 NOT_FOUND = Text not found.
 OBJECT = Text object invalid.
 REFERENCE_CHECK = Reference sequence interrupted.
Demonstration
• Creating an output program using the
SAPScript function modules OPEN_FORM ,
WRITE_FORM , CLOSE_FORM.
Dec-2008 SAPScript - Output Program | 17
Practice
• Creating an output program using the
SAPScript function modules OPEN_FORM ,
WRITE_FORM , CLOSE_FORM.
Dec-2008 SAPScript - Output Program | 18
Summary
• An output program is required to retrieve
data to be printed in SAPScript forms.
• The general function-modules used in
SAPScript forms are : OPEN_FORM
WRITE_FORM , CLOSE_FORM,
CONTROL_FORM , READ_TEXT.
• The ‘OPEN_FORM’ function-module opens the
SAPScript Form for Printing .
• The ‘WRITE_FORM’ function-module transfer
the data to the SAPScript Form.Dec-2008 SAPScript - Output Program | 19
Questions
• What is the purpose of the output program ?
• What is the function-module required to
transfer data to the SAPScript form ?
• What is the use of the ‘CLOSE_FORM’
function-module ?
Dec-2008 SAPScript - Output Program | 20

Weitere ähnliche Inhalte

Was ist angesagt?

Sap User Exit for Functional Consultant
Sap User Exit for Functional ConsultantSap User Exit for Functional Consultant
Sap User Exit for Functional ConsultantAnkit Sharma
 
01. sap fi co training
01. sap fi co training01. sap fi co training
01. sap fi co trainingadityafico
 
SAP PI Sheet integration with DMS(Document Management System)
SAP PI Sheet integration with DMS(Document Management System)SAP PI Sheet integration with DMS(Document Management System)
SAP PI Sheet integration with DMS(Document Management System)Ankit Sharma
 
Bdc BATCH DATA COMMUNICATION
Bdc BATCH DATA COMMUNICATIONBdc BATCH DATA COMMUNICATION
Bdc BATCH DATA COMMUNICATIONHitesh Gulani
 
0103 navigation
0103 navigation0103 navigation
0103 navigationvkyecc1
 
Closingcockpit
ClosingcockpitClosingcockpit
Closingcockpitadityafico
 
Sap step-by-step-navigation-guide-for-beginners
Sap step-by-step-navigation-guide-for-beginnersSap step-by-step-navigation-guide-for-beginners
Sap step-by-step-navigation-guide-for-beginnersHossam Abdo
 
Enhancement technique how to use validations
Enhancement technique how to use validationsEnhancement technique how to use validations
Enhancement technique how to use validationsUgeshkumarnetha Dasari
 
3logo Survey Charts
3logo Survey Charts3logo Survey Charts
3logo Survey Chartslees_ush
 
Sap abap training Overview
Sap abap training OverviewSap abap training Overview
Sap abap training Overviewraviadm100
 
SapInsideTrackBonn Sap&Adobe
SapInsideTrackBonn   Sap&AdobeSapInsideTrackBonn   Sap&Adobe
SapInsideTrackBonn Sap&Adobesergio.ferrari
 
SAP GUI and Navigation - Quick Guide
SAP GUI and Navigation - Quick Guide SAP GUI and Navigation - Quick Guide
SAP GUI and Navigation - Quick Guide Ankit Sharma
 
SAP Foundations and Navigation
SAP Foundations and Navigation SAP Foundations and Navigation
SAP Foundations and Navigation K Singh
 
Basic guide of sap
Basic guide of sapBasic guide of sap
Basic guide of sapRamesh Kumar
 

Was ist angesagt? (20)

Sap User Exit for Functional Consultant
Sap User Exit for Functional ConsultantSap User Exit for Functional Consultant
Sap User Exit for Functional Consultant
 
Sap navigation 2013
Sap navigation 2013Sap navigation 2013
Sap navigation 2013
 
01. sap fi co training
01. sap fi co training01. sap fi co training
01. sap fi co training
 
SAP PI Sheet integration with DMS(Document Management System)
SAP PI Sheet integration with DMS(Document Management System)SAP PI Sheet integration with DMS(Document Management System)
SAP PI Sheet integration with DMS(Document Management System)
 
Smart form
Smart formSmart form
Smart form
 
Bdc BATCH DATA COMMUNICATION
Bdc BATCH DATA COMMUNICATIONBdc BATCH DATA COMMUNICATION
Bdc BATCH DATA COMMUNICATION
 
0103 navigation
0103 navigation0103 navigation
0103 navigation
 
Closingcockpit
ClosingcockpitClosingcockpit
Closingcockpit
 
Chapter 03 sap navigation
Chapter 03 sap navigationChapter 03 sap navigation
Chapter 03 sap navigation
 
Sap step-by-step-navigation-guide-for-beginners
Sap step-by-step-navigation-guide-for-beginnersSap step-by-step-navigation-guide-for-beginners
Sap step-by-step-navigation-guide-for-beginners
 
Enhancement technique how to use validations
Enhancement technique how to use validationsEnhancement technique how to use validations
Enhancement technique how to use validations
 
Sap Adobe Form
Sap Adobe FormSap Adobe Form
Sap Adobe Form
 
3logo Survey Charts
3logo Survey Charts3logo Survey Charts
3logo Survey Charts
 
Sap overview
Sap overviewSap overview
Sap overview
 
Sap abap training Overview
Sap abap training OverviewSap abap training Overview
Sap abap training Overview
 
SapInsideTrackBonn Sap&Adobe
SapInsideTrackBonn   Sap&AdobeSapInsideTrackBonn   Sap&Adobe
SapInsideTrackBonn Sap&Adobe
 
SAP GUI and Navigation - Quick Guide
SAP GUI and Navigation - Quick Guide SAP GUI and Navigation - Quick Guide
SAP GUI and Navigation - Quick Guide
 
SAP Foundations and Navigation
SAP Foundations and Navigation SAP Foundations and Navigation
SAP Foundations and Navigation
 
Basic guide of sap
Basic guide of sapBasic guide of sap
Basic guide of sap
 
Bte
BteBte
Bte
 

Ähnlich wie Chapter 04 sap script - output program

Looking for best Sap abap training institute in Chennai
Looking for best Sap abap training institute in ChennaiLooking for best Sap abap training institute in Chennai
Looking for best Sap abap training institute in ChennaiRaja AMEKS Infotech
 
SAP BI Generic Extraction Using a Function Module.pdf
SAP BI Generic Extraction Using a Function Module.pdfSAP BI Generic Extraction Using a Function Module.pdf
SAP BI Generic Extraction Using a Function Module.pdfKoushikGuna
 
ERP Magazine April 2018 Issue 1
ERP Magazine April 2018 Issue 1 ERP Magazine April 2018 Issue 1
ERP Magazine April 2018 Issue 1 Rehan Zaidi
 
ERP Magazine April 2018 - The magazine for SAP ABAP Professionals
ERP Magazine April 2018 - The magazine for SAP ABAP ProfessionalsERP Magazine April 2018 - The magazine for SAP ABAP Professionals
ERP Magazine April 2018 - The magazine for SAP ABAP ProfessionalsRehan Zaidi
 
sap abap training in chennai
sap abap training in chennaisap abap training in chennai
sap abap training in chennaisanjai rsamy
 
Chapter 5 modularization & catch statement (paradiso-a45b1d's conflicted co...
Chapter 5   modularization & catch statement (paradiso-a45b1d's conflicted co...Chapter 5   modularization & catch statement (paradiso-a45b1d's conflicted co...
Chapter 5 modularization & catch statement (paradiso-a45b1d's conflicted co...marco_paradiso
 
Abap function module help
Abap function module helpAbap function module help
Abap function module helpKranthi Kumar
 
Chapter 01 user exits
Chapter 01 user exitsChapter 01 user exits
Chapter 01 user exitsKranthi Kumar
 
Complete reference to_abap_basics
Complete reference to_abap_basicsComplete reference to_abap_basics
Complete reference to_abap_basicsAbhishek Dixit
 
Custom Forms and Configuration Forms in Drupal 8
Custom Forms and Configuration Forms in Drupal 8Custom Forms and Configuration Forms in Drupal 8
Custom Forms and Configuration Forms in Drupal 8Italo Mairo
 
Managing cash flow in Primavera P6 - Oracle Primavera P6 Collaborate 14
Managing cash flow in Primavera P6 - Oracle Primavera P6 Collaborate 14Managing cash flow in Primavera P6 - Oracle Primavera P6 Collaborate 14
Managing cash flow in Primavera P6 - Oracle Primavera P6 Collaborate 14p6academy
 
Smartforms interview questions with answers
Smartforms interview questions with answersSmartforms interview questions with answers
Smartforms interview questions with answersUttam Agrawal
 

Ähnlich wie Chapter 04 sap script - output program (20)

Sap scripts
Sap scriptsSap scripts
Sap scripts
 
Sap abap
Sap abapSap abap
Sap abap
 
Looking for best Sap abap training institute in Chennai
Looking for best Sap abap training institute in ChennaiLooking for best Sap abap training institute in Chennai
Looking for best Sap abap training institute in Chennai
 
SAP Adobe forms
SAP Adobe formsSAP Adobe forms
SAP Adobe forms
 
SAP BI Generic Extraction Using a Function Module.pdf
SAP BI Generic Extraction Using a Function Module.pdfSAP BI Generic Extraction Using a Function Module.pdf
SAP BI Generic Extraction Using a Function Module.pdf
 
ERP Magazine April 2018 Issue 1
ERP Magazine April 2018 Issue 1 ERP Magazine April 2018 Issue 1
ERP Magazine April 2018 Issue 1
 
ERP Magazine April 2018 - The magazine for SAP ABAP Professionals
ERP Magazine April 2018 - The magazine for SAP ABAP ProfessionalsERP Magazine April 2018 - The magazine for SAP ABAP Professionals
ERP Magazine April 2018 - The magazine for SAP ABAP Professionals
 
Abap sample
Abap sampleAbap sample
Abap sample
 
sap abap training in chennai
sap abap training in chennaisap abap training in chennai
sap abap training in chennai
 
Chapter 5 modularization & catch statement (paradiso-a45b1d's conflicted co...
Chapter 5   modularization & catch statement (paradiso-a45b1d's conflicted co...Chapter 5   modularization & catch statement (paradiso-a45b1d's conflicted co...
Chapter 5 modularization & catch statement (paradiso-a45b1d's conflicted co...
 
Abap function module help
Abap function module helpAbap function module help
Abap function module help
 
Alv theory
Alv theoryAlv theory
Alv theory
 
Chapter 01 user exits
Chapter 01 user exitsChapter 01 user exits
Chapter 01 user exits
 
Batch input session
Batch input sessionBatch input session
Batch input session
 
Complete reference to_abap_basics
Complete reference to_abap_basicsComplete reference to_abap_basics
Complete reference to_abap_basics
 
12 Smartforms. .pptx
12 Smartforms.                     .pptx12 Smartforms.                     .pptx
12 Smartforms. .pptx
 
Custom Forms and Configuration Forms in Drupal 8
Custom Forms and Configuration Forms in Drupal 8Custom Forms and Configuration Forms in Drupal 8
Custom Forms and Configuration Forms in Drupal 8
 
Managing cash flow in Primavera P6 - Oracle Primavera P6 Collaborate 14
Managing cash flow in Primavera P6 - Oracle Primavera P6 Collaborate 14Managing cash flow in Primavera P6 - Oracle Primavera P6 Collaborate 14
Managing cash flow in Primavera P6 - Oracle Primavera P6 Collaborate 14
 
Dbms fast track 2/3
Dbms fast track 2/3Dbms fast track 2/3
Dbms fast track 2/3
 
Smartforms interview questions with answers
Smartforms interview questions with answersSmartforms interview questions with answers
Smartforms interview questions with answers
 

Mehr von Kranthi Kumar

Creating simple comp
Creating simple compCreating simple comp
Creating simple compKranthi Kumar
 
Controllers and context programming
Controllers and context programmingControllers and context programming
Controllers and context programmingKranthi Kumar
 
Binding,context mapping,navigation exercise
Binding,context mapping,navigation exerciseBinding,context mapping,navigation exercise
Binding,context mapping,navigation exerciseKranthi Kumar
 
Web(abap introduction)
Web(abap introduction)Web(abap introduction)
Web(abap introduction)Kranthi Kumar
 
BATCH DATA COMMUNICATION
BATCH DATA COMMUNICATIONBATCH DATA COMMUNICATION
BATCH DATA COMMUNICATIONKranthi Kumar
 
Call transaction method
Call transaction methodCall transaction method
Call transaction methodKranthi Kumar
 
Using folder options for page protection
Using folder options for page protectionUsing folder options for page protection
Using folder options for page protectionKranthi Kumar
 
Version it satya_dev
Version it satya_devVersion it satya_dev
Version it satya_devKranthi Kumar
 

Mehr von Kranthi Kumar (20)

Exercise in alv
Exercise in alvExercise in alv
Exercise in alv
 
Dynamic binding
Dynamic bindingDynamic binding
Dynamic binding
 
Data binding
Data bindingData binding
Data binding
 
Creating simple comp
Creating simple compCreating simple comp
Creating simple comp
 
Creating messages
Creating messagesCreating messages
Creating messages
 
Creating a comp
Creating a compCreating a comp
Creating a comp
 
Controllers and context programming
Controllers and context programmingControllers and context programming
Controllers and context programming
 
Context at design
Context at designContext at design
Context at design
 
Binding,context mapping,navigation exercise
Binding,context mapping,navigation exerciseBinding,context mapping,navigation exercise
Binding,context mapping,navigation exercise
 
Alv for web
Alv for webAlv for web
Alv for web
 
Web(abap introduction)
Web(abap introduction)Web(abap introduction)
Web(abap introduction)
 
Abap faq
Abap faqAbap faq
Abap faq
 
Sap abap material
Sap abap materialSap abap material
Sap abap material
 
Crm technical
Crm technicalCrm technical
Crm technical
 
control techniques
control techniquescontrol techniques
control techniques
 
BATCH DATA COMMUNICATION
BATCH DATA COMMUNICATIONBATCH DATA COMMUNICATION
BATCH DATA COMMUNICATION
 
Call transaction method
Call transaction methodCall transaction method
Call transaction method
 
Using folder options for page protection
Using folder options for page protectionUsing folder options for page protection
Using folder options for page protection
 
Business workflow
Business workflowBusiness workflow
Business workflow
 
Version it satya_dev
Version it satya_devVersion it satya_dev
Version it satya_dev
 

Chapter 04 sap script - output program

  • 1. SAPScript - Output Program Dec-2008 SAPScript - Output Program |
  • 2. Objectives • The participants will : – Analyze the Function Modules OPEN_FORM , WRITE_FORM , CLOSE_FORM etc. used in the output program to work with the SAPScripts. Dec-2008 SAPScript - Output Program | 2
  • 3. Output Program - Overview • Program retrieves the data to be printed in a SAPScript Form. • Structure of Programs – Stand alone – Transaction Triggered • Communication in between program and SAPScript Form is done via execution of function calls and communication structures. • Execution sequence of function calls – A SAPScript Form must be opened before being able to output data. – Data can be transfer as often as required. – At the end, the SAPScript Form has to be closed. Dec-2008 SAPScript - Output Program | 3
  • 4. Output Program - Function Call • General Function calls: – CALL FUNCTION ‘ OPEN_FORM ’. – CALL FUNCTION ‘ WRITE_FORM ’. – CALL FUNCTION ‘ CLOSE_FORM ’. – CALL FUNCTION ‘ CONTROL_FORM ’. – CALL FUNCTION ‘ READ_TEXT ’. Dec-2008 SAPScript - Output Program | 4
  • 5. Output Program - Function Call ‘OPEN_FORM’ Dec-2008 SAPScript - Output Program | 5 »CALL FUNCTION ‘ OPEN_FORM ’ EXPORTING FORM = .. LANGUAGE = .. DEVICE = .. OPTIONS = .. DIALOG = .. APPLICATION= .. IMPORTING LANGUAGE = .. EXCEPTIONS …..
  • 6. Output Program - Function Call ‘OPEN_FORM’ Dec-2008 SAPScript - Output Program | 6  OPEN_FORM opens SAPScript Form for Printing .  Parameters  LANGUAGE defines the SAPScript Form language version .  DEVICE specifies the output device type .( Example : PRINTER, SCREEN, TELEX, TELEFAX)  OPTIONS can be used to specify the print preview.  DIALOG can request a pop-up screen on which user can enter spool information such as printer name.  FORM is used to specify the name of the SAPScript Form to be used.
  • 7. Output Program - Function Call ‘OPEN_FORM’ • Possible Exceptions : – DEVICE= Device type invalid – FORM = SAPScript Form does not exist – OPTIONS = Options invalid – UNCLOSED = A SAPScript Form is still active Dec-2008 SAPScript - Output Program | 7
  • 8. Output Program - Function Call ‘WRITE_FORM’ Dec-2008 SAPScript - Output Program | 8 CALL FUNCTION ‘ WRITE_FORM ’ EXPORTING ELEMENT = .. TYPE = .. FUNCTION = .. WINDOW = .. EXCEPTIONS …..
  • 9. Output Program - Function Call ‘WRITE_FORM’ Dec-2008 SAPScript - Output Program | 9  WRITE_FORM transfer the data to the SAPScript Form.  Parameters  Explicitly specify ELEMENT and WINDOW name to output data to a specific ELEMENT with in a WINDOW.  No specification of WINDOW name is necessary for MAIN window.  TYPE defines area of the MAIN window, where data need to written. Possible values :  TOP = MAIN window header.  BOTTOM = MAIN window footer.  BODY = MAIN window normal output area (Default).
  • 10. Output Program - Function Call ‘WRITE_FORM’ • FUNCTION defines how the data specified in the text element is to be written in the respective WINDOW. – MAIN window • SET = Append to preceding output. • APPEND = Identical with SET. • DELETE = Ineffective. – OTHER window • SET = Delete old contents and output new text. • APPEND = Append to preceding output. • DELETE = Delete the specified text element. – Default is SET Dec-2008 SAPScript - Output Program | 10
  • 11. Output Program - Function Call ‘WRITE_FORM’ • Possible Exceptions : – ELEMENT = Text does not exist. – FUNCTION = Function is invalid. – TYPE = Window area is invalid. – WINDOW = Window does not exist. – UNOPENED = SAPScript Form printing not opened. Dec-2008 SAPScript - Output Program | 11
  • 12. Output Program - Function Call ‘CLOSE_FORM’• SAPScript Form opened with function ‘OPEN_FORM’ is closed. • SAPScript must be closed before being able to output the data on the screen or printer. • Possible exceptions : – UNOPENED = No open SAPScript Form. Dec-2008 SAPScript - Output Program | 12 CALL FUNCTION 'CLOSE_FORM' * IMPORTING * RESULT = * RDI_RESULT = * TABLES * OTFDATA = * EXCEPTIONS * UNOPENED = 1 * BAD_PAGEFORMAT_FOR_PRINT = 2 * SEND_ERROR = 3 * SPOOL_ERROR = 4 * CODEPAGE = 5 * OTHERS = 6.
  • 13. Output Program - Function Call ‘CONTROL_FORM’ • ‘CONTROL_FORM’ can execute SAPScript control commands. • Example : PROTECT … ENDPROTECT. • Parameter COMMAND accept the SAPScript command. • Possible exceptions : – UNOPENED = SAPScript Form printing has not been opened. – UNSTARTED = No SAPScript Form opened Dec-2008 SAPScript - Output Program | 13
  • 14. Output Program - Function Call ‘READ_TEXT’CALL FUNCTION ‘ READ_TEXT ’ EXPORTING OBJECT = .. NAME = .. ID = .. LANGUAGE = .. IMPORTING HEADER = .. TABLES LINES = .. EXCEPTIONS ….. Dec-2008 SAPScript - Output Program | 14
  • 15. Output Program - Function Call ‘READ_TEXT’ Dec-2008 SAPScript - Output Program | 15  An application text can be read from text file. HEADER and LINES contain header and text information after successful execution.  Work area for header must be defined as a field string. DATA BEGIN OF HEADER INCLUDE STRUCTURE THEAD DATA END OF HEADER  Work area for text lines must be defined as an internal table. DATA BEGIN OF LINES OCCURS ... INCLUDE STRUCTURE TLINE DATA END OF HEADER
  • 16. Output Program - Function Call ‘READ_TEXT’ Dec-2008 SAPScript - Output Program | 16  Possible Exceptions :  ID = Text ID invalid.  LANGUAGE = Language invalid.  NAME = Text name invalid.  NOT_FOUND = Text not found.  OBJECT = Text object invalid.  REFERENCE_CHECK = Reference sequence interrupted.
  • 17. Demonstration • Creating an output program using the SAPScript function modules OPEN_FORM , WRITE_FORM , CLOSE_FORM. Dec-2008 SAPScript - Output Program | 17
  • 18. Practice • Creating an output program using the SAPScript function modules OPEN_FORM , WRITE_FORM , CLOSE_FORM. Dec-2008 SAPScript - Output Program | 18
  • 19. Summary • An output program is required to retrieve data to be printed in SAPScript forms. • The general function-modules used in SAPScript forms are : OPEN_FORM WRITE_FORM , CLOSE_FORM, CONTROL_FORM , READ_TEXT. • The ‘OPEN_FORM’ function-module opens the SAPScript Form for Printing . • The ‘WRITE_FORM’ function-module transfer the data to the SAPScript Form.Dec-2008 SAPScript - Output Program | 19
  • 20. Questions • What is the purpose of the output program ? • What is the function-module required to transfer data to the SAPScript form ? • What is the use of the ‘CLOSE_FORM’ function-module ? Dec-2008 SAPScript - Output Program | 20