cancel
Showing results for 
Search instead for 
Did you mean: 

Script Error in Item text thru SAVE_TEXT FM

Former Member
0 Kudos

Hi Guys ,

I want to print the Item text for materials in ME23N in a script . I have 3 conditions for two conditions ....

INCLUDE &T166P-TXNAM& OBJECT &T166P-TDOBJECT& ID &T166P-TDID& LANGUAGE &EKKO-SPRAS& PARAGRAPH IQ NEW-PARAGRAPH IQ 

is working properly and for a particluar condition this statement is not working properly and i solved this one by using the

PERFORM GET_ITEM_TEXT IN PROGRAM OUTPUT
USING &EKKO-EBELN&
USING &EKPO-EBELP&
USING &EKKO-SPRAS&
CHANGING &TDLINE&
ENDPERFORM

under this perform I am using READ_TEXT FM .... and after that i am looping the data and passing that data to a standard text as below ....


w_header-tdobject = 'TEXT'.

*   Standard text name
    w_header-tdname = 'Z_ITEM_TEXT'.

*   Text id
    w_header-tdid = 'ST'.

*   Language
    w_header-tdspras = '1'.

*  Populate the standard text with table data
    CALL FUNCTION 'SAVE_TEXT'
      EXPORTING
        client          = sy-mandt
        header          = w_header
        insert          = 'X'
        savemode_direct = 'X'
      TABLES
        lines           = i_text
      EXCEPTIONS
        id              = 1
        language        = 2
        name            = 3
        object          = 4
        OTHERS          = 5.
    IF sy-subrc <> 0.

    ENDIF.

And in Script editor am calling standard text as

INCLUDE Z_ITEM_TEXT OBJECT TEXT ID ST LANGUAGE EN

But i am not getting the data correctly in the script .

For ex. there r 2 items for a PO .... for first item you have just Item text1 and for second one you have

Item text2

Item text2 ( I need the text in the same format as in two lines thats why I am passing data to standard text as table data .)

So please help me to solve this one .

Thanks in advance.

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi,

You can also do another way.

1. By using read_text get item texts in internal table.

2.

loop at it_texts.
       call function 'write_form'
         element = 'ITEM_TEXT'.
         window = <window>
   endloop.

3. in main window under that element 'ITEM_TEXT' write as below

/E ITEM_TEXT

P it_texts-tdline.

Thanks,

Suma.