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

Regarding READ_TEXT Fm

Former Member
0 Likes
2,794

Hi ,

i want to read the long text from sales text in material master . Iam using the read_text function module. I know the id i.e '0001' , and object is 'MVKE' . How to pass the value for the parameter name .

iam having the values of the materials in an internal table .

This is my code

LOOP AT i_final INTO wa_final.

IF wa_final-matnr IS NOT INITIAL.

MOVE wa_final-matnr TO V_NAME.

CALL FUNCTION 'READ_TEXT'

EXPORTING

  • CLIENT = SY-MANDT

id = '0001'

language = 'E'

name = V_NAME

object = 'MVKE'

  • ARCHIVE_HANDLE = 0

  • LOCAL_CAT = ' '

  • IMPORTING

  • HEADER =

TABLES

lines = i_line

EXCEPTIONS

id = 1

language = 2

name = 3

not_found = 4

object = 5

reference_check = 6

wrong_access_to_archive = 7

OTHERS = 8

.

APPEND i_line.

CLEAR i_line.

ENDIF.

ENDLOOP.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
2,041

Hi A Kumar,

V_NAME is combination of material number with leading zeros (18 Char), sales org and distribution channel.

MATNR CHAR 18

VKORG CHAR 4 Sales Organization

VTWEG CHAR 2 Distribution Channel

So it will be like this...

Find VKORG and VTWEG from Respective tables...

Pass MATNR to VBAP get the VBELN

Pass VBELN to VBAK and GET the VKORG and VTWEG..

Or see as per ur configuration if any other table contains the value of VKORG and VTWEG...

and then..

So use concatenate statement here to get the exact value of V_NAME

CONCATENATE MATNR VKORG VTWEG INTO V_NAME.

Now pass this V_NAME to FM..

Try to run READ_TEXT FM from SE37 and pass the values above...

Goto MM03

Enter Material no ..

Select Sales Text.,,

Here it will ask you to enter sales org and Dist Channel..

And modify your code accordingly as well...

Hope it will solve your problem..

Thanks & Regards

ilesh 24x7

Hi ,

i want to read the long text from sales text in material master . Iam using the read_text function module. I know the id i.e '0001' , and object is 'MVKE' . How to pass the value for the parameter name .

iam having the values of the materials in an internal table .

This is my code

LOOP AT i_final INTO wa_final.

IF wa_final-matnr IS NOT INITIAL.

MOVE wa_final-matnr TO V_NAME.

CALL FUNCTION 'READ_TEXT'

EXPORTING

  • CLIENT = SY-MANDT

id = '0001'

language = 'E'

name = V_NAME

object = 'MVKE'

  • ARCHIVE_HANDLE = 0

  • LOCAL_CAT = ' '

  • IMPORTING

  • HEADER =

TABLES

lines = i_line

EXCEPTIONS

id = 1

language = 2

name = 3

not_found = 4

object = 5

reference_check = 6

wrong_access_to_archive = 7

OTHERS = 8

.

APPEND i_line.

CLEAR i_line.

ENDIF.

ENDLOOP.

5 REPLIES 5
Read only

Former Member
0 Likes
2,041

Hi A kumar,

Do the following modification in ur code..

Look at the comments which i made in the below code...

DATA : V_NAME TYPE TDOBNAME. " Define Variable V_NAME  like this
DATA : I_LINE TYPE STANDARD TABLE OF TLINE WITH HEADER LINE.

LOOP AT I_FINAL INTO WA_FINAL.

  IF WA_FINAL-MATNR IS NOT INITIAL.
    MOVE WA_FINAL-MATNR TO V_NAME.

    CALL FUNCTION 'READ_TEXT'
      EXPORTING
       CLIENT                        = SY-MANDT
        ID                            = '0001'
        LANGUAGE                      = 'E'
        NAME                          = V_NAME
        OBJECT                        = 'MVKE'
*       ARCHIVE_HANDLE                = 0
*       LOCAL_CAT                     = ' '
*     IMPORTING
*       HEADER                        =
      TABLES
        LINES                         = I_LINE " it's internal table contains text u wanna read
*     EXCEPTIONS
*       ID                            = 1
*       LANGUAGE                      = 2
*       NAME                          = 3
*       NOT_FOUND                     = 4
*       OBJECT                        = 5
*       REFERENCE_CHECK               = 6
*       WRONG_ACCESS_TO_ARCHIVE       = 7
*       OTHERS                        = 8
              .
    IF SY-SUBRC <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.

    IF SY-SUBRC = 0.
      LOOP AT I_LINE. " use read statement of Loop at to read content of this internal table.
        WRITE : I_LINE-TDLINE.
* Write Ur Logic here..
      ENDLOOP.
    ENDIF.

  ENDIF.
ENDLOOP.

Hope it will solve your problem..

Thanks & Regards

ilesh 24x7

Read only

Former Member
0 Likes
2,041

Hi ilesh ,

Thanks for reply. iam not geting the values in the internal table . Before psoting this thread itself i have checked in debugging . i was thinking as to what values should i move to the variable v_name.

thanks

Read only

0 Likes
2,041

Hi,

Are u passing the material number with leading zeros. This is mandatory. Check whether v_name contains leading zeros.(18 digit number)

Also check whether it is maintained for that language(English) or not.

If u want to get all the descriptions into single table then use one more internal table.

After getting data from FM put this statement.

LOOP AT...

CALL FM READ_TEXT....

CHECK NOT i_lines[] IS INITIAL.

APPEND LINES OF i_lines TO i_lines_final.

ENDLOOP.

Noticed one more thing

U have to pass like this.

If material number is 12345 the

v_name = 000000000000012345CR 01

So its combination of material number with leading zeros, sales org and distribution channel. Concatenate all these things and pass it.

Just try this.

Check below on how to check these variables.

Open ur material in MM02, Select sales text view=>Click on editor icon=>Menu=>Header.

Here u will find what are all the details u need to pass to this FM.

Not only for this. For any other text also follow same procedure.

Hope it is helpful.

Thanks,

Vinod.

Edited by: Vinod Reddy Vemuru on Jul 12, 2008 10:47 AM

Edited by: Vinod Reddy Vemuru on Jul 12, 2008 10:52 AM

Read only

0 Likes
2,041

Hi Kumar,

You can find the values of these fields.

Text Name
Language
Text ID
Text Object

Goto the Sales text Tab in Material Master transaction MM01, at the left end bottom you can find the Text Editor Push button.

Select the text and press the Text editor push button now you can see the text editor. in that Menu path

Goto ---> Header

Now you get a Text editor screen there you can find the the values of these fields.

Text Name
Language
Text ID
Text Object

Generally you need to pass these values to the Function Module READ_TEXT.

Best reagards,

raam

Read only

Former Member
0 Likes
2,042

Hi A Kumar,

V_NAME is combination of material number with leading zeros (18 Char), sales org and distribution channel.

MATNR CHAR 18

VKORG CHAR 4 Sales Organization

VTWEG CHAR 2 Distribution Channel

So it will be like this...

Find VKORG and VTWEG from Respective tables...

Pass MATNR to VBAP get the VBELN

Pass VBELN to VBAK and GET the VKORG and VTWEG..

Or see as per ur configuration if any other table contains the value of VKORG and VTWEG...

and then..

So use concatenate statement here to get the exact value of V_NAME

CONCATENATE MATNR VKORG VTWEG INTO V_NAME.

Now pass this V_NAME to FM..

Try to run READ_TEXT FM from SE37 and pass the values above...

Goto MM03

Enter Material no ..

Select Sales Text.,,

Here it will ask you to enter sales org and Dist Channel..

And modify your code accordingly as well...

Hope it will solve your problem..

Thanks & Regards

ilesh 24x7