Creating Sales Order from WEB Dynpro
Background:
My client has the requirement to front end SAP Sales Order Create with a WEB Dynpro screen.
This WEB Dynpro screen is used to enter minimum data required to create a sales order, plus custom VBAP fields, (added to VBAP using append structure).
I am using BAPI_SALESDOCU_CREATEFROMDATA2 to create the sales order. All is working fine.
New Requirement:
Client now has an additional requirement to calculate Net Value (VBAK-NETWR and VBAP-NETWR) based on item conditions and a custom item field VBAP-ZZUSE. I have all the data I need to calculate custom Net Value (VBAK-NETWR and VBAP-NETWR), however these fields are is not available in BAPI_SALESORDER_CREATEFROMDAT2, structure BAPISDH1 or structure BAPISDITM.
Question:
Does anyone have any suggestions? I have searched for a different BAPI where NETWR is available, but can find none. An option I am considering is to code a custom BAPI that uses RV_SAPES_DOCUMENT_UPDATE where both VBAK and VBAP are available, just to update NETWR. This function is used during execution of VA01.
Any other suggestions or ideas?
Additional Information:
My client is a services based client.
For example a material represents a service (drilling) this material is priced at value per day. Number of days is stored in VBAP as a custom field ZZUSE. The requirement is to use existing condition and ZZUSE (number of days 1 - 99) to calculate Net Value and update VBAK-NETWR and VBAP-NETWR based on condition and ZZUSE.
I can not allow BAPI_SALESORDER_CREATEFROMDAT2 to calculate VBAK-NETWR and VBAP-NETWR based only on conditions.
Does this clarify my requirement? Do you have any suggestions?
Similar Messages
-
Creating sales order using web dynpro JAVA
Hello everyone,
i am new to web dynpro. Can any one tell me how to creating sales order by web dynpro JAVA using BAPI.
Thanks.
Vinita SharmaHi...
you can use Adaptive RFC methodology in web dynpro java to work with BAPIs..... these are standard bapi's provided
Here are required Bapis... select which one you want....
BAPISDORDER_GETDETAILEDLIST Sales Order: List of All Order Data
BAPI_ORDER_CHANGE_STATUS_GET Change status for order
BAPI_SALESDOCU_CREATEFROMDATA Creating a Sales Document
BAPI_SALESORDER_CHANGE Sales Order: Change Sales Order
BAPI_SALESORDER_CREATEFROMDAT1 Sales Order: Create Sales Order
BAPI_SALESORDER_CREATEFROMDAT2 Sales Order: Create Sales Order
BAPI_SALESORDER_CREATEFROMDATA Create sales order, no more maintenance
BAPI_SALESORDER_GETLIST Sales order: List of all orders for customer
BAPI_SALESORDER_GETSTATUS Sales order: Display status
BAPI_SALESORDER_SIMULATE Sales Order: Simulate Sales Order
check this thread SALES ORDER creation using BAPI
sample java program which will call SAP bapi function sales order create
PradeeP -
Creating Sales Order using Web Dynpro for java
Hi SDN,
I am new to Web Dynpro for java. I have developed an application for creating a sales order using adaptive RFC Model using BAPI. It's working fine when i create a single order. I wanna create SO with more than one line item. I have used the Table UI Element to do so. But i could not able to enter the 2nd item details. Please suggest me how to pass more than one line item from the Table UI element.
Thanks in advance.
Regards,
BashaHi Basha,
Do you need to display the header items and detailed items?
If the BAPI Contains Output values in R/3 side.
I mean to say if BAPI contains 4 line items.u can get thru wdjava the followinf way.
1. Create webdynpro application.
2.Import the model.
3.Create Customcontroller and model binding .
4. Write the execute method in controller.
BAPI b = new BAPI();
WdContext.node<BAPI>.bind(b);
give inputs for BAPI
b.setname(" ");
b.setno("");
wdContext.currentBAPI().modelObejet().execute();
wdContext.node<output>.invalidate(); in try catch
5. create view or when u give the dynpro application its
in the add custom to view and drag BAPI custom to view .
6.Crete UI for ur table thru insertTemplate table directly mapp the output values.
7. deploy and run
U can get the out line items .
Or any thing else post ur requirement.
Thanks
Lohi -
Creating a Sales Order using Web Dynpro
Hi SDN,
I want to create a Sales Order using Web Dynpro application. For that i have used "Bapi_Salesorder_Createfromdat2" as a adaptive RFC model. Every thing is fine and i could able to create a sales order for a single line item. But my intension is to create a sales order for multiple line items. So in the "Intialview" i have used a "Table" UI element to pass multiple line items. When i execute this application i could pass only single line item from this table. The table UI contol is not allowing to enter the second line item in the second row of the table. Can any one suggest me to solve this problem.
Thanks in advance.
Regards
BashaHi Basha,
You need to create new element for the model node manually. For example: Create button "New item" and in action handler put someting like described here:
Add row to table
How to add more values in a Table in WD appl
How to add a row to table dynamically?
How to add a column to a table dynamically.
add row to table bound to rfc model
Best regards, Maksim Rashchynski. -
Hello,
I am getting this Error message"error determining posting period(infostructure S008,Variant Z2,RC3)" while creating Sales order from Inbound Idocs in the IDOC,which is affecting sales order creation.
While viewing this Info structure S008, I could see no records have been maintained. Wanted to know the reasons behind this Hard error?
Is it something related to Date Field used in the Update Rules for this Infostructure which is causing this posting period error?
Appreciate your inputs on this.
Thanks and Regards
Mohammed RoshanThank you Jelena,I checked the Ship. Delivery dates in the IDOC which are for Current Fiscal Year- 20140703 and 20140711,Could there be any other reason for this error?
Could it be an issue with e Update rule in this Infostructire S008
Secondly when we try change the update rule thru MC25 for this Infostructure S008,It gives a message"
"Maintenance of SAP standard updates not allowed"
Kindly advice
Thanks and Regards
Mohammed Roshan -
Create Sales order from Internal Purchase Order using IDOC
Hello Friends,
I have requirement to create Sales Order from Internal Purchase Order Using IDOC.
Backgorund, we have already configured IDOC orders05 to create Sales Order from external Purchase order from Inbound IDOC, and it is working fine.
Now we have new requirement to create Sales Order from our own Purchase order, i.e. When PO is created in one plant corresponidng sales order automatically must needs to create in another Plant with respect PO.
I m trying to design a solution for above problem as follows,
1.create an Inbound Idoc from PO, by creatiing one new message type on PO save.
2.Process that Inbound IDOC same as it is from external PO.
3.Once processed Sales order will create.
Please help me in step 1. to create Inbound IDOC from PO.
If you want any further clarification please write me.
Thanks,
MaheshI had done a similar scenario before and we achieved it through SAP XI. The problem is with the control record. When we create a ORDERS IDOC from a PO the control record will be for outbound transmission. We sent the file to XI and XI resent it back with some data parsing and a new inbound control record. This way it went neat outbound and inbound.
I'm not sure what kind of architecture you have. If you have to do it within your ECC/R/3, then you could create the outbound IDOC to a new port and write a fresh RFC to pick it up from the same folder and create a new control record for inbound processing.
I haven't tried this; but there is a "processing w. trigger (inbound)" option on the outbound process code. May be you can explore into that a bit more.
I'm sure there could be better approaches to handle this within ECC so if you stumble on any, do write back. I would like to know to update my knowledge . -
Creating sales order from contract ISA R/3 Edition
Hi Forum,
Our scenario are
1 - customer select product from catalog and place order from internet
2 - sometimes, customer already have a contract with us (created earlier manually on SAP) and want to create sales order from internet referencing a SAP-contract.
For scenario No.1 - we can use standard SAP
For scenario No.2 - is there any standard way to do so? or we have to do customization?
Any suggestion are welcome.
Thanks a million.!!Hello
"Contract Processing" is not supported out-of-the-box in ISA R/3 edition.
However, you have a good news. The OSS Note [788245 |https://service.sap.com/sap/support/notes/788245]- "ISA R/3 4.0: contract processing", explains how to implement this feature on a project basis.
We have implemented this feature successfully at few customers.
Hope this helps.
Easwar
http://www.parxlns.com -
BAPI:Create sales order from an existing open sales order for open items
Dear All,
Could any one suggest me any BAPI that can create sales order from an existing OPEN sales order for OPEN items. since we are closing all open orders and creating new orders with reference to existing open orders. please suggest, its would be great help.
Regards,
Reddyhi suresh,
we are changing tax procedure from formula to condition based, so this is the reason we have close all the open orders and recreate in TAXINN procedure, it is going to be large number of records( open orders), so....
Regards,
Reddy -
Create sales order from multiple quotation
Hi All,
How we can create sales order from multiple quotation what is transaction code for this.
AhmedHi Ahmed,
There are two options.
1. For creating Sales Order with ref to too many Quotations:
Go to T. Code VA26 and enter the Doc Date or Quotation Valid to Date and Sold to party, Quotation Type to get all the outstanding Quotations for that particular Sold to Party. Then Select the required quotations and then select Follow-up actions button to create Single Sales Order.
2. For less number of Quotations:
You can simply go by referring each quotation by placing the cursor in alternate line item in sales order by selecting "Create with ref" button.
Hope this will solve your problem.
Ravi. -
Need to create sale order from the flat file & mail has to be sent
Hi Experts,
I have a requirement to create a sale order from a flat file and once the oder is created, mail has to be sent to customer as well as to internal user with the order details. I want to know how this process can be implemented and what adapters are needed to execute this.
it would be very helpful, if i get an step-by-step procedure.
Points assured for any helpful answers.
Thanks in Advance
JaiHI Jai,
You need to create two interfaces as file will be sending the Sales oreder details that you need to capture in IDOC or RFC and then have to trigger to create the sales order. For this Standard BAPIs are also available.
These RFC or BAPIs will response with Sales order details that you need to divert to Mail adapter with the use of BPM and also have to go for Async to Sync bridge.
File -
>XI (BPM) ---> BAPI/RFC (Request)
MailAdapter <- XI (BPM) <--- BAPI/RFC (Response)
For this refer below links for step by step
/people/arpit.seth/blog/2005/06/27/rfc-scenario-using-bpm--starter-kit - File to RFC
https://www.sdn.sap.com/irj/sdn/weblogs?blog=/pub/wlg/1685 [original link is broken] [original link is broken] [original link is broken] - File to Mail
/people/krishna.moorthyp/blog/2005/06/09/walkthrough-with-bpm - Walk through BPM
/people/siva.maranani/blog/2005/05/22/schedule-your-bpm - Schedule BPM
/people/sriram.vasudevan3/blog/2005/01/11/demonstrating-use-of-synchronous-asynchronous-bridge-to-integrate-synchronous-and-asynchronous-systems-using-ccbpm-in-sap-xi - Use of Synch - Asynch bridge in ccBPM
https://www.sdn.sap.com/irj/sdn/weblogs?blog=/pub/wlg/1403 [original link is broken] [original link is broken] [original link is broken] - Use of Synch - Asynch bridge in ccBPM
If you will use IDOC then In IDOC inbound processing you need to trigger for Sales order creation and then have to send the Sales Order generated IDOC as an Outbound to Mail Adapter
Flat file -
> XI ---> IDOC
IDOC -
> XI ---> Mail
This will be bit easy scenario to develope as compare to using BAPI with BPM
/people/ravikumar.allampallam/blog/2005/06/24/convert-any-flat-file-to-any-idoc-java-mapping - Any flat file to any Idoc
configuring IDOC-XI-Mail scenario using following web-log:
/people/michal.krawczyk2/blog/2005/03/07/mail-adapter-xi--how-to-implement-dynamic-mail-address
/people/sravya.talanki2/blog/2005/08/18/triggering-e-mails-to-shared-folders-of-sap-is-u - Triggering Email from folder
Thanks
Swarup -
Documentation on Creating Sales Order using Web Services
hi,
I can goto ESA Preview system using SAPGUI and create a sales order (using va01 transaction).
I tried to do the similar thing using the WebService (Create Sales order), but have lots of problems.
->Fields used in WebServices are not in sync with what would be if you use the GUI. (example u enter sales region, buyer id, ship address and the items for a standard sales order.
->There is not much documentation on what the fields in the webservice mean. (e.g. what is the difference between BuyerParty and BuyerInternalId? )
->There are no sample combination of values that work. (Belive me it would take hours to figure out right combination of values needed..)
Any hints would be appreciated
Kiran
http://erp.esworkplace.sap.com/socoview(bD1lbiZjPTgwMCZkPW1pbg==)/smdisplay.asp?id=138ABFEEA8A34999BFCEB31537EC8D65&fragID=&packageid=CBD4F2B708B8144DAEA05442D8FD491E&context=&iv=
http://erp.esworkplace.sap.com/socoview(bD1lbiZjPTgwMCZkPW1pbg==)/smdisplay.asp?id=5640EE01E71B11DAB5240007E9102256&fragID=&packageid=CBD4F2B708B8144DAEA05442D8FD491E&iv=Hi...
you can use Adaptive RFC methodology in web dynpro java to work with BAPIs..... these are standard bapi's provided
Here are required Bapis... select which one you want....
BAPISDORDER_GETDETAILEDLIST Sales Order: List of All Order Data
BAPI_ORDER_CHANGE_STATUS_GET Change status for order
BAPI_SALESDOCU_CREATEFROMDATA Creating a Sales Document
BAPI_SALESORDER_CHANGE Sales Order: Change Sales Order
BAPI_SALESORDER_CREATEFROMDAT1 Sales Order: Create Sales Order
BAPI_SALESORDER_CREATEFROMDAT2 Sales Order: Create Sales Order
BAPI_SALESORDER_CREATEFROMDATA Create sales order, no more maintenance
BAPI_SALESORDER_GETLIST Sales order: List of all orders for customer
BAPI_SALESORDER_GETSTATUS Sales order: Display status
BAPI_SALESORDER_SIMULATE Sales Order: Simulate Sales Order
check this thread SALES ORDER creation using BAPI
sample java program which will call SAP bapi function sales order create
PradeeP -
FM to create Sales Order from reference billing document
Hi,
I need to create a sales order from a reference billing document. Please tell me if there is any function module/BAPI to do that.
Thanks in advance for the help
Regards,
VarunHi
<b>SD_SALES_DOCUMENT_COPY</b> copy Sales Doc into new one with the required Sales Doc Type (VBAK-AUART) for further creating.
<b>SD_SALES_DOCUMENT_SAVE</b> create Sales Doc from the copied document
create subsequent document
REPORT Z.
data: w_auart like vbak-auart, "current SalesDoc type
w_auara like tvak-auara, "Subsequent SalesDoc type
w_vbak like vbak.
parameter p_vbeln like vbak-vbeln.
at selection-screen on p_vbeln.
SELECT SINGLE auart FROM vbak into w_auart
WHERE vbeln = p_vbeln.
if sy-subrc <> 0.
message e398(00) with 'Sales Doc' p_vbeln 'not found'.
endif.
start-of-selection.
SELECT SINGLE auara FROM tvak into w_auara
WHERE auart = w_auart.
if sy-subrc <> 0 or w_auara is initial.
message e398(00) with 'Subsequent type not defined for' w_auart.
else.
1. copy
CALL FUNCTION 'SD_SALES_DOCUMENT_COPY'
EXPORTING
i_auarn = w_auara
i_vbeln = p_vbeln.
2. paste
CALL FUNCTION 'SD_SALES_DOCUMENT_SAVE'
IMPORTING
evbak = w_vbak.
3. commit
COMMIT WORK.
4. report
write: / 'Sales Doc', w_vbak-vbeln, 'created.'.
endif.
regards
vinod -
Problem in Creating Sales Order From One DB to another DB
Hello All,
I am trying to create a Sales Order in another database from the current database based on the Purchase Order but while creating the sales order system is throwing an error " In "To Whse" enter valid values [ZAPp 0] "
My Code for Creating Sales Order in another DB are as follows :-
'==== Connect To another SAP Company ====='
'=====================================
Dim oCompany_DB As New SAPbobsCOM.Company
oCompany_DB.Server = "OSL_SERVER"
oCompany_DB.LicenseServer = "OSL_SERVER"
oCompany_DB.UseTrusted = False
oCompany_DB.CompanyDB = Database_Name
oCompany_DB.UserName = SAPUserName
oCompany_DB.Password = SAPPassword
oCompany_DB.DbUserName = DBUserName
oCompany_DB.DbPassword = DBPassword
oCompany_DB.DbServerType = SAPbobsCOM.BoDataServerTypes.dst_MSSQL2005
lRetCode = oCompany_DB.Connect()
If lRetCode <> 0 Then
oCompany_DB.GetLastError(lErrCode, sErrMsg)
If (lErrCode <> -4006) Then
Class_InterCmp_Main.SBO_Application.MessageBox(sErrMsg)
End If
End If
'===== Creating the Sales Order ====='
'================================
Dim oOrder As SAPbobsCOM.Documents = oCompany_DB.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oOrders)
Dim DocDueDate As String = oRecord.Fields.Item("DocDueDate").Value
oOrder.DocDueDate = DocDueDate
oOrder.CardCode = Customer
While Not oRecord.EoF
Dim ItemCode As String = oRecord.Fields.Item("ItemCode").Value
Dim WhsCode As String = oRecord.Fields.Item("WhsCode").Value
Dim Quantity As Double = oRecord.Fields.Item("Quantity").Value
Dim Price As Double = oRecord.Fields.Item("Price").Value
Dim Discnt As Double = oRecord.Fields.Item("DiscPrcnt").Value
Dim TaxCode As String = oRecord.Fields.Item("TaxCode").Value
oOrder.Lines.ItemCode = ItemCode
oOrder.Lines.WarehouseCode = WhsCode
oOrder.Lines.Quantity = Quantity
oOrder.Lines.Price = Price
oOrder.Lines.DiscountPercent = Discnt
oOrder.Lines.TaxCode = TaxCode
oOrder.Lines.Add()
oRecord.MoveNext()
End While
lRetCode = oOrder.Add
'=== Check For Error if any ===='
If lRetCode <> 0 Then
oCompany_DB.GetLastError(lErrCode, sErrMsg)
If (lErrCode <> -4006) Then
Class_InterCmp_Main.SBO_Application.MessageBox(sErrMsg)
End If
End If
oCompany_DB.Disconnect()
When i execute the above code company gets connected but sales order not getting added in another company.
Thanks,
AmitYou can not do it the alternate way Kevin suggests, direct DB inserts are prohibited by SAP and can corrupt your DB, particularly because unlike what most people think, all SAP documents affect more than just their own tables (e.g. the numbering table, the history tables).
Are you getting any error message, or is it returning 0?
If it is returning 0, then check is the document actually going to the newly created database or maybe somehow going to old one.
If it isn't returning 0, what is the error code and message.
Edit:
Also I do see an error in your code. As it stands, you are adding an empty line to the end of every order. This can cause problems for SAP.
Dim counter As Integer = 0
If counter <> 0 Then 'Not equals 0, forum hides lt & gt symbols.
oOrder.Lines.Add()
End If
counter = counter + 1
oOrder.Lines.ItemCode = ItemCode
oOrder.Lines.WarehouseCode = WhsCode
oOrder.Lines.Quantity = Quantity
oOrder.Lines.Price = Price
oOrder.Lines.DiscountPercent = Discnt
oOrder.Lines.TaxCode = TaxCode
Edited by: njmog1 on May 9, 2011 10:14 AM -
Creating Sales Orders from Quantity Contract - ORDERS05 IDOC
Hi,
I have created a Quantity Contract in ECC. Now I want sales orders to be created w.r.t to the Contract through ORDERS05.
Can anyone suggest which IDOC Segment and Qualf i have to populate to achive the same.
Also say once I am able to achive the creation of Release Orders from the Contract through ORDERS05. If I surpass the Qty of the Contract . The IDOC should be have a field for notifying the same.
REgards,
BInayakHello Binayak
You may use the following segment and fields for reference data:
Segment: E2EDK02
Fields:
QUALF : IDOC qualifier reference document - I think for contracts this is '001'.
BELNR : IDOC document number
POSNR : Item number
As per a flag to indicate that the contract quantity is surpassed, I doubt there will be anything like that becasue is an Idoc is before you created the order and how will the system know you have surpassed until an order is entered?
I think you need to use 'completion rule' and copy control 'update document flow' features to work on this.
Hope this helps. -
Error while creating Sales Order from IDOC_INPUT_ORDERS F.M
Hi All,
I am processing IDOC_INPUT_ORDERS from WE19 which should create New Sales Order.
But it is giving Error/Exit message and coming out of screen this error is coming in Billing Screen[Item]. Also error is coming in BDC part.
This error is occuring after one information message for 'Credit Check'.
The error message is BS-022->["New object number is temporary"].
But when i searched this error in VA01 code in SAPMV45A (or) in IDOC_INPUT_ORDERS it is not found anywhere.
Also i searched through where-used-list for this message[BS-022] it is found in 2 other places[F.M's] which are no way related to IDOC_INPUT_ORDERS (or) VA01/SAPMV45A.
Can anybody tell me
1. Why this error is coming [BS-022 -> New object number is temporary"].
2. Where exactly it is occuring in VA01/SAPMV45A!
Can anybody solve this issue.
Any clues in this regard will be appreciated.
Thanks in advance.
Thanks,
Deep.Hi All,
Can anybody give me some resolution for the above posted issue!
Thanks in advance.
Thanks,
Deep.
Maybe you are looking for
-
Error while running web application through JDEV (10.1.3.0.3) in OC4J. Here is the error message. 07/10/02 14:45:28 Exception in thread "OC4J Launcher" oracle.classloader.util.AnnotatedNoClassDefFoundError: Missing class: javax.xml.bind.JAXBCont
-
Macbook Pro Mid 2010 (Model 6.2) restarts like cray cray
Can't believe this is happening... Macbook Pro Mid 2010 Model - Intel i5 2.4GHz - RAM 8GB - GPU NVIDIA GeForce GT 330M So I've seen quite a lot of threads discussing the 'GPU Panic' issue since I first encountered it a few weeks ago. The problem had
-
My computer no longer detects internal speakers
This evening I opened my macbook to play something from itunes and I got no sound and this: So I checked the sound in my system preferences and noticed that it no longer listed internal speakers as a sound output Does that mean my speakers are kaput?
-
how do i restore my backup from an iphone 4s to a brand new 5? my 5 had to be updated to the newest ios and therefore was prompted to restore as a new iphone first
-
Nano & 20 Gig Don't Work in USB
Hi all, So I am the proud owner of a new iPod nano that won't sync up with my PC when plugged in via USB. I also tried this with my 20 gig iPod and get similar results. I first used the nano with my work PC, and everything went fine. When I came home