cancel
Showing results for 
Search instead for 
Did you mean: 

Using BAPI_PO_CHANGE to change header text of PO

Former Member
0 Kudos

Hi,

Would anyone know how to use BAPI_PO_CHANGE to modify a PO's header text (header text 1 and header text 2)? I'm passing the data to the table POTEXTHEADER but the changes weren't reflected when i viewed the PO.

Thanks.

Accepted Solutions (0)

Answers (4)

Answers (4)

Former Member
0 Kudos

Hello Winnie,

Please have a look at the OSS notes 782948. This may give u the solution.

Former Member
0 Kudos

Hi,

We can't access the OSS right now. Could you post the solution instead? Many thanks.

Former Member
0 Kudos

Hi,

Here is the Note text - Given this you probably can try the SAVE_TEXT directly now

You use the PurchaseOrder.Change API to change only the texts in a purchase order. The BAPI_PO_CHANGE BAPI returns the message that the purchase order was saved, but the text changes are not apparent in the purchase order.

When you call BAPI_PO_CHANGE, the system does not write any change documents for any text changes.

You cannot delete texts for an item object.

The system does not return the created/changed texts to the initiator after processing.

Solution

Implement the program correction.

Note the following:

To be able to delete item texts, enter the following information for the BAPI in the POTEXTITEM structure and/or the POTEXTHEADER structure:

PO_NUMBER: not absolutely necessary

PO_ITEM: define the corresponding number for items, with header texts the line item number is always 00000

TEXT_ID: for example F04

TEXT_LINE: leave this field empty explicitly.

Due to technical restrictions, we cannot provide this correction in SAP R/3 Release 4.6C.

Regards,

Ravi

Note : Please mark the helpful answers

Former Member
0 Kudos

Hai Winnie

check with the standard progrm 'LMASSPURCHREQU09' for

'BAPI_PO_CHANGE'

Thanks & regards

Sreenivasulu P

former_member181962
Active Contributor
0 Kudos

HI Winnie,

The bapi_po_change bapi calls the save_text function module in turn.

It should update the header texts.

Can you show what you are coding?

Regards,

Ravi

Former Member
0 Kudos

that's what i'm wondering about. the said function module calls save_text but it just wouldn't work in my case.

my code looks something like this:


 CALL FUNCTION 'BAPI_PO_CHANGE'
    EXPORTING
      PURCHASEORDER                = V_PO
*     POHEADER                     = I_PO_HEADER
*     POHEADERX                    =
*     POADDRVENDOR                 =
*     TESTRUN                      =
*     MEMORY_UNCOMPLETE            =
*     MEMORY_COMPLETE              =
*     NO_MESSAGING                 =
*     NO_MESSAGE_REQ               =
*     NO_AUTHORITY                 =
*     NO_PRICE_FROM_PO             =
*   IMPORTING
*     EXPHEADER                    =
   TABLES
*     RETURN                       = I_RETURN
*     POITEM                       = I_PO_ITEMS
*     POITEMX                      =
*     POADDRDELIVERY               =
*     POSCHEDULE                   = I_PO_ITEM_SCHEDULES
*     POSCHEDULEX                  =
*     POACCOUNT                    = I_PO_ITEM_ACCOUNT_ASSIGNMENT
*     POACCOUNTPROFITSEGMENT       =
*     POACCOUNTX                   =
*     POCONDHEADER                 =
*     POCONDHEADERX                =
*     POCOND                       =
*     POCONDX                      =
*     POLIMITS                     =
*     POCONTRACTLIMITS             =
*     POSERVICES                   =
*     POSRVACCESSVALUES            =
*     POSERVICESTEXT               =
*     EXTENSIONIN                  =
*     EXTENSIONOUT                 =
      POTEXTHEADER                 = I_PO_TEXTHEADER
*     POTEXTITEM                   =
*     POPARTNER                    =
            .

i only passed the PO number and the structure containing the header texts. Would this have anything to do with the fm not working properly?

Former Member
0 Kudos

Hi,

1. Can you show the code, where you loading the TEXT table, the parameters you are passing?

2. Are you calling BAPI_TRANSACTION_COMMIT after this?

Regards,

Ravi

Former Member
0 Kudos

i'm only filling the TEXT_LINE and TEXT_FORM is defaulted to '*'.

I'm not calling bapi_transaction_commit

Former Member
0 Kudos

Hi,

Not filling TD_FORM is ok, But I think you will have to call the BAPI_TRANSACTION_COMMIT to save the changes to the database.

Also, cross check the object / tdid parameters.

Regards,

Ravi

Note : Please mark the helpful answers

Former Member
0 Kudos

what do i have to pass to BAPI_TRANSACTION_COMMIT? i tried using it w/o any parameters and the PO still remains the same.

how can i double check the object/tdid parameters?

thanks

Former Member
0 Kudos

Go to ME23n, display the text and go into the full screen mode. Here, in the menu Go TO-->Header

You should be able to see the parameter values.

Regards,

Ravi

Former Member
0 Kudos

Hi,

Look at the small example which I used for other application....

CALL FUNCTION 'BAPI_ACC_DOCUMENT_POST'

EXPORTING

documentheader = it_hdr

TABLES

accountgl = it_gl

ACCOUNTRECEIVABLE = act_rec

currencyamount = it_curr

return = t_result.

*

CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'.

After that you just call the above FM thats all no need to pass something.

Thanks.

If this helps you reward with points.

Message was edited by: KDeepak

Former Member
0 Kudos

still no changes in the header text...

former_member181962
Active Contributor
0 Kudos

try this way,

CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'

EXPORTING

wait = <'X' or space>

IMPORTING

return = lv_return.

IN you case try using commit_text function module as well.

Regards,

ravi

Former Member
0 Kudos

still no changes when i called bapi_transaction_commit...

Former Member
0 Kudos

Hi,

Why don't you use SAVE_TEXT to update the texts followed by COMMIT_TEXT.

Text Name Order Number

Language EN

Text ID F01 Header text

Text object EKKO Purchasing doc. header texts

Regards,

Ravi

Note : Please mark the helpful answers