2008 Jan 14 2:34 PM
Dear All,
Has any one successfully implemented the BAPI_SALESORDER_CHANGE Bapi to change the Z fields in a sales order ?
I have extended the corresponding structures,I have used update flag = 'U' and also passed 'X' to update the changed field...but still it is not updating the fields
I have gone through lot of threads in SDN but not able to find any thread which has solution
Can any one help me out on this issue.
Note:
1. We are able to create the Sales order with BAPI_SALESORDER_CREATEFROMDAT2 ...able to populate all the Z Fields also.
I am using 4.7EE version.
Regards,
Srinivas
2008 Jan 14 2:43 PM
Hi Srinu,
Are you calling 'BAPI_TRANSACTION_COMMIT' after?
Regards,
Chester
Dear All,
Has any one successfully implemented the BAPI_SALESORDER_CHANGE Bapi to change the Z fields in a sales order ?
I have extended the corresponding structures,I have used update flag = 'U' and also passed 'X' to update the changed field...but still it is not updating the fields
I have gone through lot of threads in SDN but not able to find any thread which has solution
Can any one help me out on this issue.
Note:
1. We are able to create the Sales order with BAPI_SALESORDER_CREATEFROMDAT2 ...able to populate all the Z Fields also.
I am using 4.7EE version.
Regards,
Srinivas
2008 Jan 14 2:40 PM
Here´s a coding example:
It´s not for salesorder but contracts, but it works exactly the same way...
DATA: ls_vbak TYPE vbak,
ls_hcest TYPE /lig/sdt_hcest.
DATA: ls_extensionin TYPE bapiparex,
lt_extensionin TYPE bapiparextab,
ls_contract_header_in TYPE bapisdh1,
ls_contract_header_inx TYPE bapisdh1x,
lt_return TYPE tt_bapiret2,
l_return TYPE bapiret2,
ls_bape_vbak TYPE bape_vbak,
ls_bape_vbakx TYPE bape_vbakx.
DATA: l_length_key TYPE i,
l_length_data TYPE i.
Fill BAPI structures
ls_contract_header_inx-updateflag = 'U'.
ls_bape_vbak-vbeln = i_vbeln.
ls_bape_vbak-/lig/hccestat = i_cestat.
ls_bape_vbakx-vbeln = i_vbeln.
ls_bape_vbakx-/lig/hccestat = yhcon_true.
DESCRIBE FIELD ls_extensionin-structure LENGTH l_length_key IN CHARACTER MODE.
CLEAR: ls_extensionin, l_length_data.
ls_extensionin-structure = yhcon_bape_vbak.
DESCRIBE FIELD ls_bape_vbak LENGTH l_length_data IN CHARACTER MODE.
ls_extensionin+l_length_key(l_length_data) = ls_bape_vbak.
APPEND ls_extensionin TO lt_extensionin.
CLEAR: ls_extensionin, l_length_data.
ls_extensionin-structure = yhcon_bape_vbakx.
DESCRIBE FIELD ls_bape_vbakx LENGTH l_length_data IN CHARACTER MODE.
ls_extensionin+l_length_key(l_length_data) = ls_bape_vbakx.
APPEND ls_extensionin TO lt_extensionin.
Call standard BAPI to do the job
CALL FUNCTION 'BAPI_CUSTOMERCONTRACT_CHANGE'
EXPORTING
salesdocument = i_vbeln
contract_header_in = ls_contract_header_in
contract_header_inx = ls_contract_header_inx
TABLES
return = lt_return
extensionin = lt_extensionin.
Let me know if that works for you....
Regards,
Michael
2008 Jan 14 2:41 PM
Did you fill-in the EXTENSIONIN structure? Please read the documentation on that parameter.
2008 Jan 14 2:45 PM
Dear Srinu,
I have filled EXTENSIONIN and I can see the data in that..but still not suceeded.
I debuged the code to see whether any where it is getting refreshed / deleted...but I didnt find any place where it is doing as mentioned.
Please help
2008 Jan 14 2:49 PM
Check the return-table for any errors or warnings....
If you have success-messages only, CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'.
2008 Jan 14 2:53 PM
I am checking the return Table and if not Error / Abort types of messages are not there then I am calling the 'BAPI_TRANSACTION_COMMIT.....it is going to this function module !!!!
2008 Jan 14 2:43 PM
Hi Srinu,
Are you calling 'BAPI_TRANSACTION_COMMIT' after?
Regards,
Chester
2008 Jan 14 2:48 PM
Yes I am using 'BAPI_TRANSACTION_COMMIT' after calling
the Function module BAPI_SALESORDER_CHANGE
I have gone through lot of threads in SDN...but no where I find the answer, now I am searching in service.sap.com to check my luck !!!
2008 Jan 14 2:55 PM
In the extensioninx structure are you definitely filling the posnr structure with an item number rather than an 'X'.
This is a common mistake.
2008 Jan 14 2:56 PM
You said you extended the corresponding structures, did you extend all of them?
For VBAK e.g. you need to extend
VBAK
BAPE_VBAK
BAPE_VBAKX
You need to pass the values for BAPE_VBAK and BAPE_VBAKX into your extension in order for the extension to work.
Hope that helps,
Michael
2008 Jan 14 3:00 PM
Yes Michael, we have extended these structures....we are able to create the Sales order by using the BAPI_SALESORDER_CREATEFROMDAT2.....in that we are populating the Z fields and there is no problem at alll....
2008 Jan 14 3:32 PM
Does the returntable contain any success-meesages or nothing at all?
If you don´t get ANY messages you should try to debug on a deeper level...
The BAPI calls FM SD_SALESDOCUMENT_CHANGE which also has a returntable.
I´ve had a similar problem these days where the BAPI did not return an error, but one of the FMs did...
2008 Jan 14 3:49 PM
K ...I will debug the code and come back to you all after some time !!!
thanx for the inputs
2008 Mar 20 12:57 PM
Hi Srinivas,
Did you manage to solve this problem? I'm currently facing the same issue and have checked out other threads and also OSS but couldn't find any solutions. Would you be able to shed some light on this?
Appreciate your help.
Thanks and regards,
Adeline.
| User | Count |
|---|---|
| 3 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |