11-14-2005 10:57 AM
data: i_potextitem LIKE bapimepotext OCCURS 0 ,
wa_potextitem LIKE bapimepotext.
text information
wa_potextitem-po_item = 10.
wa_potextitem-text_id = 'F01'.
wa_potextitem-text_form = '*'.
wa_potextitem-text_line = 'test'.
APPEND wa_potextitem TO i_potextitem.
CALL FUNCTION 'BAPI_PO_CREATE1'
EXPORTING
poheader = wa_poheader
poheaderx = wa_poheaderx
TABLES
return = i_return
poitem = i_poitem
poitemx = i_poitemx
potextitem = i_potextitem
.
when I run it , come out the follow thing in the return message.
A ME 009
System error (text name empty in text object EKPO and text ID F01).
when i do not pay the focous on potextitem, it runs well.
I don't know whether it's a system's bug,
my version is 4.6c
11-14-2005 11:26 AM
Hello,
I think you should fill wa_potextitem-po_number as well.
Regards,
John.
11-14-2005 11:26 AM
Hello,
I think you should fill wa_potextitem-po_number as well.
Regards,
John.
11-14-2005 12:16 PM
11-14-2005 12:32 PM
Hi Leibnitz,
I think you have to fill the potextheader as well.
This is what the documentation says.
(If you haven't missed it).
Description
This parameter enables you to create header texts. The assignment of the text is carried out via a text ID. This identification number consists of the ID for the document type (a PO has F) and the text ID itself (example: F01). You can find these values in Customizing under Text Types for Header Texts in the node Texts for Purchase Orders .
In the case of item texts, PO_ITEM contains the item number of the purchasing document (in the case of header texts, the field PO_NUMBER is not to be populated).
If texts are to be changed with the Change method, only the complete text can be replaced. It is not possible to delete just one line, for example.
4. Examples of population of BAPI_PO_CREATE1 interface:
Parameter: POTEXTHEADER
PO_NUMBER
PO_ITEM = 00000
TEXT_ID = F01
TEXT_FORM = *
EXT_LINE = HEADER TEXT
Parameter: POTEXTITEM
PO_NUMBER
PO_ITEM = 00010
TEXT_ID = F05
TEXT_FORM = *
EXT_LINE = ITEM TEXT, ITEM 00010
Thanks and Regards,
Ravi
11-14-2005 12:32 PM
Hi,
When PO gets created you will get message PO Number XXXXXXXXXXXXXX has been created. If you are getting that message then BAPI is executed successfully. But immediately after executing BAPI you have to execute BAPI_TRANSACTION_COMMIT so that the created PO gets committed in the Database. If you do not call Transaction commit then this will be rolled back when PO create Bapi is called again.
Hope this helps.
Ramesh
11-14-2005 1:10 PM
hi, Ramesh,
Thank you very much, i forget to put
wa_poheader-status = 'F'.
In BAPI_PO_CREATE it looks like
wa_poheader-doc_cat = 'F'.
now all the thing are well.
thx very much.