0% found this document useful (0 votes)
6 views31 pages

Script

This document outlines the steps to create a Purchase Order (PO) form using the SAP SE71 transaction. It details the process of setting up pages, windows, and text elements, as well as writing the driver program to retrieve and print PO data. The instructions include specific coding and formatting requirements for the final output of the PO form.

Uploaded by

Sachin Bagal
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views31 pages

Script

This document outlines the steps to create a Purchase Order (PO) form using the SAP SE71 transaction. It details the process of setting up pages, windows, and text elements, as well as writing the driver program to retrieve and print PO data. The instructions include specific coding and formatting requirements for the final output of the PO form.

Uploaded by

Sachin Bagal
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

Requirment-1 : Purchase Order.

Steps :
GO TO SE71.

Provide program Name : ZSCRIPT_PO -> Create.

Provide Meaning : Purchse Order(Any Name).

Click on Basic Setting.


Select Pages Option(F6).

Step 1: Create Page

Click On Edit -> Create Element


Provide -> Page : PAGE1

Meaning : Page1 -> Enter.


Provide Next Page : PAGE1.

Click on Windows (F7).

Click on Edit -> Create Element.


Provide Window : TITLE

Meaning : Title -> Enter.


Create the required no. of window as per layout.

Repeat the same procedure for below window


Click on Page Windows(F8) button.

Select Edit –> Create Element.


Double Click on Address.

Double click on each windows so windows would be added to the page.


Select Paragraph Format Buttons.

Create Paragraph formats.


Double Click on HD – Header

Select tabs button at extreme bottom right.


Provide Family as COURIER and SIZE 12 for all paragraph formats.

For TITLE family as COURIER and size 16.


Select Character Format Buttin(Shift+F5).

Provide
Write the code for Headings, Line item information, Grand total in Main Windows.

Now, Select Page Windows (F8) Button.


Double Click on Main Windows.

Select Text Elements(F9) -> Goto -> Change Editor.


F3 FOR BACK

Double click on ADDRESS Window

Select Text Element(F9) -> Goto -> Change Editor.


F3 For back.

Double Click On footer windows

Select Text Element -> Goto -> Change Editor.


F3 for back

Step :write the code for printing LOGO window.

Double click on LOGO window

Select text element -> Goto -> Change Editor

Select Insert -> Graphics.


Select Store on Document Tab
You will find the pop-up -> Enter

Below syntax come autotmatically.


F3 for back.

Double click on PO_NO -> Text Element -> GOTO -> Change Editor
F3 For Back

Double Click on PAGE_NO

Text Element -> GOTO ->Change Editor


F3 For Back

Double click on TITLE window

Select Text Element -> GOTO -> Change Editor


F3 for back

Double click on TEXT window.

Select Text Element -> GOTO -> Change Editor


Finally, Re-arrange the window with the requirement

Click on Setting -> Form Painter -> select check box graphical form painter -> enter.
Specify Default paragraph and first page
Now,

Write the driver program

Goto SE38
*&---------------------------------------------------------------------*
*& Report ZSCRIPT_PO_PROGRAM
*&
*&---------------------------------------------------------------------*
*&
*&
*&---------------------------------------------------------------------*

REPORT ZSCRIPT_PO_PROGRAM.

TABLES : ADRC,LFA1,EKKO.
PARAMETERS : P_EBELN TYPE EKKO-EBELN .

*DATA DECLARATIONS
DATA : WA_EKKO TYPE EKKO .
DATA : WA_EKPO TYPE EKPO .
DATA : IT_EKPO TYPE TABLE OF EKPO .
DATA : WA_LFA1 TYPE LFA1 .
DATA : WA_ADRC TYPE ADRC .
DATA : V_TOT TYPE EKPO-NETWR .

*READ PO HEADER DETAILS


SELECT SINGLE * FROM EKKO
INTO WA_EKKO
WHERE EBELN = P_EBELN .

*READ PO ITEM DETAILS


SELECT * FROM EKPO
INTO TABLE IT_EKPO
WHERE EBELN = P_EBELN .

READ TABLE IT_EKPO INTO WA_EKPO INDEX 1.


DO 100 TIMES .
APPEND WA_EKPO TO IT_EKPO .
ENDDO.

*READ VENDOR MASTER DATA TO FIND THE ADDRESS NUMBER


SELECT SINGLE * FROM LFA1 INTO WA_LFA1 WHERE LIFNR = WA_EKKO-LIFNR .
SELECT SINGLE * FROM ADRC INTO WA_ADRC WHERE ADDRNUMBER = WA_LFA1-ADRNR .

*OPEN THE FORM


CALL FUNCTION 'OPEN_FORM'
EXPORTING
FORM = 'ZSCRIPT_PO'
LANGUAGE = SY-LANGU.

*PRINT EACH ITEM IN MAIN WINDOW


LOOP AT IT_EKPO INTO WA_EKPO .
*CALCLUATE GRAND TOTAL
V_TOT = V_TOT + WA_EKPO-NETWR .
WA_EKPO-MATNR = 'APACHE-160' .
CALL FUNCTION 'WRITE_FORM'
EXPORTING
ELEMENT = 'BODY'
WINDOW = 'MAIN'.

*PRIINT THETOTAL AFETR ANIN WINDOW BODY PAGE


AT LAST .
CALL FUNCTION 'WRITE_FORM'
EXPORTING
ELEMENT = 'TOTAL'
WINDOW = 'MAIN'.
ENDAT.
ENDLOOP .

CALL FUNCTION 'CLOSE_FORM'.

You might also like