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

PO SAPScript question.

0 Likes
808

Hello SAPients!

I'm a little confused with a situation I have, I have to modify SAPScript MEDRUCK (ZMEDRUCK in fact) and print program SAPFM06P (ZSAPFM06P) I wanted to modify the ENTRY_NEU subroutine but there I can only see this code:

-


form entry_neu using ent_retco ent_screen.

data: l_druvo like t166k-druvo,

l_nast like nast,

l_from_memory,

l_doc type meein_purchase_doc_print.

clear ent_retco.

if nast-aende eq space.

l_druvo = '1'.

else.

l_druvo = '2'.

endif.

call function 'ME_READ_PO_FOR_PRINTING'

exporting

ix_nast = nast

ix_screen = ent_screen

importing

ex_retco = ent_retco

ex_nast = l_nast

doc = l_doc

changing

cx_druvo = l_druvo

cx_from_memory = l_from_memory.

check ent_retco eq 0.

call function 'ME_PRINT_PO'

exporting

ix_nast = l_nast

ix_druvo = l_druvo

doc = l_doc

ix_screen = ent_screen

ix_from_memory = l_from_memory

ix_toa_dara = toa_dara

ix_arc_params = arc_params

ix_fonam = tnapr-fonam "HW 214570

importing

ex_retco = ent_retco.

endform.

-


According to the development standards for this project, the SAPScript should not have PERFORM sentences, all the processing and calculating functionality should be in the print program, does that mean I have to modify the Function modules? Do you know other way of doing it? What would you recommend?

Thanks

5 REPLIES 5
Read only

Former Member
0 Likes
774

You will have to copy the entire standard program and make the changes.

Thanks,

SKJ

Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
774

In reality, the print program that you mention is really just an "in between" driver, the actually printing goes on in the function group MEDRUCK or ZMEDRUCK. You must copy the function group MEDRUCK to a "Z" version called ZMEDRUCK, this will then allow you to copy the function modules within, one of wich being the ME_PRINT_PO function module, copy this into Z_ME_PRINT_PO. Now in this function module is where you will make you modifications. There are lot so includes in there where you will need to copy them as well and comment out the old include name and include the "Z" version. Also, you will need to change the call in the mentioned program above so that it calls the "Z" version of your print function module.

call function 'Z_ME_PRINT_PO'            "<--  Like So
exporting
ix_nast = l_nast
ix_druvo = l_druvo
doc = l_doc
ix_screen = ent_screen
ix_from_memory = l_from_memory
ix_toa_dara = toa_dara
ix_arc_params = arc_params
ix_fonam = tnapr-fonam "HW 214570
importing
ex_retco = ent_retco.
endform.

REgards,

Rich Heilman

Read only

0 Likes
774

Thanks for your reply, as always, very good information.

I have one more question: What would you say is the best way of changing all those includes and the calls?

Read only

0 Likes
774

You simply need to change these via SE80. There is not really a quick and easy way to do this, other than jump into the code and start modifing.

Regards,

Rich Heilman

Read only

0 Likes
774

But make sure that you only copy what is required. You only need to make "Z" version of the includes that you need to modify, all others can stay as standard.

Regards,

Rich Heilman