Ex :-
-
- Creating a delivery note.
Steps : -
- Go to Transaction Code SE71 .
- Enter the Form name which start's with Y or Z< Form name > and click on Create.
- Pop-up will appear.
- Click on Continue.
- Enter the Meaning.
- Click on Settings -> Form Painter.
- Pop-up will appear.
- Enable Form Painter and PC Editor.
- Click on Continue.
- Click on Layout to design the page.
Note :
- Window is place holder in a page.
- Main Window is compulsory in Script.
- To create window , right click on page -> Create Window.
- To rename the window , right click on window -> Rename .
Paragraph format and Character format :
Paragraph format : If you want to set the font size and font style for a paragraph then use Paragraph format .
- Enter the paragraph format name.
- Click on Font to adjust font family and size.
- Click on Tab for tab spacing if require.
- Similarly create some paragraph format.
- Click on Definition to give default paragraph format.
Character format :
- If you want to highlight the word or words or bar-code then use character format.
- Click on Save
Heading Window.
- Save->Check>Activate.
To check output
- Enter output device name and click on print preview.
Logo
- To upload the Graphic / Image
- Click on Logo window and click text.
- Click on Insert -> Graphics.
- Click on Stored on Document Server.
- Enter the Logo name and Resolution.
- Save->Check->Activate.
- Test it.
Driver Program.
- Go to Transaction Code SE38.
- Enter the program name and click on create.
TABLES : LIKP , TVKO.
DATA : WA_SALES TYPE ADRC.
PARAMETERS : P_VBELN TYPE LIKP-VBELN.
START-OF-SELECTION.
PERFORM GET_DATA.
PERFORM PRINT_DATA.
FORM GET_DATA .
* GET THE DATA FROM DELIVERY DOC HEADER
SELECT SINGLE * FROM LIKP
WHERE VBELN = P_VBELN.
* GET THE SALES ORG ADDRESS
SELECT SINGLE * FROM TVKO
WHERE VKORG = LIKP-VKORG.
* GET THE DATA FROM ADRESS TABLE ADRC
SELECT SINGLE * FROM ADRC
INTO WA_SALES WHERE ADDRNUMBER = TVKO-ADRNR.
ENDFORM. " GET_DATA
* GET THE DATA FROM DELIVERY DOC HEADER
SELECT SINGLE * FROM LIKP
WHERE VBELN = P_VBELN.
* GET THE SALES ORG ADDRESS
SELECT SINGLE * FROM TVKO
WHERE VKORG = LIKP-VKORG.
* GET THE DATA FROM ADRESS TABLE ADRC
SELECT SINGLE * FROM ADRC
INTO WA_SALES WHERE ADDRNUMBER = TVKO-ADRNR.
ENDFORM. " GET_DATA
FORM PRINT_DATA .
call function 'OPEN_FORM'
EXPORTING
* APPLICATION = 'TX'
* ARCHIVE_INDEX =
* ARCHIVE_PARAMS =
DEVICE = 'PRINTER'
* DIALOG = 'X'
FORM = 'ZBILLINGNOTE'
LANGUAGE = SY-LANGU
* OPTIONS =
* MAIL_SENDER =
* MAIL_RECIPIENT =
* MAIL_APPL_OBJECT =
* RAW_DATA_INTERFACE = '*'
* SPONUMIV =
* IMPORTING
* LANGUAGE =
* NEW_ARCHIVE_PARAMS =
* RESULT =
EXCEPTIONS
CANCELED = 1
DEVICE = 2
FORM = 3
OPTIONS = 4
UNCLOSED = 5
MAIL_OPTIONS = 6
ARCHIVE_ERROR = 7
INVALID_FAX_NUMBER = 8
MORE_PARAMS_NEEDED_IN_BATCH = 9
SPOOL_ERROR = 10
CODEPAGE = 11
OTHERS = 12
.
if SY-SUBRC <> 0.
* Implement suitable error handling here
endif.
call function 'OPEN_FORM'
EXPORTING
* APPLICATION = 'TX'
* ARCHIVE_INDEX =
* ARCHIVE_PARAMS =
DEVICE = 'PRINTER'
* DIALOG = 'X'
FORM = 'ZBILLINGNOTE'
LANGUAGE = SY-LANGU
* OPTIONS =
* MAIL_SENDER =
* MAIL_RECIPIENT =
* MAIL_APPL_OBJECT =
* RAW_DATA_INTERFACE = '*'
* SPONUMIV =
* IMPORTING
* LANGUAGE =
* NEW_ARCHIVE_PARAMS =
* RESULT =
EXCEPTIONS
CANCELED = 1
DEVICE = 2
FORM = 3
OPTIONS = 4
UNCLOSED = 5
MAIL_OPTIONS = 6
ARCHIVE_ERROR = 7
INVALID_FAX_NUMBER = 8
MORE_PARAMS_NEEDED_IN_BATCH = 9
SPOOL_ERROR = 10
CODEPAGE = 11
OTHERS = 12
.
if SY-SUBRC <> 0.
* Implement suitable error handling here
endif.
* TO SET THE DATA CALL PARTICULAR WINDOW
call function 'WRITE_FORM'
EXPORTING
ELEMENT = 'SALES'
* FUNCTION = 'SET'
* TYPE = 'BODY'
WINDOW = 'ADD1'
* IMPORTING
* PENDING_LINES =
EXCEPTIONS
ELEMENT = 1
FUNCTION = 2
TYPE = 3
UNOPENED = 4
UNSTARTED = 5
WINDOW = 6
BAD_PAGEFORMAT_FOR_PRINT = 7
SPOOL_ERROR = 8
CODEPAGE = 9
OTHERS = 10
.
if SY-SUBRC <> 0.
* Implement suitable error handling here
endif.
call function 'WRITE_FORM'
EXPORTING
ELEMENT = 'SALES'
* FUNCTION = 'SET'
* TYPE = 'BODY'
WINDOW = 'ADD1'
* IMPORTING
* PENDING_LINES =
EXCEPTIONS
ELEMENT = 1
FUNCTION = 2
TYPE = 3
UNOPENED = 4
UNSTARTED = 5
WINDOW = 6
BAD_PAGEFORMAT_FOR_PRINT = 7
SPOOL_ERROR = 8
CODEPAGE = 9
OTHERS = 10
.
if SY-SUBRC <> 0.
* Implement suitable error handling here
endif.
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
.
if SY-SUBRC <> 0.
* Implement suitable error handling here
endif.
ENDFORM. " PRINT_DATA
* IMPORTING
* RESULT =
* RDI_RESULT =
* TABLES
* OTFDATA =
EXCEPTIONS
UNOPENED = 1
BAD_PAGEFORMAT_FOR_PRINT = 2
SEND_ERROR = 3
SPOOL_ERROR = 4
CODEPAGE = 5
OTHERS = 6
.
if SY-SUBRC <> 0.
* Implement suitable error handling here
endif.
ENDFORM. " PRINT_DATA
- Click on window ADD1 and click on text.
- A group of Variables called as Text Element.
- Save->Check->Activate.
- Execute the program.
To get Sold to party address.
Source Code
TABLES : LIKP , TVKO , KNA1.
DATA : WA_SOLD TYPE ADRC.
DATA : WA_SOLD TYPE ADRC.
* * * GET THE SOLD TO PARTY ADRESS
SELECT SINGLE * FROM KNA1
WHERE KUNNR = LIKP-KUNNR.
SELECT SINGLE * FROM ADRC
INTO WA_SOLD WHERE ADDRNUMBER = KNA1-ADRNR.
SELECT SINGLE * FROM KNA1
WHERE KUNNR = LIKP-KUNNR.
SELECT SINGLE * FROM ADRC
INTO WA_SOLD WHERE ADDRNUMBER = KNA1-ADRNR.
call function 'WRITE_FORM'
EXPORTING
ELEMENT = 'SOLD'
* FUNCTION = 'SET'
* TYPE = 'BODY'
WINDOW = 'ADD2'
* IMPORTING
* PENDING_LINES =
EXCEPTIONS
ELEMENT = 1
FUNCTION = 2
TYPE = 3
UNOPENED = 4
UNSTARTED = 5
WINDOW = 6
BAD_PAGEFORMAT_FOR_PRINT = 7
SPOOL_ERROR = 8
CODEPAGE = 9
OTHERS = 10
.
if SY-SUBRC <> 0.
* Implement suitable error handling here
endif.
EXPORTING
ELEMENT = 'SOLD'
* FUNCTION = 'SET'
* TYPE = 'BODY'
WINDOW = 'ADD2'
* IMPORTING
* PENDING_LINES =
EXCEPTIONS
ELEMENT = 1
FUNCTION = 2
TYPE = 3
UNOPENED = 4
UNSTARTED = 5
WINDOW = 6
BAD_PAGEFORMAT_FOR_PRINT = 7
SPOOL_ERROR = 8
CODEPAGE = 9
OTHERS = 10
.
if SY-SUBRC <> 0.
* Implement suitable error handling here
endif.
- Click on window add2.
- Execute the program.
Tab spaces in paragraph.
- Click on paragraph format and enter the paragraph format name and description.
- Click on Tabs.
- Enter the Tab position and Alignment.
Character format and bar code.
- Click on character format.
- Enter the Character format name and description.
- Select BAR CODE using f4 help.
Source code
- Click on Details Window and click on text.
- Save -> Check->Activate.
- Click on Execute.
Column Heading
- Call function module.
- Create a paragraph format with Tab space.
- Click on Main Window and click on text.
- Save -> Check -> Activate.
- Create Standard Text : SO10
- Go to Form Layout , click on condition window and click on text.
- Insert -> Text -> Standard.
- Pop-up will appear.
- Enter the Text Name , Text ID and Language and click on Okay.
- Save -> Check -> Activate the Form.
- Execute the Driver program.
-
No comments:
Post a Comment