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

Help on Bapi

Former Member
0 Likes
414

Hi Friends,

I am in a urgent situation in need of documentation for Bapi BAPI_PRICES_CONDITIONS.

i need to update price in the table konp. is this bapi will be helpfull or is there any other BAPI which will be more helpfull to update price..

It will be more helpfull if i can get some documentation for this BAPI.

Reward is SURE for reply..

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
383

Hi,

please check out the below program it might help you

BEGIN OF i_file OCCURS 0 ,

varkey(100),

kbetr LIKE konp-kbetr,

konwa LIKE konp-konwa,

kpein LIKE konp-kpein,

kmein LIKE konp-kmein,

datab type datab,

datbi type datbi,

END OF i_file.

lt_bapicondct-operation = gc_operation. "this code for creating condition

lt_bapicondct-cond_usage = t681-kvewe. "Usage of the condition table

lt_bapicondct-table_no = t681-kotabnr. "Condition table

lt_bapicondct-applicatio = t681-kappl. "Application

lt_bapicondct-cond_type = p_kschl. "condition type

lt_bapicondct-varkey = i_file-varkey. "condition key

lt_bapicondct-valid_to = i_file-datbi.

  • lt_bapicondct-agree_cond = '0001004168'.

lt_bapicondct-valid_from = i_file-datab.

lt_bapicondct-cond_no = '$000000001'.

APPEND lt_bapicondct.

lt_bapicondhd-operation = gc_operation. "this code for creating condition

lt_bapicondhd-cond_no = '$000000001'.

lt_bapicondhd-created_by = sy-uname.

lt_bapicondhd-creat_date = sy-datum.

lt_bapicondhd-cond_usage = t681-kvewe. "Usage of the condition table

lt_bapicondhd-table_no = t681-kotabnr. "Condition table

lt_bapicondhd-applicatio = t681-kappl. "Application

lt_bapicondhd-cond_type = p_kschl. "condition type

lt_bapicondhd-varkey = i_file-varkey. "condition key

lt_bapicondhd-valid_from = i_file-datab.

lt_bapicondhd-valid_to = i_file-datbi.

APPEND lt_bapicondhd.

lt_bapicondit-operation = gc_operation. "this code for creating condition

lt_bapicondit-cond_no = '$000000001'.

lt_bapicondit-cond_count = 1.

lt_bapicondit-applicatio = t681-kappl. "Application

lt_bapicondit-cond_type = p_kschl. "condition type

lt_bapicondit-cond_p_unt = i_file-kpein. "Condition pricing unit

lt_bapicondit-cond_unit = i_file-kmein. "Condition unit

lt_bapicondit-cond_value = i_file-kbetr. "Rate where no scale exists

lt_bapicondit-condcurr = i_file-konwa. "Rate unit

APPEND lt_bapicondit.

ENDLOOP.

CALL FUNCTION 'BAPI_PRICES_CONDITIONS'

TABLES

ti_bapicondct = lt_bapicondct[]

ti_bapicondhd = lt_bapicondhd[]

ti_bapicondit = lt_bapicondit[]

ti_bapicondqs = lt_bapicondqs[]

ti_bapicondvs = lt_bapicondvs[]

to_bapiret2 = lt_bapiret2[]

to_bapiknumhs = lt_bapiknumhs[]

to_mem_initial = lt_mem_initial[]

EXCEPTIONS

update_error = 1

OTHERS = 2.

********please reward points if the information is helpful to you**************

2 REPLIES 2
Read only

Former Member
0 Likes
383

Read only

Former Member
0 Likes
384

Hi,

please check out the below program it might help you

BEGIN OF i_file OCCURS 0 ,

varkey(100),

kbetr LIKE konp-kbetr,

konwa LIKE konp-konwa,

kpein LIKE konp-kpein,

kmein LIKE konp-kmein,

datab type datab,

datbi type datbi,

END OF i_file.

lt_bapicondct-operation = gc_operation. "this code for creating condition

lt_bapicondct-cond_usage = t681-kvewe. "Usage of the condition table

lt_bapicondct-table_no = t681-kotabnr. "Condition table

lt_bapicondct-applicatio = t681-kappl. "Application

lt_bapicondct-cond_type = p_kschl. "condition type

lt_bapicondct-varkey = i_file-varkey. "condition key

lt_bapicondct-valid_to = i_file-datbi.

  • lt_bapicondct-agree_cond = '0001004168'.

lt_bapicondct-valid_from = i_file-datab.

lt_bapicondct-cond_no = '$000000001'.

APPEND lt_bapicondct.

lt_bapicondhd-operation = gc_operation. "this code for creating condition

lt_bapicondhd-cond_no = '$000000001'.

lt_bapicondhd-created_by = sy-uname.

lt_bapicondhd-creat_date = sy-datum.

lt_bapicondhd-cond_usage = t681-kvewe. "Usage of the condition table

lt_bapicondhd-table_no = t681-kotabnr. "Condition table

lt_bapicondhd-applicatio = t681-kappl. "Application

lt_bapicondhd-cond_type = p_kschl. "condition type

lt_bapicondhd-varkey = i_file-varkey. "condition key

lt_bapicondhd-valid_from = i_file-datab.

lt_bapicondhd-valid_to = i_file-datbi.

APPEND lt_bapicondhd.

lt_bapicondit-operation = gc_operation. "this code for creating condition

lt_bapicondit-cond_no = '$000000001'.

lt_bapicondit-cond_count = 1.

lt_bapicondit-applicatio = t681-kappl. "Application

lt_bapicondit-cond_type = p_kschl. "condition type

lt_bapicondit-cond_p_unt = i_file-kpein. "Condition pricing unit

lt_bapicondit-cond_unit = i_file-kmein. "Condition unit

lt_bapicondit-cond_value = i_file-kbetr. "Rate where no scale exists

lt_bapicondit-condcurr = i_file-konwa. "Rate unit

APPEND lt_bapicondit.

ENDLOOP.

CALL FUNCTION 'BAPI_PRICES_CONDITIONS'

TABLES

ti_bapicondct = lt_bapicondct[]

ti_bapicondhd = lt_bapicondhd[]

ti_bapicondit = lt_bapicondit[]

ti_bapicondqs = lt_bapicondqs[]

ti_bapicondvs = lt_bapicondvs[]

to_bapiret2 = lt_bapiret2[]

to_bapiknumhs = lt_bapiknumhs[]

to_mem_initial = lt_mem_initial[]

EXCEPTIONS

update_error = 1

OTHERS = 2.

********please reward points if the information is helpful to you**************