Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Regarding Scripts...........

Former Member
0 Likes
496

Hi All,

I am new to ABAp programming.Can any one help in Sap Scripts.

Here I had a Z* form which I need to modify.

First I want to know how to look a print Programme for this form.

Can any one help in this....

Thanking you.

5 REPLIES 5
Read only

Former Member
0 Likes
477

Hi,

A Print Program look like this

The print program:

  • Writing INTRODUCTION

CALL FUNCTION 'WRITE_FORM'

EXPORTING

ELEMENT = 'INTRODUCTION'

FUNCTION = 'SET'

TYPE = 'BODY'

WINDOW = 'MAIN'

EXCEPTIONS

OTHERS = 8

.

  • Writing ITEM_HEADER

CALL FUNCTION 'WRITE_FORM'

EXPORTING

ELEMENT = 'ITEM_HEADER'

FUNCTION = 'SET'

TYPE = 'BODY'

WINDOW = 'MAIN'

EXCEPTIONS

OTHERS = 8

.

  • Set ITEM_HEADER into TOP area of main window for subsequent pages

CALL FUNCTION 'WRITE_FORM'

EXPORTING

ELEMENT = 'ITEM_HEADER'

FUNCTION = 'SET'

TYPE = 'TOP'

WINDOW = 'MAIN'

EXCEPTIONS

OTHERS = 8

  • Write ITEM_LINE

LOOP AT .....

CALL FUNCTION 'WRITE_FORM'

EXPORTING

ELEMENT = 'ITEM_LINE'

FUNCTION = 'SET'

TYPE = 'BODY'

WINDOW = 'MAIN'

EXCEPTIONS

OTHERS = 8.

ENDLOOP.

  • Delete ITEM_HEADER from TOP area of main window

CALL FUNCTION 'WRITE_FORM'

EXPORTING

ELEMENT = 'ITEM_HEADER'

FUNCTION = 'DELETE'

TYPE = 'TOP'

WINDOW = 'MAIN'

EXCEPTIONS

OTHERS = 8

  • Print CLOSING_REMARK

CALL FUNCTION 'WRITE_FORM'

EXPORTING

ELEMENT = 'CLOSING_REMARK'

FUNCTION = 'SET'

TYPE = 'BODY'

WINDOW = 'MAIN'

EXCEPTIONS

OTHERS = 8.

Also check this link,

http://www.sap-img.com/sapscripts.htm

http://www.henrikfrank.dk/abapexamples/SapScript/sapscript.htm

Hope u understood.

Thanks&Regards,

Ruthra.R

Read only

0 Likes
477

Hi,

What i am asking is If a Z* form is existing how can we see a print programm which is already exits.

Thanking you.

Read only

0 Likes
477

Hi,

Use table TTXFP, by specifing your Z* form name you can find out print program name.

TNAPR table also used for this, but the table has entries only if the form assigned to output type.

Hope this will help for you

Cheers,

Sasi

Read only

Former Member
0 Likes
477

Hi,

using TNAPR table you can find out print program name

in the FONAM (FORM) field enter your sapscript form name then you get print program, routine, output type and all the details corresponding to the form

Cheers,

Sasi

Read only

Former Member
0 Likes
477

Hi

- From SE71: Form->Check->Texts:

If you are lucky, the system ask you which program it

should use to check sapscript: that program is your

program.

- If your sapscript is used in some standard transaction

You can try to find the program in TNAPR table, or you

go to customizing.