Application Development 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: 

Regarding scripts

Former Member
0 Kudos

Hi friends,

I am creating customzed form for delivery . Already

standard form is there . But i have to test my own form i.e 'zform' and own print program . How it is possible ?

Tell me the steps if possible.

Any output types will be there ? if so how to do it ?

Please specify some output types you know it ?

Thanks

venkatrav

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Venkatravi,

To test your custom form you need to configure the custom print program and script in the NACE transaction. You can use LAVA as the output type.

***Reward points if useful

Regards,

Kiran Bobbala

6 REPLIES 6

Former Member
0 Kudos

Venkatravi,

To test your custom form you need to configure the custom print program and script in the NACE transaction. You can use LAVA as the output type.

***Reward points if useful

Regards,

Kiran Bobbala

Former Member
0 Kudos

Hi,

do like this.

Goto Transaction Code <SE71> and

select from Menu UTILITIES ->Copy from Client.

Enter the Form Name, Its source Client and the target Form Name that you want it to be saved as on your client.

Say you are naming it as zmedruck1.

Click on EXECUTE.

After this,

configur in NACE.

NACE -> select INVOCE -> press the Push Button "OUT PUT TYPES" -> in the next screen, click on PROCESSING ROUTINES" ->

GIVE your form name and Print Program name ->save.

Regards

Sandeep Reddy

Former Member
0 Kudos

HI,

Do the script as our friends suggested to do .

Using a driver program we can call the script from our report programs.

The driver program code is below. Make necessary changes for ur program.

We need 5 function modules for calling the script through the abap program.

OPEN_FORM

START_FORM

WRITE_FORM

END_FORM

CLOSE_FORM

&----


*& Report ZC_DRIVER

*&

&----


*&

*&

&----


REPORT ZC_DRIVER.

TABLES : ZSTUDENT_COLLEGE , ZSTUDENT_PERSONA.

TYPES: BEGIN OF TY_STDPER,

ZSTDID(6) TYPE C,

ZSTDNAME(50) TYPE C,

ZSTDADDRESS(80) TYPE C,

ZSTDCITY(20) TYPE C,

ZSTDPINCODE(6) TYPE C,

ZSTDPHONE(12) TYPE C,

END OF TY_STDPER,

BEGIN OF TY_STDCOL,

ZSTDID(6) TYPE C,

ZSTDNAME(50) TYPE C,

ZSTDBRANCH(4) TYPE C,

ZSTDCOLLEGE(30) TYPE C,

END OF TY_STDCOL.

DATA : ZSTD_PER TYPE TABLE OF TY_STDPER,

ZSTD_COL TYPE TABLE OF TY_STDCOL,

WA_PER TYPE TY_STDPER,

WA_COLL TYPE TY_STDCOL.

SELECT * FROM ZSTUDENT_PERSONA INTO CORRESPONDING FIELDS OF TABLE ZSTD_PER.

CALL FUNCTION 'OPEN_FORM'

EXPORTING

  • APPLICATION = 'TX'

  • ARCHIVE_INDEX =

  • ARCHIVE_PARAMS =

  • DEVICE = 'PRINTER'

  • DIALOG = 'X'

FORM = 'ZC_SCRIPT'

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

CALL FUNCTION 'START_FORM'

EXPORTING

  • ARCHIVE_INDEX =

FORM = 'ZC_SCRIPT'

LANGUAGE = SY-LANGU

  • STARTPAGE = ' '

  • PROGRAM = ' '

  • MAIL_APPL_OBJECT =

  • IMPORTING

  • LANGUAGE =

  • EXCEPTIONS

  • FORM = 1

  • FORMAT = 2

  • UNENDED = 3

  • UNOPENED = 4

  • UNUSED = 5

  • SPOOL_ERROR = 6

  • CODEPAGE = 7

  • OTHERS = 8

.

IF SY-SUBRC <> 0.

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

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

ENDIF.

LOOP AT ZSTD_PER INTO WA_PER.

CALL FUNCTION 'WRITE_FORM'

EXPORTING

ELEMENT = 'T_ELE'

FUNCTION = 'SET'

TYPE = 'BODY'

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.

ENDLOOP.

CALL FUNCTION 'END_FORM'

  • IMPORTING

  • RESULT =

  • EXCEPTIONS

  • UNOPENED = 1

  • BAD_PAGEFORMAT_FOR_PRINT = 2

  • SPOOL_ERROR = 3

  • CODEPAGE = 4

  • OTHERS = 5

.

IF SY-SUBRC <> 0.

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

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

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.

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

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

ENDIF.

Reward points if helpful.

Thanks and Regards.

Former Member
0 Kudos

Hi,

There are two solutions for your problem depending on what is ur requirement:

Scenario 1: New Output type

New Drver Program

Use T-code NACE:

Firstly: If you want to use your driver program then follow steps below:

NACE -> Output Types -> New Entry ->

In the selection screen enter the output type for ex : ZP01

Then go to Processing Routines:

Enter ur Driver Program and also the Form routine from where you will trigger ur form.

The defien the partner functions depending on the medium of output Ex: EDI, Print O/p

Scenario 2: New O/p

Existing Driver program;

Follow the same steps above and do the assignments..

Hope this helps..

Former Member
0 Kudos

They are two ways to debug the SAPScript.

1). Use Tools - Word Processing - Layout Set (SE71). Enter name of layout set and then Utilities - Activate Debugger.

It is of no consequence which layoutset you enter when selecting the SAPscript debugger. (Menu path: Tools-Wordprocessing - Forms, Utilities - Activate Debugger) The next layoutset called will invoke the debugger.

2). Another way to set the SAPScript debugger is to run program RSTXDBUG.

When you debug Print program it is same as you debug any other ABAP program. While when you debug SAPScript, you actually debug the code ( scripting) you have written SAPScript Form.

regards,

venkat

Former Member
0 Kudos

Hi,

Actually output types will be created by Functional people, ask your functional people to create a output type to your zform.

Regards

Ganesh