Update CRM Orders
Hi Guys, I'm trying to update 2 or more sales orders by using just one call to FM CRM_ORDER_MAINTAIN. Is this possible?
I've also tried BAPI_SLSTRANSACT_CHANGEMULTI but I think I'm not passing the correct relations between tables.
The requierement is to update a sales order by adding an item.
Order A -> itemA1
-> new item A2
Order B -> itemB1
-> new item B2
Thanks in advance.
Manuel
Sure it is possible just by using CRM_ORDER_MAINTAIN, however seeing the interface of this function module it is quite impressive.
You will have to fill several interface parameters. like ORDERADM_H, ORDERADM_I, INPUT_FIELDS etc. etc.
It would be best to go to transaction SE38, and start report CRM_ORDER_READ. After executing this, you will see all relevant interface parameters that need to be filled. Use this as a basis for updating 2 orders at once.
But remember, the MODE in several tables will have to set to Update (Type CRMT_MODE = 2).
Best of luck.
Similar Messages
-
hi,
i am using bol object BTORDER to update partner.
first i create a new order and then trying to change partner on this order and gives me below error:
"Too many Owner entered; remove An Entry"
I think it tries to append a new partner instead of updating it.
how can i update partner without appending a new one with abap code.
this is my code:
TRY.
lr_entity = lr_partner_set_h->create_related_entity( iv_relation_name = 'BTPartnerAll' ).
CATCH cx_crm_genil_model_error.
EXIT.
CATCH cx_sy_ref_is_initial.
ENDTRY.
IF lr_entity IS BOUND.
lr_entity->set_property( iv_attr_name = 'PARTNER_FCT'
iv_value = '00000022' ).
lr_entity->set_property( iv_attr_name = 'PARTNER_NO'
iv_value = lv_partner ).
ENDIF.thanks for ur reply.
I understand the problem.thanks.
But still cant find after i get the data by using GET_RELATED_ENTITY method.Which method should i use to change partner ? -
How to update user status in CRM Order depending the delivery status in R/3
Hi All,
In my scenario the partial delivery allowed to the customer while creating the CRM Order. But as per my requirement the status should be updated when the complete order and delivery takes place.
Let me describe you clearly:
Suppose I want to deliver 5 quantities products to the customer but initially I want to deliver only 3 quantities and rest 2 quantities later. When I do the post goods issue of 3 quantities in R/3 system the status should not change in CRM system. When I will do the rest 2 quantities in post goods issue in R/3 then the user status should change in CRM Order. But in current when I do the delivery of 3 quantities the user status is changing in CRM Order.
I need the user status should change in CRM only when the entire deliverytakes place in R/3.
Thanx
ChinmayaWhenever an item is fully delivered, by standard, a "Completely Delivered" status will be updated into the item. If the I suppose by referring to that you will know an item is partial or completely delivered. When all items in the order is fully delivered, the standard header status will set to "Completed". So, you will also know if the whole order is partial or completely delivered.
If you want to add a user status, the simplest, you can make use of the ORDER_SAVE Badi. Just call the function CRM_STATUS_MAINTAIN_OW. You can update both header and item status. -
Error in Action when CRM Order is updated as Error from R/3 update
Hi,
Currently we are in CRM 6.0 SP04 and R/3 4.7 SP14
Process:
1) B2B user places order through ISA
2) Order gets replicated R/3 from CRM through middleware (Scenario A setting)
3) If there are any changes in order on either side, changes gets replicated.
Requirement:
We have a requirement from business to trigger workflow in CRM if order is in error. Following are the possible scenarios
1) Error while saving order in CRM
2) No errors in CRM. However, Order will get error in R/3 because of inconsistent configuration or master data between CRM and R/3. The BDOC will be green while replicating to R/3 and acknowledgement to CRM.
3) BDOC status is in error
Solution approach:
We created an action to trigger event when order status set to "Contains error". The condition for Action trigger are Order have error free flag NE X(BUS 2000115 ) OR Status = I1030 OR status = I1056.
Issues:
1) Scenario : Order is successfully create in CRM without any error. Order gets replicated to R/3 u2013 BDOC is green. However, the order gets error status in R/3 because of inconsistent configuration or master data. The acknowledgement BDOC updates the error status in CRM. However, Action does not get trigger when the order is updated as Error from R/3.
Pls advise possible solution and also suggest any other way to achieve the required functionality to generate workflow for CRM order updated as Error from R/3.
Regards,
Anil RitheHi Anil,
Try this, implement ORDER_SAVE BAdI. This BAdI is triggered every time an order is saved, you could put in your logic to see if the order has errors, if yes trigger your workflow.
I haven't tested but this should work for your case when the crm order is set to error status after the replication to R/3(the BDOC scenario).
This may not be the most efficient method of doing, but this would definitely work.
Make sure you use proper checks at the beginning of your order_save BAdI implementation as this badi would get executed on save of every 1-order object.
~Kiran -
BAPi/call function that calculates the pricing condition in CRM order
Hello Experts,
Can anybody suggest me which BAPI to be used in order to recalculate the pricing condition that is already maintained in the CRM order.
I'm trying to upload .txt file which contains basic price value ( condition type ZPR0 ) to update in the order. This new value should over write the existing one in the CRM order & recaluclate the tax & other condition types in the pricing procedure. Can anybody suggest me how to go abt.
Regards
Devika.S
Edited by: Devika.S on Apr 7, 2009 7:07 AMHi Devika,
Can you have a look at these two BAPIs as listed below to see if any of them fits your requirement?
BAPI_BUPA_FRG0030_ADD - Add pricing data
BAPI_BUPA_FRG0030_CHANGE - Changing pricing data
Hope this helps,
Cheers,
Sougata. -
Hi All,
How can I cancel an item of a CRM order?
Is this possible through BAPI ? If yes , please mention how.
Thanks a lot
AjithHi
These sales orders have been locked by the user (not a dialogue user) which is used for the BDoc transfer from CRM to R/3. Generally orders created in R/3 from CRM can be also be changed in R/3. But because of data difference between R/3 and CRM now the orders are locked. It is not allowing to update any data from CRM also.
So these order getting unlocked from the user is not working because now no updation from CRM to R/3 on these locked orders are happening.
Regards -
Hi forum!!
In the ERP order we assign a item of a order to a WBS element and we need to see that WBS element in CRM but that field does not appear in the CRM order!!
Because of that I think about creating an ERP Order in CRM Order because the WBS element does exist!!but the problem comes here, when I insert the value in the WBS element that value disappears when I press enter or I save the Order.
Does anyone of yours know something about that??
Any ideas??HI Cecilia,
I am also need to assign WBS element in service order item,but I can't find that filed.
Can you share with me?
Thanks
Tiffany -
Update Sale Order Header Text through Enhancement
Hi Experts,
I Have a requirement to update the sale order Header Text , when the sale order is opened in VA02 and saved.
Here in I tried using edit_text, it updates sale order header text directly in DB during run time even before the save action is completed.
But I need to just fill the header text and that has to be saved during the save action only.
I tried coding the same in the user exit (userexit_save_document) but this user exit gets triggered only when there is some changes made to the document when opened in VA02 & Saved.
Is there any user exist to pass sale Order Header text and save when save button is clicked irrespective of the document been changed or not.
Thanks in advance
SathishHi Brad Bohn,
My actual requirement is to trigger an Idoc when the user goes to VA02 transaction and clicks save.
IDoc gets triggered only when there is some changes to that document, that is through NAST table entry based on the output configurations in NACE transaction.
Now that the user wants to trigger an IDoc even if there is no change (ie. to reprocess the IDoc) when he just opens a sale order in VA02 and click save.
It is not possible to trigger an IDoc through configurations when there is no actual change in VA02 and saved.
So it has to be forcefully sent by making some additions to the Order through coding, so I choose that Text box to fill some additional data and save .
Kindly Let me Know any thing could be done for this scenario.
Thanks in advance
Sathish -
How to update sales orders using B1WS in SAP 8.8 PL18
Hello all.
We are having a problem updating sales orders using Sap Business One Web Service ( B1WS ).
We are running SBO 8.8 PL18, MS-SQL 2008, and all is fine when using the SBO client.
But when it comes to updating sales orders through B1WS we just cannot get it to work.
We can add new orders easily without problems. Updating orders always gives this error:
\[ORDR.PayDuMonth\]\[line: 0\] , 'Field cannot be updated (ODBC -1029)'
We have checked and verified multiple times that our setup is correct.
Also the WDSL files are verified.
We can update orders just fine using the sboclient.
And using B1WS we can basically do everything, besides updating.
We have also tried this on different company db's, so we are quite sure this is not
something related to some general setting we missed, but who knows?
We have tried different ways to "assemble" the order before updating, but it always
ends with the above error.
Here is an example of one of the tests, where we load an order by docentry,
increment the quantity of all open lines by '1', and then try to update it.
protected void Page_Load(object sender, EventArgs e)
// First we login
string sessionId = "";
LoginService.LoginService l_login = new LoginService.LoginService();
LoginService.LoginDatabaseType l_dbtype = LoginService.LoginDatabaseType.dst_MSSQL2008;
LoginService.LoginLanguage _lang = LoginService.LoginLanguage.ln_English;
string _server = "SAP-8_8PL18";
string _licserver = "SAP-8_8PL18:30000";
string _db = "my_test_company";
string _user = "manager";
string _pass = "********";
try
sessionId = l_login.Login(_server, _db, l_dbtype, true, _user, _pass,
_lang, true, _licserver);
catch (Exception ex)
Response.Clear();
Response.Write(ex.Message);
Response.End();
if (sessionId == "")
Response.Clear();
Response.Write("No sessionId");
Response.End();
// We are logged in and have a sessionId
// Now load a valid open order by docentry
try
OrdersServiceRef.OrdersService orderService = new OrdersServiceRef.OrdersService();
orderService.MsgHeaderValue = new OrdersServiceRef.MsgHeader();
orderService.MsgHeaderValue.SessionID = sessionId;
orderService.MsgHeaderValue.ServiceName = OrdersServiceRef.MsgHeaderServiceName.OrdersService;
orderService.MsgHeaderValue.ServiceNameSpecified = true;
OrdersServiceRef.DocumentParams docParams = new OrdersServiceRef.DocumentParams();
docParams.DocEntry = 31; // Docentry of a known open order
docParams.DocEntrySpecified = true;
OrdersServiceRef.Document order = orderService.GetByParams(docParams);
OrdersServiceRef.DocumentDocumentLine line = null;
for (int i = 0; i < order.DocumentLines.Length; i++)
line = order.DocumentLines<i>;
if (line.LineStatus == OrdersServiceRef.DocumentDocumentLineLineStatus.bost_Open)
line.Quantity += 1;
orderService.Update(order);
catch (System.Web.Services.Protocols.SoapException ex)
Response.Clear();
Response.Write(ex.Message);
Response.End();
catch (Exception ex)
Response.Clear();
Response.Write(ex.Message);
Response.End();
Response.Clear();
Response.Write("All OK");
Response.End();
I hope that someone has an idea as to why this happens.
The customer often changes quantity or adds lines on their orders,
and the only way to solve it so far has been to make a new order and
close the old one.
Thanks in advance
J. ThomsenHi,
Welcome you post on the forum.
Have you checked if you only update a specific line instead of a loop?
Thanks,
Gordon -
Run time error while closing the CRM Order using BAPI
Hi Experts,
Need your invaluable suggestions here.Apologies for the lengthy mail, intention is to give clear idea of the issue.
I am facing an issue while closing the CRM orders. According to our business process, when an issue is solved we will keep the order in resolved status only. We will not directly close the order from the CRM tool, instead we have created a custom program for the same purpose.
For the custom program we will give input as the order number and execute it, this will close the order.
Here close the order means assigning it to Close status as well assign the reason code.
We have created some reason codes for closed status.
So when the program is run the Order moves from resolved status to closed status along with reason code.
But of late we are facing some problems with this program, it is giving run time error for some CRM orders.
Run time error message : The ABAP/4 Open SQL array insert results in duplicate database records.
The exception, which is assigned to class 'CX_SY_OPEN_SQL_DB', was not caught in procedure "CRM_SERVICE_OS_UPD_OST_DU" "(FUNCTION)", nor was it propagated by a RAISING clause.
Please find my code which have used in the custom program
Closing the resolved SOs in the system
CALL FUNCTION 'CRM_STATUS_CHANGE_EXTERN_OW'
EXPORTING
objnr = iv_guid
user_status = lc_status_closed
EXCEPTIONS
object_not_found = 1
status_inconsistent = 2
status_not_allowed = 3
OTHERS = 4.
IF sy-subrc <> 0.
WRITE : 'Error at maintaining status'.
ENDIF.
Set reason code
build lt_subject
ls_subject-ref_guid = iv_guid.
ls_subject-katalogart = 'A2'.
ls_subject-codegruppe = 'ZR000003'.
ls_subject-code = 'ZR33'. " Reason code
ls_subject-mode = 'A'.
APPEND ls_subject TO lt_subject.
build lt_ossset
ls_osset-ref_guid = iv_guid.
ls_osset-subject_profile = 'ZREASON03'.
ls_osset-profile_type = 'G'.
ls_osset-subject = lt_subject.
APPEND ls_osset TO lt_osset.
build lt_service_os
ls_service_os-ref_guid = iv_guid.
ls_service_os-ref_kind = 'A'.
ls_service_os-osset = lt_osset.
APPEND ls_service_os TO lt_service_os.
build lt_input_fields
REFRESH: lt_input_fields, lt_field_names.
CLEAR : ls_input_fields, ls_field_names.
ls_field_names-fieldname = 'CODE'.
APPEND ls_field_names TO lt_field_names.
ls_field_names-fieldname = 'CODEGRUPPE'.
APPEND ls_field_names TO lt_field_names.
ls_field_names-fieldname = 'KATALOGART'.
APPEND ls_field_names TO lt_field_names.
ls_field_names-fieldname = 'SERVICE_PROFILE'.
APPEND ls_field_names TO lt_field_names.
ls_input_fields-ref_guid = iv_guid.
ls_input_fields-ref_kind = 'A'.
ls_input_fields-objectname = 'SERVICE_OS'.
ls_input_fields-field_names = lt_field_names.
APPEND ls_input_fields TO lt_input_fields.
CALL FUNCTION 'CRM_ORDER_MAINTAIN'
EXPORTING
it_service_os = lt_service_os
CHANGING
ct_input_fields = lt_input_fields
EXCEPTIONS
error_occurred = 1
document_locked = 2
no_change_allowed = 3
no_authority = 4
OTHERS = 5.
IF sy-subrc <> 0.
WRITE : 'Error at maintaining reason'.
ENDIF.
CALL FUNCTION 'CRM_ORDER_SAVE'
EXPORTING
it_objects_to_save = lt_header_guid
iv_update_task_local = lv_update_task_local
IMPORTING
et_saved_objects = lt_saved_objects
EXCEPTIONS
document_not_saved = 1
OTHERS = 2.
IF sy-subrc <> 0.
WRITE : 'Error at saving'.
ELSE.
WRITE : 'Successfully Closed'.
COMMIT WORK AND WAIT.
ENDIF.
Run time error is coming at COMMIT WORK AND WAIT statement.
Please let me know any corrections are required in the above program.
When I analyzed the run time error I have found that it trying to insert the record in CRMD_SRV_OSSET for that CRM order, but already one record is present in the table for the same CRM order number.
For most of the CRM orders there is no entry in this table so they are closing successfully but for a few orders for which there is an entry we are getting the above run time error.
There is nothing wrong with the orders which have an entry already in the table CRMD_SRV_OSSET, I need to close these kind of orders with out run time error.
Kindly provide your feedback.Hi Dinakar,
You posted this in APO PPDS forum. This question should go to PP forum where someone could answer it.
Please close this thread and open a new thread in PP forum so that you could get help quickly from the relevant experts.
Regards - Pawan -
Error while updating Sales Order : Another user Modified Table (RDR1 )
Hi All,
I am getting an error message while running the following steps.
Steps
1) Pull an entry from sales order.
2) Add new data to line.
3) Update the sales order.
a) Sap updated the data.
b) Through code using DI API we updated some UDF.
4) With out closing / Pressing OK button
5) We added new data to line.
6) Then Press update.
An Error will through by B1 as Another user modified the table(RDR1 ). Before going to the code where we are handling the update of UDF.
But after the 3rd step above when we do
4) Close the window or pressed ok
5) take the sales order window again pull the data
6) Add new Data to line.
7) Update sales order then it will go smoothly.(Updating by B1 and from code )
Can anybody tell me why this happens?And any workarounds to solve this?
Deepeshare u adding a matrix row thru the code? I get this error when I am adding rows and I get the rownumber out of sync.
if so get the max (lineid) from rdr1 and then check against the matrix.rowcount before adding a row. if lineid is greater that matrix.rowcount take lineid + 1 and assign it to the matrix.row, else take the rowcount + 1
if not, and as a workaround, then you can try using the SBO_SP_transactionnotification stored procedure. -
CRM orders with error "Do not enter a business agreement for sold-to party"
Dear SDN'ler,
after creating orders in SAP CRM via ISA (CRM 4.0) and uploading them to R/3 all orders are created successfully in R/3 but an error message is sent back to SAP CRM in case of ALL orders.
Error message is the following:
"Do not enter a business agreement for sold-to party xyz"
Message no. CRM_BILLING011
Diagnosis
The field "FI-CA active" is not selected for the sold-to party 6000201 in the business master record. Since the business agreement is used in the component FI-CA, excluding the control of processes, it makes sense to enter a business agreement.
Procedure
Delete the entered business agreement.
==> Could someone please give me some more information about the mentioned "business agreement"? Where do I find field "FI-CA active" (in R/3 or CRM customer master data?)?
==> And how can I eliminate this error message for CRM orders in SAP CRM?
Thanks a lot.
Best Regards,
Rainer GryschkaPlease check the customising setting under following path:
SPRO --> Customer Relationship Management --> Master Data --> Business Partner -- > Business Agreement --> Define Basic Settings
Alternatively you may also check following customisation table using SM30 --> CRMC_BUAG_ACTV -
Update Purchase order number in Sales order item level from inbound ORDCHG iDoc
Hi Gurus,
I want to update purchase order number from the iDoc 'ORDCHG' to sales order item level (sold to party purchase order number) i.e, VBAK-BSTKD.
Which exit I need to use? where to update? Can you please help.
Thank you in advance.
Regards,
SanFinally Resolved the problem by writing 2 exits.
one exit 'EXIT_SAPLVEDB_007' for identify correct item in the sales order by updating the customer purchase order item number i.e., VBAP-POSEX. if we update the POSEX field then it wont create new item instead, it will update the item which it is referring to .
2nd exit for updating the purchase order number.
I have tried to pass the program name, screen number, field name, field value etc to bdcdata in the exit 'EXIT_SAPLVEDB_002'. but I observed that it is not going to that screen in the debugging.
when I try E1EDP02 with QUALF '044' it will update ship-to party's purchase order number. so to update ship-to party's purchase order number it is going to that screen.
so I have used that thing to update purchase order number in sold-to party's purchase order number.
so when it is going that screen iam changing the field name 'VBKD-BSTKD_E' to 'VBKD-BSTKD' in bdcdata. Then it is worked.
This is the solution I found in my time.
Any way it is solved. Hope it will be helpful for others who will get this problem. -
Terms of payment in CRM order is not getting copied to the Accout
Hi Experts
The terms of payment which has been selected inthe CRM order under the billing tab is appearing up to the invoice created in CRM . But the same terms of payment is not appearing inthe accounting documents generated in ECC.
Can any one suggest how the configuration done or how to do the setting for the same in ECC or at CRM
Regards
Rajesh
Edited by: Rajesh s on Feb 10, 2009 12:55 AMHi,
You need to check in ECC if the customer master has the payment terms maitained or not. This could be the reason for the payment terms not being populated into the ECC billing documents.
hope this helps
Shiloo -
Update sales order qty through BAPI_SALESORDER_CREATEFROMDAT2
HI
Can anybody help me out. I have the requirement for creating sales order through BAPI_SALESORDER_CREATEFROMDAT2. The sales order is created but with 0 quantity.
I am using fields RNDDLV_QTY and TARGET_QTY and REQ_QTY in schedule lines & also setting the update indicator to 'X' in the corresponding itemx structures.
In fact it used to work earlier and has stopped now. I am also checking if there could be any change in configuration but don't think this should be the reason.
Can someone guide me as to which quantity fields of the BAPI are the right ones to update sales order qty?
thanksHi,
You are using the correct fields i.e. TARGET_QTY and REQ_QTY. Just check if you are passing the same Item Number in both the tables.
Hope it helps...
Lokesh
Maybe you are looking for
-
IPhone 4s recorded voice memos failing to send and locking memo app.
I am using an iPhone 4s 16gb with the latest ios. When I record a voice memo, and then try to send it via iMessage it often fails to send. It does not provide any error messages but what will happen is, I will push the "send" button and the phone wi
-
Project X - Turning a Pismo into an iMac
Hi everyone, Some of you may remember that last year I bought a Pismo with a smashed screen, specifically for the 500MHz processor, RAM and HDD. Well, now I've decided what to do with it - I'm going to make the machine into the world's first TFT iMac
-
Retrofit in SAP Solution Manager 7.1 Supported Across Different OS's?
Is Solution Manager 7.1 Retrofit Capability supported with a different enhancement pack level and across different Operating Systems (HP-UX & AIX)? The specific scenario would be setup of a dual landscape where traditional Dev -> QAS-> PRD is on HP U
-
I just upgraded Photoshop CS5 extedded from CS4 extended. Everything went OK till I gate update 12.2 Version. Tool tip stop working. when hovering the mouse point, it does not show nothing. Just white stripe. And sometime or everytime when I open Pho
-
Can Spotlight be set to search parital words?
I find that anything I enter into spotlight HAS to be at the beginning of a word. Is there a wildcard character?