‎2010 Nov 22 4:46 PM
Hi Experts,
I have requirement to change condition record (T-code: VK12) using Function module or BAPI. Actually, User wants to change the amount field by uploading spreadsheet data. I need to write the program to use spreadsheet and update amount field of condition record. Please help me out.
Thanks,
Sajjad
‎2010 Nov 22 6:57 PM
please search in SE37 with BAPICONDITIONRECORDCREATE...hope you will get a correct function module...
‎2010 Nov 23 4:43 PM
‎2010 Nov 23 4:48 PM
RV_CONDITION_COPY,RV_CONDITION_SAVE ,RV_CONDITION_RESET - Commit
Execute these three fm's in sequence.
RV_CONDITION_COPY has a parameter maintain_mode , pass A for create and B for change
‎2010 Nov 24 1:45 PM
Hi,
Thanks a lot for your advise. I tried to test these FM in the following way. But it does not work.
CALL FUNCTION 'SD_KONP_SELECT'
EXPORTING
SCALE_READ = 'X'
LONG_TEXT_READ = 'X'
TABLES
condition_item = cond_item
condition_number = cond_number
condition_scale = cond_scale.
xkonp = cond_item.
select single * into corresponding fields of wa_komg
from t681
where kappl = 'V'
and KOTABNR = '527'.
clear: t_komv.
gv_KOTABNR = '527'.
gv_KAPPL = 'V'.
gv_KSCHL = 'ZBFR'.
loop at xkonp into wa_konp.
clear: wa_komv,
t_komv.
move-corresponding wa_konp to wa_komv.
wa_komv-waers = wa_konp-konwa.
if wa_komv-kbetr = '1.40'. "just trying to test change data
wa_komv-kbetr = 3.
endif.
append wa_komv to t_komv.
call function 'RV_CONDITION_COPY'
exporting
application = gv_KAPPL
condition_table = gv_KOTABNR
condition_type = gv_KSCHL
date_from = tvalp-datab
date_to = fl_datbi
enqueue = 'X' "yes
i_komk = komk
i_komp = komp
key_fields = wa_komg
maintain_mode = 'B' "'A' for create, B for Update
no_authority_check = yes
no_field_check = yes
SELECTION_DATE = '00000000'
KEEP_OLD_RECORDS = ' '
MATERIAL_M =
USED_BY_IDOC = ' '
I_KONA =
overlap_confirmed = yes
NO_DB_UPDATE = ' '
IMPORTING
E_KOMK =
E_KOMP =
NEW_RECORD =
E_DATAB =
E_DATBI =
E_PRDAT =
tables
copy_records = t_komv
COPY_STAFFEL =
COPY_RECS_IDOC =
exceptions
enqueue_on_record = 1
invalid_application = 2
invalid_condition_number = 3
invalid_condition_type = 4
no_authority_ekorg = 5
no_authority_kschl = 6
no_authority_vkorg = 7
no_selection = 8
table_not_valid = 9
no_material_for_settlement = 10
no_unit_for_period_cond = 11
no_unit_reference_magnitude = 12
invalid_condition_table = 13
others = 14.
if sy-subrc = 0.
endif.
endloop.
call function 'RV_CONDITION_SAVE'.
CALL FUNCTION 'RV_CONDITION_RESET'
EXPORTING
FREE_MEMORY =
.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
EXPORTING
WAIT =
IMPORTING
RETURN =
.
Thanks,
‎2010 Nov 24 1:52 PM
Check this link to know how to use it
link:[http://www.sapnet.ru/viewtopic.php?p=1644]