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

problems to update internal table in module pool .

Former Member
0 Likes
1,395

Hi Guys , I m trying to update the internal table that I use to drive the fields of a table control , but it doesnt modify the internal table.

some code is easier i guess

in the include to

types : begin of ty_zrc006,
         zrc_cond type  zrc_c006_c-zrc_cond,
         zrc_period_i type  zrc_c006_c-zrc_period_i,
         zrc_period_f type  zrc_c006_c-zrc_period_f,
         knumh type zrc_c006_c-knumh,
         aedat type zrc_c006_c-aedat,
         aezet type zrc_c006_c-aezet,
         aenam type zrc_c006_c-aenam,
         kostl type zrc_c006_i-kostl,
         zrc_perc type zrc_c006_i-zrc_perc,
         MARK TYPE C.
types : end of  ty_zrc006.
data: ti_zrc006 type standard table of ty_zrc006 initial size 0." with header line.

in other include

module MODIFY_LIN input.
read table ti_zrc006 into wa_zrc006 index tabc_ctocusto-CURRENT_LINE.

move:   zrc_c006_i-kostl  to  wa_zrc006-kostl,
        zrc_c006_i-zrc_perc to wa_zrc006-zrc_perc,
        'X'            to wa_zrc006-mark.
modify  ti_zrc006  INDEX  tabc_ctocusto-CURRENT_LINE  from  wa_zrc006 ."  transporting   . "


endmodule.                 " MODIFY_ITAB_REG  INPUT

But when I execute after PAI it never update ti_zrc006 even when wa_zrc006 is filled. any idea ?

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
911

Hi

Try this out.

In PAI

loop at itab.
" Place all your FIELD and CHAIN statements before you call the below module
   module modify_tab. " This should not be linked up with any field statements and be an independent module
" The above should execute irrespective of any changes to the screen fields
endloop.

in Program

module modify_tab.
   describe table itab lines tc-lines.
      if tc-current_line > tc-lines.
          append itab.
      else.
          modify itab index tc-current_line.
     endif.
endmodule

Cheerz.

Ramchander Rao.K

5 REPLIES 5
Read only

Former Member
0 Likes
911

Just remove following line.

read table ti_zrc006 into wa_zrc006 index tabc_ctocusto-CURRENT_LINE.

Also make sure that the module MODIFY_LIN is called between Loop. Endloop. of PAI.

Regards,

Aditya

Read only

0 Likes
911

thank you Aditya , I ve already try that, but it doesnt work : my PBO PAI are this way :

process before output.
  module fill_list_condic.
  module status_0100.
  loop at ti_zrc006 into wa_zrc006 with control tabc_ctocusto.
    module modify_lin .
  endloop.

process after input.

  loop at ti_zrc006 .
    chain.
      field:  ZRC_C006_I-kostl,
              ZRC_C006_I-zrc_perc.
      module update_line  on chain-request.
    endchain.
  endloop.
  chain.
    field :     ti_zrc006-bukrs,
                ti_zrc006-desc_cond,
                ti_zrc006-zrc_period_i,
                ti_zrc006-zrc_period_f.
    module modify_cab on chain-request.
  endchain.

  module user_command_0100.

Read only

0 Likes
911

Hi

as you are getting the values ZRC_C006_I-kostl and ZRC_C006_I-zrc_perc from input, modify your internal table in your PAI. because PBO only displays the data in internal table.

in PBO write the code as,

Loop at ti_zrc006 with control tabc_ctocusto cursor tabc_ctocusto-current_line.

module display_int_table.

endloop.


Module display_int_table.

tabc_ctocusto-kostl = ti_zrc006-kostl.
..
..
..n whatever the other fields are.

endmodule.

Hope this helps.

and one more thing, when you are modifying an internal table inside the loop , INDEX is not needed, it automatically updates the current line in loop.

Edited by: mbd2186 on Feb 17, 2011 4:14 AM

Read only

Former Member
0 Likes
911

Hi,

I guess the Internal table might have updated with the new values but the table control in the screen would have not refreshed in the PAI. So I suggest you to see in the debug mode whether the Internal table which you are modifying is updated with the new values or not. I guess it might have updated but you also need to REFRESH the table control used for displaying the data in the PAI.

Please implement this and let me know in case of any.

Regards,

SRinivas

Read only

Former Member
0 Likes
912

Hi

Try this out.

In PAI

loop at itab.
" Place all your FIELD and CHAIN statements before you call the below module
   module modify_tab. " This should not be linked up with any field statements and be an independent module
" The above should execute irrespective of any changes to the screen fields
endloop.

in Program

module modify_tab.
   describe table itab lines tc-lines.
      if tc-current_line > tc-lines.
          append itab.
      else.
          modify itab index tc-current_line.
     endif.
endmodule

Cheerz.

Ramchander Rao.K