11-15-2007 9:48 AM
Hi all.
I have change include FM06PE04 to "Z"FM06PE04 and call the function ME_READ_PO_FOR_PRINTING , the function returns structure l_doc with data (structure l_doc is a type group) .
How can i read data from the fields of the tables in this structure ???
Please explain the spelling .
11-15-2007 9:55 AM
Look at the example below:
Here is the form in your old (Z) version of SAPFM06P:
FORM ENTRY_NEU USING ENT_RETCO ENT_SCREEN.
XSCREEN = ENT_SCREEN.
IF NAST-AENDE EQ SPACE.
XDRUVO = '1'.
ELSE.
XDRUVO = '2'.
ENDIF.
CLEAR: XFZ, XOFFEN, XLMAHN, XLPET.
*- Anstoß Verarbeitung -
*
CLEAR ENT_RETCO.
PERFORM LESEN USING NAST.
MOVE RETCO TO ENT_RETCO.
ENDFORM.
Here is form entry_neu in your new (Z) version of SAPFM06P:
*----
*
INCLUDE FM06PE02 *
*----
*
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.
Remember, the form should be in the Z version of SAPFM06P - not the Z version of SAPLMEDRUCK. Make sure the configuration (TNAPR) has the SAPFM06P program name and entry point.
Please give me reward ponts..
11-15-2007 10:12 AM
Hi
It depends on what you need to read, the structure L_DOC is like the type
MEEIN_PURCHASE_DOC_PRINT.
This type is defined in type group MEEIN:
types: BEGIN OF MEEIN_PURCHASE_DOC_PRINT,
XEKKO LIKE EKKO,
XPEKKO LIKE PEKKO,
XEKPA like msgpa occurs 0,
XEKPO LIKE EKPO OCCURS 0,
XPEKPO LIKE PEKPO OCCURS 0,
XEKET LIKE EKET OCCURS 0,
Xekkn like ekkn occurs 0,
Xekek like ekek occurs 0,
Xekeh like ekeh occurs 0,
XAEND type meein_xaend occurs 0,
xtkomv type komv occurs 0,
* XAETX TYPE MEEIN_xaetx occurs 0,
END OF MEEIN_PURCHASE_DOC_PRINT.
So if you need to read a data of a strcuture (like the header data), you can use directly it:
Es.: Purchase order number = L_DOC-XEKKO-EBELN
If you need to read a data of a table, you need to use a work area:
DATA: W_EKPO LIKE EKPO.
LOOP AT L_DOC-XEKPO INTO W_EKPO.
ENDLOOP.
Max
11-15-2007 11:08 AM