Skip to Content
author's profile photo Former Member
Former Member

PO line item text and material po text

Hi,

I want to fetch the text maintained at item po level and print the same with form..

I am passing following parameters in my Include text in smartforms..

Text name &VAR6& ..... concatenated po number and item

( 4700000011 + 00010) = 470000001100010

Text object EKKO

Text ID F01

Language EN

but its failing to fetch the same....I guess the problem is with var6 value...not sure

also for material po text i m passing

Text name &G_ZEKPO-MATNR& ..

Text object MATERIAL

Text ID BEST

Language EN

This is also failing.....

In both cases text is maintained... what is the problem??

Pls help..

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Nov 30, 2007 at 04:01 AM

    See this sample code

    ABAP READ_TEXT functions to read the SAP Long Text

    You have to used the READ_TEXT functions to read the SAP long text. e.g. Sales Order, Purchase Order Item text etc.

    To check your long text header, go into the long text. Click Goto -> Header

    Example of READ_TEXT functions reading tables PBIM - Independent requirements for material.

    REPORT ZTEXT .

    TABLES: PBIM.

    • stxh, stxl, stxb - trans tables for text

    • ttxit - text on text-ids

    • ttxot - Short texts on text objects

    • Transaction MD63

    SELECT-OPTIONS: S_MATNR FOR PBIM-MATNR,

    S_WERKS FOR PBIM-WERKS.

    DATA: BEGIN OF HTEXT.

    INCLUDE STRUCTURE THEAD.

    DATA: END OF HTEXT.

    DATA: BEGIN OF LTEXT OCCURS 50.

    INCLUDE STRUCTURE TLINE.

    DATA: END OF LTEXT.

    DATA: BEGIN OF DTEXT OCCURS 50.

    DATA: MATNR LIKE PBIM-MATNR.

    INCLUDE STRUCTURE TLINE.

    DATA: END OF DTEXT.

    DATA: TNAME LIKE THEAD-TDNAME.

    SELECT * FROM PBIM WHERE WERKS IN S_WERKS.

    MOVE PBIM-BDZEI TO TNAME.

    CALL FUNCTION <b>'READ_TEXT'</b>

    EXPORTING

    • CLIENT = SY-MANDT

    ID = 'PB'

    LANGUAGE = 'E'

    NAME = TNAME

    OBJECT = 'PBPT'

    • ARCHIVE_HANDLE = 0

    IMPORTING

    HEADER = HTEXT

    TABLES

    LINES = LTEXT

    EXCEPTIONS

    ID = 1

    LANGUAGE = 2

    NAME = 3

    NOT_FOUND = 4

    OBJECT = 5

    REFERENCE_CHECK = 6

    WRONG_ACCESS_TO_ARCHIVE = 7

    OTHERS = 8.

    LOOP AT LTEXT.

    IF LTEXT-TDLINE NE ''.

    MOVE LTEXT-TDLINE TO DTEXT-TDLINE.

    MOVE PBIM-MATNR TO DTEXT-MATNR.

    APPEND DTEXT.

    ENDIF.

    ENDLOOP.

    ENDSELECT.

    LOOP AT DTEXT.

    WRITE:/ DTEXT-MATNR, DTEXT-TDLINE.

    ENDLOOP.

    http://www.sapdevelopment.co.uk/sapscript/sapscript_texts.htm

    Also

    *Internal table to store standard texts

    DATA: IT_TEXTS like T_LINE occurs o with header line.

    CALL FUNCTION 'READ_TEXT'

    EXPORTING

    • CLIENT = SY-MANDT

    id = "Text ID

    language = "Laguage

    name = "Text name

    object = "text object

    • ARCHIVE_HANDLE = 0

    • IMPORTING

    • HEADER =

    tables

    lines = IT_TEXTS "Internal table

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

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      Hi,

      Are u talking about the material short text??? If not check the header of the long text and see if the variable you are passing in the include text are right....also run the FM read_text and see if the parameters that you are passing in the include text in smartforms on passing the saem to the FM does it return any value if not then there is a problem in the parameter values that you are passing..Also check in the tables STXB,STXH and STXL text with the same parameters exits there or not....

      Regards,

      Himanshu

      Message was edited by:

      Himanshu Verma

  • Posted on Apr 26, 2016 at 06:36 AM

    you can directly get it from Base table EKPO

    EKPO-TXZ01 ---> Give you PO Item Desc

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.