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

create inquiry using BAPI_INQUIRY_CREATEFROMDATA2

Former Member
0 Likes
3,184

Dear Experts ,

My requirement is create inquiry using bapi "BAPI_INQUIRY_CREATEFROMDATA2" , this fm is creating inquiry and when open in VA13

then it is giving error as sd document is not in the database or has been archived , I filled all the tables but still it is giving error ,

where i did the mistake if u want i will paste my code .My doubt is how to fill configurable tables. please help me in this.

3 REPLIES 3
Read only

Former Member
0 Likes
1,864

Hi,

After BAPI, BAPI_INQUIRY_CREATEFROMDATA2 execution , do u use BAPI_TRANSACTION_COMMIT.

If yes , Please set wait time for 2 second or something , if  your BAPI return correct value. Please try to check in debug.

Regards,

Prasenjit

Read only

RaymondGiuseppi
Active Contributor
0 Likes
1,864

First check for error messages in RETURN parameter, then use the WAIT option in COMMIT WORK or call of BAPI_TRANSACTION_COMMIT, so the update tasks update the database. You could then, if problem is not solved due to database load and buffering, use a small loop executing a SELECT from database and WAIT UP TO 1 SECONDS if not successful.

Regards,

Raymond

Read only

0 Likes
1,864

Dear Experts ,

I am getting following errors,

Internal error: 000010, 000010, NOT_ALL_INPUT_DATA_PROCESSED_AND_INCONSISTENT,

Error in SALES_ITEM_IN 000010

how to resolve this , please help me in this .

i am pasting my code.

data : wa_header TYPE BAPISDHD1,
it_items
TYPE TABLE OF BAPISDITM ,
wa_items
TYPE BAPISDITM,
it_partners
TYPE TABLE OF BAPIPARNR,
wa_partners
TYPE BAPIPARNR,
it_schedules
TYPE TABLE OF  BAPISCHDL,
wa_schedules
TYPE  BAPISCHDL,
it_conditions
TYPE TABLE OF BAPICOND ,
wa_conditions
TYPE BAPICOND,

it_ref
TYPE TABLE OF BAPICUCFG,
wa_ref
TYPE BAPICUCFG,
it_inst
TYPE TABLE OF BAPICUINS,
wa_inst
TYPE BAPICUINS,
it_part
TYPE TABLE OF BAPICUPRT,
wa_part
TYPE BAPICUPRT,
it_value
TYPE TABLE OF BAPICUVAL ,
wa_value
TYPE BAPICUVAL,
it_refinst
TYPE TABLE OF BAPICUREF,
wa_refinst
TYPE BAPICUREF,
wa_headerx
type BAPISDHD1X,
it_itemx
TYPE TABLE OF  BAPISDITMX,
wa_itemx
TYPE  BAPISDITMX,
it_conditionx
TYPE TABLE OF BAPICONDX ,
wa_conditionx
TYPE BAPICONDX ,
it_schedulex
TYPE TABLE OF  BAPISCHDLX ,
wa_schedulex
TYPE  BAPISCHDLX .
data return type table of BAPIRET2.

DATA:
*lta_inq_bapiret2 TYPE STANDARD TABLE OF bapiret2,
*lta_inq_items TYPE STANDARD TABLE OF bapisditm,
*lta_inq_itemsx TYPE STANDARD TABLE OF bapisditmx,
*lta_inq_sched TYPE STANDARD TABLE OF bapischdl,
*lta_inq_schedx TYPE STANDARD TABLE OF bapischdlx,
*lta_inq_partners TYPE STANDARD TABLE OF bapiparnr,
*lta_inq_cfgs_ref TYPE STANDARD TABLE OF bapicucfg,
*lta_inq_cfgs_inst TYPE STANDARD TABLE OF bapicuins,
*lta_inq_cfgs_part_of TYPE STANDARD TABLE OF bapicuprt,
*lta_inq_cfgs_value TYPE STANDARD TABLE OF bapicuval,
lta_inq_cfgs_blob
TYPE STANDARD TABLE OF bapicublb,
lta_inq_cfgs_vk
TYPE STANDARD TABLE OF bapicuvk.
*lta_inq_cfgs_refinst TYPE STANDARD TABLE OF bapicuref.


data: conf_id type char6 value '000001',
inst_id
type char8 value '00000001',
salesordernumber
type vbeln.

*  data: conf_id type char6 value '000001',
*        inst_id type char8 value '00000001',
*        salesordernumber type vbeln.

.
wa_header
-doc_type = 'ZSIN'.
wa_header
-sales_org = '1000'.
wa_header
-division = '10'.
wa_header
-distr_chan = '13'.

