Problem in Sales Order BAPI
Hi All,
M using BAPI_SALESORDER_CREATEFROMDAT2 to create Sales Order. It is working fine & creating sales order. But i also want to give Order Quantity in sales order. What is the field name for that in BAPI.
Thanks in advance....
Regards
AK
Hi AK....
You can assign the quantity in table
ORDER_SCHEDULES_IN
you have to assign REQ_QTY in this table for material....
Here For each material you have to assign Item no....
like
010
020
with ref to that material gets identified in this table.......
eg.
in item table
item 010 and material no is 0000000001
and if u wan to give quantity then
ORDER_SCHEDULES_IN
itme no 010 and REQ_QTY = 10
That will solve your problem
Regards
Ashish
Similar Messages
-
I am trying to update the sales order text using "BAPI_SALESORDER_CHANGE" But i am getting an error as " Sold-to party E455 not maintained for sales area E901 C1"
I passed the sales order no, and the text to be upated and the Update flag is set to "U".
When i try giving the same values in se37 it updates the sales order text successfully but when i use the same BAPI in the report i am getting the above error. Can anyone pls help me out.hi
the message is very clear that the sold to party ur refering is not from the same sales area. if u have the customer already then extend the same to the said sales area, by common division and distribution channel
<b>reward points</b>
Regards -
Problem with sales order bapi..
HI experts,
from va02, if my change means of transportation conditon types are updating correclty.
but the same thing if i do with Action ZM05 velo related, this in not workig fine.
in side my process i have BAPI_SALESORDER_CHANGE.
Please let me know if any possbile solutions on this.
Regards,
JayantHi,
you must commit or roolback after use this BAPI.
Commit if returncode it's ok.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
* EXPORTING
* WAIT =
* IMPORTING
* RETURN =
Rollback in another case.
CALL FUNCTION 'BAPI_TRANSACTION_ROLLBACK'
* IMPORTING
* RETURN =
Rgds -
BAPI - Problem in Sales order creation
Hi Friends,
I have problem in Sales order creation using BAPI ,I am getting a messsage - Error in creating document ,I have sent the code along with this mail ,can you help it out.
Code:
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.
Regards,
Dineshwhat messages u are gettting in RETURN ? Please check the RETURN tables data.
[code]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.
Regards
Prabhu -
Hi,
We would like to pass custom fields data to Custom screens in VA01 Standard Sales Order. For that we are extending standard BAPI BAPI_SALESORDER_CREATEFROMDAT2 using EXTENSION parameter. We have appended custom structures to VBAKKOZ. VBAKKOZX, BAPE_VBAK,BAPE_VBAKX and able to pass information from portal upto 480 characters using
valuepart1 and valuepart2.
But when we are trying to extend it further, standard sales order BAPI
BAPI_SALESORDER_CREATEFROMDAT2 is going to dump at :
CALL METHOD cl_abap_container_utilities=>fill_container_c
EXPORTING
im_value = da_bape_vbap
IMPORTING
ex_container =
ch_parex+lenstruc(da_length_bape_vbap)
EXCEPTIONS
illegal_parameter_type = 1
OTHERS = 2.
We need to extend it up to 900 chars.
Any help on this will be greatly apprecited.
Thanks
KalyanI found shortly after posting my message that the notes had not been correctly applied as the Notes Assistant ended with an error, and the error that resulted in this failure had not been corrected. The basis folks failed to inform me that this error had occured in applying the notes. I discovered it through testing. Had you applied the notes and run into the same error?
When we subsequently corrected for this, the issue with lenstruc went away and everything appears to be OK. The real problem was that due to the error in the Notes Assistant the updated version of LVBAKTOP with the definition of lenstruc did not get activated. It was left in a state where it needed an SSCR key to be applied manually, which should all have been handled automatically with SNOTE.
Once this was done and the source was activated, the original error went away. The two notes seem to have solved the original Unicode issue as well.
We still have this update in the development area only since the CRM enhancements that caused the original problem with an append to the VBAK structure are also still in development. We will be testing those changes together before moving everything up. If there are any further issues that come up, I'll let you know.
What I am wondering is if you had a similar problem applying the above notes, since the problem went away for us when the notes to handle the Unicode conversion were properly applied.
Brian
Edited by: Brian Sammond on Jul 24, 2008 10:55 AM -
How to change pricing Conditions in Sales order in change sales order bapi
Hi Experts,
How to change pricing Conditions in Sales order in change sales order bapi.
I have used the 2 function modules bapi-changesalesorder and sd salesdocument change, But it is creating the new record , instead of changing the existing one, Could please assist regarding the same
Thanks in Advance .
NLNHI NLN
I have just tried on my system and managed to overwrite the existing price by passing the following parameters.
<b>Import Paramters:</b>
SALESDOCUMENT - Sales Document Number
ORDER_HEADER_INX - UPDATEFLAG as <b>'U'</b>.
LOGIC_SWITCH - Import Structure - Pass 'X' to LOGIC_SWITCH-COND_HANDL.
<b>Tables:</b>
CONDITIONS_IN - ITM_NUMBER,
COND_COUNT, -> Condition counter same as KONV-ZAEHK generally it is <b>'01'</b>
COND_TYPE,
COND_VALUE,
CURRENCY.
CONDITIONS_INX - ITM_NUMBER,
COND_COUNT,
COND_TYPE,
UPDATEFLAG as <b>'U'</b>,
CURRENCY.
Hope i have clarified your query.
Kind Regards
Eswar -
I have a problem regarding sales order line item with confimed quanity
Hi Experts,
I have a problem regarding sales order line item with confimed quanity with '0' with delivery block but confirming the sales order quantity once the order is released from credit check.
The situation arises as per the below scenarios.
Scenario - 1 - When the sales order has two line item - one line item with confirmed qunaity in the schedule line and for the 2nd line item there is no available stock for the Material xxxxxx.
Initially the sales order is created for the line item 2 with confirmed quantity = 0, and having the delivery block = 01 for the Material xxxxxx and the order is set with credit check. Once the order is relased from the credit check. The quanity for the item 2 where the confirmed quantity will be = 0 ( Where it is not changing the confirmed quantity)
Scenario -2- Updating the order qunaity for the line item 2 as (9Pcs) it will goes to credit check and save the order.
Maintain the stock for the line item 2 ( 5 Pcs).
Once the order is released from the credit check. Then for the line item 2 the confirm quanity will be seting to 5 Pcs with Delivery blcok 01.
This should not happen, When the credit check is released even though if it has stock based on the delivery blockl it should set the confirmed quanity to Zero.
Can you please help me how to solve this issue.
Looking forward for your reply.
Thanks and Regards,Hi,
I agree with your point. In the sales order When the complete delivery check box is enabled where the confimed qty is set to zero, it is fine but when we save the orderr it goes to credit check. Once we release the order using VKM3 where in the sales order the confimed quantity is setting to 5, But it should set to Zero quantity. Quatity should not be get confirmed it should be Zero Quantity.
Further in SPRO - customizing in the deliveries blocking reasons - It has a tick mark in the confirmation blcok. But we dont want to remove the - Confirmation Block tick mark
Please any one can help me if you have any solution to solve this problem.
Thanks and Regards. -
Condition Period Problem in Sales order - Need help
Hi Gurus
I am testing Sales Order back dated
Condition period Problem in Sales order
example for you to understand
Sales Order where PO date is 17.12.2007
Del Date & Price date is 13.02.2008
Then it is not calculating IN: A/R BED %IN A/R BED totalN A/R CESS [1621]
But if i do it after 14 feb 2008 then it is calculating IN: A/R BED %IN A/R BED totalN A/R CESS [1621]
When I do it with current date it is calculating IN: A/R BED %IN A/R BED totalN A/R CESS [1621] say date is 9-5-2008
I am not able to trace out problem, kindly help me from where I do I check and why this is happening.
Rajesh ChalkeHi,
I am not sure if this solves your problem, but I am suspecting that this might be due to the 'valid on date' of the condition records created for the relevant duty condition types.
Since it was a recent regulation and VK11 usually defaults current date as the valid date, that condition record may have been valid only from the recent date on which it was created.
Check the date in VK12 (To find the exact selection parameters, check the pricing analysis in the sales order which will display the exact condition record which is being selected as of current date.) Check for the same parameters; change the date to relevant date in the past and recreate the sales order. Hopefully this should solve the issue.
Cheers,
KC -
Problem in Sales Order with specific condition type.
Hello Experts,
I'm facing a problem in sales order creation for a specific condition type.
the actual scenario is as below,
We have created a new condition type for special discount.This condtion type is applicable only for specific sales channels.Also the discount percentage has to fetched from a custom table.
To achieve this I've written a user exit "RV64A999"
In the FM, i've calculated the subtotal and fetched the discount percentage and calculated the discount amount. After implementing this, the SO were been created properly. for all the line items the discount amount was getting calculated properly.
But then I added a condition at the top of code in exit that the calculation for the new condition type should happen only for selected sales channels.
But after adding this condition in code, i'm facing problem. Now when I create/ change any SO, the discount amounts are getting calculated incorrectly. I'm getting discount amount even if the line item subtotal amount is zero (0).
Any help or pointers reagrding this issue will be very helpful and highly appreciated.Hi ..
Check your config. again or debug the routine code with your ABAPer and find the problem area.
-Maharshi -
Rounding off value problem in sales order
Hi All,
This is related to a rounding off value problem in sales order.
The problem is described by an example which is as follows -
Selling Price of Material A = Rs. 176.76
Excise charged = Rs. 21.80
Total Price = Rs.176.76 + Rs.21.80 = Rs. 198.56
On this total Trade Discount (ZDTD) having access sequence,is calculated at the rate of 4% = Rs. 7.94
But the condition base value after the discount is showing Rs.198.60 instead of Rs.198.56
I want the system to reflect the value as Rs.198.56 intact and it should not round up to the nearest value i.e. Rs. 198.60
Why is this happening? Is it possible to reflect the exact value? If yes what is needed to be done?
The commercial round off is activated for the DIFF Condition Type.
Looking forward to some valuable suggestions.
Thanks & Regards
Priyanka MitraHi Ramesh,
Thanks for your suggestion but the problem has been solved by me.
Regards
Priyanka Mitra -
Problem about sales order stock stock transfer and batch determination
Hi, experts, I get a problem about sales order stock stock transfer and batch determination.The following is the current situation of my system:
In OMCG I assigned search procedure ME0001 to both 311 and 311 E and ticked check batch. After that, I found that if iI need to tranfer unrestricted-use material from storage location 1000 to 2000 with movement type 311, I just need to input * at the field batch, then the system will display all of the available batches. But for the transferring of sales order stock with movement type 311 E, after I input * at the batch field, no batch is displayed and there is also no message from the system.
Can anybody help me? Is there anything else I need to do? Thanks very much.I think my question is not clear, actually I tried 562 E , 411 E and 413 already. all the transaction looking for the sales order but unfortunatly the sales order is deleted from SAP.
-
Problem with sales order and Service order
Dear Guru's
We have a real problem with sales orders and service orders and how we treat these. For a project that uses a WBS, it's not a problem to manipulate SAP to give us a list of shortages (orders with no or limited supply) for each order, but for some reason our after sales orders and our service orders do not work this way.
Thanks and Regards,
Deethya.CLOSED
-
The problem for sales order ra settlement
dear friends
i encounter a problem in sales order settlement
1 we use rev based result analyse ,and with profit realization
2 when the so status is rel ,the valuation base is Q,when the status is TECO and finl ,the valuation base is J
3 when we partially do the billing and run the ra settlement ,the poc = cumulate act rev/plan rev * actual cost in current period(i think this should be the cumulate actual cost ),and it lead to the error calcuation of the COGS,i do not know where the confirguation is error ,is in valuation base ?
can you help me
thank youdear friends
i encounter a problem in sales order settlement
1 we use rev based result analyse ,and with profit realization
2 when the so status is rel ,the valuation base is Q,when the status is TECO and finl ,the valuation base is J
3 when we partially do the billing and run the ra settlement ,the poc = cumulate act rev/plan rev * actual cost in current period(i think this should be the cumulate actual cost ),and it lead to the error calcuation of the COGS,i do not know where the confirguation is error ,is in valuation base ?
can you help me
thank you -
Problem in sales order change via BAPI
We are in AFS system and we try to reduce a quantity in sales order via BAPI.
We recive back an error 8w 280. We are not able to find wich is and where is a problem.
Does anyone have experince on that problem/error message
Thanks in advance
AndreaHi Andrea,
Since BAPI invloves more programming stuff, I adivce you to post this thread in the ABAP forums also.
Regards,
Senthilkumar SD -
Problem in Sales order create using BAPI with reference to quotation
Hi,
I am creating a sales order from Quotation using BAPI /AFS/BAPI_SALESORD_CREATEFDATA.
The Sale order is getting created and the document flow is updated. When i check the status of quotation it is "OPEN".
Ideally when a sale order is created in VA01 with reference to a quotation and if all items are added in the order from quotation, then the status of the quotation must be "Complete".
When i use the BAPI, the status of the quotation is sill "Open". Has anyone faced this issue?
Even if anyone has faced this issue with BAPI_SALESORDER_CREATEFROMDAT2, please let me know...
RegardsHi RV,
I am using BAPI to create order reference to contracts. I am facing same issue. Its not updating document flow (vbfa-plmin field). After creating orders I am forcing to update plmin field in vbfa. This worked fine. But now status in reference document not updating properly. I saw your thread. It looks like similar issue. I saw your comments "Customization was not maintained properly for the Order types ". Please can you explain little bit more about your solution. It will helps us lot.
Thanks,
srini
Maybe you are looking for
-
Reformatting 4:3 for 16:9 output in FCP v.6
Hi everyone, I usually work in Avid, and I am not sure how to solve a very common issue in editing when in FCP. I'm sure someone has worked out a method for dealing with this. If you are going to output in 16:9 for widescreen playback but you are wor
-
Storage Type and storage bin in MB26 pick list
Hi, We want to print a pick list using MB26. The pick list should contain the warehouse number , storage type and storage bin. I have found that in the layout of MB26 pick list, we can pull these fields. However, the values of these fields are not ge
-
How to play a music in the background ?
Hi, I would like to play a music in the background of a webpage, no players or anything, just a music playing to put the ambiance, if you don't see what I mean, ask me more info Sincerely .
-
Inter-area TE and L1/L2 ISIS routers
I am a little bit confused when we talked about inter-area TE and L1/L2 ISIS routers. I have 8 L1/L2 routers in a partial mesh, these routers belong to different ISIS areas. As I understand ISIS implements a topology table for the L2 routes and thus
-
I've tried Turning off "Show All Music" and then swiping left on the song to delete it, but it wont give me the option to delete the songs. Please help. (this is iOS.7 btw) It only does this for some of the songs, but the rest of them I can delete. T