Professional Documents
Culture Documents
script-error.smartpcfixer.com Follow These 3 Steps Instantly, Fix Script Error Under 2 Min!
HOME ABAP INTERVIEW QUESTIONS Privacy Policy REPORTS SAP DIALOG PROGRAMMING Dow nloads SCRIPTS SMARTFORMS BDC
Cross Applications
RFC
BAPI
ALE IDOC
Web Dynpro
Work Flow
Downloads
Sap ABAP
C# Script
Perl Script
Post Script
Your contribution can keep this blog alive!!!
GOOGLE TRANSLATOR
Select Language
Powered by
Translate
FOLLOW BY EMAIL
Email address... Submit
Search
FOLLOW US ON TWITTER!
Dear Readers this post explains the Script Tutorial Real Time Scenario on Creation of Purchase Order, in this post i'm explained step by step procedure to create Script on Purchase Order. This post gives the complete idea about the creation of Script for beginners. Lets's go through this post for more details about creation of script. Interested ABAP'ers click on read more to read the post.
+1
POPULAR POSTS
SAP OO ABAP, OOPS ABAP Interview Questions Answers
Dear Readers this post explains the Script Tutorial Real Time Scenario on Creation of Purchase Order, in this post i'm explained step by step procedure to create Script on Purchase Order. This post gives the complete idea about the creation of Script for beginners. Lets's go through this post for more details about creation of script.
BLOG ARCHIVE
2014 (28) 2013 (60) 2012 (71) December (7) August (1) June (1) May (1) Script Tutorial Real Time Scenario on Purchase Ord... April (22) March (11) February (23) January (5)
TOTAL PAGEVIEWS
492762
Step 7 : Write the code for Printing Headings, Line item information, Grand total in Mainwindow
converted by Web2PDFConvert.com
Step 8 : Write the code for Printing Vendor address in Address window
Step 9 : Write the code for Printing Footer information in Footer window
Step19 : Change the Driver Program for using STARTFORM AND END FORM
Detailed Steps: 1. Go to Se71 Tcode -->Give formname -->ZPO_SCRIPT, Click on --> Create Button.
converted by Web2PDFConvert.com
A pop-up message will be displayed, no need to do any thing press Enter Button.
converted by Web2PDFConvert.com
->click on BASIC settings. 3. Select page format Landscape Specify Page Format, First Page, Default Paragraph.
converted by Web2PDFConvert.com
converted by Web2PDFConvert.com
Give page as PAGE1 and meaning as Main Page->> Give Next Page as Page1
converted by Web2PDFConvert.com
5. click on WINDOWS
Click on EDIT --> select CRATE ELEMENT (by default, MAIN window will be added)
converted by Web2PDFConvert.com
Create another window by going to EDIT --> Create Element Give the window name as TITLE , Description as Window for Title.
converted by Web2PDFConvert.com
Step 2 : Create Required no of Window as per the layout given 6. click on EDIT->create element->give window name as logo and meaning as window for logo.
Step 3: Create Page Windows and specify height/width 7. Click on Page windows
converted by Web2PDFConvert.com
Click on EDIT->CRATE ELEMENT->Double click on each window so that the window would be added to the page.
Give the appropriate height, width, left / right margin as below for each window
converted by Web2PDFConvert.com
converted by Web2PDFConvert.com
Maintain the Font Attributes ( Font Family, Size, Bold, Italic, Underline ) as required.
converted by Web2PDFConvert.com
Give Tabs for HEADER paragraph format as below. Tabs are nothing but positions to display data. Create 5 Tabs with required positions.
converted by Web2PDFConvert.com
converted by Web2PDFConvert.com
Click on EDIT --> Create Element --> Give Character Format and Description and Maintain Font Attributes as requirement
converted by Web2PDFConvert.com
Step 7 : Write the code for Title, Headings, Line item information, Grand Total in Mainwindow
Goto->Pagewindows
For Title Select Title Page Window and click on Text Editor CLICK ON GOTO CHANGE EDITOR--->write the below code
converted by Web2PDFConvert.com
Write the Below Code under editor TL --> Paragraph Format and " PURCHASE ORDER " is the title.
Now Select the Main Window, Select the editor and write below code.
converted by Web2PDFConvert.com
Here,
/: TOPENDTOP is used to print header information in the main window so that the it flows on to every page . /E (Text Element) BODY----this is used to print body. All the line item values . /E (Text Element) Total----used to print total at the end of main window . This element is called after the loop..endloop..so that Grand total is printed immediately after the main window .
Step 8 : Write the code for Printing Footer information in Footer window Select Footer in Page windows and write code for Footer in text editor. Goto->Pagewindows-> Double click on FOOTER window and click on texteditor-> write the below code.
converted by Web2PDFConvert.com
Step 9 : Write the code for Printing PO Details/PageNo/Title Similarly, for all windows write the below code in the text editor Goto->Pagewindows->Double click on PO_NO window and click on texteditor ->write the below code
Goto->Pagewindows->Double click on PAGE_NO window and click on texteditor>write the below code
DF--Page.No : &PAGE&/&SAPSCRIPT-FORMPAGES(C)&
converted by Web2PDFConvert.com
Step 10 : Write the code for Printing Vendor address in Address window
Goto->Pagewindows->Double click on ADDRESS window and click on texteditor>write the below code.
Goto SE78
--> Graphics
Click on F4 to select the Bitmap Image from computer to SAP Document Server.
Select the URL of the Image and Give the Name and Description of the Image.
To cheek the the Image whether it is uploaded or not, Give the image name and select color bitmap image and click on the Print Preview (F8) button.
converted by Web2PDFConvert.com
Step 11 : Write the code for Printing Logo in Logo window Goto->Pagewindows ->Double click on LOGO window and click on texteditor ->write the below code or Click on INSERT->GRAPHICS
->Select Stored on Document Server ->Give Name 'LOGO' (Image name Uploaded through SE78) ->Give object : GRAPHICS ID : BMAP Select color Bitmap Image->Press Enter
converted by Web2PDFConvert.com
Now we have to create Standard Text for this Script Using "SO10" Tcode.
We can write the text directly in the window. But in the real time we use a concept called standard Text.
Goto SO10
converted by Web2PDFConvert.com
--> go to EDIT
Go back to script Goto -->Pagewindows -->Double click on TEXT window and click on texteditor -->write the below text.
/: INCLUDE ZV_PO_TEXT OBJECT TEXT ID ST THIS IS STD TEXT THRU SO10 TXN.
Or
CLick on Insert->Text->Standard
converted by Web2PDFConvert.com
Finally, Lets Re-arrange all the window positions again by going to Graphical Form Painer.
Click on SETTINGS -->FORM PAINTER -->Select Checkbox Graphical Form Painter And press enter.
converted by Web2PDFConvert.com
The form should look as below. If not arrange all the windows as below by dragging and dropping.
Arrange all the windows like below screen shot by dragging and dropping the windows as per our business requirement.
converted by Web2PDFConvert.com
Now goback to PC EDITOR. Minimize the above window and Settings --> Form Painter --> Un check the Graphical Form Painter, now pc editor will be displayed.
*&---------------------------------------------------------------------* *& Report ZPO_SCRIPT_DP *& *&---------------------------------------------------------------------* *& *& *&---------------------------------------------------------------------* REPORT ZPO_SCRIPT_DP NO STANDARD PAGE HEADING.
********** DATA DECLARETIONS DATA : I_EKPO TYPE TABLE OF EKPO, WA_EKKO TYPE EKKO, WA_EKPO TYPE EKPO, WA_LFA1 TYPE LFA1, WA_ADRC TYPE ADRC, V_TOT TYPE EKPO-NETWR. ****** PARAMETER FOR EBELN SELECTION PARAMETERS : P_EBELN TYPE EBELN.
converted by Web2PDFConvert.com
******* SELECTING PO HEADER DATA SELECT SINGLE * FROM EKKO INTO WA_EKKO WHERE EBELN = P_EBELN. ******* SELECTING PO ITEM DATA SELECT * FROM EKPO INTO TABLE I_EKPO WHERE EBELN = P_EBELN. ********* FETCHING VENDOR DATA FOR ADDRESS USING EKKO SELECT SINGLE * FROM LFA1 INTO WA_LFA1 WHERE LIFNR = WA_EKKO-LIFNR. ********** FETCHING VENDOR ADDRESS FROM ADRC TABLE USING VENDOR SELECT SINGLE * FROM ADRC INTO WA_ADRC WHERE ADDRNUMBER = WA_LFA1ADRNR. ********** READING DATA PO ITEM TABLE TO WORK AREA READ TABLE I_EKPO INTO WA_EKPO INDEX 1. ******* TO READ DATA 100 TIMES FOR DEMO PURPOSE DO 100 TIMES. APPEND WA_EKPO TO I_EKPO. ENDDO. ********* CALLING THE SCRIPT USING OPEN_FORM CALL FUNCTION 'OPEN_FORM' EXPORTING FORM = 'ZPO_SCRIPT' LANGUAGE = SY-LANGU. ********** LOOP THE ITAB TO WA TO READ DATA LOOP AT I_EKPO INTO WA_EKPO. ****** FOR CALCULATING THE TOTAL V_TOT = V_TOT + WA_EKPO-NETWR. ******* WRITING THE DATA ON SCRIPT CALL FUNCTION 'WRITE_FORM' EXPORTING ELEMENT = 'BODY ' WINDOW = 'MAIN'. ******** TO DISPLAY TOTAL AT END OF THE SCRIPT AT LAST. CALL FUNCTION 'WRITE_FORM' EXPORTING ELEMENT = 'TOTAL' WINDOW = 'MAIN'. ENDAT. ENDLOOP. ******* TO CLOSE THE FORM WHICH IS OPENED BY OPEN FORM CALL FUNCTION 'CLOSE_FORM'.
converted by Web2PDFConvert.com
Save and Activate the Program. Now Execute the Program and give PO number as : 3000000007
The Output of the Script form is look likes below: First Page:
Last Page:
converted by Web2PDFConvert.com
Previous Posts:
converted by Web2PDFConvert.com
Dear ABAP'ers if any Suggestions, Comments, Doubts feel free to leave a comment in the below comment box.
"You found the information helpful and want to say thanks? Your donation is enough to inspire us to do more. Thanks a bunch!"
Landscape Design
Newer Post
Home
Older Post
Publish
Preview
Categories
Data
Dictionary (22)
IDoc Tutorials (6)
Object Oriented ABAP (19) Object Oriented ABAP Interview Questions (15) OOABAP (9) Reports (13) Reports Interview Questions (9) SAP ABAP Interview Questions (35) SAP ABAP Introduction (45)
Protected Blog
converted by Web2PDFConvert.com