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

Change Condition record using Function module or BAPI

Former Member
0 Likes
6,169

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

5 REPLIES 5
Read only

Former Member
0 Likes
2,925

please search in SE37 with BAPICONDITIONRECORDCREATE...hope you will get a correct function module...

Read only

0 Likes
2,925

Hi,

It does not help me at all. Any advise?

Thanks,

Read only

kesavadas_thekkillath
Active Contributor
0 Likes
2,925

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

Read only

0 Likes
2,925

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,

Read only

0 Likes
2,925

Check this link to know how to use it

link:[http://www.sapnet.ru/viewtopic.php?p=1644]