‎2010 Apr 17 11:13 AM
Hi,
I use BAPI_CONTRACT_CREATEFROMDATA to generate contract no. but when i execute report
display following error like
SALES_HEADER_IN has been processed successfully
Condition PR00 is missing in pricing procedure A V ZESE41
The sales document is not yet complete: Edit data
Sales document was not changed
Edited by: kk.adhvaryu on Apr 17, 2010 12:14 PM
‎2010 Apr 17 11:20 AM
Hi,
PR00 is the mandatory pricing condition. Configuration is missing for the pricing procedure. Ask your functional to configure the respective pricing procedure to have PR00 condition. Then it works fine.
FYI...
You will get the same error even if you try to create the contract manually.
Thanks,
Vinod.
‎2010 Apr 17 11:22 AM
if possible then can u pl give sample code without passing patnar details.
‎2010 Apr 17 11:25 AM
Pricing condition "PR00" which you are passing in Bapi is not defined in pricing procedure "ZESE41".
Regards
Vinod
‎2010 Apr 17 11:34 AM
Hi vinod,
now i got following error
SALES_HEADER_IN has been processed successfully
Condition ZSPS is not allowed as header condition
The sales document is not yet complete: Edit data
Sales document was not changed
‎2010 Apr 17 11:39 AM
Set
CONTRACT_CONDITIONS_IN-ITM_NUMBER = <item_number>
CONTRACT_CONDITIONS_INX-ITM_NUMBER = <item_number>uncomment the line
move '000010' to w_conds-itm_number,I think you have to fill CONTRACT_CONDITIONS_INX structure also.
Regards
Vinod
*
Edited by: Vinod Kumar on Apr 17, 2010 4:13 PM
‎2010 Apr 17 11:47 AM
as u told i do this but again error like
Condition ZSPS is not allowed as header condition
why this error i not assign in header then?
‎2010 Apr 17 12:00 PM
Try this code
move '000010' to w_conds-itm_number.
move 'ZSPS' to w_conds_cond_type.
move '34.00' to w_conds-cond_value,
move 'INR' to w_conds-currency,
append w_conds to t_conds.
move '000010' to w_conds-itm_number.
move 'ZSPS' to w_conds_cond_type.
move 'X' to w_conds-cond_value.
move 'X' to w_conds-currency.
move 'I' to w_conds-updateflag.
append w_condsx to t_condsx.Fill both the structures CONTRACT_CONDITIONS_IN & CONTRACT_CONDITIONS_INX using the structures T_CONDS & T_CONDSX.
Regards
Vinod
‎2010 Apr 17 12:14 PM
i do as u told but agian error
SALES_HEADER_IN has been processed successfully <
Sales unit D is not defined for item 000010 <
Error in SALES_ITEM_IN 000010 <
Condition ZSPS is not allowed as header condition <
‎2010 Apr 17 12:19 PM
Paste the Code part where you have filled the Conditions & conditionsx structure.
Regards
Vinod
‎2010 Apr 17 12:23 PM
w_conds like bapicond,
t_conds like bapicond occurs 0,
t_condsx like BAPICONDITIONX occurs 0,
w_condsx type BAPICONDITIONX,
move '000010' to w_conds-itm_number.
move 'ZSPS' to w_conds-cond_type.
move '34.00' to w_conds-cond_value.
move 'INR' to w_conds-currency.
append w_conds to t_conds.
move '000010' to w_condsx-itm_number.
move 'ZSPS' to w_condsx-cond_type.
move 'X' to w_condsx-cond_value.
move 'X' to w_condsx-currency.
move 'I' to w_condsx-updateflag.
append w_condsx to t_condsx.
have gmail id?
Edited by: kk.adhvaryu on Apr 17, 2010 1:27 PM
‎2010 Apr 17 12:29 PM
Item level i already pass sales unit see
***** ITEMS *****
move: 'Q1512' to w_items-material,
'2601' to w_items-PLANT,
'2601' to w_items-SHIP_POINT,
*p_charg to w_items-BATCH,
*
*p_werds to w_items-S_PROC_IND,
*
*p_pstyv to w_items-ITEM_CATEG,
*
'10.000' to w_items-target_qty,
'10' to w_items-target_qu,
'PC' TO w_items-SALES_UNIT,
*p_brgew1 to w_items-gross_wght,
*p_ntgew1 to w_items-net_weight,
*
*p_gewei1 to w_items-untof_wght,
*
*p_gewei1 to w_items-unof_wtiso,
'000010' to w_items-itm_number.
* p_netwr1 to w_items-target_val,
* 'USD' to w_items-currency,
* 'USD' to w_items-curr_iso.
append w_items to t_items.
‎2010 Apr 17 12:29 PM
This error occurs only when you pass the pricing condition with position no '000000', where as this condition is defined at item level in pricing procedure.
Regards
Vinod
‎2010 Apr 17 12:35 PM
‎2010 Apr 19 6:16 AM
‎2010 Apr 17 11:27 AM
See this is my code
REPORT zr_and_d .
data: w_header like bapisdhd1,
v_order like bapivbeln-vbeln,
w_return like bapiret2,
t_return like bapiret2 occurs 0,
w_items like bapisditm,
t_items like bapisditm occurs 0,
w_partners like bapiparnr,
t_partners like bapiparnr occurs 0,
w_conds like bapicond,
t_conds like bapicond occurs 0,
w_sched like bapischdl,
t_sched like bapischdl occurs 0,
w_texts like bapisdtext,
t_texts like bapisdtext occurs 0,
v_exit.
selection-screen begin of block b1 with frame.
parameters:
p_sp type kunnr,
p_sh type kunnr,
p_auart type AUART,
p_vkorg type vkorg,
p_vtweg type vtweg,
p_spart type spart,
p_gueen type gueen,
p_guebg type guebg.
selection-screen end of block b1.
start-of-selection.
Edited by: kk.adhvaryu on Apr 17, 2010 12:28 PM
‎2010 Apr 17 11:29 AM
Check the pricing procedure definition in t-code V/08. Check whether pricing condition PR00 is availbale in the pricing procedure ZESE41.
Regards
Vinod
Edited by: Vinod Kumar on Apr 17, 2010 3:59 PM
‎2010 Apr 17 11:29 AM
***** HEADER *****
move:
p_auart to w_header-doc_type,
p_guebg to w_header-CT_VALID_F,
p_gueen to w_header-CT_VALID_T,
p_vkorg to w_header-sales_org,
p_vtweg to w_header-distr_chan,
p_spart to w_header-division.
*
*
***** ITEMS *****
move: 'Q1512' to w_items-material,
'2601' to w_items-PLANT,
'2601' to w_items-SHIP_POINT,
'10.000' to w_items-target_qty,
'1' to w_items-target_qu,
'000010' to w_items-itm_number.
append w_items to t_items.
clear w_items.
‎2010 Apr 17 11:30 AM
***** PRICING *****
move: 'ZSPS' to w_conds-cond_type,
'34.00' to w_conds-cond_value,
* p_netwr1 to w_conds-conbaseval,
'INR' to w_conds-currency,
*p_unit1 to w_conds-cond_unit,
'1' to w_conds-cond_p_unt,
'C' to w_conds-calctypcon.
*'000010' to w_conds-itm_number,
*
*'011' to w_conds-cond_st_no,
*
*'00' to w_conds-cond_count.
append w_conds to t_conds.
‎2010 Apr 17 11:32 AM
Hi,
Don't post the entire code. Check the pricing procedure first (V/08).
Regards
Vinod
‎2010 Apr 17 11:37 AM
How can i pass Condition ZSPS in item level ?pl chek my code and tell
‎2010 Apr 17 11:31 AM
***** SCHEDULE LINES *****
move: '000010' to w_sched-itm_number,
'0001' to w_sched-sched_line,
'20050112' to w_sched-req_date,
'1' to w_sched-date_type,
sy-uzeit to w_sched-req_time,
'10.000' to w_sched-req_qty.
append w_sched to t_sched.
***** PARTNERS *****
move: 'AG' to w_partners-partn_role,
p_sp to w_partners-partn_numb.
append w_partners to t_partners.
move: 'RE' to w_partners-partn_role,
p_sh to w_partners-partn_numb.
append w_partners to t_partners.
***** TEXTS *****
move: '0002' to w_texts-text_id,
'000010' to w_texts-itm_number,
'E' to w_texts-langu,
'EN' to w_texts-langu_iso,
'*' to w_texts-format_col,
'fff' to w_texts-text_line.
append w_texts to t_texts.
*
move: '0002' to w_texts-text_id,
'000010' to w_texts-itm_number,
'E' to w_texts-langu,
'EN' to w_texts-langu_iso,
'*' to w_texts-format_col,
'hh' to w_texts-text_line.
append w_texts to t_texts.
‎2010 Apr 17 11:31 AM
move: '0002' to w_texts-text_id,
'000010' to w_texts-itm_number,
'E' to w_texts-langu,
'EN' to w_texts-langu_iso,
'*' to w_texts-format_col,
'hhh' to w_texts-text_line.
append w_texts to t_texts.
break developer.
call function 'BAPI_CONTRACT_CREATEFROMDATA'
exporting
CONTRACT_HEADER_IN = w_header
* ORDER_HEADER_INX
* BEHAVE_WHEN_ERROR
* LOGIC_SWITCH
* TESTRUN
convert = 'X'
importing
salesdocument = v_order
tables
return = t_return
CONTRACT_items_in = t_items
* ORDER_ITEMS_INX
CONTRACT_partners = t_partners
CONTRACT_schedules_in = t_sched
* ORDER_SCHEDULES_INX
CONTRACT_conditions_in = t_conds
* ORDER_CONDITIONS_INX
CONTRACT_text = t_texts
* ORDER_KEYS
* EXTENSIONIN
* PARTNERADDRESSES
.
break developer.
if t_return[] is initial.
call function 'BAPI_TRANSACTION_COMMIT'.
write: 'Sales document', v_order, 'has been created'.
else.
loop at t_return into w_return.
case w_return-type.
when 'E'.
message id w_return-id type 'I' number w_return-number
with w_return-message_v1
w_return-message_v2
w_return-message_v3
w_return-message_v4.
v_exit = 'X'.
when 'A'.
message id w_return-id type 'I' number w_return-number
with w_return-message_v1
w_return-message_v2
w_return-message_v3
w_return-message_v4.
v_exit = 'X'.
when 'I'.
message id w_return-id type 'I' number w_return-number
‎2010 Apr 17 11:32 AM
with w_return-message_v1
w_return-message_v2
w_return-message_v3
w_return-message_v4.
when 'W'.
message id w_return-id type 'W' number w_return-number
with w_return-message_v1
w_return-message_v2
w_return-message_v3
w_return-message_v4.
when 'S'.
message id w_return-id type 'S' number w_return-number
with w_return-message_v1
w_return-message_v2
w_return-message_v3
w_return-message_v4.
endcase.
endloop.
endif.
if v_exit = 'X'.
exit.
else.
call function 'BAPI_TRANSACTION_COMMIT'.
endif.
but not generate contract no. can u pl tell what is my mistake now pricing procedure already config.
‎2010 Apr 19 2:14 PM
solve my issue i just pass details into contract_data_in and contract_conditions_in