Skip to Content
0
Former Member
Apr 21, 2009 at 05:27 PM

TDG text for materials in mb51

81 Views

Hi Gurus!

I am trying to read the transportation of dangerous goods text for the materials showing up on the mb51 report but its landing me into runtime error saying that

 When changing or deleting one or more lines of the internal table
 "\PROGRAM=YRM07DOCS\DATA=LIST[]" or when inserting in the table
  "\PROGRAM=YRM07DOCS\DATA=LIST[]", 0 was used as
 the line index. An index less than or equal to zero is not
 allowed.

 The error can occur when using the following options:
 1. "INDEX idx" for specifying the line number in the table
  "\PROGRAM=YRM07DOCS\DATA=LIST[]"
    where you want to change, insert or delete.
 2. "FROM idx" for specifying the start index when deleting a line
    area from or inserting a line area into the table
  "\PROGRAM=YRM07DOCS\DATA=LIST[]".
 3. "TO idx" for specifying the end index when deleting a line
    area from or inserting a line area into the table
  "\PROGRAM=YRM07DOCS\DATA=LIST[]".

 At the time of the termination, the table contained 93 lines.

Could any one please help me out in getting this text for materials on my output.

Thanks

call function 'READ_TEXT'
  exporting
    id                            = 'EURP'
    language                      = language
    name                          = name
    object                        = 'MATERIAL'
  tables
    lines                         = tlines
  exceptions
    others                        = 1.
if sy-subrc = 0.
  loop at tlines.
    if sy-tabix = 1.
      tdg_text = tlines-tdline.
    else.
      concatenate tdg_text tlines-tdline into
          tdg_text separated by space.
    endif.
  endloop.
endif.