Use of Bapi to change CO-PA characteristics in sales orders
Hello,
I need to change CO-PA characteristics in existing Sales Orders items. I read that BAPI_ACC_SALES_ORDER_POST is supposed to do that, but after many tests I have no success.
The SALESCRITERIA structure seems adequate to receive the characteristic field and value, but I have not understood how to fill SALESORDER and SALESAMOUNT in order to reference the item.
I will appreciate any help - if there is another way to achieve this, please share.
Thanks in advance
Joao
Hello,
Thank you for your interest. I will try to explain the requirements that I think are relevant for the answer:
1 - This SAP implementation will work integrated with an intranet portal - that means that all the access to SAP (read/write) will be made via SQL (for reading) or BAPI/Webservices (for writing). The use of the standard SAP transactions will be minimum;
2 - The implementation is divided in two major steps;
3 - First step (current) includes only FI/CO - this means that the logistics part will remain in the legacy system for a while more. The posting of logistics documents into FI/CO documents will be made by the portal, using FI/CO BAPIs;
4 -Second step will include all the logistics area (future);
5 - The reason for my question is that the SD module will be used in the FIRST step to post 2 document types not existing in the legacy system (Credit Note, Debit Note). For these 2 document types we will use a BAPI to create the "sales order" document, but that document needs some manual CO-PA characteristics - and that is the reason for the question. Using TCODE VA01 I can manually enter CO-PA values for these characteristics, and I need a solution to do this via webservices as well (and of course I'm trying to avoid a batch-input solution, at least for now);
Regards
Joao
Similar Messages
-
Hi. i used Function module to change Characteristic values of a sales order
hi. i used Function module to change Characteristic values of a sales order..
but sales order's Characteristic values didn't change.
And the Function module doesn't occur any log message.
please tell me wrong code, and how to solve this problem.
if i have wrong method, what data can i pass to change the characteristic values
DATA: LT_E1CUVAL TYPE TABLE OF E1CUVAL.
DATA: WA_E1CUVAL TYPE E1CUVAL.
DATA: LS_CFG_HEAD LIKE CUXT_CUCFG_S,
LS_INSTANCES LIKE CUXT_CUINS_S,
LS_VALUES LIKE CUXT_CUVAL_S,
LS_E1CUCFG LIKE E1CUCFG,
LS_E1CUINS LIKE E1CUINS,
LS_E1CUVAL LIKE E1CUVAL,
LS_PROFILE LIKE E1CUCOM,
LS_VBAP LIKE VBAP,
L_CUOBJ LIKE INOB-CUOBJ,
L_ATINN LIKE CABN-ATINN.
DATA: LT_INSTANCES LIKE CUXT_CUINS_S OCCURS 0,
LT_PART_OF LIKE CUXT_CUPRT_S OCCURS 0,
LT_VALUES LIKE CUXT_CUVAL_S OCCURS 0,
LT_VAR_KEYS LIKE CUXT_CUVK_S OCCURS 0,
LT_KSML LIKE KSML OCCURS 0 WITH HEADER LINE,
BEGIN OF LT_CLINT OCCURS 0,
CLINT LIKE KSSK-CLINT,
END OF LT_CLINT.
DATA: LT_CUIB LIKE CUIB_CUOBJ_S OCCURS 0 WITH HEADER LINE.
DATA: E_ROOT_INSTANCE TYPE CUXT_INSTANCE_NO.
DATA: EV_ROOT_PERSIST_ID TYPE IBEXTINST_DATA-EXT_INST_ID.
DATA: EV_CFG_HAS_CHANGED TYPE XFELD.
DATA: EV_HANDLE_APPL_LOG TYPE BALLOGHNDL.
DATA: L_CUOBJ_NEW TYPE CUOBJ.
DATA: L_OWNER TYPE IBXX_BUSINESS_OBJECT.
REFRESH LT_E1CUVAL.
CLEAR LS_VBAP.
SELECT SINGLE CUOBJ INTO CORRESPONDING FIELDS OF LS_VBAP
FROM VBAP WHERE VBELN = I_VBELN
AND POSNR = I_POSNR.
IF SY-SUBRC <> 0.
RAISE INSTANCE_NOT_FOUND.
ENDIF.
REFRESH LT_CUIB. CLEAR LT_CUIB.
LT_CUIB-INSTANCE = LS_VBAP-CUOBJ.
APPEND LT_CUIB.
CALL FUNCTION 'CUCB_INITIALIZER'
EXPORTING
IT_INSTANCES = LT_CUIB[].
CALL FUNCTION 'CUXI_GET_SINGLE_CONFIGURATION'
EXPORTING
I_ROOT_INSTANCE = LS_VBAP-CUOBJ
IMPORTING
E_CFG_HEAD = LS_CFG_HEAD
ES_PROFILE = LS_PROFILE
ET_RETURN = ET_RETURN
TABLES
E_TAB_INSTANCES = LT_INSTANCES
E_TAB_PART_OF = LT_PART_OF
E_TAB_VALUES = LT_VALUES
E_TAB_VAR_KEYS = LT_VAR_KEYS
EXCEPTIONS
INVALID_INSTANCE = 1
NO_ROOT_INSTANCE = 2
INSTANCE_IS_A_CLASSIFICATION = 3
INTERNAL_ERROR = 4
NO_PROFILE_FOUND = 5
INVALID_DATA = 6
OTHERS = 7.
IF SY-SUBRC <> 0.
CASE SY-SUBRC.
WHEN 1.
RAISE INSTANCE_NOT_FOUND.
WHEN 3.
RAISE INSTANCE_IS_A_CLASSIFICATION.
WHEN OTHERS.
RAISE INVALID_DATA.
ENDCASE.
ELSE.
LOOP AT LT_VALUES INTO LS_VALUES.
IF LS_VALUES-CHARC = 'SAP_MILLCA_PACKAGING'
OR LS_VALUES-CHARC = 'PD_CA_PACKING_DM'.
LS_VALUES-VALUE = '7100010'. "This is test data
MODIFY LT_VALUES FROM LS_VALUES.
ELSE.
DELETE LT_VALUES WHERE CHARC = LS_VALUES-CHARC.
ENDIF.
CLEAR LS_VALUES.
ENDLOOP.
ENDIF.
영업정보 특성 변경
CALL FUNCTION 'CUXI_SET_SINGLE_CONFIGURATION'
EXPORTING
I_CFG_HEADER = LS_CFG_HEAD
I_ROOT_INSTANCE = LS_VBAP-CUOBJ
I_PLANT =
I_STRUCTURE_EXPLOSION_DATE =
I_STRUCTURE_EXPLOSION_APPL_ID =
I_LOGSYS =
IS_PROFILE = LS_PROFILE
IV_ONLY_SINGLE_LEVEL =
IV_HANDLE_APPL_LOG =
IV_OBJECT_APPL_LOG = 'CIF'
IV_SUBOBJECT_APPL_LOG = 'T_CNFG'
IMPORTING
E_ROOT_INSTANCE = E_ROOT_INSTANCE
EV_ROOT_PERSIST_ID = EV_ROOT_PERSIST_ID
EV_CFG_HAS_CHANGED = EV_CFG_HAS_CHANGED
EV_HANDLE_APPL_LOG = EV_HANDLE_APPL_LOG
ET_RETURN = ET_RETURN
TABLES
I_TAB_INSTANCES = LT_INSTANCES
I_TAB_PART_OF = LT_PART_OF
I_TAB_VALUES = LT_VALUES
I_TAB_VAR_KEYS = LT_VAR_KEYS
I_TAB_BLOB =
EXCEPTIONS
NO_CONFIGURATION_DATA = 1
NO_ROOT_INSTANCE = 2
INVALID_INSTANCE = 3
INSTANCE_IS_A_CLASSIFICATION = 4
INTERNAL_ERROR = 5
NO_PROFILE_FOUND = 6
INVALID_DATA = 7
OTHERS = 8
IF SY-SUBRC <> 0.
CASE SY-SUBRC.
WHEN 1.
RAISE NO_CONFIGURATION_DATA.
WHEN 3.
RAISE NO_ROOT_INSTANCE.
WHEN 3.
RAISE INVALID_INSTANCE .
WHEN 3.
RAISE INSTANCE_IS_A_CLASSIFICATION.
WHEN 3.
RAISE INTERNAL_ERROR.
WHEN OTHERS.
RAISE INVALID_DATA.
ENDCASE.
ENDIF.
COMMIT WORK.
save configuration with next commit
CLEAR: LS_INSTANCES.
READ TABLE LT_INSTANCES INTO LS_INSTANCES INDEX 1.
L_OWNER-OBJECT_TYPE = LS_INSTANCES-OBJ_TYPE.
L_OWNER-OBJECT_TYPE = 'PVS_POSVAR'.
L_OWNER-OBJECT_KEY = LS_INSTANCES-OBJ_KEY.
CALL FUNCTION 'CUCB_CONFIGURATION_TO_DB'
EXPORTING
ROOT_INSTANCE = LS_VBAP-CUOBJ
ROOT_OBJECT = L_OWNER
IMPORTING
NEW_INSTANCE = L_CUOBJ_NEW
EXCEPTIONS
INVALID_INSTANCE = 1
INVALID_ROOT_INSTANCE = 2
NO_CHANGES = 3
OTHERS = 4.
IF SY-SUBRC > 1 AND SY-SUBRC <> 3.
CLEAR LS_VBAP-CUOBJ.
RAISE INTERNAL_ERROR.
ELSEIF SY-SUBRC = 1.
LS_VBAP-CUOBJ = L_CUOBJ_NEW.
ENDIF.
What's wrong?
help me to solve this problem.
Thanks a lot.<b>SD_SALES_DOCUMENT_READ</b> Reads sales document header and business data: tables VBAK, VBKD and VBPA (Sold-to (AG), Payer (RG) and Ship-to (WE) parties)
<b>SD_SALES_DOCUMENT_READ_POS</b> Reads sales document header and item material: tables VBAK, VBAP-MATNR
<b>SD_DOCUMENT_PARTNER_READ</b> partner information including address. Calls SD_PARTNER_READ
<b>SD_PARTNER_READ</b> all the partners information and addresses
<b>SD_DETERMINE_CONTRACT_TYPE</b>
In: at least VBAK-VBELN
Exceptions: NO CONTRACT | SERVICE_CONTRACT | QUANTITY_CONTRACT
<b>SD_SALES_DOCUMENT_COPY</b>
<b>RV_ORDER_FLOW_INFORMATION</b> Reads sales document flow of sales document after delivery and billing
SD_SALES_DOCUMENT_SAVE create Sales Doc from the copied document
SD_SALES_DOCUMENT_ENQUEUE to dequeue use DEQUEUE_EVVBAKE
RV_DELIVERY_PRINT_VIEW Data provision for delivery note printing
SD_PACKING_PRINT_VIEW
SD_DELIVERY_VIEW Data collection for printing
called from RV_DELIVERY_PRINT_VIEW, SD_PACKING_PRINT_VIEW
RV_BILLING_PRINT_VIEW Data Provision for Billing Document Print
regards
vinod -
BAPI or FM to Simulate Pricing for Sales order
Hi,
We are replicating sales order processing using Webdynpro(Portal).In that we are done with sales order Create,Change,Display except pricing for new custom condition types.
The rquirement is whenever the user added new custom Condition Type along with the Condition amount for the line item the net value for the line item should be recalculated and should be dispalyed in the screen.
I have searched for any BAPI or Function Module to calculate the pricing in Simulation mode and return the Netvalue for the Sales order line item.But no luck.I need to know is there any BAPI or FM avaliable for the same?
Regards,
Vigneswaran SHi Namesh,
Thanks for the reply.I think you are not getting my point.We dont have any issues in SAP GUI.We are developing Sale order screen in Webdynpro and in that we have to handle the pricing part.Means that whatever operation user can do in pricing (like changing the condition amount and immediately net value will get upadted) in SAP GUI,has to be done using Webdynpro(portal) as well.To do changes in Pricing condition type and amount at webdynpro side,we have to simulate the pricing using BAPI inorder to recalculate the net value and display it on the webdynpro screen.Please tell me is ther any FM or BAPI to calculate the pricing.
Regards,
Vigneswaran S
Edited by: Vigneswaran S on May 14, 2008 11:44 PM -
How to control Changing of item category in sales order Manually
Hello Gurus,
How to restrict manual changing of item category in sales order?
Reason for it:
When ever they want to give some free goods to customer , they are changing Item category in Standard Sales order at item level then deliverying free goods to customer
looking for your inputs
Thanks in advance
Regards
VenkatHello,
There are two possible ways:
1. In Item Caterogy Determination remove the Manual Item Categories so that system will determine the Item Category only from defined options.
2. Use T-SHDO - create Screen Variant & make the item Category Feild as Display only.
Hope this helps..
Thanks,
Jignesh Mehta -
Can't change quantity when copy from Sale order for Delivery
Hi all!
Can i use authorization for can't change quantity when copy from Sale order for Delivery.Tien,
Approval will not work when you have mutiple rows of data. You would have to work with SP Transaction Notification
There has been threads before on the forum on the same topics.
Block the Quantity in Sales Delivery
Approval Procedure for chaning quantity in Delivery Document
Suda -
Changing proposed delivery date in sales order for one specific sales org
Hi All,
I want to change proposed delivery date in sales order automatically for one specific sales org only without changing lead time in VOV8.
For that can I use MV45AFZZ. But it is asking access key to make changes. Is there any other user exit for the same. And how does exactly change it.
Thanks in advanced.
Points will be awarded.
Regards,EXIT_SAPFV45E_001 has nothing to do with this - it is meant to update the purchase order from a sales order. It might not even be triggered if the sales order has no link to a purchase order.
USEREXIT_SAVE_DOCUMENT is not really good for this either, because the delivery date has to be changed before that. If memory serves, it also influences the schedule lines and probably the ATP check and such. I would strongly advise against it. One of the other routines in MV45AFZZ should do just fine, USEREXIT_MOVE_FIELD_TO_VBAK for example. -
How to change the Profit Center in Sales Order
Hi Gurus,
Previously they setted the profit center (YB999) in sales order, now i want to change the profit center and need to give the amount into this profit center 100500.
So, could you guide me how to change the profit center in sales order.
Thank you for your replies.....
Thanks & Regards,
Chandrababu.B
Edited by: Chandrababu Naidu on May 25, 2011 12:44 PMHi
If this SO is processed partially - i.e. transactions happened - You cant change it
You can use ABAP and change it in Debug mode, but not advisable... Better to short close the SO and open a new SO for Balance qty
br, Ajay M
Edited by: Ajay Maheshwari on May 25, 2011 5:10 PM -
Change of partner analyse in sales orders
Hello,
I changed the partner analyse for sales orders and added a new mandatory partnerrole.
In new documents the partner analyse works fine, but in the existed sales documents I cant´t see, that a mandotory role is missing.
How can I see that this role is missing in the exsting documents???
Thanks for info
NicoleYou can create a custom report but there is no standard way to do this.
When a document is created in SAP, it is a "snapshot" of that configuration, master data, and information as it exists when the document is created. On the SD side there are a few things you can influence, for example, SAP contains some standard tools for mass updating of pricing information. Most of the document exists in its unchanged state though.
You *may* be able to use VA05 and do this (although I doubt it, no system in front of me right now). Other than that transaction or a custom report there really aren't a lot of options.
If you are familiar enough with the tables, you can do a "quick view" or an ABAP Query to get the info. However the SAP partner table is recursive so to avoid getting lots and lots of duplicates you will either have to add some code to a full query, or do offline manipulation of the data.
If you're looking for soild SAP experience to help through some of these hurdles, please contact me.
Bill Wood - President
R3Now Consulting
http://www.r3now.com SAP thought leadership!
Platinum SAP Solutions
(704) 905 - 5175
http://www.linkedin.com/in/billwood -
Change header pricing condition in sales order
Hi,
I have an requirement in VA01 and VA02 to automatically edit one header pricing condition. The user can able to change the value of that condition type in header not in items . Does anyone know what user exit I can use for this requirement.
ThanksHi Sunil,
Plealse find below 2 methods to change header pricing conditions in sales order.
1.Goto SE38, give prog name as MV45AFZZ and in that write logic under USEREXIT_PRICING_PREPARE_TKOMK . (OR)
2) The same can be done by creating a Alt Calculation type routine through VOFM and writng the logic in the routine, which will then be assigned to the pricing procedure in the condition type which will automatically calculate the condition.
Try with the options mentioned above..
Regards,
KK -
Changing the status of the sales order item based on reason for rejection
Hi All,
When a Sales order item is rejected then the status at the item level is changed as 'TECO'.When the reason for rejection is removed the status 'Teco' is reset.This status change can be achieved using the user exit 'MV45AFZZ'.But the exit does not allow re-atp calculation whenver a blocked item is release.I have use the exit 'MV45AFZB' ,through this the status change as well as re-atp calculation takes place.But the status changed(Based on reason of rejection) does not appear in the same screen.The change gets reflected only when the sakes order is saved and i open it again.
I want the status change to appear in the same screen.I am doing my code in the form 'userexit_check_vbap' of the exit 'MV45AFZB'. Please let me know if there are any user exits or BADI's available for the same(Changing the status of the sales order item based on reason for rejection ).
Regards,
S.SubasreeHi subburamaiah
If you want the report you can create a separate SIS report . In that take the input field as a Reason for rejection.. and ask for the output the list of sales orders .Now when you check this user defined report you will give the reason for rejection and check what all orders got rejected on that reason for rejection.
Regards
Srinath -
Bapi or function module to create a sales order in CRM 5.1 system
Hi experts,
Anyone knows any Bapi or function module to create a Sales order in CRM 5.1 system directly.
Thanks.
regards.
Ruchi.hi ruchi,
sory for the late respond, got a lot works to be done.
based on my experience, you need several more information such as currency, uom for quantity, sales organization, etc.
and honestly, i have never tried to create an order by just using 3 information ( sold to party, item, and quantity ),
but i think it is possible because some of the information can be determined using configuration, but still some information is missing and the order that you create will have an error and you can't do next process of the order unless somebody fix / fill the information needed.
just an idea, perhaps you need some z-tables to put your certain information needed for order creation and the information is maintained for each sold to party ( sold to party is a key of z-tables ) and each time order is created, all information will be query in this tables.
and for this tables may be you can create an offline maintainance scenario using an adobe document. by this way, the sold to party can maintained all his/her/their information by them self.
and by using this scenario, you can still maintain / create the order by programming ( perhaps using function module CRM_ORDER_MAINTAIN or else ).
actually i want to implement in my company but don't have a chance becuase all has been set up and the management will think twice for implementing this scenario.
hopes it hels
cheers -
Problem after change item status procedure in sales orders.
Hello experts,
I have changed item status procedure for sales orders. But now all BDoc with queue name CSA_ORDER_xxxxx remain in state 'Written to qRFC Queue (intermediate state)' and needs to be reprocessed manually.
No problem reprocessing.
Have somebody any idea ?
Best regards
Juan SalomHi,
Is your inbound queue un-registered(type U)? Look at trx.
SMQR
and see if it is in un-registered. If yes, select the CSA_ORDER_*** queue and click on
Registration
button.
If this does not help, re-generate your Bdoc services (for Bdoc BUS_TRANS_MSG) using
SMOGGEN
or
using the generation workbench.
Then try the delta once again and observe for queue and Bdoc status in the
SMW01
Hope it helps! Reward if helpful.
Regards,
Sudipta -
Mass change of LOADING DATE on Sales orders
Hi
Does anyone know how we can MASS CHANGE the LOADING DATES on SALES ORDERS with MANY LINE ITEMS - ALL WITH Different DELIVERY DATES
So basically we are wanting to over-ride the loading dates which SAP suggests - which relates to the ROUTE
I am aware that you can use EDIT > Fast change > delivery date - but this would put all of the delivery dates then to be the same
Your help would be much appreciated, as the Operatives are doing this line by line, order by order at the moment
Many thanks
TonyDear Tony,
Won't You able to change the same Via LSMW (or through BDC-Program)?
Just check whether the T. Code: MASS, could be useful
Best Reagrds,
Amit -
Not allowing the change of profit center on sales orders.
Good afternoon everyone,
I am wondering if anyone has come across the need to not allow the changing of profit centers on sales orders. We do not want our CSR to have the ability to change the profit center from what is automatically populated on the sales order.
Thanks,
Matthew FeeHi,
Yes this is possible
Go to T-Code SHD0 and use the transaction -va01 & screen variant BUS2032 .
and go to details . Now select the field you want to use and put tick on "output only". this will refer that the mentioned fields are not while creating sales order .
Hope this will resolve your problem
Regards,
Krishna O -
Can u tell me any bapi to create the purchase req with sales order as refer
can u tell me any bapi to create the purchase req with sales order as reference?
Hi Mukesh,
You can use 'BAPI_REQUISITION_CREATE' for the purchase requisition creation if through transaction, you use transaction ME51N for creating the purchase requisition.
Cheers,
Sujay
Maybe you are looking for
-
New AFPTCP abend with NW65SP7 and SP8
We're seeing what appears to be a new AFPTCP-related abend on our user filestore servers and one particular server seems to be more vulnerable than others. We first saw this with NW65SP7 but have since applied NW65SP8 +edir87310_ftf1 +N65NSS8a +MM65S
-
How can i use Catalog in Method Type?
Dear Experts, How can i use Catalog in Method Type? I want to use Multiple method type mean require selection option(help from catalog)and also need to entere the result against certain parameters. So how can i do this possible ? Except use of additi
-
Flash UI Component Reference Point-Can It Be Changed?
When an image loads into the UI Component with the scaleContent parameter checked, it centers itself. With scaleContent unchecked, the images import in at the upper left corner If Is there a way to have the images load in at the upper right point? I,
-
How do I stop psp starter ed to disable win picture and faxviewer?
I installed Photoshop Album Starter edition 3.0 and all of a sudden That program took over when I doubleclicked on a picture in my filebrowser. I DO NOT want to use anything but the built in windows picture and fax viewer when I am outside of any pro
-
In the normal toolbar of Adobe Photoshop CS4 Extended there is something like a dropdown menu, but just to the right, if you right-click a button. (Perhabs the marquee button) Now my question is: Where and how can I use a"dropdown menu" for my button