‎2010 Jun 04 6:16 AM
Hi all,
when I drop PR to PO in ME21N, the text of PR needs to be displayed in PO header text.
Im reading the text of PR, using READ_TEXT.
and I have used SAVE_TEXT to populate the header text of PO.
The problem is the text is not displaying on the header text.
But, when I double click the header text, it takes me to change editor,after coming back from change editor the text is displaying.
Pls let me know what would be the problem.
Thankyou,
Priya
‎2010 Jun 04 6:18 AM
‎2010 Jun 04 6:26 AM
Hi Dzed,
Thanks for your information.
could you pls provide the sample code for FM COMMIT_TEXT.
ur effor would be appreciated.
Rgss,
Priya
‎2010 Jun 04 6:37 AM
Hello
In this FM you pass OBJECT, NAME, text ID and LANGUAGE same as you pass into SAVE_TEXT for particular text.
And SAVEMODE_DIRECT = 'X'.
‎2010 Jun 04 6:48 AM
Hello Dzed,
Its not working.
The problem is im not passing the name as Im not aware of the PO no.
But when I double click the header text and come back from the change editor, the text is being displayed.
Pls let me know if there any alternative for this.
Thankyou,
Priya
‎2010 Jun 04 6:49 AM
Hi,
Use SAVE_TEXT with following parameters
insert = 'X'
savemode_direct = 'X'Regards
Vinod
‎2010 Jun 04 6:55 AM
Hi Dzed n Vinod,
Here is the code which im using after reading the text.
Pls let me know where it is going wrong.
***populate the text for PO
IF NOT t_potext[] IS INITIAL.
header_po-tdobject = 'EKKO'.
header_po-tdid = 'F02'.
header_po-tdspras = v_spras.
CALL FUNCTION 'SAVE_TEXT'
EXPORTING
client = sy-mandt
header = header_po
insert = 'X'
savemode_direct = 'X'
* OWNER_SPECIFIED = ' '
* LOCAL_CAT = ' '
IMPORTING
* FUNCTION =
NEWHEADER = header_new
TABLES
lines = t_potext[]
EXCEPTIONS
id = 1
language = 2
name = 3
object = 4
OTHERS = 5
.
IF sy-subrc = 0.
CALL FUNCTION 'COMMIT_TEXT'
EXPORTING
OBJECT = header_po-tdobject
NAME = '*'
ID = header_po-tdid
LANGUAGE = header_po-tdspras
SAVEMODE_DIRECT = 'X'
* KEEP = ' '
* LOCAL_CAT = ' '
* IMPORTING
* COMMIT_COUNT =
* TABLES
* T_OBJECT =
** T_NAME =
* T_ID =
* T_LANGUAGE =
.
ENDIF.Thankyou,
Priya
‎2010 Jun 04 7:00 AM
You are not passing TDNAME ?
You must be saving the Long Text after the PO is created, correct ?
If you are using BAPI to create the PO, the PO number will be stored in the RETURN param. You can get the PO number from there.
Edited by: Suhas Saha on Jun 4, 2010 11:30 AM
‎2010 Jun 04 7:05 AM
Hi Suhas,
Tdname is not yet generated.
Thing is im copying the text from PR to PO, once I drop the PR to PO.
The text has to be displayed. But the TDNAME, ie the PO no would be generated once I save the PO.
But the text needs to be displayed before that.
Pls let me know if there any alternative for this.
Regards,
Priya
‎2010 Jun 04 7:28 AM
***populate the text for PO
IF NOT t_potext[] IS INITIAL.
header_po-tdobject = 'EKKO'.
header_po-tdid = 'F02'.
header_po-tdspras = v_spras.
header_po-tdname = 'XXXXX' -> Include the tdname
CALL FUNCTION 'SAVE_TEXT'
EXPORTING
client = sy-mandt
header = header_po
insert = 'X'
savemode_direct = 'X'
OWNER_SPECIFIED = ' '
LOCAL_CAT = ' '
IMPORTING
FUNCTION =
NEWHEADER = header_new
TABLES
lines = t_potext[]
EXCEPTIONS
id = 1
language = 2
name = 3
object = 4
OTHERS = 5
.
As you are using savemode_direct ='X' no need of using commit_text.
In the debug just check the exception.
‎2010 Jun 04 7:25 AM
Hi,
Use this BADI ME_REQ_HEADER_TEXT for copying the PR text to PO.
Regards,
Surendar Reddy.
‎2010 Jun 04 7:35 AM
Hi Surender,
Could you pls paste the code how to use the BADI: ME_REQ_HEADER_TEXT
Thankyou,
Priya
‎2010 Jun 04 7:45 AM
Hi,
METHOD if_ex_me_req_header_text~copy_header_text.
re_copy ='X'.
ENDMETHOD.
Regards,
Surendar Reddy.
‎2010 Jun 04 7:51 AM
‎2010 Jun 04 8:26 AM
Hi ,
Thanks for your information.
@Surendar: The badi ME_REQ_HEADER_TEXT is not working .
and the worst thing is ME_PROCESS_PO_CUST is not availble in this system as it was 4.6 version.
Any how thanks everybody for ur time and information.
Rgs,
Priya