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: 

SAP Standard Scripts ( how to Modify Standard Scripts)

Former Member
0 Kudos

hi every one , This is Abdul Rahman , i want to know how i should modify Standard SAP Scripts like RVORDER01 or MEDRUCK SCRIPTS ,i want to know whole process . and how to Run the Script . plz any kindly send some good DOC or web pages which i can acess

thankyou

Abdul Rahman

7 REPLIES 7

Former Member
0 Kudos

Unfortunately I can't post any sample code because it will be very confusing and complicated, but I will try to elaborate.

Go to transaction OMFE. Tell me what you see there for the output type you are interested in. Let me take the standard output type NEU. The entry looks something like this.

NEU Purchase order 1 SAPFM06P ENTRY_NEU MEDRUCK.

The first one is your output type, next is its description, next is the medium, then the program, routine, and the form name.

You already copied the layout MEDRUCK to ZMEDRUCK. Now copy SAPFM06P to ZZSAPFM06P. Now ENTRY_NEU routine is in the include FM06PE02. You need to make your changes here to accommodate for the new field. So copy this include to ZZFM06PE02 and make your changes. Also, in ZZSAPFM06P, change the line where it says INCLUDE FM06PE02 to INCLUDE ZZFM06PE02.

Now in this routine ENTRY_NEU, there is a function module call ME_READ_PO_FOR_PRINTING which reads in the PO data from the tables. We need to copy this function module as well as this is where you will do your extra selections for the new fields. You will do the same with the other function call ME_PRINT_PO, if you need to change anything on the print.

after this to define output type...

NACE

You can track the form and the print program used for that form

NACE is used to create output type while creating the output type you will mention forms, and driver program.

that will be maintained in the table TNAPR.if you create the output type using NACE then it will be automatically visible in table NAST and TNAPR.

so check in NAST, TNAPR table

http://help.sap.com/saphelp_erp2005/helpdata/en/c8/1989fe43b111d1896f0000e8322d00/frameset.htm

EX--in simple terms..take a transaction say ME21N ( Purchase Order ), u can see a Print icon there. now when u click on this icon, it has to print the PO document. Now how does it do that? when u click Print, the control gets transffered to a print program, now which program gets triggered is decided by what program name u specify in NACE.

So in NACE>EF>Output Type>NEU>processing routine--> u can see some standard program already configured( maybe SAPFM06P n form MEDRUCK )..these are the programs n sapscript that gets executed wen u say "PRINT" in the transactrion...so u can customise the print program for customer changes over here by copying the standard program n form into a Z/Y one and replacing the program names in NACE.

0 Kudos

Sir,

as i am new to ABAP

i am struggling with the modification of the standard SAPSCRIPT MEDRUCK or assigning my own SAPSCRIPT in NACE to the PO output types.

i have seen your forum and acted accordingly

here are some problems that i am facing please help Sir

-


assigning my own SAPSCRIPT

-


1. it is showing OPEN FORM error for document 'so and so' on having the print preview.

-


copying the MEDRUCK SAPSCRIPT and Modifying

-


i would like to tell you that when i copied MEDRUCK SAPSCRIPT into a ZMEDRUCK, i am not able to add, delete any new elements there. i can edit or modify those which are reviously there but adding new window or repositioning the old windows is not possible

1. while copying the program SAPFM06P the language is german, how to change that as language option is not there

2. i also copied the include FM06PE02, now on saving its asking for a ENHANCEMENT POINT

3. i copied the Function Group MEDRUCK and function modules ME_READ_PO_FOR_PRINTING and ME_PRINT_PO but I am not able to find the place where i have to mention the new SAPSCRIPT name so that it would work.wher woul i'll get OPEN_FORM, WRITE_FORM, where i'll get to give my SAPSCRIPT name

4. is it sufficient to change the name of the SAPSCRIPT in the NACE output types FORM or we have to change this name internally also if we are changing our own created SAPSCRIPT

5. right now a field is displaying a material number, i have the req. of taking its description from a structure on a specific condition and display it there, this coding will be done at which place, function gruop or SAPSCRIPT.

i have to do certain format changes that is

REPOSITIONING of ADDRESS and other windows

upload the logo

and some field display modification

for this what you will advice

1. copy of MEDRUCK and modifying ... because if i am copying it into ZMEDRUCK and placing it in NACE it is working without CHANGING the program and function group... but all my motives are not done as i told u its optionless of new windows and repostioning option

2. if i am making a new script then i am clueless what all thing to be changed and the trubles i mentioned above

please guide Sir

i need it urgently

0 Kudos

Dear All,

Kindly help in modifying the SAP Standard script of PO printing as im very new to SAPSCRIPT programing.

My requirements are as follows.

1.Need to add field in the customer address area, CNPJ

CNPJ = (Select paval from T001Z for some cond...) + ( select J_1BBRANCH from

T001W for some cond...) + Function returns HR_BR_CGC_CHECK_DIGITS).

2.Need to add field in the PO Item display area, UnitPrice.

