‎2006 Nov 01 8:43 PM
I am modifying a standard medruck sapscript form for the customer needs. Now on the printout, if i want the text under 'item_text' text element to come after the text under'ITEM_SCHEDULE' text element, where should I change the code? in main program ? or in form itself? Please give me an idea reg. this.
/E ITEM_TEXT
IC ,,&TTXIT-TDTEXT&
/: INCLUDE &T166P-TXNAM& OBJECT &T166P-TDOBJECT& ID &T166P-TDID& LANGUAGE &
/E ITEM_SCHEDULE
IM ,,,,,,&RM06P-PRMG1&,,&T006A-MSEHT&,,&RM06P-PRITX& &RM06P-LFDAT&,,,,
= &RM06P-PHTXT(27)&
Thanks a lot,
Krishen
‎2006 Nov 01 8:48 PM
Hi, in this case, you will need to change in the program itself. Why? Because it is using Text Elements in the MAIN window and the order in which the elements are printed is driven by the function calls(WRITE_FORM) in the print program. So in your case, have a look at include LMEDRUCKF18 line 426. THis is the call to the element ITEM_TEXT
Regards,
Rich Heilman
‎2006 Nov 01 8:48 PM
Hi, in this case, you will need to change in the program itself. Why? Because it is using Text Elements in the MAIN window and the order in which the elements are printed is driven by the function calls(WRITE_FORM) in the print program. So in your case, have a look at include LMEDRUCKF18 line 426. THis is the call to the element ITEM_TEXT
Regards,
Rich Heilman
‎2006 Nov 01 9:00 PM
thanks Rich.
Can you give me an idea of how to modify here?
I mean if i call function related to item_text after the function related to item_schedule, can it solve the problem?
Looks like i have to copy the whole main program with includes and change it.
Thanks a lot.
‎2006 Nov 01 9:10 PM
Yes it will, and yes you will have to copy a couple of things, first you will need to copy the driver, program SAPFM06P into custom program SAPFZM06P. Then copy function group MEDRUCK into ZMEDRUCK with all the function modules, then go to the SAPFZM06P program and copy the include program FM06PE02 into ZFM06PE02 and include this in the main program SAPFZM06P, inside the ZFM06PE02, change the call in the ENTRY_NEU form to call the "Z" version of your function module in the ZMEDRUCK function group.
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.
<b>call function 'ZME_PRINT_PO'</b>
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.
You must then change your configuration for the purchase order to tell the system to use the "Z" versions of the print program SAPFZM06P
Regards,
Rich Heilman
‎2006 Nov 03 2:52 PM
Rich.
I tried this procedure but again got busy in other ABAP tasks. Thanks for your detailed procedure. I appreciate.
Krishen.
‎2006 Nov 03 2:57 PM
Hi Kishen,
Otherthann modifying the standrd Print program, You can write external subroutine whereever you want the text and pass this information back to layout.
regards,
Chandra.
‎2006 Nov 03 3:22 PM
Hi Krishen,
if you think you are very experienced and very tough you may go ahead and copy and change the module pool. You will have more trouble to get it integrated again. As far as I remember the print modules are integrated part of the huge purchase module.
I would not try this.
You could try to leave ITEM_TEXT empty and place move the lines under the ITEM_SCHEDULE lines. Possibly the data are still vailable. But then, if there are no schedule lines for output, you would not get the text lines as well.
I'm afraid you may have to use external performs to check conditions and work around them this way. My estimation is that it's less work that way.
Regards,
Clemens