WA_HEADER
-QT_VALID_T = sy-datum.

wa_partners
-partn_role = 'AG'.
wa_partners
-partn_numb = '0004000490'.
*       WA_PARTNERS-ITM_NUMBER = '000010'.
APPEND wa_partners to it_partners.

wa_partners
-partn_role = 'WE'.
wa_partners
-partn_numb = '0004000490'.
*       WA_PARTNERS-ITM_NUMBER = '000010'.
APPEND wa_partners to it_partners.

wa_partners
-partn_role = 'ZM'.
wa_partners
-partn_numb = '0000000216'.
*       WA_PARTNERS-ITM_NUMBER = 0.
APPEND wa_partners to it_partners.

wa_items
-itm_number = '000010'.
wa_itemS
-material = '000000000000600331'.
WA_ITEMS
-PLANT = '1100'.
wa_items
-PO_ITM_NO = '000010'.
wa_itemS
-target_qty = '1'.
WA_ITEMS
-TARGET_QU = 'EA'.
APPEND WA_ITEMS TO IT_ITEMS.

wa_itemx
-itm_number = '000010'.
wa_itemx
-UPDATEFLAG = 'I'.
wa_itemx
-material = 'X'.
wa_itemx
-PLANT = 'X'.
wa_itemx
-TARGET_QTY = 'X'.
wa_itemx
-TARGET_QU = 'X'.
WA_ITEMX
-PO_ITM_NO = 'X'.
APPEND WA_ITEMX TO IT_ITEMX.

wa_ref
-posex = '000010'.
wa_ref
-root_id = '00000001'.

wa_ref
-config_id = conf_id.
wa_ref
-complete = '1'.
wa_ref
-consistent = '1'.
APPEND wa_ref to it_ref.
*  insert wa_quote_ref into table tab_quote_ref.
**Refinst
wa_refinst
-posex = '000010'.
wa_refinst
-config_id = conf_id.
wa_refinst
-inst_id = inst_id.
APPEND wa_refinst to it_refinst.
*  insert wa_quote_refinst into table tab_quote_refinst.
*
wa_inst
-inst_id = inst_id.
wa_inst
-config_id = conf_id.
wa_inst
-obj_type = 'MARA'.
wa_inst
-class_type = '300'.
wa_inst
-obj_key = '000000000000600331'.
wa_inst
-quantity = '1'.
APPEND wa_inst to it_inst.
*  insert wa_quote_inst into table tab_quote_inst.
*
**Attribute values
wa_value
-config_id = conf_id.
wa_value
-inst_id inst_id.
wa_value
-charc = 'MODEL_TYPE'.
wa_value
-value = 'GD'.
APPEND wa_value to it_value.

  CALL FUNCTION 'BAPI_INQUIRY_CREATEFROMDATA2'
EXPORTING
*     SALESDOCUMENTIN               =
INQUIRY_HEADER_IN            
= wa_header
*     INQUIRY_HEADER_INX            =
*     SENDER                        =
*     BINARY_RELATIONSHIPTYPE       =
*     INT_NUMBER_ASSIGNMENT         =
*     BEHAVE_WHEN_ERROR             =
*     LOGIC_SWITCH                  =
*     TESTRUN                       =
*     CONVERT                       = ' '
IMPORTING
SALESDOCUMENT                
= salesordernumber
TABLES
RETURN                        = return
INQUIRY_ITEMS_IN             
= it_items
INQUIRY_ITEMS_INX            
= IT_ITEMX
INQUIRY_PARTNERS             
= it_partners
INQUIRY_SCHEDULES_IN         
= it_schedules
INQUIRY_SCHEDULES_INX        
= IT_SCHEDULEX
*     INQUIRY_CONDITIONS_IN         =
*     INQUIRY_CONDITIONS_INX        =
INQUIRY_CFGS_REF             
= it_ref
INQUIRY_CFGS_INST            
= it_inst
INQUIRY_CFGS_PART_OF         
= IT_PART
INQUIRY_CFGS_VALUE           
= it_value
INQUIRY_CFGS_BLOB            
= lta_inq_cfgs_blob
INQUIRY_CFGS_VK              
= lta_inq_cfgs_vk
INQUIRY_CFGS_REFINST         
it_refinst
*     INQUIRY_TEXT                  =
*     INQUIRY_KEYS                  =
*     EXTENSIONIN                   =
*     PARTNERADDRESSES              =
.

if salesordernumber ne ''.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'.
else.
CALL FUNCTION 'BAPI_TRANSACTION_ROLLBACK'.
endif.