SP in Sales Order
Hi all,
I have a scenario lke this:
When user create SO, there will be warning/block message that will check 3 conditions based on information provide in Sales Order Form and User Table. That informations are BP Code, Item Code and Warehouse. If all the data in sales order form meet the information in user table, then user can add the document but if not then there will be warning message.
I've try to use SP_TN to do this. But when i execute the SP_TN it doesn't work, perhaps there's something wrong with my code. Please help me to solve this problem. Here's my query:
IF @transaction_type IN ('A','U') AND @object_type = '17'
BEGIN
IF EXISTS(T1.[WhsCode] FROM ORDR T0 INNER JOIN RDR1 T1 ON T0.DocEntry = T1.DocEntry, [dbo].[@CUST_ITEM] T2
WHERE T0.[CardCode] = T2.[U_CustCode] and T1.[ItemCode] = T2.[U_ItemCode]
AND T1.[WhsCode] <> T2.[U_WhsCode] AND T0.DOCENTRY = @list_of_cols_val_tab_del)
BEGIN
SELECT @Error = 1, @error_message = 'Account name must not be blank'
END
END
Thanks and Regards
Hi Lailus
Try the following:
IF @transaction_type IN ('A','U') AND @object_type = '17'
BEGIN
IF EXISTS(SELECT T1.WhsCode FROM ORDR T0 INNER JOIN RDR1 T1 ON T0.DocEntry = T1.DocEntry, dbo.[@CUST_ITEM] T2 WHERE T0.CardCode = T2.U_CustCode and T1.ItemCode = T2.U_ItemCode AND T1.WhsCode != T2.U_WhsCode AND T0.DOCENTRY = @list_of_cols_val_tab_del)
BEGIN
SELECT @Error = 1, @error_message = 'Account name must not be blank'
END
END
Firstly, Query must contain the word SELECT, secondly the dbo.@CUST_ITEM must be in square brackets. Tested and works fine on my side.
Remember that square brackets are replaced as hyper links (underlined) in this forum, so you might need to change the query after you copy it.
Kind regards
Peter Juby
Similar Messages
-
Open Sales Orders Backlog Report
Hi All: I have been asked to create Backlog reports for Open Sales Orders and the revenue amounts for the next 15days, one month, 2 months, 3 months 6 months etc etc. Does anyone know of a standard report that covers that and the business content and cues that go with it?
Thanks in advance
BobbyI haven't seen any standard content for it, with my client, we actually developed the open order report from Item extractor and status extractor. And compare the created on date to the system data to see how long it has been opened for and put it in different buckets.
Hopes that help.
thanks.
Wond. -
Need a report on open order aging. The open order means not delivered or partially delivered. Further with days range since its open or not fully delievered i.e. > 15 days or 15-30 days and so on.
The standard transactions Va05 and VL10c can provide the list but dont provide any aging info.
Kindly help in this.
thanks
anuDear Anu
1. First in VA05 you can use Variants and get the report as desired by you,create one variant and use Filter along with greater then, less then (all are in selection option icon)
This way you can create three variants.
But limitation is dates has to be manually changed in variants each time.
2. Try this Tcodes
S_ALR_87014387 Display Document Flow
S_ALR_87014392 Display Document Flow
This reports will give you document flow run report with ticking checkbox for sales order,delivery and goods isse then after getting the list expand all (Shift+F12)
you will get the quantities for sales order, and what is delivered and what is issued.
3. As such if you want exactly the report you can take help of ABAP to create the ALV
4. Report or create Queries in SQVI , or else create MCSI report
Regards
Jitesh -
How to restrict manual changing of free goods in sales order
Hi ,
Goodmorning ,
We have some requirement : In sales order free goods quantity determination by system should not be allowed to change manually , where can we do this ?
Looking for your inputs
Thanks and regards
VenkatAs per SAP Standard, when the main Item quantity is changed, the Free Goods are redetermined. In this case any manual changes to Free Goods Quantities are lost.
But your requirement is for restricting the Chages of the Quantity of Free Goods Correct?
I believe there is no SAP standard solution for this. You will have to apply a User Exit, which will check the Item category of each LIne item & if it is free goods (TANN) then changes are not permitted.
Hope this helps.
Thanks,
Jignesh Mehta -
Query help needed for Sales order panel user field query.
I have a user defined form field on sales order row level called = U_DEPFEEAMT
1, I would like this field to get the value from a field on this sales order row level multiplied by what is in point 2 below. The details of field in point 1 is :
Form=139, item=38, pane=1, column=10002117, and row=1
2. The contents in field 1 should be multiplied by a value coming from another user field linked to OITM master item.
The details of user field attached to OITM is :
OITM.U_DepositFeeON
Appreciate your help.
Thank you.Try this one:
SELECT T0.U_DepositFeeON*$[$38.10002117.number\]
FROM dbo.OITM T0
WHERE T0.ItemCode = $[$38.1.0\]
Thanks,
Gordon -
Logic for Open Sales order qty
What should be the logic given to determine "open sales order qty" during designing a report.
Note the criterias are as under:
1) Open sales order qty is the confirmed qty less the delivery qty.
2) The delivery qty should be delivery order qty (The delivery should not necessarily be pick, packed & PGI)sorry it doesn't work for services, since they do not create requirements.
in this case you can use VBFA table, subracting all the delivered quantities VBFA-RFMNG with VBFA-VBTYP_N = J and VBFA-VBELV/VBFA-POSNV = to your order/item from the ordered quantities
hope this help you.
Roberto -
Dear all,
I need to create a open sales order report. Could you please tell me from which table i can get open sales order. Its standard report is VA05 and also I checked in table VBBE. but all record which i get from VA05 are not visible in VBBE table. It means VBBE doesnt carry all pending open records.
Please guide me from which table i can get it or what is the sriteria to get it?
Thankyou very much in advance
Punnet Sharmahi,
my logic goes like this:
Note: Open cursor is used since we are dealing with huge amnt of data:
* Select orders based on their Delivery status
SELECT vbeln
FROM vbuk INTO TABLE git_vbuk
WHERE lfstk = 'A' OR lfstk = 'B' .
* Filter selected orders
* Selection using open cursor
DATA: lwa_op_sal_ord1 TYPE gt_comtab.
IF sy-subrc = 0.
OPEN CURSOR c1 FOR
SELECT vbap~matnr
FROM vbap INNER JOIN vbak
ON vbap~vbeln EQ vbak~vbeln
FOR ALL entries IN git_vbuk
WHERE vbap~vbeln = git_vbuk-vbeln AND
vbak~vbtyp = 'C'.
DO.
CLEAR lwa_op_sal_ord1.
FETCH NEXT CURSOR c1 INTO CORRESPONDING FIELDS OF lwa_op_sal_ord1.
IF sy-subrc = 0.
APPEND lwa_op_sal_ord1 TO li_op_sal_ord1.
ELSE.
CLOSE CURSOR c1.
EXIT.
ENDIF.
ENDDO.
ENDIF.
here filter orders based on 'A' and 'B' from VBUK...
then frm header table VBAK get order for vbtyp ='C'.
now li_op_sal_ord1 will have open sales orders..
Moreover as per ur query y do u need the item data frm VBAP as u are only concerned abt VBELN.
If u need item u hv 2 run another select.
regards,
ags -
Open Balance on Sales Order Cost Report
Hi SAP Group -
I have a couple questions about the settlement of manufacturing variance to COPA.
When our settlement process is complete (production order and sales order both settled to COPA), there is a balance remaining on the sales order cost report which is equal to the manufacturing variance on the production order.
It seems that the manufacturing variance is posting from the production order to the sales order, but is not being assigned to the PSEG and flowing to COPA.
I am looking for advice in two areas:
First, how do we "clear" these balances on old orders that are already settled?
Second, how do we prevent this from happening on future orders?
Thanks !!!Refer to OSS 183250 and note 186485.
If you dont specify in the settlement profile for the production order that the variances are not transferred from the production order into CO-PA, you will settle the variances to <b>CO-PA twice</b>: once from the production order (broken down into variance categories), and once from the sales order item. The settlement rule still references the material and not the sales order item.
Special Features of Product Cost by Sales Order with Valuated Sales Order Stock
<a href="http://help.sap.com/erp2005_ehp_02/helpdata/en/90/ba66cc446711d189420000e829fbbd/content.htm">Read the topic on 'Special Features of Product Cost by Sales Order with Valuated Sales Order Stock'</a>
You may want to check the period of the variance settlement from mfg order to sales order and ensure the settlement of sales order is also done the same period, if the type is PER. -
Hi,
We have a business scenario of one sales order --> one delivery document. Any items which have not been confirmed for delivery need to be closed out so that they do not show up as open requirements.
One way is to reject the open line items. However, rejection reduces the original customer sales order value.
Is there any other way that the open sales order line items can be changed in status so that the pricing is intact, but the item is closed out ?
Would appreciate inputs from the forum
ThanksHi
In standard itself this can be achieved
In t code OVAG itself for your reason of rejection if you maintain BLANK in the statistical column
Then those rejected values will not be reflected in sales order
Suppose a sales order contains three materials say
Material A qty 3 units
Material B qty 3 units
Material C qty 2 units
Each and everything is priced as 10 US dollars
then the nett value of this order will be 80 US dollars
Suppose if you reject Material C qty 2 units with a reason of rejection by maintaining the settings that i mentioned above the sales order value still Will be 80 US dollars and will not become 60 US dollars
This is what you are looking for (i hope so)
Please try this
Regards
Raja -
hai to all
i my senario i should download the open sale order existing in the present production server into a flat fle
can anyone tell me where this ship- to party is getting stored while creating the sale order. please let me know the table name.
regards
vijayHi Vijay,
To find out Open Sales Order. You shoud get them from VBUK-GBSTK <> 'C'. Store them in internal table.
To get Ship-to-party, you can get it from VBPA (partner table).
VBPA-VBELN = sales order number
VBPA-POSNR = '000000'
VBPA-PARVW = 'WE' or 'SH'
You will get details for Ship to Party.
regards,
ram -
Hi!
I need report similar to /AFS/MD04 AFS stock req list but for all material of one sale order on onew screen.
User want to see statuses for allpositions of order at one time to make decision about delivery.
any standart report?
Andrey Garshin.Hi Andrey,
I don't see a benefit from seeing statuses in a sales order.
/AFS/MD04 is a stock/requirements list for the MRP conroller.
It does a complete different calculation than ARUN or ATP.
It will not help you to determine what can delivered.
You can have orders in B status and still be able to allocate and deliver it.
So explain your business requirements. What do you want to see?
Best Regards,
Markus
Edited by: Markus Doerr on Jun 8, 2010 10:16 AM -
Hi firends i need to develop a report according salesorder and line item stock report.
kdauf kdpos shkzg
0000001663 000010 S 10
0000001663 000010 S 20
0000001663 000010 S 30
0000001663 0000020 S 10
0000001663 00000020 S 10
0000001663 00000020 S 30
0000001663 00000020 S 20
0000001663 00000020 H 2 0
0000001665 000010 S 10
here the requirement sales order and line item debits and credits should be added and should as like thse
00000001663 10 60qty
00000001663 20 10 (s = 50 h = 40 ) s-h = 10.
00000001665 10 10
the report should display like these
thanksHi Pramod ,
You can use collect to add the Debit and credit and then use loop all the S read table H do
s-h and append it to It_final you get data as u want .
Try It
regards
Nilesh -
Dear Expert.
I want Sales Order Status report as below mentioned format required quarry base report from Date to To Date.
Location-OrderSeries-OrderNo-CardCode-CardName-ItemCode-Item Descripotion-Inv.UOM-Order Qty-Allocated Qty-DeliverQty-Peniding Qty adn Pending Order Value.Hi,
You can check this :
select t3.location as 'Location',t0.series as 'Order Series',
t0.docnum as 'Order No.',t0.cardcode as 'Business Partner Code',
t0.cardname as 'Business Partner Name', t1.itemcode as 'Item',
t1.dscription as 'Item Name', t2.invntryUom as 'Inventory UoM',t1.quantity as 'Order Qty',
t1.QtyToship as 'Allocated Qty- Qty to Ship', t1.delivrdQty as 'Delivered Qty',
t1.OrderedQty as 'Ordered Qty', t1.openCreQty as 'Pending Qty',
t1.Opensum as 'Pending Order Row Value'
from ORDR t0 inner join RDR1 t1 on t1.docentry = t0.docentry
inner join OITM t2 on t2.itemcode = t1.itemcode
inner join OLCT t3 on t3.code = t1.loccode
where t0.docdate >= '2011.01.01' and t0.docdate <= '2011.12.31'
Hope it helps.
Kind Regards,
Jitin
SAP Business One Forum Team -
Sale Order Scenario - Report in PS Budget /Actual/Variance
Dear Experts,
Please help me understand solve the scenario given below
Step 1
Work order issued to a contractor ( contract includes Service and Material from the contractor) - Service being the labour part
and Material being the cement
But cement is supplied by the client as a sale of cement at a basic price agreed between the two parties.
Eg:
There are 2 WBS
WBS 1 - has a PR released converted to PO with value 100 ( inclusive service + material)
Material procured through me51n , Me21n - GR done and stock has come to GNST ( 40 rs)
material converted to sale order stock mb1b - 412 E after creating sale order with reference to WBS 2
WBS 2 - reports cost incurred for procurement ie; 40rs
Actual booked against WBS1 based on GR 100
Once the billing is done for rs 20 ( basic price) report in budget actual variance shows as below
Budget Actual Variance
WBS 1 200 100 100
WBS 2 40 -40
Report should show 120 as the project cost rather than 140 - since 20 is lost against selling at lower cost.
How to get the cost to 120 which is the actual cost for the workDear Experts,
Please help me understand solve the scenario given below
Step 1
Work order issued to a contractor ( contract includes Service and Material from the contractor) - Service being the labour part
and Material being the cement
But cement is supplied by the client as a sale of cement at a basic price agreed between the two parties.
Eg:
There are 2 WBS
WBS 1 - has a PR released converted to PO with value 100 ( inclusive service + material)
Material procured through me51n , Me21n - GR done and stock has come to GNST ( 40 rs)
material converted to sale order stock mb1b - 412 E after creating sale order with reference to WBS 2
WBS 2 - reports cost incurred for procurement ie; 40rs
Actual booked against WBS1 based on GR 100
Once the billing is done for rs 20 ( basic price) report in budget actual variance shows as below
Budget Actual Variance
WBS 1 200 100 100
WBS 2 40 -40
Report should show 120 as the project cost rather than 140 - since 20 is lost against selling at lower cost.
How to get the cost to 120 which is the actual cost for the work -
Open sale order quantity in VA05
hi all,
can anyone please tell me the function module or bapi or Table to find out open sales order quantity coming in VA05.
regards.First of all define what is open , is it created but notdelivered , or delivered but not invoiced.
The table VBUP has flags for statuses eg
A Not yet processed
B Partially processed
C Completely processed
A for open , B for partial C for complete , so by checking this table you will find which are actually delivered or invoiced completely.
Tcode V.02 gives u this option. -
Open Sale Order Value (FD33) not getting diminished even after closing SO?
Hi,
Upon Executing FD33 and clicking the status view for a Customer say XYZ , and then choosing EXTRAS-Open Sale Order . Say the value of open sale orders being shown is 75000. Even after closing the open sale orders (By Selecting VA05 and Putting reason for Rejection), and then also the Open Sales Order value is not getting diminished.
What could be the reason ?
Pls help.
Regrds,
BinayakHi Binayak,
As mentioned by you, running of Credit re-org program 'RVKRED77' is the only solution for this problem and it is known problem in SAP.
Some precautions
1. Always run the program in background by scheduling a job.
2. The idle time is around midnight when no user is working on SAP.
3. Some time the job fails as some other program may be updating same tables as this program. In such cases re-schedule the job at different time.
4. You may run the program 'RVKRED88' which will simulate without actual updation of credit values.
Hope this clarifies..
Regards,
Madhu.
Maybe you are looking for
-
I tried to update my photo library a week ago, but I stopped it. Now that I wanted to resume updating, it says in the app store "You cannot update this software since you have not owned the major version of this software." WHAT DO I DO??
-
I Can't save a contact number on my contact list on my 8520
Hi there, My Blackberry 8520 is refusing to add contacts on my contact and freeze when I insist. What should I do? Thanks Trey Solved! Go to Solution.
-
Importing photos from CD to iphoto?
I am a new Mac user - I need to know how to import pictures from my cd to iphoto. Please help. Thanks.
-
HUGE MacBook Pro Running Mountain Lion Sleepwake Issue!!!!
Hello. There is simply no way that I can describe this issue. So, I have uploaded a video of it on YouTube in the hope that someone may have an idea of what it is and how to fix it. Thanks... http://www.youtube.com/watch?v=hTtlj5l_LNk&feature=youtu.b
-
hi all i am looking for answers for the followings 1) what is the bussiness object for purchase order ? 2) how can we get the list of idoc contains an errors ? 3)use of control form in function module ? thanks