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

CS12 Longtext Issue

Hi,

I am facing issue one issue with CS12 T-Code.

There is one component which is used in different material, But when we are fetching text ( FM Read_Text is used ) .

CONCATENATE sy-mandt stb-stlty stb-stlnr stb-stlkn stb-stpoz INTO wa_name.

CALL FUNCTION 'READ_TEXT'

EXPORTING

client = sy-mandt

id = 'MPO'

language = sy-langu

name = wa_name

object = 'BOM'

TABLES

lines = lt_lines

Now for different material Value in WA_NAME it is passing same value, So it is fetching same text although different text is maintained in both material.

So what should be different value to be passed in WA_NAME to get the text maintained in respective material.

Thanks

Ankesh Jindal

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

4 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on May 30, 2013 at 08:31 AM

    Hi Ankesh,

    In this statement,

    CONCATENATE sy-mandt stb-stlty stb-stlnr stb-stlkn stb-stpoz INTO wa_name.

    you are passing the key fields of 'STPO' table i.e.


    Here no where you are passing material so the text would not vary until and unless any of these values change. Also see the values which are present when we manually create texts via CS12 for different materials and pass the same to READ_TEXT and it will function properly.

    Please ask if anything is not clear.

    Regards,

    Ankit.


    scn_1.png (12.6 kB)
    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on May 30, 2013 at 03:36 AM

    Hi Ankesh,

    After above FM Call check below Sample Code ... for Retrieve Long text to the Respective Material .

    LOOP AT ITAB INTO WA.

    CALL FUNCTION 'READ_TEXT'

    .......

    ...

    ...

    TABLES

    lines = lt_lines

    IF SY-SUBRC = 4.

    REFRESH IT_Lines.

    ENDIF.

    LOOP AT IT_Lines.

    IF SY-TABIX EQ '1'.

    WRITE :/2 WA-TDNAME, 20 SY-VLINE, 23 WA-TDSPRAS ,42 SY-VLINE ,45 IT_Lines-TDLINE.

    ELSE.

    WRITE :/20 SY-VLINE, 23 WA-TDSPRAS,42 SY-VLINE, 45 IT_Lines-TDLINE.

    ENDIF.

    AT LAST .

    WRITE :/1 SY-ULINE(249) .

    CLEAR : SY-TABIX,wa_name .

    ENDAT.

    ENDLOOP.

    REFRESH : IT_Lines .

    CLEAR WA .

    ENDLOOP.

    Regard's

    Smruti

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on May 29, 2013 at 04:14 PM

    Hi Ankesh,

    did you debug and look at wa_name what's inside before each FM call? Maybe you'll need a clear or you are passing the wrong values here? How is your stb structure filled?

    Regards,

    Marc

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on May 30, 2013 at 11:36 AM

    Hi Ankesh Jindal,

    I have wrote the below code to get the long text from PR header.

    I hope this will be helpful for your requirement.

    LOOP AT i_pr_head INTO w_pr_head.

    w_pr_head-txtnm = w_pr_head-banfn.

    CALL FUNCTION 'READ_TEXT'
    EXPORTING
    id = 'B01'
    language = sy-langu
    name = w_pr_head-txtnm
    object = 'EBANH'
    TABLES
    lines = lt_line
    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.

    LOOP AT lt_line INTO ls_line.
    w_pr_head-hdtxt = ls_line-tdline.
    MODIFY i_pr_head FROM w_pr_head TRANSPORTING hdtxt WHERE banfn = w_pr_head-banfn.
    ENDLOOP.
    ENDLOOP.

    Try this and let us know if any other details required on the same.

    With Regards,

    Gurulakshmi

    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.