Skip to Content
author's profile photo Former Member
Former Member

Problem in item data updation in Opportunity Creation

Hi All,

I am able to create the opportunity with BAPI_OPPORTUNITY_CREATEMULTI but the item data ( product tab in the opportunity ) is blank.

Please see the code below which i am using for this item data population. Update is getting terminated if i am using header handle. Please send me the correct solution for this problem.

*&----


&

*set item data

*----


&

clear ls_input_field.

ls_input_field-ref_handle = lc_handle_2.

  • ls_input_field-ref_kind = 'B'.

ls_input_field-objectname = 'ORDERADM_I'.

ls_input_field-fieldname = 'HANDLE'.

INSERT ls_input_field INTO TABLE lt_input_field.

ls_input_field-fieldname = 'HEADER_HANDLE'.

INSERT ls_input_field INTO TABLE lt_input_field.

  • ls_input_field-fieldname = 'LOGICAL_KEY'.

  • INSERT ls_input_field INTO TABLE lt_input_field.

ls_input_field-fieldname = 'ORDERED_PROD'.

INSERT ls_input_field INTO TABLE lt_input_field.

ls_input_field-fieldname = 'NUMBER_INT'.

INSERT ls_input_field INTO TABLE lt_input_field.

ls_input_field-fieldname = 'MODE'.

INSERT ls_input_field INTO TABLE lt_input_field.

lv_item = 0.

lv_number_int = 0.

ls_item-handle = lc_handle_2.

ls_item-header_handle = lc_handle_1.

  • ls_item-parent_handle = lc_handle_1.

if i_form_id = 'CAP'.

ls_item-ordered_prod = 'CAP_FEE'.

ls_item-number_int = lv_number_int + 10.

ls_item-mode = 'A'.

append ls_item to lt_item.

lv_number_int = ls_item-number_int.

clear ls_item.

*&----


&

*set schedule line

*----


&

clear ls_input_field.

ls_input_field-ref_handle = lc_handle_2.

ls_input_field-objectname = 'SCHEDLIN'.

ls_input_field-ref_kind = 'B'.

ls_input_field-fieldname = 'ITEM_HANDLE'.

INSERT ls_input_field INTO TABLE lt_input_field.

ls_input_field-fieldname = 'HANDLE'.

INSERT ls_input_field INTO TABLE lt_input_field.

ls_input_field-fieldname = 'QUANTITY'.

INSERT ls_input_field INTO TABLE lt_input_field.

ls_scheduleline-item_handle = lc_handle_2.

ls_scheduleline-handle = lc_handle_1.

ls_scheduleline-quantity = 1.

append ls_scheduleline to lt_scheduleline.

endif.

- Prakash

Add a comment
10|10000 characters needed characters exceeded

Related questions

1 Answer

  • author's profile photo Former Member
    Former Member
    Posted on Feb 06, 2012 at 12:06 PM

    Hi Prakash,

    Comment the following lines of code:

    ls_input_field-fieldname = 'HANDLE'.

    INSERT ls_input_field INTO TABLE lt_input_field.

    ls_input_field-fieldname = 'HEADER_HANDLE'.

    INSERT ls_input_field INTO TABLE lt_input_field.

    ls_item-header_handle = lc_handle_1.

    ls_input_field-fieldname = 'ITEM_HANDLE'.

    INSERT ls_input_field INTO TABLE lt_input_field.

    ls_input_field-fieldname = 'HANDLE'.

    INSERT ls_input_field INTO TABLE lt_input_field.

    ls_scheduleline-item_handle = lc_handle_2.

    And for mainatining the Unit of product, populate data in PRODUCT_I table.

    Ensure that u are creating the opportunity only else for update change the mode to 'B'.

    Hope this helps!!

    Prerna

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.