Application Development 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: 

Problem in using FM READ_TEXT to read Material Sales Text.

Former Member
0 Kudos

Hi Guys,

I am developing a Customer Outstanding report in which I display all the invoices of a particular customer.

I need to read "Material Sales Text" which comes under "Item Text" tab in transaction FBL5N.

I have used READ_TEXT in my program. I have identified the Object, and ID but I am stuck up with the Name. I dont know what Name to pass. I have tried passing the Invoice Number in "Name" but couldnt get the text.

Request you to please help me out. Please check the below code.

CALL FUNCTION 'READ_TEXT'

EXPORTING

  • CLIENT = SY-MANDT

id = '0001'

language = SY-LANGU

name = -


???????????????

object = 'VBBP'

  • ARCHIVE_HANDLE = 0

  • LOCAL_CAT = ' '

  • IMPORTING

  • HEADER =

tables

lines = tl001

EXCEPTIONS

ID = 1

LANGUAGE = 2

NAME = 3

OTHERS = 8

Thanks.

15 REPLIES 15

Former Member
0 Kudos

Hi,

Please write the below ..

SELECT TDOBJECT

TDNAME

TDID

TDSPRAS

FROM STXH INTO TABLE IT_STXH

WHERE TDOBJECT = 'MATERIAL'.

LOOP AT IT_STXH INTO WA_STXH.

L_ID = WA_STXH-TDID.

L_LAN = WA_STXH-TDSPRAS.

L_NAME = WA_STXH-TDNAME.

*pass WA_STXH-TDOBJECT to NAME ..

endloop.

Regards,

Srini.

former_member404244
Active Contributor
0 Kudos

Hi,

Goto transaction FBL5N ->Item->Material sales text->double click on it ->in the menu GOTO-> select header->Change editor..

You will get one popup and see what is there in the NAME..pass that value and see if you are getting the desired result.

Regards,

Nagaraj

Former Member
0 Kudos
*&---------------------------------------------------------------------*
*&      Form  READ_TEXT
*&---------------------------------------------------------------------*
FORM read_text  USING    p_tdid  p_tdname
                CHANGING p_tdline.

  DATA: it_line  TYPE STANDARD TABLE OF tline,
        wa_line  TYPE tline                  ,
        l_tdid   TYPE thead-tdid,
        l_tdname TYPE thead-tdname.

  l_tdid   = p_tdid.
  l_tdname = p_tdname.

  CALL FUNCTION 'READ_TEXT'
    EXPORTING
      id       = l_tdid
      language = 'E'
      name     = l_tdname
      object   = 'VBBP'
    TABLES
      lines    = it_line
    EXCEPTIONS
      OTHERS   = 8.

  LOOP AT it_line INTO wa_line.
    IF NOT wa_line-tdline IS INITIAL.
      p_tdline = wa_line-tdline.
    ENDIF.
  ENDLOOP.

ENDFORM.                    " READ_TEXT

0 Kudos

For VBBP the name is a concatenation of sales doc and sales doc item.

You have to find corresponding sales order and order item and compose the name with this data.

0 Kudos

Sorry Guys... a mistake in the question.... The transaction is VF03 and not FBL5N.

In transaction VF03, "Material Sales Text" is present under the "Item Text" tab.

I just need the name i.e. the string to be passed in READ_TEXT.

Thanks.

0 Kudos

As I said for VBBP the name is a concatenation of sales doc and sales doc item..

0 Kudos

Hi Tomek,

Can you please tell me the table and the fields from wherin I can get the data for sales doc and sales doc item.

I am using tables VBRK and VBRP.

Thanks.

0 Kudos

Try VBRP-AUBEL, AUPOS

0 Kudos

Hi,

In VBRP table, according to my invoice number i.e 30000080, I got the values for AUBEL and AUPOS.

They are AUBEL = 840000069

AUPOS = 10.

I passed the string as '84000006910' to Name in READ_TEXT.

It didnt work.

Please help.

Thanks.

0 Kudos

Hello,

Please ignore my previous post. I thought you were trying to read the Material Sales Text maintained in MM03.

In the change mode, double click on the text field. A line editor will open, then GoTo --> Header. Here you'll get the "Text Name".

Text Name = Billing Doc + Line Item ( e.g., 0090000136000010 = 0090000136 (Billing Doc.) + Line Item (10) )

BR,

Suhas

0 Kudos

Try AUBEL and AUPOS with leading zeros or put breakpoint on READ_TEXT for this document and see the name.

0 Kudos

For material Sales text in Billing document, you don't need to pass AUBEL(Order Number) and AUPOS(Order Line item). Follow the solution mentioned by Suhas with text Object = VBBP.

0 Kudos

Hi Vinod/Suhas,

From which table can I get the line Item Number ? VBRK or VBRP.

Can you please tell me the field names.

Thanks.

Moderator message: that's enough now, please do some research of your own, don't expect to be spoonfed on each detail. Thread locked.

Edited by: Thomas Zloch on Jan 11, 2011 1:33 PM

0 Kudos

Hi

The name of tetxt will be the bill number concatenated with item number, you can get all data from VBRP:

NAME(10) = VBRP-VBELN.

NAME+10(6) = VBRP-POSNR.

or

CONCATENATE VBRP-VBELN VBRP-POSNR INTO NAME.

Max

SuhaSaha
Advisor
Advisor
0 Kudos

Hello,

You can use the BAPI 'BAPI_MATERIAL_GET_ALL' to get the Material Sales text. The text lines are returned in the table param MATERIALLONGTEXT.

You need to pass the Sales Org. & Distribution Channel values for the BAPI to return the sales text.

Anyway as per your question:

NAME = MATERIAL + SALES ORG + DISTR. CHANNEL (RESPECTING BLANKS)

BR,

Suhas

PS: The object is MVKE & not VBBP as used by you!