cancel
Showing results for 
Search instead for 
Did you mean: 

NEW to SAPSCRIPTS need help

Former Member
0 Kudos

hi all,

please anyone can help i am new to scripts. can anyone tell me step by step process for creating a layout and line-editor coding . please need it urgently...

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Amit,

Are you looking for a new script or modifying an existing one.Would be helpful if you tell us the problem.

Thanks,

Dishant

Former Member
0 Kudos

Hi dishant sir i got a script to make which will run from the standard trransaction va02.

what i need is that in va02 we enter order number and the n the script will run its layout is diff. not as the standard one . so what i need is that at the run time i have to pick this order value in my prog. so that i can select records based on this can you tell me how we can do that???

Former Member
0 Kudos

Hi Amit,

You will be getting the order number in the script.If you are not modifying the driver program,create a separate program in se38 and call this program from your script using PERFORM statement.You can then use the form in your program and call whatever changes you want.

E.g:

FORM get_order TABLES pt_input STRUCTURE itcsy

pt_output STRUCTURE itcsy.

Here you use the REad statement and do whatever code you want.

Hope this helps you.

Thanks,

Dishant

Answers (7)

Answers (7)

Former Member
0 Kudos

Hi,

Send me ur personal mail_id,

i have some docus and examples on SAPSCRIPT

Looking Forward ur Mail soon. For Detials VIew My Business Card

Rewards

Fareedas

Former Member
0 Kudos

Hi Amit,

Introduction

http://www.thespot4sap.com/articles/SAPscript_Introduction.asp

http://www.sapbrain.com/TUTORIALS/TECHNICAL/SAPSCRIPTS_tutorial.html

http://esnips.com/doc/1ff9f8e8-0a4c-42a7-8819-6e3ff9e7ab44/sapscripts.pdf

http://esnips.com/doc/1e487f0c-8009-4ae1-9f9c-c07bd953dbfa/script-command.pdf

http://esnips.com/doc/64d4eccb-e09b-48e1-9be9-e2818d73f074/faqss.pdf

http://esnips.com/doc/cb7e39b4-3161-437f-bfc6-21e6a50e1b39/sscript.pdf

http://esnips.com/doc/fced4d36-ba52-4df9-ab35-b3d194830bbf/symbols-in-scripts.pdf

http://esnips.com/doc/b57e8989-ccf0-40d0-8992-8183be831030/sapscript-how-to-calculate-totals-and-sub...

SAP SCRIPT FIELDS

http://help.sap.com/saphelp_erp2005vp/helpdata/en/d1/8033ea454211d189710000e8322d00/content.htm

scripts easy material

http://www.allsaplinks.com/sap_script_made_easy.html

Label Creation in SAP Scripts

1. Create a page window and assign it to a page.

2. Choose Edit --> Main windows.

A dialog box appears.

3. Enter values in the fields Area width and Area height in accordance with the input guidelines for main windows.

4. Enter values in the fields Spacing and Number in the Horizontal group if you want to use multiple columns. You can ignore the fields in the Vertical group.

5. Determine how many columns and line areas are required for label printing. Then enter the corresponding values in the fields in the Horizontal and Vertical groups.

Also Check these links.

FAQs

http://esnips.com/doc/64d4eccb-e09b-48e1-9be9-e2818d73f074/faqss.pdf

SAPscripts How to calculate Totals and Subtotals

To calculate totals and sub totals in sap scripts you have to use subroutines.

Say if you have to add the unit price (KOMVD-KBERT) then in the main window whereever tat value is picked write this routine

/: DEFINE &TOT_PRICE&

/: PERFORM F_GET_PRICE IN PROGRAM <subroutine prog name> /:USING &KOMVD-KBERT& /:CHANGING &TOT_PRICE& /:ENDPERFORM

Then write the variable where ever you want it to be printed (mostly it will be in footer window)

Then create subroutine pool program and you have to write the code.

FORM F_GET_PRICE tables int_cond structure itcsy

outt_cond structure itcsy. data : value type kbert.

