cancel
Showing results for 
Search instead for 
Did you mean: 

sap script

Former Member
0 Kudos

pls tell me coding for following text data in se38.

/E ELE

/: BOX XPOS '13' CH WIDTH '0' CM HEIGHT '20' CM FRAME '20' TW

/:TOP

P2 Sal docNo,,Item No,,Material No,,Amount

/:BOX YPOS '22' CH WIDTH '20' CM HEIGHT '0' CM FRAME '20' TW

/:ENDTOP

P2<C1>&ITAB-VBELN&,,&ITAB-POSNR&,,&ITAB-MATNR&,,&ITAB-NETWR&

/:BOTTOM

P2End of window &PAGE&

/:ENDBOTTOM

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi,

1. Select the data into table itab.

2. Call function open_form. "to open the form

export form name.

3. loop at itab.

4.call function write_form.

export parameter element as 'ELE'

5. endloop.

6. call function close_form.

Hope it will be useful.

kamala.

Former Member
0 Kudos

for writing code for following in se38 first u have to

call functon open form as for example:call function 'OPEN_FORM'

exporting

  • APPLICATION = 'TX'

  • ARCHIVE_INDEX =

  • ARCHIVE_PARAMS =

device = 'PRINTER'

  • DIALOG = 'X'

form = FORM NAME'

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.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

endif.

This will call ur form and set a interface between se38 and form printer

than by this after displaying header information .

u have to display information of detail which is written in editor of main window as ur code indicates . In main window there are three parts header info, body info and footer info for displaying seprete information in main window in these three parts. so for that u have to call write form function and maintion there in type that this paart is of header, body or footer(body)

and in the same way u vae to make seprrate text element for all three part before writting them in editor by writing /E in command box in editor example of write function iscall function 'WRITE_FORM'

exporting

element = 'PODETAILHEADING(NAME OF TEXT ELEMENT IN EDITOR WRITTEN IN FRONT OF COMMAND BOX/E')

function = 'SET'

type = 'TOP/BODY/BOTTOM'

window = 'MAIN'

  • 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.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

endif.

THAN UR OUTPUT COMES IN SCRIPT LAYOUT ACCORDINGLY

Thanks

AND

please reward points if useful please