cancel
Showing results for 
Search instead for 
Did you mean: 

Populating Quantity field in BAPI : "BAPI_OPPORTUNITY_CREATEMULTI"

Former Member
0 Kudos

I want to populate quantity field for an Item while creating Opportunity using BAPI_OPPORTUNITY_CREATEMULTI.

along with other data, I am populating BAPI internal table required for quantity as below, opportunity is being created with item. But quantity field is blank. Can anyone advise what I have been doing wrong or what’s right way of populating this table parameter.

Appreciate help on this.

-


s_scheduleline-item_handle = ‘0000000002’.

s_scheduleline-handle = ‘0000000001’.

s_scheduleline-quantity = s_valid-est_qty. " Quantity

APPEND s_scheduleline TO it_scheduleline.

s_input-ref_handle = ‘0000000002’

s_input-ref_kind = 'B'.

s_input-objectname = 'SCHEDLIN'.

s_input-fieldname = 'QUANTITY'.

APPEND s_input TO it_input.

CALL FUNCTION 'BAPI_OPPORTUNITY_CREATEMULTI'

TABLES

header = it_header

opportunity = it_opp

partner = it_partner

appointment = it_appointment

status = it_status

customer_head = it_cust_h

text = it_text

item = it_item

product = it_product

scheduleline = it_scheduleline

pricing_item = it_price_i

input_fields = it_input

saved_process = it_saved

return = it_return.

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Resolved

Former Member
0 Kudos

Hi,

Can you please tell me the solution.

I am also able to create oppurtunity, but quantity and unit both are not getting filled?

Can you please share your solution at your earliest.

Thanks,

Narendra.

sachin_yadav3
Active Participant
0 Kudos

Hi,

I am also facing the same problem.

Kindly help to get the solution.

Regards

Sachin Yadav

dalibor_riger
Explorer
0 Kudos

Be sure to reset logical_key field from input_fields structure after inserting partner data.

ls_fields-objectname = 'PARTNER'.

ls_fields-logical_key = '0000'.

ls_fields-fieldname = gc_fieldname-partner_no.

APPEND ls_fields TO lt_fields.

ls_fields-logical_key = ''.

Edited by: Dalibor Riger on Nov 29, 2011 5:09 PM

former_member182350
Active Contributor
0 Kudos

Try: by changing

s_input-ref_handle = ‘0000000001’

Former Member
0 Kudos

Its not helping...Quantity is not being populated.