Application Development 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: 

BAPI_PO_CREATE1 system wrong when Create item text and header text

Former Member
0 Kudos

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

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hello,

I think you should fill wa_potextitem-po_number as well.

Regards,

John.

5 REPLIES 5

Former Member
0 Kudos

Hello,

I think you should fill wa_potextitem-po_number as well.

Regards,

John.

0 Kudos

it's creating po_number ,how can i get the po_number?

0 Kudos

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

Former Member
0 Kudos

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

0 Kudos

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.