statics value1 type kbert.

Read int_cond table index 1.

value = int_cond-value.

value1 = value1 + value.

Read outt_cond table index 1.

outt_cond-value = value1.

Modify outt_cond index 1.

ENDFORM.

Regards,

Eshwar.

Former Member
0 Kudos
Former Member
0 Kudos

Hi

this is also very usefull

Former Member
0 Kudos

hi,

refer to yhe link.

http://help.sap.com/saphelp_crm40/helpdata/en/16/c832857cc111d686e0000086568e5f/content.htm

SAP Sapscripts Tips and Tricks

The standard system come with all the standard sapscripts for you to print invoices, delivery orders or sales order etc. You can further enhance the form with SAPscripts which is the standard SAP form design tools for user to developed customized form printing format such as purchase orders, invoices, checks, labels.

With the combination of third party barcode software (barcode.dll) or printer with bardimm, you can print barcode directly using SAP scripts.

To create SAPscipts goto tcode : SE71

Once your SAPscripts are created, you have to used an abap program to called the sapscripts form.

A Sample SAP Scripts Reports

Author: Mona

CALL FUNCTION 'OPEN_FORM'

  • EXPORTING

  • APPLICATION = 'TX'

  • ARCHIVE_INDEX =

  • ARCHIVE_PARAMS =

  • DEVICE = 'PRINTER'

  • DIALOG = 'X'

  • FORM = 'ZSCRIPT1'

  • 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 = 'ZFORM1'

  • LANGUAGE = ' '

  • STARTPAGE = 'X'

PROGRAM = 'ZSCRIPT1'

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

CALL FUNCTION 'WRITE_FORM'

EXPORTING

  • ELEMENT = ' '

  • FUNCTION = 'SET'

  • TYPE = 'BODY'

WINDOW = 'HEADER'

  • IMPORTING

  • PENDING_LINES =

EXCEPTIONS

ELEMENT = 1

FUNCTION = 2

TYPE = 3

UNOPENED = 4

UNSTARTED = 5

WINDOW = 6

BAD_PAGEFORMAT_FOR_PRINT = 7

SPOOL_ERROR = 8

OTHERS = 9

.

IF SY-SUBRC <> 0.

write:/ 'ERROR IN HEADER'.

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

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

ENDIF.

CALL FUNCTION 'WRITE_FORM'

EXPORTING

  • ELEMENT = ' '

  • 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

OTHERS = 9

.

IF SY-SUBRC <> 0.

write:/ 'ERROR IN HEADER'.

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

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

ENDIF.

CALL FUNCTION 'WRITE_FORM'

EXPORTING

  • ELEMENT = ' '

  • FUNCTION = 'SET'

  • TYPE = 'BODY'

WINDOW = 'FOOTER'

  • IMPORTING

  • PENDING_LINES =

EXCEPTIONS

ELEMENT = 1

FUNCTION = 2

TYPE = 3

UNOPENED = 4

UNSTARTED = 5

WINDOW = 6

BAD_PAGEFORMAT_FOR_PRINT = 7

SPOOL_ERROR = 8

OTHERS = 9

.

IF SY-SUBRC <> 0.

write:/ 'ERROR IN HEADER'.

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

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

ENDIF.

CALL FUNCTION 'END_FORM'

  • IMPORTING

  • RESULT =

  • EXCEPTIONS

  • UNOPENED = 1

  • BAD_PAGEFORMAT_FOR_PRINT = 2

  • SPOOL_ERROR = 3

  • CODEPAGE = 4

  • OTHERS = 5

.

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

.

Can you explain the difference between

1.open_form and Start form

2.end_form and Close_form.

whether all 4 modules are required in the driver pgm .

Open_form => It assign the form and printer, It should be first.

Start_form => It start Writing mode. You can use write_form in loop to write more than one lines befor End_form.

End_form => It end writing mode of current page and will require to start again through Start_form.

Close_form=> it end the Form. After this you can not start again for created file.

regards,

sreelakshmi