Application Development 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: 

Problem with CUST_MAT22 field in BAPI_INQUIRY_CREATEFROMDATA2

Former Member
0 Kudos

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.

5 REPLIES 5

Former Member
0 Kudos

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

0 Kudos

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

0 Kudos

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.

0 Kudos

I worked as suggested by you. But still customer material no is empty. Please help in resolving the issue.

Regards

K Srinivas

Former Member
0 Kudos

resolved. i went for cust35 field instead of cust22 field