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

Create/Change Sales Deals using VB21

Former Member
0 Likes
2,429

Hey All-

Currently we have BDC to Create/Change Sales Deals using tcodes VB21 and VB22.Now we have decided to use any standard Function Module/BAPI in place of BDC because of performance issue.

I was trying with function module 'RV_CONDITION_COPY''RV_CONDITION_SAVE', 'RV_CONDITION_RESET' and 'Commit Work' ,but don't see any sales deals are creating.I see records updates table 'A501','KONH' and 'KONP' without Sales Deals Number.If anyone of you resolved the issue,Can you please post me the sample code?Thanks

Thanks,

Sony

Hey All-

Currently we have BDC to Create/Change Sales Deals using tcodes VB21 and VB22.Now we have decided to use any standard Function Module/BAPI in place of BDC because of performance issue.

I was trying with function module 'RV_CONDITION_COPY''RV_CONDITION_SAVE', 'RV_CONDITION_RESET' and 'Commit Work' ,but don't see any sales deals are creating.I see records updates table 'A501','KONH' and 'KONP' without Sales Deals Number.If anyone of you resolved the issue,Can you please post me the sample code?Thanks

Thanks,

Sony

2 REPLIES 2
Read only

Former Member
0 Likes
1,757

This message was moderated.

Read only

0 Likes
1,757

Thanks Mishara..I did the same way,but still did not work..

wa_komg-matnr = e_material.

wa_komg-vkorg = e_sorg.

wa_komg-meins = 'EA'.

wa_komg-vtweg = '10'.

wa_komg-spart = '10'.

wa_komg-zzshiptype = e_shiptype."'D'.

wa_komg-waerk = 'USD'.

wa_komg-mfrnr = e_mfrnr.

wa_kona-boart = 'ZNSC'.(Type of Sales Deal)

wa_kona-botext = 'Test for ZNSC'.

wa_kona-abrex = e_mfrnr.

wa_kona-vkorg = e_sorg.

wa_kona-vtweg = '10'.

wa_kona-spart = '10'.

wa_kona-abtyp = 'C'.

wa_kona-kappl = 'V'.

wa_kona-kobog = 'ZNSC'. (Type of Sales Deal)

wa_kona-bukrs = '1000'.

wa_kona-waers = 'USD'.

wa_kona-datab = e_date_from.

wa_kona-datbi = e_date_to.

wa_kona-ernam = sy-uname.

wa_kona-erdat = sy-datum.

wa_kona-erzet = sy-uzeit.

it_komv-kappl = e_appln."V.

it_komv-kschl = e_condition."ZE8P(condition type)

it_komv-kpein = '1'.

it_komv-waers = 'USD'. "gw_t001-waers.

it_komv-kmein = 'EA'.

it_komv-kbetr = e_amount.

it_komv-krech = 'C'.

wa_pispr-matnr = e_material.

wa_pispr-vkorg = e_sorg.

wa_pispr-vtweg = 10.

wa_pispr-spart = 10.

CALL FUNCTION 'SPR_KOMK_KOMP_FILL'

EXPORTING

pi_i_spr = wa_pispr

IMPORTING

pe_i_komk = komk

pe_i_komp = komp.

CALL FUNCTION 'RV_CONDITION_COPY'

EXPORTING

application = e_appln

condition_table = '501'

condition_type = e_condition

date_from = e_date_from

date_to = e_date_to

enqueue = 'X'

i_komk = komk

i_komp = komp

key_fields = wa_komg

maintain_mode = 'A'

no_authority_check = 'X'

keep_old_records = 'X'

  • used_by_idoc = 'X'

i_kona = wa_kona

overlap_confirmed = 'X'

no_db_update = space

IMPORTING

e_komk = komk

e_komp = komp

new_record = new_record

TABLES

copy_records = it_komv

  • copy_recs_idoc = it_komv_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.

CALL FUNCTION 'RV_CONDITION_SAVE'

TABLES

knumh_map = lt_knumh_map.

CALL FUNCTION 'RV_CONDITION_RESET'.

COMMIT WORK.

Please,let me know where I am doing the mistake...Thanks