Skip to Content

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

inquiry creation bapi

Hi..

iam creating inquiry using bapi fm.iam trying to upload iam getting many errors.here is my code.

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,

i_salesdocnum like BAPIVBELN-VBELN.

lt_header-doc_type = 'ZSJ1'.

lt_header-sales_org = '3020'.

lt_header-distr_chan = '20'.

*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 = ''.

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-plant = '1000'.

lt_inquiry_items_in-material = '000000000000000188'.

lt_inquiry_items_in-itm_number = '000010'.

*lt_inquiry_items_in-exchg_rate = '1000000'.

CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'

EXPORTING

input = lt_inquiry_items_in-material

IMPORTING

OUTPUT = lt_inquiry_items_in-material

.

APPEND lt_inquiry_items_in.

lt_inquiry_items_inx-updateflag = ''.

  • 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 = 'AG'.

lt_partners-partn_numb = '0000001000'.

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 = i_salesdocnum

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.

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