Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Sales Order Inquiry bapi upload problem

Hi All..

when iam trying to upload SO inquiry sample data through bapi iam getting these Errors :

Material 1423 is not defined for sales org.1000, distr.chan.12, language DE

Error in SALES_ITEM_IN 000000

Sales document was not changed.

but i defined 1423 material in sales org.1000, distr.chan.12.

here is my abap code.

&----


*& Report ZSAMPLE

*&

&----


*&

*&

&----


REPORT zsample.

DATA:lt_header LIKE bapisdhd1 OCCURS 0 WITH HEADER LINE,

lt_inquiry_items_in LIKE bapisditm OCCURS 0 WITH HEADER LINE,

lt_inquiry_items_inx LIKE bapisditmx OCCURS 0 WITH HEADER LINE,

lt_header_x LIKE bapisdhd1x OCCURS 0 WITH HEADER LINE,

lt_partners LIKE bapiparnr OCCURS 0 WITH HEADER LINE,

lt_return LIKE bapiret2 OCCURS 0 WITH HEADER LINE.

lt_header-doc_type = 'ZSJ1'.

lt_header-sales_org = '1000'.

lt_header-distr_chan = '12'.

lt_header-division = '00'.

lt_header-purch_date = '20081121'.

lt_header-purch_no_c = '7654321'.

APPEND lt_header.

CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'

EXPORTING

input = lt_header-doc_type

IMPORTING

output = lt_header-doc_type.

APPEND lt_header.

lt_header_x-updateflag = 'U'.

lt_header_x-doc_type = 'X'.

lt_header_x-sales_org = 'X'.

lt_header_x-distr_chan = 'X'.

lt_header_x-division = 'X'.

lt_header_x-purch_date = 'X'.

lt_header_x-purch_no_c = 'X'.

APPEND lt_header_x.

*lt_inquiry_items_in-currency = 'USD'.

*lt_inquiry_items_in-ITM_NUMBER = '0010'.

*lt_inquiry_items_in-plant = '0001'.

lt_inquiry_items_in-material = '000000000000001423'.

lt_inquiry_items_in-itm_number = '000010'.

*lt_inquiry_items_in-exchg_rate = '1000000'.

APPEND lt_inquiry_items_in.

lt_inquiry_items_inx-updateflag = 'U'.

  • lt_inquiry_items_inx-ITM_NUMBER = 'X'.

  • lt_inquiry_items_inx-PLANT = 'X'.

lt_inquiry_items_inx-material = 'X'.

lt_inquiry_items_inx-itm_number = 'X'.

APPEND lt_inquiry_items_inx.

lt_partners-partn_role = 'SH'.

lt_partners-partn_numb = '0000000149'.

APPEND lt_partners.

CALL FUNCTION 'BAPI_INQUIRY_CREATEFROMDATA2'

EXPORTING

  • SALESDOCUMENTIN = ' '

inquiry_header_in = lt_header

inquiry_header_inx = lt_header_x

  • SENDER =

  • BINARY_RELATIONSHIPTYPE =

  • INT_NUMBER_ASSIGNMENT =

  • BEHAVE_WHEN_ERROR =

  • LOGIC_SWITCH =

  • TESTRUN =

  • CONVERT = ' '

  • IMPORTING

  • SALESDOCUMENT =

TABLES

return = lt_return

inquiry_items_in = lt_inquiry_items_in

inquiry_items_inx = lt_inquiry_items_inx

inquiry_partners = lt_partners

  • INQUIRY_SCHEDULES_IN =

  • INQUIRY_SCHEDULES_INX =

  • INQUIRY_CONDITIONS_IN =

  • INQUIRY_CONDITIONS_INX =

  • INQUIRY_CFGS_REF =

  • INQUIRY_CFGS_INST =

  • INQUIRY_CFGS_PART_OF =

  • INQUIRY_CFGS_VALUE =

  • INQUIRY_CFGS_BLOB =

  • INQUIRY_CFGS_VK =

  • INQUIRY_CFGS_REFINST =

  • INQUIRY_TEXT =

  • INQUIRY_KEYS =

  • EXTENSIONIN =

  • PARTNERADDRESSES =

.

READ TABLE lt_return WITH KEY type = 'E'.

WRITE : /5 lt_return-type, 20 lt_return-id , 30 lt_return-number , 50 lt_return-message.

IF sy-subrc NE 0.

CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'

  • EXPORTING

  • WAIT =

  • IMPORTING

  • RETURN =

.

ENDIF.

Thank you,

Madhu Rao.

Former Member
Not what you were looking for? View more on this topic or Ask a question