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

Updating certain fields in Table

$
0
0

Hello Experts,

I am working on the program used to calculate renewal price of an equipment based on CPI and acquisition price. There is Custom field defined in table EQUI for renewal price (ZZSTOFN_VERD). I have used BAPI_EQUIPMENT_SAVEREPLICA to modify the table as per renewal price. There is no field available in BAPI for Renewal Price so i have used Acquisition Price field for trial basis and it worked. Now what i want to do is instead of Acquisition Price the Renewal Price should be updated in Renewal Price field (ZZSTOFN_VERD) of table EQUI. Here is the code below,

 

 

Data:  l_tab_equi  LIKE TABLE OF l_str_equi,

          l_str_equi  TYPE l_str_equipment,

          l_str_equip TYPE bapi_ieqm_extractor,

          l_str_equix TYPE bapi_ieqmx_extractor,

          l_tab_equip LIKE TABLE OF bapi_ieqm_extractor,

          l_tab_equix LIKE TABLE OF bapi_ieqmx_extractor.

        

       

LOOP AT l_tab_equi INTO l_str_equi.

       MOVE l_str_equi-equnr TO l_str_equip-ta_guid.

       MOVE l_str_equi-equnr TO l_str_equip-equipment_int.

       MOVE l_str_equi-equnr TO l_str_equip-equipment_ext.

       MOVE l_str_equi-eqtyp TO l_str_equip-equicatgry.

       MOVE l_str_equi-eqktx TO l_str_equip-descript.

       MOVE l_str_equi-invnr TO l_str_equip-inventory.

       MOVE l_str_equi-ansdt TO l_str_equip-acqdate.

       MOVE l_str_equi-answt TO l_str_equip-acquisval.

*      MOVE l_str_equi-newwt TO l_str_equip-acquisval.

*      MOVE l_str_equi-newwt TO gs_equi-ZZSTOFN_VERD.

*      APPEND gs_equi TO g_tab_equ.

*      UPDATE equi FROM TABLE g_tab_equ.

       MOVE l_str_equi-waers TO l_str_equip-currency.

       APPEND l_str_equip TO l_tab_equip.

 

       l_str_equix-ta_guid = l_str_equip-ta_guid.

       l_str_equix-acquisval = 'X'.

       APPEND l_str_equix TO l_tab_equix.

     ENDLOOP.

 

I really don't understand how to achieve this using BAPI? If anybody have any idea please share it with me.

 

Thanks,

Avadhut


Viewing all articles
Browse latest Browse all 8453

Trending Articles



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