Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 8667

Re: how to fetch data from database table based on table control values

$
0
0

Hi

 

It seems you're using the same workarea (wa_zpp_mpo) for the dynpro field and the internal table, so the data can  be overwritten, you should use a different workarea while reading the internal table and read it after getting the data you need

 

 

module update_table INPUT.

     readtable it_zpp_mpo INTO wa_zpp_mpo index TBC_9003-current_line.

*  Create another temperoray work area wa_zpp_mpo_tmp.

     SELECT single * FROM ZPP_MPO_MASTER1 INTO wa_zpp_mpo_tmp

              WHERE matnr = wa_zpp_mpo-matnr.

     if sy-subrc = 0.

      clear wa_zpp_mpo_tmp.

     endif.

    

   

     readtable it_zpp_mpo INTO wa_zpp_mpo_tmp_2 index TBC_9003-current_line.

     read_rc = sy-subrc

    if read_rc <> 0.

       clear wa_zpp_mpo_tmp_2.

    endif.

   wa_zpp_mpo_tmp_2-matnr = wa_zpp_mpo-matnr.  

    wa_zpp_mpo = wa_zpp_mpo_tmp_2.


     WA_ZPP_MPO-MCARDNO = wa_zpp_mpo_tmp-mcardno.

     WA_ZPP_MPO-ZFQTY = wa_zpp_mpo_tmp-zfqty.

     WA_ZPP_MPO-REMAKS = wa_zpp_mpo_tmp-remaks

   

    if read_rc = 0.

       modify it_zpp_mpo FROM wa_zpp_mpo index TBC_9003-current_line.

    else.

      append wa_zpp_mpo to it_zpp_mpo.

    endif

 

Max


Viewing all articles
Browse latest Browse all 8667

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>