Updating a child of a BOM material using bapi sales order change
Hi, Appreciate your thoughts on the following issue..
We have a batch program which uses a bapi sales order change and updates the plant at the line items of the sales order. when this plant is assigned.. if any of the line item is a BOM item, it explodes and the data from the parent ( like payment terms, fixed val date ) should get copied to the child items same as the parent. This is happening fine if manual mode using va01 and va02 but when plant is updated using bapi the childs are not getting the data from the parent ( which comes through config )...
Appreciate your inputs and any additional information to be passed to the bapi for the BOM materials to get the same config data as parent to the child when exploded...
Thanks and will reward helpful answers..
Hi, Appreciate your thoughts on the following issue..
We have a batch program which uses a bapi sales order change and updates the plant at the line items of the sales order. when this plant is assigned.. if any of the line item is a BOM item, it explodes and the data from the parent ( like payment terms, fixed val date ) should get copied to the child items same as the parent. This is happening fine if manual mode using va01 and va02 but when plant is updated using bapi the childs are not getting the data from the parent ( which comes through config )...
Appreciate your inputs and any additional information to be passed to the bapi for the BOM materials to get the same config data as parent to the child when exploded...
Thanks and will reward helpful answers..
Similar Messages
-
HI ,
Is there any TCODE where in I can know " a particular material is used in how many sales orders" and tcode etc pls helpHi kumar,
MD04 is veryuseful.
or else go to se12 and give table name "VBAP" and in the material field give the material name which u want to get the orders and execute.
reward me if it helps.
Reagrds,
kishore. -
Sale Order change BAPI - Storage loc not updated
Hi Everybody,
Iam using "BAPI_SALESORDER_CHANGE", to change the sale order items.
First iam calling above bapi with switch B, for new pricing & then second time for material change.
When i change any material number, it is getting updated correctly.
But the storage location, even though iam passing in the bapi it is not updated, & is blank - updation flag is also passed.
When i execute sale order change again it is updated - ie, for any material change for first bapi call, storage loc is not updated - for 2nd bapi call storage loc is updation - for same input in both the cases.
Is there any way to update the storage loc is first call of sales order change bapi.
Below is the parameters iam passing in bapi :
CALL FUNCTION 'BAPI_SALESORDER_CHANGE'
EXPORTING
SALESDOCUMENT = LS_SALESDOCUMENT
ORDER_HEADER_IN = LT_HEADER_IN
ORDER_HEADER_INX = LT_HEADER_X
TABLES
RETURN = LT_RETURN
ORDER_ITEM_IN = LT_ITEMS
ORDER_ITEM_INX = LT_ITEM_X
ORDER_CFGS_REF = LT_CFGS_REF
ORDER_CFGS_INST = LT_PARTS
ORDER_CFGS_VALUE = LT_VALUES
ORDER_CFGS_BLOB = LT_CUBLOB
ORDER_CFGS_VK = LT_CUVK
ORDER_CFGS_REFINST = LT_CUREF
SCHEDULE_LINES = LT_SCHEDULE_L
SCHEDULE_LINESX = LT_SCHEDULE_X
ORDER_TEXT = LT_TEXT
CONDITIONS_IN = LT_CONDITION_L
CONDITIONS_INX = LT_CONDITION_X.
Any help is appreciated.
Regards,
Nagarajan.JHi,
Storage location is updated only when same sale order bapi is called another time with required details.
rgs,
Nagarajan J -
Create material using bapi ' bapi_material_savedata'
Hi Experts,
i was tring to create material using bapi ' bapi_material_savedata' but the material is not updating in the table.
please find the code and suggest me if any modification
data: la_headdata type BAPIMATHEAD,
la_clientdata type BAPI_MARA,
la_CLIENTDATAX type BAPI_MARAX,
la_return type BAPIRET2.
data: i_materialdescription type table of BAPI_MAKT,
wa_materialdescription like line of i_materialdescription.
*la_headdata-MATERIAL = int_matnum-MATERIAL.
*LOOP AT int_matnum.
la_headdata-MATERIAL = int_matnum-MATERIAL.
write : int_matnum-material.
*ENDLOOP.
la_headdata-MATERIAL = '100000518'."int_matnum-MATERIAL.
la_headdata-IND_SECTOR = p_indsr.
la_headdata-MATL_TYPE = p_matype.
la_clientdata-BASE_UOM = 'FT3'.
la_clientdata-pur_valkey = ' '.
la_CLIENTDATAX-BASE_UOM = 'X'.
la_clientdata-MATL_GROUP = '01'.
la_CLIENTDATAX-MATL_GROUP = 'X'.
wa_materialdescription = 'TEST'.
append wa_materialdescription to i_materialdescription.
clear: wa_materialdescription.
CALL FUNCTION 'BAPI_MATERIAL_SAVEDATA'
EXPORTING
headdata = la_headdata
CLIENTDATA = la_clientdata
CLIENTDATAX = la_CLIENTDATAX
PLANTDATA =
PLANTDATAX =
FORECASTPARAMETERS =
FORECASTPARAMETERSX =
PLANNINGDATA =
PLANNINGDATAX =
STORAGELOCATIONDATA =
STORAGELOCATIONDATAX =
VALUATIONDATA =
VALUATIONDATAX =
WAREHOUSENUMBERDATA =
WAREHOUSENUMBERDATAX =
SALESDATA =
SALESDATAX =
STORAGETYPEDATA =
STORAGETYPEDATAX =
FLAG_ONLINE = ' '
FLAG_CAD_CALL = ' '
IMPORTING
RETURN = la_return
TABLES
MATERIALDESCRIPTION = i_materialdescription
UNITSOFMEASURE =
UNITSOFMEASUREX =
INTERNATIONALARTNOS =
MATERIALLONGTEXT =
TAXCLASSIFICATIONS =
RETURNMESSAGES =
PRTDATA =
PRTDATAX =
EXTENSIONIN =
EXTENSIONINX =
Please Help me
Regards,
NareshHi all,
Now it is asking me for the other fields,
E ,
The field MARA-XCHPF/BAPI_MARA-BATCH_MGMT is defined as a required field; it does not contain an entry
i have passed this val as
la_clientdata-batch_mgmt = 'X'.
even though i am getting the same error.
can you help me to solve the issue.
Tthanks
Naresh
Edited by: naresh.k.dasari on Jan 4, 2011 10:36 AM -
Hi Friends,
I want to create a material using BAPI, can anyone give me some sample program or can any one give me links which earlier posted this problem.
Points for sure for sample program.
thanks and regards
Vijayahi
good
go through this REPORT z_bapi_salesorder_create.
Parameters
Sales document type
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 2(20) v_text FOR FIELD p_auart.
PARAMETERS: p_auart TYPE auart OBLIGATORY.
SELECTION-SCREEN END OF LINE.
Sales organization
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 2(20) v_text1 FOR FIELD p_vkorg.
PARAMETERS: p_vkorg TYPE vkorg OBLIGATORY.
SELECTION-SCREEN END OF LINE.
Distribution channel
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 2(20) v_text2 FOR FIELD p_vtweg.
PARAMETERS: p_vtweg TYPE vtweg OBLIGATORY.
SELECTION-SCREEN END OF LINE.
Division.
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 2(20) v_text3 FOR FIELD p_spart.
PARAMETERS: p_spart TYPE spart OBLIGATORY.
SELECTION-SCREEN END OF LINE.
SKIP 1.
Sold-to
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 2(20) v_text4 FOR FIELD p_sold.
PARAMETERS: p_sold TYPE kunnr OBLIGATORY.
SELECTION-SCREEN END OF LINE.
Ship-to
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 2(20) v_text5 FOR FIELD p_ship.
PARAMETERS: p_ship TYPE kunnr OBLIGATORY.
SELECTION-SCREEN END OF LINE.
SKIP 1.
Material
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 2(20) v_text6 FOR FIELD p_matnr.
PARAMETERS: p_matnr TYPE matnr OBLIGATORY.
SELECTION-SCREEN END OF LINE.
Quantity.
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 2(20) v_text7 FOR FIELD p_menge.
PARAMETERS: p_menge TYPE kwmeng OBLIGATORY.
SELECTION-SCREEN END OF LINE.
Plant
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 2(20) v_text9 FOR FIELD p_plant.
PARAMETERS: p_plant TYPE werks_d OBLIGATORY.
SELECTION-SCREEN END OF LINE.
Data declarations.
DATA: v_vbeln LIKE vbak-vbeln.
DATA: header LIKE bapisdhead1.
DATA: headerx LIKE bapisdhead1x.
DATA: item LIKE bapisditem OCCURS 0 WITH HEADER LINE.
DATA: itemx LIKE bapisditemx OCCURS 0 WITH HEADER LINE.
DATA: partner LIKE bapipartnr OCCURS 0 WITH HEADER LINE.
DATA: return LIKE bapiret2 OCCURS 0 WITH HEADER LINE.
DATA: lt_schedules_inx TYPE STANDARD TABLE OF bapischdlx
WITH HEADER LINE.
DATA: lt_schedules_in TYPE STANDARD TABLE OF bapischdl
WITH HEADER LINE.
Initialization.
INITIALIZATION.
v_text = 'Order type'.
v_text1 = 'Sales Org'.
v_text2 = 'Distribution channel'.
v_text3 = 'Division'.
v_text4 = 'Sold-to'.
v_text5 = 'Ship-to'.
v_text6 = 'Material'.
v_text7 = 'Quantity'.
v_text9 = 'Plant'.
Start-of-selection.
START-OF-SELECTION.
Header data
Sales document type
header-doc_type = p_auart.
headerx-doc_type = 'X'.
Sales organization
header-sales_org = p_vkorg.
headerx-sales_org = 'X'.
Distribution channel
header-distr_chan = p_vtweg.
headerx-distr_chan = 'X'.
Division
header-division = p_spart.
headerx-division = 'X'.
headerx-updateflag = 'I'.
Partner data
Sold to
partner-partn_role = 'AG'.
partner-partn_numb = p_sold.
APPEND partner.
Ship to
partner-partn_role = 'WE'.
partner-partn_numb = p_ship.
APPEND partner.
ITEM DATA
itemx-updateflag = 'I'.
Line item number.
item-itm_number = '000010'.
itemx-itm_number = 'X'.
Material
item-material = p_matnr.
itemx-material = 'X'.
Plant
item-plant = p_plant.
itemx-plant = 'X'.
Quantity
item-target_qty = p_menge.
itemx-target_qty = 'X'.
APPEND item.
APPEND itemx.
Fill schedule lines
lt_schedules_in-itm_number = '000010'.
lt_schedules_in-sched_line = '0001'.
lt_schedules_in-req_qty = p_menge.
APPEND lt_schedules_in.
Fill schedule line flags
lt_schedules_inx-itm_number = '000010'.
lt_schedules_inx-sched_line = '0001'.
lt_schedules_inx-updateflag = 'X'.
lt_schedules_inx-req_qty = 'X'.
APPEND lt_schedules_inx.
Call the BAPI to create the sales order.
CALL FUNCTION 'BAPI_SALESDOCU_CREATEFROMDATA1'
EXPORTING
sales_header_in = header
sales_header_inx = headerx
IMPORTING
salesdocument_ex = v_vbeln
TABLES
return = return
sales_items_in = item
sales_items_inx = itemx
sales_schedules_in = lt_schedules_in
sales_schedules_inx = lt_schedules_inx
sales_partners = partner.
Check the return table.
LOOP AT return WHERE type = 'E' OR type = 'A'.
EXIT.
ENDLOOP.
IF sy-subrc = 0.
WRITE: / 'Error in creating document'.
ELSE.
Commit the work.
COMMIT WORK AND WAIT.
WRITE: / 'Document ', v_vbeln, ' created'.
ENDIF.
thanks
mrutyun^ -
Capture u201CInstallation Chargesu201D of a material sold in Sales Order
Hi SD Gurus,
We have requirement to capture u201CInstallation Chargesu201D of a material sold in Sales Order. The charges are quantity based and shall be shown separately in sale order & invoice. This charge shall be treated as additional revenue (with separate revenue G/L Account) and shall be maintained as optional. If included as a condition type, we do not want the item totals of the materials to be affected by this condition.
In the existing pricing procedure, the material price field is made mandatory. We tried to enter it as a service line item and entered the u201CInstallation Chargesu201D with a new condition type with new revenue G/L Account. But it insists for a price for the material due the mentioned configuration.
Request your valuable suggestion in achieving this requirement.
Regards,
VikrantHi,
You can achieve this functionality using the Bill of Material concept.
Create the material and its BOM. In the BOM, include the main material and the service. (Case A)
Also maintain an alternative BOM for the same material, the BOM being the material itself and nothing else. (CaseB)
Make the parent item relevant for pricing and child items not relevant for pricing
In sales order, give the main material, so the sales material and service will come.
In Case A, maintain a condition type with a reqmt routine saying that the condition will be valid only if the BOM contains the service item. Maintain the condition record. So, if the BOM contains the material and its service, this condition type will come else it will not come.
If you don't want to charge the service, replace the BOM of case A with the alternative BOM maintained for the material to go to case B.In case B, this extra condition type will not come. Hence only the price of the main material will come.
Hope this helps u -
BOM Re-Explosion at sales order created with referance to Contract
Hi Experts,
Need your advise in mapping below requirement.
Our clinet is into service industry.
The sales process is Contract --> Sales Order --> Invoice.Currently all the services will be charged using a BOM.
The BOM IS Created as below.
BOM Header Material--- ABC
BOM Components -
ABC1
Now because of additional tax requirements for the services we need to differentiate the services charged to the customer, thus we are planning to change the BOM Masterdata as below.
BOM Header Material--- ABC
BOM Components---- ABC2 , ABC3, ABC4,ABC5,
Because of the change in BOM master data all the new contracts created will have the new BOM and its components.
Our concern is how to convert the existing contracts. Business is asking even for the existing contracts if a sales order is created it should contain the new materials and taxes should be calculated based on the new materials.
For the Legacy (Existing) contracts as few sales orders and invoices are created, we can not delete the old materials and add new materials.
Is there any way to make the BOM Re explosion at sales order level .
Ex: Conract created with old bom data and it has ABC and ABC1 materials in it, when a sales order is created system should read the new bom master data and explode it with the new materials.
If we do it either through SAP Standard feature or by a user exit will there be any negative impacts on the existing transactions or will there be any problems as the materials in the contracts and sales orders will be different.
Please share your thoughts and inputs on this.
Thanks,
SriniHi All,
When we ran the test cases the BOM is not Re-exploded in the sales order when created with referance to a contract. One option we thought about is cancelling all the open contracts and creating new contracts for those, thus the new bom will be added to the contract. It looks very hectic as we have aroung 5000+ open contracts.
Can any one suggest an alternative approach for this.
Thanks,
Srinivas
Edited by: srini vasarao on Jun 27, 2011 9:02 AM -
BAPI_SALESORDER_SIMULATE can be used in case of Sales Order Change?
Hi All,
I'm using FM 'BAPI_SALESORDER_CHANGE' to update sales order.
It's working fine even multiful item (delete, add, changing item).
But I need to give simulated information to SAP portal before changing Sales order.
This 'BAPI_SALESORDER_SIMULATE' FM looks like for creating new Sales Order.
Is there any other simulation BAPI FM for Sales order change?
Thanks.Hi,
You can use
BAPI_ORDER_CHANGE_STATUS_GET Change status for order
BAPI_SALESORDER_CHANGE Sales Order: Change Sales Order
Thanks
Sarada -
How to block material issuing after sales order invoiced?
As the subject mentioned, could be a possible to block material issuing since sales order invoiced, or
in the another words, after the sales order completed?
Or could be a possible to set sales order as closed, and then material issuing related with this sales order are
forbidden?
Thanks in advanced,
Zhou ZhenDear Friend
A sales order is created say order no 10000 and for material X say 10 units this order is delivered and PGIed and invoiced and the payment too has come
That means the order 10000 is closed
Case 1
Now an user goes to VA02 t code and put this order no 10000 and changes the material X qty from 10 to 12 and opens up the whole order once again
This can be controlled by using t code OVAH choosing message class the V4 message no 083 and change from warning to error
Case2
But to avoid the user to add material Y to the existing order say 10000 then i think we have to go for user exit
Because the system doesnot even throw a warning message too in case 2 (according to my knowledge) and allows another line item to be added in the same order
But you can test it if it throws any warning message we can try to convert that error
But in case 2 it is not happening(even warning is not there)
Regards
Raja -
How to link Material Document with Sales Order
Hi,
When we receive stock through MFHU transaction it becomes sales order stock. The movement type used to receive these into stock would be 131 for MTS & 131 E for MTO. My question is how link Material Document (MKPF/MSEG) with Sales Order because later using that sales order and line item I want to get the planned order number in SAP from PLAF table.
Thanks & Regards,
Balaji Viswanath.Hi,
To refer to Sales order you have to go to Purchase order .
Step1 -From MSEG table you can get the EBELN ( PO) EBELP
BWART (Movement Type).
Step2-Now go to EKPO and retrieve all the PO EBELN, LABNR corrresponding
to the PO found the MSEG table.
Step3-Now go to the VBAK for Sales order Header record and compare the field
VBELN = EKPO-LABNR+0(10) and to rerive Sales order item go to VBAP and
copmpare the fields VBELN = EKPO-LABNR+0(10) and
POSNR = EKPO-LABNR+10(5).
Thanks
PK -
Function to find quantity of a material in Open sales Order in 4.5
hi ,
is there any function to find the total quantity of a material in open sales order for an input date in 4.5
RegardsI think you may find function <b>RV_BILLING_PRINT_VIEW</b> helpful. This is the function used by the standard SAP report <b>RVADIN01</b> to assemble all the information needed to print a Sales Order. The structure and table output by this function contain all the information in the header and line items of the Sales Order.
To watch this function in action, set a break point on this function (line 1075 of RVADIN01 in my system) and print a Sales Order (SO).
I use VF31 to print an arbitrary SO during testing.
Your company may have altered the standard print configuration for sales orders in SAP. If so, you will need to note the output type of your test Sales Order in VF31 and use Transaction <b>V/83</b> to determine which program is being used to print that type of SO. -
Can a material of a sales order have more than one billing doc
Hi,
Can a material of a sales order have more than one billing doc(vbrp-vbeln)
Regards,
SeemaHi,
Yes it is possible.we can have multiple invoice for a sales order of one line item.
For this we should have order quantity not exceeds billing quantity at the item category level.
Also we have to use teh field Quantity +/- indicator at the copy control level.
Regards,
Krishna. -
Hi folks,
Can anybody tell me the BAPI name to update the plant, route and storage location in the sales order.
if possible please tell me BAPI name in general which updates the sales order values...
thanks in advanceHi,
Use the bapi'S 'BAPI_SALESORDER_CHANGE'
and 'BAPI_TRANSACTION_COMMIT' to update the sales orders.
Regards,
Sudheer Kumar -
Any case study on using ERP sales order vs CRM Sales order in IC WEB UI
Hi All,
Currently we have a requirement where in agent uses ERP Sales order functionality in IC WEB UI for creating sales order. Incase of any incompleteness in order or any pricing error an activity should get created and should get assinged to Back office guy(CRM User).
My approach is as follows, we will call a custom FM in CRM from the user exit associated with Sales order transaction, This logic gets executed on save of ERP sales order.This custom FM will create an activity in CRM and assing it to back office guy. Other approach is to use the IDOC linked to the VAO1 transaction which inturns calls the custom fm.
Can you please suggest if you have any better approach to this.
Recently we came to know that ERP Sales order has got limited functionalities. If some one has a case study doc on ERP Sales order vs CRM sales order pls give me the ref link.
Thanks,
udayaHi Udaya,
Calling a Customer Specific R/3 Transaciton was quite easy in CRM 4.0 / 5.0 in the PC-UI Framework using Object Links. You can do that all by customizing and creating a custom method for a BOR Object in Transaction SWO1.
I think I've used CRM_ORDER_MAINTAIN to update the Document Flow. The subsequent activities where created by BAPI_ACTIVITYCRM_CREATEMULTI. I've wrapped all that standard functions in a RFC enabled function module.
It would be possible to provide also a link in the E-Mail to the Manager but the client is using a Citrix environment to provide access to the Portal. But Outlook runs locally. So we decided to use the standard Portal iView to display the Alerts. When you fill the Alert Container with the elements OBJKEY_GUID, OBJKEY_BOR_OBJECT_TYPE, OBJKEY_CRM_OBJECT_TYPE, OBJKEY_METHOD and OBJKEY_LOGICAL_SYSTEM using the Function Module SWC_ELEMENT_SET that provides a direct link to the specific document too.
Best regards
Gregor -
Extending sales order change BAPI and updating custom fields
Hi
i added 3 new fields into VA01/02/03 screen.i added at the header level in the additional data tab B area and appended them in VBAK table.
i want to change these values using sales order change BAPI.i added the fields in the structure VBAKKOZ,VBAKKOZX,BAPE_VBAK,BAPE_VBAKX.
may i know what else i need to do?should i move them anywhere with in the code or does the bapi take those values automatically using EXTENSIONIN structure?
also can some one send me code to actually check if bapi is changing my values?
if poss tell me how should i populate values into BAPI.After adding field in structures VBAKKOZ,VBAKKOZX,BAPE_VBAK,BAPE_VBAKX, create pair of name-value pair extensiot structure and value.
Fill values as follows :
Data : ls_parex TYPE bapiparex,
lt_parex TYPE STANDARD TABLE OF bapiparex.
ls_parex-structure = 'BAPE_VBAK'.
ls_parex-valuepart1+0(10) = Sales order no
ls_parex-valuepart1+10(XX) = somevalue. <---- Value for custom field no 1
ls_parex-valuepart1+XX(XX) = somevalue. <---- Value for custom field no 2
APPEND ls_parex TO lt_parex .
clear ls_parex.
ls_parex-structure = 'BAPE_VBAKX'.
ls_parex-valuepart1+0(10) = Sales order no
ls_parex-valuepart1+10(1) = 'X'. <--- checkbox mark for custom field no 1
ls_parex-valuepart1+11(1) = 'X'. <--- checkbox mark for custom field no 2
APPEND ls_parex TO lt_parex.
Same pair for VBAKKOZ & VBAKKOZX
Updating custom fields
CALL FUNCTION 'BAPI_SALESORDER_CHANGE'
EXPORTING
salesdocument = Sales order number
order_header_inx = 'U' <--- U for update
TABLES
extensionin = lt_parex[].
Edited by: nkarwa on Oct 25, 2010 12:39 PM
Maybe you are looking for
-
Deleting Limit Items on PO even though follow on documents exist
Dear SRM Experts I am hoping someone can explain the below behaviour: Where PO's have follows on documents i.e. confirmation and /or invoice you cannot delete PO's items on a PO. This makes sense. However we also have PO's with Limit items(created vi
-
Output quality less than source file in sequence FCP 7
I imported a .mov file into my sequence. It is 1920X1080 Apple ProRes.422. 7 1/2 mins. long. 6.18GB. I added a new audio file for the entire sequence. Inserted a few edits to the credits using Motion. I exported, first at Apple ProRes 422 HD also 192
-
Mail sending using sender importing parameter using so_object_send function
Hi all, I using so_object_send function module to send mail. My requirement is with respect to any user logged in the sender mail address should be taken by V_SENDER parameter in exporting parameter. <code> CALL FUNCTION 'SO_
-
Hi all, Is it possible to get hold of the "GWInstance id" given in both the CLOPT and the deployment file from GWWS Plugin code? I guess I can use the MIB, but was is the class name and what service name should I call? .TMIB?? I think this is the fie
-
How do i set up rss feeds through apple email?
How do I set up an RSS feed in the apple email?