2008 Jul 21 5:16 PM
HI,
I am changing an Enquiry using BAPI_INQUIRY_CREATEFROMDATA2. I came to know this bapi can be used to create and change inquiries. After succesfully chnaging the document i am getting message from SAP Office
"Express document "Update was terminated" received". dont know why... can anybody help me in this issue...
When i am using for same sales document change using bapi BAPI_CUSTOMERINQUIRY_CHANGE.. it is working fine...
here is code...
data: lt_header like BAPISDHD1 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 = 'IN'.
lt_header-purch_date = '20080808'.
lt_header-purch_no_c = '7654321'.
append lt_header.
lt_header_x-updateflag = 'U'.
lt_header_x-purch_date = 'X'.
lt_header_x-purch_no_c = 'X'.
append lt_header_x.
lt_partners-partn_role = 'AG'.
lt_partners-partn_numb = '0000012345'.
append lt_partners.
CALL FUNCTION 'BAPI_INQUIRY_CREATEFROMDATA2'
EXPORTING
SALESDOCUMENTIN = '0010012345'
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 =
* 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'.
if sy-subrc ne 0.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
* EXPORTING
* WAIT =
* IMPORTING
* RETURN =
.
endif.
I'm pretty sure that you do not want to use this BAPI to change your inquiry, use the supplied BAPI for changing and only use the CREATE for creating.
REgards,
Rich Heilman
2008 Jul 21 5:35 PM
2008 Jul 21 5:53 PM
2008 Jul 21 5:58 PM
Thanks Rich,
I was in Dilemma, to use this or not...
But why SAP given option to change Inquiry with this BAPI?
Can you explain .....if possible
Regards
Giri
2008 Jul 21 5:59 PM
2008 Jul 21 6:04 PM
In FM Document,
when i click on the input parameter INQUIRY_HEADER_INX.. the following description opens
Checkbox for Header Data
Description
This paramter fulfills the following two tasks:
Controls processing functions with the value in the UPDATEFLAG field (change indicator).
The following entries are available:
' ' : Create a new sales document
I: Create a new sales document
U: Change an existing sales document
😧 Delete an existing sales document
Controls the field entry with checkboxes
If the UPDATEFLAG field has been activated, the system only copies those fields from the SALES_HEADER_IN parameter that have been activated with 'X'.
this part made me assume to use this BAPI to change Inquiry also.
Giri
| User | Count |
|---|---|
| 6 | |
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |