Application Development 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: 

INSERT command in CLM1 tcode

Former Member
0 Kudos

Hi,

I have done BDC recording for CLM1 tcode. Later In costs Tab of CLM1 Tcode, There is a ALV.As ALV can not be Inserted or Updated with BDC recording. I have directly moved into table CKIS. I am gettingDUMP at INSERT command,When ever I run the Tcode.

Insert ckis from table lit_ckis.

Regards,

Deepthi.

6 REPLIES 6

Former Member
0 Kudos

hi,

can you give me your code details

regards,

raghava.

former_member194416
Contributor
0 Kudos

When you use insert command you have to make sure the line that you are trying to insert don't exist in the table. Otherwise you'll have a dump. Try to use other command like modify or update or check transparent table before inserting.

Edited by: Gungor Ozcelebi on Jul 21, 2009 10:52 AM

0 Kudos

Hi,

I have tried to Use UPDATE and MODIFY then the values are not getting updated in cost tab of ALV.My code is below.

SELECT SINGLE * INTO lwa_qmel

FROM qmel

WHERE qmnum = w_src-qmnum.

  • Update the ALV in Costs TAB.

LOOP AT i_src_temp INTO w_src_temp WHERE indicator = w_src-indicator.

MOVE w_src-qmnum TO w_src_temp-qmnum.

lwa_ckis-wertn = w_src_temp-menge * w_src_temp-gpreis.

lwa_qmel-estimated_costs = lwa_qmel-estimated_costs + lwa_ckis-wertn.

  • Conversion Exit for Cost Element

CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'

EXPORTING

input = w_src_temp-kstar

IMPORTING

output = lwa_ckis-kstar.

CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'

EXPORTING

input = c_lednr

IMPORTING

output = lwa_ckis-lednr.

  • Increment the POSNR value,so that to Update in the Next Line of ALV of Cost Tab

lv_itemno = lv_itemno + 1.

  • Alpha routine also exists for lednr.

MOVE :

w_src_temp-typps TO lwa_ckis-typps,

w_src_temp-menge TO lwa_ckis-menge,

w_src_temp-meins TO lwa_ckis-meeht,

w_src_temp-gpreis TO lwa_ckis-gpreis,

lwa_qmel-kalnr TO lwa_ckis-kalnr,

lv_itemno TO lwa_ckis-posnr,

lc_x TO lwa_ckis-kstar_manual,

lc_1 TO lwa_ckis-peinh,

lc_x TO lwa_ckis-price_manual,

lwa_ckis-wertn TO lwa_ckis-wrtfw_kpf,

lwa_ckis-wertn TO lwa_ckis-wrtfw_pos,

lc_usd TO lwa_ckis-fwaer_kpf,

lc_usd TO lwa_ckis-fwaer,

sy-datum TO lwa_ckis-steas,

w_src_temp-gpreis TO lwa_ckis-opreis,

w_src_temp-gpreis TO lwa_ckis-tpreis,

lc_1 TO lwa_ckis-peinh_2,

lc_1 TO lwa_ckis-peinh_3,

lv_itemno TO lwa_ckis-component_id,

gc_bzobj TO lwa_ckis-bzobj,

gc_kalka TO lwa_ckis-kalka,

gc_tvers TO lwa_ckis-tvers,

gc_kokrs TO lwa_ckis-kokrs_hrk.

APPEND lwa_ckis TO lit_ckis.

CLEAR lwa_ckis.

ENDLOOP.

  • Check if CSIK is locked if not then update else wait.

lv_tab = lc_ckis.

lv_locked = lc_4.

WHILE lv_locked <> 0.

CLEAR lv_locked.

PERFORM f8000_check_lock USING lv_tab

CHANGING lv_locked.

ENDWHILE.

  • INSERT ckis FROM TABLE lit_ckis.

MODIFY ckis FROM TABLE lit_ckis.

Regards,

Deepthi.

Former Member
0 Kudos

hi,

When your updating the Data Base tables first we need use lock objects. so that we can avid multiple users accessing simaltaniously and use all the neccessary values for the data base table. in that fashion you can do it .

~linganna

0 Kudos

Hi,

Iam checking the LOCK for the table CKIS befre updating.

Regards,

Deepthi.

Former Member
0 Kudos
  • Lock the table

CALL FUNCTION 'VIEW_ENQUEUE'

EXPORTING

action = 'E' "lock

enqueue_mode = 'E' " exclusive enque

view_name = 'QMEL'

EXCEPTIONS

client_reference = 1

foreign_lock = 2

invalid_action = 3

invalid_enqueue_mode = 4

system_failure = 5

table_not_found = 6

OTHERS = 7.

  • Deque all locked tables

CALL FUNCTION 'DEQUEUE_ALL'.

MODIFY qmel FROM lwa_qmel.

  • Deque all locked tables

CALL FUNCTION 'DEQUEUE_ALL'.