cancel
Showing results for 
Search instead for 
Did you mean: 

Fetching multiple lines from item text in a PO

Former Member
0 Kudos

Friends,

i am having problem in fetching the item text from tcode [me23n]. I am able to fetch the 1st line from the item text and able to print it in the PO through SAP Script, but can anyone tell me how to fetch and print the 2nd,3rd ....line from the same.

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Siddhartha Prakash ,

Use the FM "read_text" to get all the lines of the item text

Passing the following to the FM :

Text Name : concatenate the POnumber (EBELN) and item number EBELP

Language : EN

Text ID : F01

Text Object : EKPO

U will get the item text (IT_TEXT) as the output

Now all the lines will be available in the internal table, so u can print each line (similar to printinmg a table)

Reward points if u find it useful

-Sapsurfer

Former Member
0 Kudos

sorry i did that, but unable to get all those lines printed.

anyway i did it by using smartforms.

if u can still help me please tell me how to do it in SAP script

thanks ,

Siddhartha

former_member181995
Active Contributor
0 Kudos

Sid,

DATA: i_lines TYPE STANDARD TABLE OF tline WITH HEADER LINE ,
        r_lines TYPE tline,
        v_cnt LIKE sy-tabix,
        name TYPE tdobname.

CALL FUNCTION 'READ_TEXT'
    EXPORTING
      client                  = sy-mandt
      id                      = stxh-tdid
      language                = stxh-tdspras
      name                    = name
      object                  = stxh-tdobject
    TABLES
      lines                   = i_lines[]
    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.
* Only 4 lines of Header text supported. Can add if needed
    LOOP AT i_lines INTO r_lines.
      CONDENSE r_lines-tdline NO-GAPS.
      v_cnt = v_cnt + 1.
      CASE v_cnt.
        WHEN 1.
          zzboldsx = r_lines-tdline.
        WHEN 2.
          zzboldsx2 = r_lines-tdline.
        WHEN 3.
          zzboldsx3 = r_lines-tdline.
        WHEN 4.
          zzboldsx4 = r_lines-tdline.
        WHEN OTHERS.
          EXIT.
      ENDCASE.
*   zzbolDSX =  i_lines-tdline .
    ENDLOOP.

Amit.