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

sample scripts for trainig example

Former Member
0 Likes
650

hi experts,

i want some sample standard trainig example(SAP SCRIPTS) which are there in the system.

like smart form: sf_example_01.

best regards,

ashok.

4 REPLIES 4
Read only

Former Member
0 Likes
608

hi,

There are some Standard Sap Scripts in SAP. We cant directly execute them in scripts we have to use some T-codes and by giving some input to the required fields we can see the output printform.

I will show one example. There are some Standard Sap Scripts such as MEDRUCK which is a standard Sap Script for Purchase Order and RVINVOICETH for Sales Order billing and so on...

To see oupt of MEDRUCK go to T-code ME9F give purchase order number and execute select one number and click on dislplay messages button on application tool bar you can find the print form of MEDRUCK.

You cannot change the Standard Sap Scripts but you can use Standard Sap Scripts and Copy them to userdefined Script and can make changes to them and replace standard Sap Script with usedefind script.

Ex: Go to SE71,

on menu bar u find Utilities->copy from Client. click on it u ll find new screen showing

Form name:

Source Clinet:

Target Form:

give Form name as usedefined form name EX: ZFORM1

Source client as 000 and

Target form as MEDRUCK.

execute.

Now, the standard from MEDRUCK is copyied to your form ZFORM1.

NOW, go to SE71 and give form name as ZFORM1 and do some changes to the form such as adding logo any thing. save and Activate.

Now, you have done changes to the Form ZFORM1 and u have to replace your form with standard SAP Script.

Go to NACE Transaction.

on Applications select EF for purchase order and click Output types button on application tool bar.

now select NEU as output types dobule click on Processing Routines.

now click on Change option on application tool bar and on right side u find MEDRUCK in form place replace MEDRUCK with ZFORM1 and SAVE.

go back twice and now go to T-code ME9F give the purchase order number and execute and select one option and click on display messges button .

you will find the changes that you have done in ZFORM1. so we cant chage the standard Sap Scripts by copying the Standard Sap Scripts we can chage and replace with our forms.

Hope this helps, Do reward.

Read only

Former Member
0 Likes
608

follow the link for detailed info on sapcript

http://www.thespot4sap.com/Articles/SAPscript_elements_more.asp

coding example

REPORT YLSD999A.

DATA W_LENGTH TYPE I.

  • GENERAL PURPOSE SUBROUTINES FOR CALLING FROM SAPSCRIPTS

*----

-


*----

-


FORM DISPLAY_POUND TABLES IN_TAB STRUCTURE ITCSY

OUT_TAB STRUCTURE ITCSY.

DATA: COUNT TYPE P VALUE 16.

DATA: W_VALUE(17) TYPE C. "defined as 7 chars to remove pence

DATA: W_CHAR TYPE C.

DATA: W_DUMMY TYPE C.

DATA: W_CURR(3) TYPE C.

  • Get first parameter in input table.

READ TABLE IN_TAB INDEX 1.

WRITE IN_TAB-VALUE TO W_VALUE .

  • get second parameter in input table

READ TABLE IN_TAB INDEX 2.

MOVE IN_TAB-VALUE TO W_CURR.

IF W_CURR = 'GBP'.

W_CURR = '£'.

ENDIF.

W_LENGTH = STRLEN( W_CURR ).

  • look for first space starting at right.

WHILE COUNT > -1.

W_CHAR = W_VALUE+COUNT(1).

  • W_CHAR = IN_TAB-VALUE+COUNT(1).

IF W_CHAR = ' '.

COUNT = COUNT - W_LENGTH + 1.

W_VALUE+COUNT(W_LENGTH) = W_CURR.

COUNT = -1.

ELSE.

  • W_VALUE+COUNT(1) = W_CHAR.

COUNT = COUNT - 1.

ENDIF.

ENDWHILE.

  • read only parameter in output table

READ TABLE OUT_TAB INDEX 1.

OUT_TAB-VALUE = W_VALUE.

MODIFY OUT_TAB INDEX SY-TABIX.

ENDFORM.

cheers,

sharad