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

Sap script Standard Program

Former Member
0 Likes
1,562

Hi all,

Can anyone please explain me how Do I copy script standard program. Say for example I want to modify the program sapfm06p of PO. Now I want to copy the program as well as it's includes and do some manipulations as per my requirement. Can anyone exlain me in detail how do I achieve that. Also IN a script , If there are two pages can I have two page formats say DINA4 for first and legal for page two.

Regards,

Varun.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,439

Hi varun,

1. goto se38

type the program name

(dont go to sourc code, stay in the initial screen)

2. now

PROGRAM -


> COPY

3. a small window will come.

there u can specifiy what-what to copy !

4.

there are two pages can I have two page formats say DINA4 for first and legal for page two.

I don't think its possible.

regards,

amit m.

12 REPLIES 12
Read only

Former Member
0 Likes
1,440

Hi varun,

1. goto se38

type the program name

(dont go to sourc code, stay in the initial screen)

2. now

PROGRAM -


> COPY

3. a small window will come.

there u can specifiy what-what to copy !

4.

there are two pages can I have two page formats say DINA4 for first and legal for page two.

I don't think its possible.

regards,

amit m.

Read only

0 Likes
1,439

Hi Amit,

Thanks for the reply. But the problem if I copy like that is the includes get copied but the function modules do not get copied where in I need to modify the code. I heard that it can be done from tcode se80 copying the function group. Can you please explain me how it can be achieved in that way.

Regards,

Varun.

Read only

0 Likes
1,439

Hi

I think you mean you need to copy the fm to print PO, i.e: ME_PRINT_PO and ME_READ_PO_FOR_PRINTING.

If it's so, you have to copy the function group MEDRUCK and after you need to copy the std program sapfm06p to replace the calling of those std fms with your Z-functions.

Max

Read only

0 Likes
1,439

You will need to copy the function group MEDRUCK into ZMEDRUCK, make sure to copy the function modules into the "Z" versions. Then you can change the call in the SAPFZM06P program to call the "Z" version of ME_PRINT_PO.

Regards,

Rich Heilman

Read only

0 Likes
1,439

If it is all about PO output. then we should go with the

subroutine pool "SAPFM06P" then go to the Incoude "FM06PE02", it includes the function calls for all the above discussed. Then if you need to change the function module code copy the function group "MEDRUCK" INCLUDE only the copied z-function modules.

That solves the problem.

Read only

0 Likes
1,439

Hi Rich,

I copied the proram from se38 an function group from se80 and used the same in nace settings and the program wored for me. So far this is fine . Now I want to change the code in one of the include in the new functon group say I want to modify code in the include LMEDRUCKF0C. It is in the program saplmedruck, in the include LMEDRUCKF01. I want to insert some lines of code into that. Can you please explain me how do I achhieve that ?

Regards,

Varun.

Read only

0 Likes
1,439

Now you need to copy the include into a "Z" include and INCLUDE it in the main program of the function group, comment out the standard INCLUDE.

 
<b>* INCLUDE LMEDRUCKF0C .  " READ_ADDRESS
  INCLUDE LZMEDRUCKF0C .  " READ_ADDRESS</b>

  INCLUDE LMEDRUCKF0B .  " READ_DATA_FROM_DB

  INCLUDE LMEDRUCKF0A .  " TMSI2_LESEN
  INCLUDE LMEDRUCKF09 .  " PROTOCOL_UPDATE
  INCLUDE LMEDRUCKF08 .  " EKET_EKES_ABMISCHEN
  INCLUDE LMEDRUCKF07 .  " PRUEFEN_MAHNUNG
  INCLUDE LMEDRUCKF06 .  " XEKPO_BEREINIGEN
  INCLUDE LMEDRUCKF05 .  " XAEND_BEREINIGEN
  INCLUDE LMEDRUCKF04 .  " ERGAENZEN_XAEND

In the main program SAPLZMEDRUCK......



*******************************************************************
*   System-defined Include-files.                                 *
*******************************************************************
  INCLUDE LZMEDRUCKTOP.                       " Global Data
  INCLUDE LZMEDRUCKUXX.                       " Function Modules

*******************************************************************
*   User-defined Include-files (if necessary).                    *
*******************************************************************
* INCLUDE LMEDRUCKF...                       " Subprograms
* INCLUDE LMEDRUCKO...                       " PBO-Modules
* INCLUDE LMEDRUCKI...                       " PAI-Modules

<b>INCLUDE LZMEDRUCKF01.
*INCLUDE LMEDRUCKF01.</b>

INCLUDE LZMEDRUCKF02.
*INCLUDE LMEDRUCKF02.

INCLUDE LZMEDRUCKF1S.
*INCLUDE LMEDRUCKF1S.

INCLUDE LZMEDRUCKE01.
*INCLUDE LMEDRUCKE01.


Regards,

Rich Heilman

Message was edited by: Rich Heilman

Read only

0 Likes
1,439

Hi varun,

Copy even the includes into Z-includes & change the include names in the main program to z-includes(you can comments & add them). like copy LMEDRUCKF0C in to a ZLMEDRUCKF0C include & do the changes.

Read only

0 Likes
1,439

u need to copy LMEDRUCKF01 into a zprogram first n then within it change the include to ZLMEDRUCKF0C ( after copying LMEDRUCKF0C to a z program )..hereafter u can do modifications in it.

Hope it helps,

Regards,

Bikash

Read only

0 Likes
1,439

Hi Rich,

The program you specified in the reply is saplzmedruck where as the standard is saplmedruck. How did you copy saplmedruck to saplzmedruck ? I tried to that using se38 but I think that is not the right manner to copy this program.

Regards,

Varun.

Read only

0 Likes
1,439

When you copied the function group, this program is copied automatically, it is the main program of the function group. Go into SE80, enter ZMEDRUCK, change pull down to Function Group. Hit enter. Double click on the function group name, you will get a dialog, click on "Main Program". There you will see the source for the main program of the function group.

Regards,

Rich Heilman

Read only

0 Likes
1,439

Hi Rich,

Thank you very much. My problem is solved. Also I am awarding points to all the friends who tried to help me.

Regards,

Varun.