cancel
Showing results for 
Search instead for 
Did you mean: 

Writing a Print Program for SAP Scripts

Former Member
0 Kudos

Hi,

If you have the documents regarding print program (What are steps involved), then please send it to accross my mail id <i><b>vmmagadi@gmail.com</b></i>

Please let me know regarding the links regarding this.

Regards,

V M Magadi

Accepted Solutions (0)

Answers (2)

Answers (2)

former_member181962
Active Contributor
0 Kudos

Hi Vidya,

Check the sample print programs in se38:

RSTXEXP1 SAPscript: Sample Program for Form Printing

RSTXEXP2 SAPscript: Example program for Course CA930 Chapter 5

RSTXEXP3 Template report for practice task, exercise chapter 5,

RSTXEXPT

Regards,

Ravi

Former Member
0 Kudos

HI Vidya,

here is sample print program... for most of the programs the main steps will be like this only.. u have to change the conditions according to ur requirement.

**************************************************

REPORT z_script_prog .

TABLES: mseg.

DATA: itab LIKE mseg OCCURS 3 WITH HEADER LINE.

SELECT * FROM mseg INTO TABLE itab.

SORT itab BY matnr.

DELETE ADJACENT DUPLICATES FROM itab COMPARING matnr.

CLEAR itab.

PERFORM oform.

PERFORM sform.

LOOP AT itab INTO mseg.

PERFORM wform.

ENDLOOP.

*perform tform.

PERFORM eform.

PERFORM cform.

&----


*& Form oform

&----


  • text

----


FORM oform.

CALL FUNCTION 'OPEN_FORM'

EXPORTING

form = 'ZSAB'

language = sy-langu.

ENDFORM. "oform

&----


*& Form sform

&----


  • text

----


FORM sform.

CALL FUNCTION 'START_FORM'

EXPORTING

  • ARCHIVE_INDEX =

form = 'ZSAB'

language = sy-langu

startpage = 'PAGE1'

.

ENDFORM. "sform

&----


*& Form wform

&----


  • text

----


FORM wform.

CALL FUNCTION 'WRITE_FORM'

EXPORTING

element = 'DATA'

function = 'SET'

type = 'BODY'

window = 'MAIN'.

ENDFORM. "wform

FORM eform.

CALL FUNCTION 'END_FORM'.

ENDFORM. "eform

&----


*& Form cform

&----


  • text

----


FORM cform.

CALL FUNCTION 'CLOSE_FORM'.

ENDFORM. "cform

**************************************************************************

Regards

SAB