Application Development and Automation 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: 
Read only

Reg Dynamic internal tables

Former Member
0 Likes
1,182

Hi All,

I have created a dynamic internal table but when i try to execute the program it is giving me the following error

LOAD_PROGRAM_NOT_FOUND and

CX_SY_PROGRAM_NOT_FOUND.

Can anyone tell me a solution for this

Thanks

Chaitanya Swaroop

Hi All,

I have created a dynamic internal table but when i try to execute the program it is giving me the following error

LOAD_PROGRAM_NOT_FOUND and

CX_SY_PROGRAM_NOT_FOUND.

Can anyone tell me a solution for this

Thanks

Chaitanya Swaroop

6 REPLIES 6
Read only

Former Member
0 Likes
742

hi check this ....do like this..

Read only

Former Member
0 Likes
742

There is some problem with your coding. Check it once. Or else show the code once.

cehck the sample code.

REPORT  zdynamic.
 
FIELD-SYMBOLS: <l_table> TYPE table,
<l_line> TYPE ANY,
<l_field> TYPE ANY.
 
DATA: is_lvc_cat TYPE lvc_s_fcat,
      it_lvc_cat TYPE lvc_t_fcat.
 
DATA: new_table TYPE REF TO data,
      new_line  TYPE REF TO data.
 
 
START-OF-SELECTION.
 
  is_lvc_cat-fieldname = 'KUNNR'.
  APPEND is_lvc_cat TO it_lvc_cat.
 
  is_lvc_cat-fieldname = 'NAME1'.
  APPEND is_lvc_cat TO it_lvc_cat.
 
  CALL METHOD cl_alv_table_create=>create_dynamic_table
    EXPORTING
      it_fieldcatalog = it_lvc_cat
    IMPORTING
      ep_table        = new_table.
 
*Create a new Line with the same structure of the table.
  ASSIGN new_table->* TO <l_table>.
  CREATE DATA new_line LIKE LINE OF <l_table>.
  ASSIGN new_line->* TO <l_line>.
 
 
  DO 2 TIMES.
    ASSIGN COMPONENT 'KUNNR' OF STRUCTURE <l_line> TO <l_field>.
    <l_field> = sy-index.
 
    ASSIGN COMPONENT 'NAME1' OF STRUCTURE <l_line> TO <l_field>.
    <l_field> = 'A'.
    INSERT <l_line> INTO TABLE <l_table>.
  ENDDO.
 
  LOOP AT <l_table> INTO <l_line>.
    WRITE:/ <l_line>.
  ENDLOOP.
 
  READ TABLE <l_table> INTO <l_line> INDEX 2.
  <l_line>+10(2) = 'B'.
  MODIFY <l_table> FROM <l_line> INDEX 2.
 
 
  LOOP AT <l_table> INTO <l_line>.
    WRITE:/ <l_line>.
  ENDLOOP.

Read only

uwe_schieferstein
Active Contributor
0 Likes
742

Hello Chaitanya

You may want to have a look at my Wiki posting [Creating Flat and Complex Internal Tables Dynamically using RTTI|https://wiki.sdn.sap.com/wiki/display/Snippets/CreatingFlatandComplexInternalTablesDynamicallyusingRTTI]

Regards

Uwe

Read only

Former Member
0 Likes
742

Hi,

I get a similar problem. It depends on what field-catalog fields I populate!

If I give field-catalog values for fieldname, ref_field and ref_table, then the method CREATE_DYNAMIC_TABLE short-dumps with

Runtime errors LOAD_PROGRAM_NOT_FOUND

Exception CX_SY_PROGRAM_NOT_FOUND

Program " " not found.

If I give field-catalog values for fieldname and rollname (which logically ought to be enough), then there is no short dump, but all the fields of the internal table seem to be character fields of length 10.

Frustrating.

Shot in the dark: we have virtualized servers - any chance that could be relevant?

John

Read only

0 Likes
742

Hi again,

My problem (described in my previous post to this thread) was solved by restricting field-catalog assignments to fieldname, inttype, intlen and, where appropriate, decimals. No short dump now.

Can't explain this.

John

Read only

0 Likes
742

I'd same problem due to duplicate field names in dynamic internal table being created. so when I deleted duplicate entries from lt_components, it worked.