03-02-2010 7:43 AM
Hi,
I am trying to inquiries using BAPI_INQUIRY_CREATEFROMDATA2 . But BAPISDITM-CUST_MAT22 field is not getting filled after inquiry got created.
CALL FUNCTION 'BAPI_INQUIRY_CREATEFROMDATA2'
EXPORTING
INQUIRY_HEADER_IN = W_ENQUIRY_THEAD
IMPORTING
SALESDOCUMENT = W_NUMBER
TABLES
RETURN = W_RETURN
INQUIRY_ITEMS_IN = W_ENQUIRY_ITEM
INQUIRY_PARTNERS = T_INQUIRY_PARTNERS
The value of Customer Material No is present in W_ENQUIRY_ITEM-CUST_MAT22. But after inquiry got created the customer material no is empty. Please guide in resolving the issue.
03-02-2010 8:11 AM
Hi,
You need to pass INQUIRY_ITEMS_INX-CUST_MAT22 = 'X'. This is the structure which tell what the fields need to be updated by BAPi.
Go trough the documentation for INQUIRY_ITEMS_INX. It clearly explians why we need to pass X for those fields which we are updating.
Regards,
Shanmugavel Chandrasekaran
03-02-2010 8:44 AM
Thankyou for the reply. I have made following changes but still not working. I am creating the inquiry and customer material is not getting populated. Please guide in resolving the issue.
DATA : W_ENQUIRY_ITEM_INX LIKE BAPISDITMX OCCURS 0 WITH HEADER LINE.
W_ENQUIRY_ITEM_INX-ITM_NUMBER = THEAD-ITEMNO.
W_ENQUIRY_ITEM_INX-UPDATEFLAG = 'X'.
W_ENQUIRY_ITEM_INX-CUST_MAT22 = 'X'.
APPEND W_ENQUIRY_ITEM_INX.
CALL FUNCTION 'BAPI_INQUIRY_CREATEFROMDATA2'
EXPORTING
SALESDOCUMENTIN =
INQUIRY_HEADER_IN = W_ENQUIRY_THEAD
IMPORTING
SALESDOCUMENT = W_NUMBER
TABLES
RETURN = W_RETURN
INQUIRY_ITEMS_IN = W_ENQUIRY_ITEM
INQUIRY_ITEMS_INX = W_ENQUIRY_ITEM_INX
INQUIRY_PARTNERS = T_INQUIRY_PARTNERS
03-02-2010 9:35 AM
Hi,
In debugging can u check W_ENQUIRY_ITEM_INX-ITM_NUMBER and W_ENQUIRY_ITEM_IN-ITM_NUMBER has same item number.
If not BAPI will not update.
Also try to create enquiry manually and see whether you can update Customer material number. If its not manually possible check the configration of your system.
Hope it helps,
Regards,
Shanmugavel Chandrasekaran.
03-02-2010 10:35 AM
I worked as suggested by you. But still customer material no is empty. Please help in resolving the issue.
Regards
K Srinivas
03-02-2010 12:06 PM