Application Development and Automation 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: 
Read only

problem with save_text

Former Member
0 Likes
2,140

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

14 REPLIES 14
Read only

Former Member
0 Likes
1,990

Hello

You need to use FM COMMIT_TEXT after call SAVE_TEXT

Read only

0 Likes
1,990

Hi Dzed,

Thanks for your information.

could you pls provide the sample code for FM COMMIT_TEXT.

ur effor would be appreciated.

Rgss,

Priya

Read only

0 Likes
1,990

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'.

Read only

0 Likes
1,990

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

Read only

0 Likes
1,990

Hi,

Use SAVE_TEXT with following parameters

insert                = 'X'
   savemode_direct       = 'X'

Regards

Vinod

Read only

0 Likes
1,990

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

Read only

SuhaSaha
Product and Topic Expert
Product and Topic Expert
0 Likes
1,990

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

Read only

0 Likes
1,990

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

Read only

0 Likes
1,990

***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.

Read only

0 Likes
1,990

Hi,

Use this BADI ME_REQ_HEADER_TEXT for copying the PR text to PO.

Regards,

Surendar Reddy.

Read only

0 Likes
1,990

Hi Surender,

Could you pls paste the code how to use the BADI: ME_REQ_HEADER_TEXT

Thankyou,

Priya

Read only

0 Likes
1,990

Hi,

METHOD if_ex_me_req_header_text~copy_header_text.

re_copy ='X'.

ENDMETHOD.

Regards,

Surendar Reddy.

Read only

0 Likes
1,990

hi

Read only

0 Likes
1,990

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