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

how to run modified standard sap scripts to get an output

Former Member
0 Kudos
413

HI friends ,

i have modified MEDRUCK standard layout by copying it into ZMEDRUCK.

for medruck the program is SAPFM06P, i would like to know how to run this device program to print the layout.

Please Let me know as early as possible.

Regards,

Roberts.K

1 ACCEPTED SOLUTION
Read only

Former Member
0 Kudos
375

Some transactions that used these sapscript are me22n me9l me9k

14 REPLIES 14
Read only

juan_suros
Contributor
0 Kudos
375

I suggest you use transaction ME9F to print Purchase Orders.

Find a Purchase Order in your system that is set up to use your changed printing program, and use the "Message detail" and "Trial printout" buttons to direct the document to a safe printer and start the printing process.

Read only

0 Kudos
375

Hi Juan,

Let say i have an extra field from the table in the layout.

i would like that to be declared in standard print program that is associated with the modified form.

what is the procedure to identify where exactly we need to add the field in the program and how to i modify standard print program.

let me know if possibel with an example ,a bit confusing to me .

Thanks in advance,

Regards,

Roberts.K

Read only

0 Kudos
375

Hi Roberts K,

If you don't want to modify the original SAP* program that handles MEDRUCK form (or ZMEDRUCK form), I suggest you to make all the calculations within your Z*-form, via commands PERFORM... IN PROGRAM... USING... CHANGING. If you do so, you won't have to modify the standard printing program

You could have a look at this thread:

Please let us know if it helped. BR,

Alvaro

Read only

0 Kudos
375

HI alvaro,

i want to modify the standard medruck program, i think you got me wrong , i was expecting the procedure for doing that modification.

please let me know.

regards,

roberts.k

Read only

0 Kudos
375

Hi Roberts,

I would not advise you to change the standard medruck program. You copy this to a custom program, like you copied the form to your custom form. Make your changes in the custom program.

Then in configuration(transaction OMFE), assign the new program and new form to the desired output type.

Hope this helps,

Srinivas

Read only

0 Kudos
375

Hi srinivas,

i tried to do that , but the custom form zmedruck is not allowing me to do that , can u let me know the procedure and where to insert the fields logic that have been inserted in the form , let me know .

thanks in advance,

regards,

roberts.k

Read only

0 Kudos
375

Hi srinivas,

could you let me know how to close the posted message.

i tried to do that , but the custom form zmedruck is not allowing me to do that , can u let me know the procedure and where to insert the fields logic that have been inserted in the form , let me know .

thanks in advance,

regards,

roberts.k

Read only

0 Kudos
375

Hi Roberts,

Since the standard program has lot of includes in it, you need to copy some of those includes as well into your custom programs(you don't have to copy all of them).

Let us assume that you are using standard program and form. See in the configuration which form routine is attached to it(typically it will be ENTRY*). Now go to this routine and see if your selection for the new field needs to be added in there. If so, you need to copy the include in which this routine is coded. Similarly you will find all the includes where you want to change, copy them into custom includes. Then you copy SAPFM06P, and within that program, replace the standard includes with the custom ones that you just identified and created.

Basic logic is that wherever you need to change the standard program, you need to copy that include.

Hope this helps,

Srinivas

Read only

0 Kudos
375

HI srinivas,

i have understood a littel bit.

could you be elobarate, like where can i find the standard inlcude and to include in standard program.

please can you if you have any sample code.

thanks is advance. its urgently needed.

regards,

roberts.k

Read only

0 Kudos
375

Hi Roberts,

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.

I am not sure how I can continue it from here but proceed with one step at a time and let me know where you are stuck and then we can proceed from there.

Regards,

Srinivas

Read only

0 Kudos
375

HI srinivas,

That is very helpful, thank you very much for the pain you to took in writing this , i will try this and will get bcak to you , thanks a lot once again .

Regards,

Roberts.K

Read only

Former Member
0 Kudos
376

Some transactions that used these sapscript are me22n me9l me9k

Read only

0 Kudos
375

Hi Hernanadez,

Thats nice , thanks for the information, but could let me know how to trace these transactions.

Thanks in advance,

Regards,

Roberts.K

Read only

0 Kudos
375

Hi Roberts,

It is not possible to trace these transactions all the way to the output as output is handled separately. Associated with each purchase order, there will be a document type. For each document type there will be some output types associated with them. You can find out which output types are assigned to a particular document type, either from configuration or take an existing PO, go to ME23N or ME22N. In the initial menu, follow the path 'Goto --> Messages'. You will see the output types here.

Now every output will end up in NAST table. This table has a object id which normally will be your document number(internal representation with leading zeros) and the output type you obtained earlier.

Hope this helps,

Srinivas