‎2011 Jan 14 12:04 PM
Hi,
I am trying to add header text to a Purchase Order using bapi_po_change.
I can get it to add a line of text OK, but when I go to add a second line it just over writes the original line.
is there a way to get the bapi to append lines to what is already there?
Thanks
‎2011 Jan 14 12:18 PM
You can use FM 'SAVE_TEXT' to update header text in PO. You need to pass text in 'LINES' table and in the header importing variable pass tdobject, tdname, tdid, tdspras. You can get the values for these parameters from header text. Double click on the header text which you want to change. Open the header text in editor mode. Then go to menu Goto-->Header. It will show text details Text Name,Language,Text ID,Text Object. Text Name will be dynamically passed as PO no.
‎2011 Jan 14 12:11 PM
Without looking at the BAPI in detail, how about reading the existing text first, append your new line, then send the whole stuff in the BAPI call?
Thomas
‎2011 Jan 14 12:18 PM
You can use FM 'SAVE_TEXT' to update header text in PO. You need to pass text in 'LINES' table and in the header importing variable pass tdobject, tdname, tdid, tdspras. You can get the values for these parameters from header text. Double click on the header text which you want to change. Open the header text in editor mode. Then go to menu Goto-->Header. It will show text details Text Name,Language,Text ID,Text Object. Text Name will be dynamically passed as PO no.
‎2011 Jan 14 12:25 PM
No you can only replace the whole set of lines, check parameter POTEXTHEADER documentation (F1)
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...
So, use suggestion, use BAPI_PO_GETDETAIL1 to get POTEXTHEADER and POTEXTITEM current values.
Regards,
Raymond