UnitPrice = ( Select KBETR from KONV where KONV-KNUMV=EKPO-KNUMV

and KSCHL = 'ZPBO' or KSCHL='PBXX'.

3.Neet to add the company logo in the Title area.( how to include a logo to the script)

<b>i went thru the coding and understand that we need to do the changes in the

ME_READ_PO_FOR_PRINTING and ME_PRINT_PO function modules.

But i dont know how to and where to add my coding ( as above given reqmt) in those func.modules, also im not sure abt how to do the changes in the SAPSCRIPT FORM LAYOUT-(Desing/Text)</b>

Note:

For this, I had copied , MEDRUCK as ZMEDRUCK,

SAPFM06P as ZSAPFM06P ,

FM06PE02 as ZFM06PE02,

did the NACE part and configured the ME23N Print Preview with the newly copied programs and form.

copied...

ME_READ_PO_FOR_PRINTING as ZME_READ_PO_FOR_PRINTING,

ME_PRINT_PO as ZME_PRINT_PO.

<b>Also im getting a declaration related error when trying to activating the ZME_PRINT_PO.</b>

Kindly guide me to solve the above given issues.

Former Member
0 Kudos

Hi,

Modifying SAP Forms

If you want to modify SAP forms, set up your development environment as follows:

Make sure that no SAP-standard forms are stored as client-specific copies in your development client.

Such forms should be held only in client 000, the SAP development and installation client. If you access an SAP-standard form from another client, then the central copy in client 000 is used.

If you need to remove SAP-standard objects from your development client, see Notes 10388 and 3355 in the SAP Online Service System (OSS). These notes explain the procedure for saving modified forms and then deleting all forms.

To modify SAP standard forms,

– Copy the forms you need from client 000 to your development client.

– Rename the forms using a name from the customer name reserve (names starting with Y or Z).

– Copy the forms to one of your own Y or Z development classes.

Renaming the SAP standard object makes it possible to manage and transport your changes with the SAP workbench organizer. The organizer is not activated for SAP-standard objects that are modified in clients other than 000.

To put your modifications into effect, you must also modify the ABAP print program used to print documents that use this form. You should rename such print programs and store them in your own Y or Z development classes.

You can use the SAP Customizing System to replace the SAP print program with your modified print program in the affected applications.

Forms: Concepts

Forms are used to control the page layout and also the text formatting in your documents. Before formatting a document for output to the screen or to a printer, you must assign a form to it. If you do not specify a form for a document, then the SYSTEM form is assigned to the document by default.

Application-specific forms are used in SAP applications to specify the page layout for such special documents as invoice or checks. These forms specify the structure of the information on the page(s) of such a document. They define, for example, the address header, item lines, the footer, and so on.

There are two ways to format texts with forms:

In the standard SAPscript text processing (Tools ® Word processing ® Standard text), you can select a form for a document. You can then type text into the main window of the form and output the document in the format defined in the form.

For example, you can select a form for a letter. You can then type the body text of the letter in the main window. When you print the letter, the default text elements in the other windows of the form (heading, footer, and so on) are printed with the body text.

A document can be generated by a print program in one of the SAP applications. The print program uses a form to generate the document. Most correspondence and document generation in the SAP System are handled by way of print programs.

A print program selects the text elements that are to be printed in the windows of a form. It may also collect information from the user or ask the user to input text directly, as in some correspondence functions. The print program may also provide data for variables defined in the form.

Finally, the print program uses the form to format the document for display or printing.

Check this link...

http://help.sap.com/saphelp_erp2005/helpdata/en/d1/802d7d454211d189710000e8322d00/frameset.htm

Thanks and Regards,

Bharat Kumar Reddy.V

Former Member
0 Kudos

Hi Abdul,

Step 1.

In SE71 Transaction Copy the standard Sapscript to your 'Z' Sapscript.

Step 2.

Go to NACE transaction assign your newly created 'Z' sapscript to the output type of your application.

Step 3.

Execute your transaction now your new sapscript will be executed.

Regards,

Mukesh Kumar

Former Member
0 Kudos

Hi this is deepthi reddy.Navigate to se71 create a zform there.Then in the menu bar UTILITIES->COPY FROM->.Then you will be asked the form name that has to be given .specify the form name.thats it done.the standard program will be apperaing in your zprogram and you can modify it.

Former Member
0 Kudos

hi abdul ... I am Chandu Reddy

well u ll query was rearding the modification of medruck...

well from the earlier post u might have got an idead about hoe to go to nace and check for the o/p type and then get the source program...

when u go to nace and select NEU for the standard PO ..and go further now u would get the

program name ...form name ...and form routine ...

for example for medruck it would be ...

SAP(SOME PROG NAME) FORM_ENTRY MEDRUCK.

now copy the prog name into se38 and that main program would have all the include programs

now search the main program for FORM_ENTRY routine ...

when you give the spool request this is the point where the controls come into the driver program.usually this routines will consist of some sap function modules where in which the code is written for the script o/p......else u can also have the code in the same routine (not sure it has been long time) ...

now go for the se71 and open medruck form ...go for text editor for the main window ..or the window u think is not necessary..or the window which u want to make changes for ...

for example u want to make the changes for main window ...

go to the text editor of the main window .. there ucan see the code under the text elements ....

here we need to notice that same medruck form is used for the RFQ QUOTATION and PO

so in the main window the text elements would for example consider header data in the script..

there would be for example

ITEM_HEADER_A for PO

ITEM_HEADER_F for RFQ

now come down to se 38 driver program where u have been in FORM_ENTRY..

now search for the funtion module WRITE_FORM in it ..with element ITEM_HEADER_A for PO...

in this way u can proceed to make changes to any standard sap script ....

and as u cannot make changes to the standard program copy it and make the changes in the NACE transaction.

Regards,

Chandu Reddy Sunkari