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

Modify error

Former Member
0 Likes
1,321

Hi All,

LOOP AT lt_outtab.
      lt_outtab-bktxt = 'Test'.
      MODIFY lt_outtab INDEX sy-tabix.
ENDLOOP.

I’m trying to modify value of BKTXT.. before passing to FM
While compiling I’m getting error like 

"The data object "LT_OUTTAB" has no structure and therefore no component called ‘BKTXT’.		
What might be error?
How can modify contents of lt_outtab.

      CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
        EXPORTING
          i_callback_program = g_repid
          is_layout          = l_layout
          it_fieldcat        = lt_fieldcat
          it_excluding       = gt_excluding
          it_sort            = lt_sortinfo
          i_save             = 'A'
          is_variant         = l_variant
          it_events          = lt_alv_event
          is_print           = flg_statistikdruck           "OP-08
        TABLES
          t_outtab           = lt_outtab.


1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,293

Hi

Let's know how the structure lt_outtab is defined:

- Or it isn't an internal table;

- Or it's an internal table without an headerline;

- Or there isn't the field BKTXT

Max

10 REPLIES 10
Read only

Former Member
0 Likes
1,294

Hi

Let's know how the structure lt_outtab is defined:

- Or it isn't an internal table;

- Or it's an internal table without an headerline;

- Or there isn't the field BKTXT

Max

Read only

0 Likes
1,293

Your table LT_OUTTAB is the table defined without the header line.

So define some work area and handle it like this:

 LOOP AT lt_outtab into wa_outtab.
      wa_outtab-bktxt = 'Test'.
      MODIFY lt_outtab from wa_outtab INDEX sy-tabix.
ENDLOOP.

Regards,

Naimesh Patel

Read only

0 Likes
1,293

DATA gt_alv TYPE STANDARD TABLE OF rfums_tax_gt_alv
     INITIAL SIZE 0 WITH HEADER LINE.
field-symbols <gt_alv> like line of gt_alv.

 PERFORM print_table TABLES  <gt_alv>-t_auste_ep     "lt_outtab here it's filling  
           USING
              par_lis1                
              var_avp1               
              c_auste_ep              
              par_var1                
              'BUKRS'                 
              'MWSKZ'                
              'PRINT_AUSTE_SUM'       
              'TOP_OF_PAGE_AUSTE_EP' 
              'CREATE_FIELDCAT_EP'.   


 FORM print_table  TABLES lt_outtab  
     USING 
     l_check_append         TYPE c
     l_check_avp            TYPE c
---------------
---------------
Read only

0 Likes
1,293

Hi

FORM print_table TABLES lt_outtab

In this way the interface parameter LT_OUTTAB is ANY table, the structure is determinated at run time.

U need to use the field-symbols:

FIELD-SYMBOLS: <WA> TYPE ANY,
               <VALUE> TYPE ANY.

LOOP AT LT_OUTTAB ASSIGNING <WA>.

  ASSIGN COMPONENT 'BKTXT' OF STRUCTURE <WA> TO <VALUE>.
  IF SY-SUBRC = 0.
    <VALUE> = 'Test'.
  ENDIF.
ENDLOOP.

Max

Read only

0 Likes
1,293

Than you can define the workarea like:


data: wa_outtab like RFUMS_TAX_ITEM.   " << 

LOOP AT LT_OUTTAB INTO WA_OUTTAB.
* USE THE WA_OUTTAB work aread data manipulation.
  WA_OUTTAB-BKTXT = 'TEST'.
  MODIFY LT_OUTTAB FROM WA_OUTTAB INDEX SY-TABIX.
ENDLOOP.

Regards,

Naimesh Patel

Read only

0 Likes
1,293

Try this:

 FORM print_table 
   TABLES lt_outtab structure gt_alv  "<====

Rob

Read only

0 Likes
1,293

Hi Perez,

I think Rob is right. You should declare your FORM statement like this :

FORM print_table TABLES lt_outtab STRUCTURE RFUMS_TAX_ITEM

USING

l_check_append TYPE c

l_check_avp TYPE c

Regards,

Nicolas

Read only

0 Likes
1,293

Max,

Thank you very much for your help..it's working..

Naimesh,

It's modifying lt_outtab with your code But I got dump while output....


"Data objects in a Unicode program are not convertible.

Anyway thank you very much .....

Read only

former_member195698
Active Contributor
0 Likes
1,293

How is your internal table LT_OUTTAB defined?

Read only

Former Member
0 Likes
1,293

You are doing this in a form where you have passed the table, but not added the STRUCTURE addition to the FORM statement.

Rob