Application Development and Automation 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: 
Read only

Sales Order Inquiry bapi upload problem

Former Member
0 Likes
646

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.

4 REPLIES 4
Read only

Former Member
0 Likes
582

hi

Use FM conversion_exit_alpha_input... and give the number exactly as the size of the field.. if there are any prefix 0's which are not given in the field.. the BAPI wont execute..

if it is in the database as 00001423 and ur giving it as 1423...it wont take it...

Check the master table of material to see how it is stored in database.

and pass exact value.

Regards,

Vishwa.

Read only

BH2408
Active Contributor
0 Likes
582

Hi ,

Here u need to use this FM :CONVERSION_EXIT_ALPHA_INPUT

it will convert into SAP format Like inserting the leading zeros .

Regards,

Bharani.

Read only

Former Member
0 Likes
582

Oh!! I think you already passes zeroes before, did nt check ur code properly... Just try to test this FM from Se37 and pass on the values to the structures in se37...

Execute from se37 tcode and check if it is the same problem.

Regards,

Vishwa.

Read only

0 Likes
582

Hi Vishva..

I Checked in se37 and executed the bapi indipendently also but it is giving the same problem.after i giving the Conversion_exit also it is giving the same problem...if u got any idea pls let me know..

Thank you,

Madhu Rao.