Order by my order
hi all,
I have a column in a table which have certain names. I want to show result by specifying my own order as follows-
ename
alan
damm
tom
xin
zuan
and I want the output as follows
Select ename from emp
order by.......;
ename
damm
alan
zuan
tom
xin
I mean...no alphabetic order. I want a fixed order as per fixed requirements.
please tell the SQL by which this can be achieved. Thanks.
-Mukesh
Mukesh i think you should consider the fact what Billy have just explained to you. May be right now the above query satisfy your current requirement. But, who knows this might violate some other condition later during testing. Our friends just submit the query based on what it looks like. But, i don't think he is quite clear about your requirement. So, my advice to you will be, first you check whether it is satisfying all requirements in all circumstances. Then implement it.
Best regards.
Satyaki De.
Similar Messages
-
Necessary Fields For Creation of Service PO of Order Type Relaese Order.
Dear Guru,
I have encountered an issue which i am trying to resolve...
My this requirment will seem little okward the way i am asking but i have no way...
The issue is I have to create a Service PO of Order type Release order (RO) using BAPI Function Module .BAPI_PO_CREATE1.
The service PO should be of multiple Item and services for particular line item should be multiple.
When I am creating this using ME21 or ME21N i am facing no issue.
But when i am using BAPI Function Module .BAPI_PO_CREATE1
i am getting following errors ;; The error which i am getting as below
T ID NUM MESSAGE
E BAPI 001 No instance of object type PurchaseOrder has been created. External reference:
E MEPO 000 Purchase order still contains faulty items
E SE 029 Please maintain services or limits
E SE 140 Service HIRING OF LCD: please specify unit of measure
But I am failing to findout in which field services or limits and unit of measurement have to maintain.
What are the necessary fields have to pass in Bapi import parameter and the table i am unable to findout.
Please show some way how to resolve this or give me some guideline to resolve this
Dear Moderator request your kind intervane to move this qurry into correct forum if i have asked this in wrong forum
Thanks and regards
saifur rahamanHi Saifur
Can you please elaborate how did you resolve the issue we are also facing same problem when we are trying to create the PO for service items through SRM it is throwing same error while creating the PO in SAP.
Email Id : [email protected]
Thank you in advance!!
Regards
Deepika -
Planned Order to Purchase Order report in SAP
Dear All
The Business process is Planned Order - Converted to Purchase Requsition - Converted to purchase order .
Is there any report in SAP , which shhows the direct link between Planned order to Purchase Order ?
Regards
ShyamI have never seen a standard report, build a query based on tables PLAF, EBAN and EKET should be involved
-
Purchase order and sales order table name
hi al,
i want to know purchase order and sales order table name in abap.
thanks
varun
Moderator message: please do some own research, this should not take too long.
Edited by: Thomas Zloch on Jan 27, 2012Hi Sunrag......
If your PO is linked with SO. Then you can fetch customer name easily by FMS in PO.
From there you ca gte the Customer Name into your PLD and it wont hang also.....
Regards,
Rahul -
Production Order and Internal Order for each item of the sales order
Hi
I am developing Make To Order Report where I have to display the MTO Line Items and non MTO Line Items. For non MTO Line Items I have to display Internal order with Planned and Actual Costs and also Production Order with Planned and Actual Costs. Could anybody tell how to get the Internal order no and production order with Planned and Actual costs for each line item for a sales order.
Thanks
NagaHi,
You can get the Production orders, Planned orders, Internal orders generated for Sales order item from AFPO table (use fields KDAUF-Sales order number & KDPOS-Sales order item). Then to identify the order type use order category (AUTYP) from table AUFK.
Once you have the Production/internal order, you can ge the cost from COSS and COSP table. Use the object number from AUFK to get the cost entries from COSS & COSP.
You can use the following sample code as reference.
Hope this is helps.. (Don't forget to mark it... )
Form GET_COSTS *
Get the material cost, labour hours and the labour cost for the *
sales order material. *
There are no interface parameters to be passed to this subroutine. *
FORM GET_COSTS.
DATA V_OBJNR LIKE AUFK-OBJNR.
DATA v_menge LIKE vbap-kwmeng.
SELECT SINGLE OBJNR
INTO V_OBJNR
FROM AUFK
WHERE AUFNR EQ AFPO-AUFNR.
SELECT * FROM COSS
WHERE OBJNR EQ V_OBJNR
AND WRTTP IN ('01', '04'). " p_wrttp. "Labour Cost ( Plan, Actual)
PERFORM GET_VALUES_FROM_COSS.
ENDSELECT.
SELECT * FROM COSP
WHERE OBJNR EQ V_OBJNR
AND WRTTP IN ('01', '04') " p_wrttp
AND KSTAR NE '0000510033'. " EQ p_kstar2. "Material Cost
PERFORM GET_VALUE_FROM_COSP.
ENDSELECT.
Get the unit cost of the production order by dividing the production
cost by the order quantity. The result will be multiplied by the
GL posting qunatity (Delivery quantity) to get the production cost
for the quantity being deluivered.
IF NOT AFPO-PSMNG IS INITIAL.
OUT_REC-LABOUR_HOURS_ACT = OUT_REC-LABOUR_HOURS_ACT / AFPO-PSMNG.
OUT_REC-ADDNL_LABOUR_HOURS_ACT =
OUT_REC-ADDNL_LABOUR_HOURS_ACT / AFPO-PSMNG.
OUT_REC-LABOUR_HOURS_PLN = OUT_REC-LABOUR_HOURS_PLN / AFPO-PSMNG.
OUT_REC-ADDNL_LABOUR_HOURS_PLN =
OUT_REC-ADDNL_LABOUR_HOURS_PLN / AFPO-PSMNG.
OUT_REC-LABOUR_COST_ACT = OUT_REC-LABOUR_COST_ACT / AFPO-PSMNG.
OUT_REC-ADDNL_LABOUR_COST_ACT =
OUT_REC-ADDNL_LABOUR_COST_ACT / AFPO-PSMNG.
OUT_REC-LABOUR_COST_PLN = OUT_REC-LABOUR_COST_PLN / AFPO-PSMNG.
OUT_REC-ADDNL_LABOUR_COST_PLN =
OUT_REC-ADDNL_LABOUR_COST_PLN / AFPO-PSMNG.
OUT_REC-MATERIAL_COST_ACT = OUT_REC-MATERIAL_COST_ACT / AFPO-PSMNG.
OUT_REC-ADDNL_MATERIAL_COST_ACT =
OUT_REC-ADDNL_MATERIAL_COST_ACT / AFPO-PSMNG.
OUT_REC-MATERIAL_COST_PLN = OUT_REC-MATERIAL_COST_PLN / AFPO-PSMNG.
OUT_REC-ADDNL_MATERIAL_COST_PLN =
OUT_REC-ADDNL_MATERIAL_COST_PLN / AFPO-PSMNG.
ENDIF.
Multiply the calculated Unit Production costs with the GL quantity to
get the actual production cost of the quantity delivered.
Calculation for Labour Hours
OUT_REC-LABOUR_HOURS_ACT = OUT_REC-LABOUR_HOURS_ACT *
OUT_REC-QUANTITY.
OUT_REC-ADDNL_LABOUR_HOURS_ACT = OUT_REC-ADDNL_LABOUR_HOURS_ACT *
OUT_REC-QUANTITY.
OUT_REC-LABOUR_HOURS_PLN = OUT_REC-LABOUR_HOURS_PLN *
OUT_REC-QUANTITY.
OUT_REC-ADDNL_LABOUR_HOURS_PLN = OUT_REC-ADDNL_LABOUR_HOURS_PLN *
OUT_REC-QUANTITY.
Calculation for Material Cost
OUT_REC-MATERIAL_COST_ACT = OUT_REC-MATERIAL_COST_ACT *
OUT_REC-QUANTITY.
OUT_REC-ADDNL_MATERIAL_COST_ACT =
OUT_REC-ADDNL_MATERIAL_COST_ACT * OUT_REC-QUANTITY.
OUT_REC-MATERIAL_COST_PLN = OUT_REC-MATERIAL_COST_PLN *
OUT_REC-QUANTITY.
OUT_REC-ADDNL_MATERIAL_COST_PLN =
OUT_REC-ADDNL_MATERIAL_COST_PLN * OUT_REC-QUANTITY.
Calculation for Labour cost
OUT_REC-LABOUR_COST_ACT = OUT_REC-LABOUR_COST_ACT *
OUT_REC-QUANTITY.
OUT_REC-ADDNL_LABOUR_COST_ACT = OUT_REC-ADDNL_LABOUR_COST_ACT *
OUT_REC-QUANTITY.
OUT_REC-LABOUR_COST_PLN = OUT_REC-LABOUR_COST_PLN *
OUT_REC-QUANTITY.
OUT_REC-ADDNL_LABOUR_COST_PLN = OUT_REC-ADDNL_LABOUR_COST_PLN *
OUT_REC-QUANTITY.
Get the planned material cost from the total of the planned cost of
the component materials in the production order confirmations.
SELECT BWART MENGE MATNR SHKZG FROM AUFM
INTO (AUFM-BWART, AUFM-MENGE, AUFM-MATNR, AUFM-SHKZG)
WHERE AUFNR EQ AFPO-AUFNR.
CHECK AUFM-BWART NE '101'.
READ TABLE I_MBEW WITH KEY MATNR = AUFM-MATNR
BWKEY = AFPO-DWERK.
IF SY-SUBRC NE 0.
SELECT MATNR BWKEY ZPLPR LPLPR PEINH
FROM MBEW
INTO I_MBEW
WHERE MATNR EQ AUFM-MATNR
AND BWKEY EQ AFPO-DWERK.
APPEND I_MBEW.
ENDSELECT.
ENDIF.
IF SY-SUBRC EQ 0.
IF I_MBEW-ZPLPR NE 0.
IF AUFM-SHKZG EQ 'H'.
OUT_REC-PLANNED_MATERIAL_COST =
OUT_REC-PLANNED_MATERIAL_COST +
( I_MBEW-ZPLPR * AUFM-MENGE / I_MBEW-PEINH ).
ELSE.
OUT_REC-PLANNED_MATERIAL_COST =
OUT_REC-PLANNED_MATERIAL_COST -
( I_MBEW-ZPLPR * AUFM-MENGE / I_MBEW-PEINH ).
ENDIF.
ELSEIF I_MBEW-LPLPR NE 0.
IF AUFM-SHKZG EQ 'H'.
OUT_REC-CURRENT_MATERIAL_COST =
OUT_REC-CURRENT_MATERIAL_COST +
( I_MBEW-LPLPR * AUFM-MENGE / I_MBEW-PEINH ).
ELSE.
OUT_REC-CURRENT_MATERIAL_COST =
OUT_REC-CURRENT_MATERIAL_COST -
( I_MBEW-LPLPR * AUFM-MENGE / I_MBEW-PEINH ).
ENDIF.
ENDIF.
ENDIF.
ENDSELECT.
Get the Future material cost per Unit by deviding the calculated
Future material cost above with the goods reciept quantity to, then
multiply the unit cost with the GL quantity to get the Future material
Cost for the Quantity delivered. (Quantity in the entery from GLPCA
Table).
IF NOT AFPO-WEMNG IS INITIAL.
OUT_REC-PLANNED_MATERIAL_COST =
OUT_REC-PLANNED_MATERIAL_COST / AFPO-WEMNG * OUT_REC-QUANTITY.
OUT_REC-CURRENT_MATERIAL_COST =
OUT_REC-CURRENT_MATERIAL_COST / AFPO-WEMNG * OUT_REC-QUANTITY.
ENDIF.
ENDFORM. " GET_COSTS
Form GET_VALUE_FROM_COSP *
Get the Material cost from COSP table. *
There are no interface parameters to be passed to this subroutine. *
FORM GET_VALUE_FROM_COSP.
FIELD-SYMBOLS: <FS> TYPE ANY.
DATA: V_COMPONENT TYPE I.
Cummulate the posting values of all the 16 period buckets as to get
total production order cost. This is to handle the aprtial posting of
prodction order values in diffrent periods.
V_COMPONENT = 15.
DO 16 TIMES.
ADD 1 TO V_COMPONENT.
ASSIGN COMPONENT V_COMPONENT OF STRUCTURE COSP TO <FS>.
IF COSP-WRTTP EQ '04' AND COSP-KSTAR EQ P_KSTAR2.
ADD <FS> TO OUT_REC-MATERIAL_COST_ACT.
ELSEIF COSP-WRTTP EQ '04'.
ADD <FS> TO OUT_REC-ADDNL_MATERIAL_COST_ACT.
ELSEIF COSP-WRTTP EQ '01' AND COSP-KSTAR EQ P_KSTAR2.
ADD <FS> TO OUT_REC-MATERIAL_COST_PLN.
ELSEIF COSP-WRTTP EQ '01'.
ADD <FS> TO OUT_REC-ADDNL_MATERIAL_COST_PLN.
ENDIF.
ENDDO.
ENDFORM. " GET_VALUE_FROM_COSP
Form GET_VALUES_FROM_COSS *
Get the Labour cost and Labour hours from the COSS table. *
There are no interface parameters to be passed to this subroutine. *
FORM GET_VALUES_FROM_COSS.
FIELD-SYMBOLS: <FS1> TYPE ANY,
<FS2> TYPE ANY.
DATA: V_COMPONENT1 TYPE I,
V_COMPONENT2 TYPE I.
Cummulate the posting values of all the 16 period buckets as to get
total production order cost. This is to handle the aprtial posting of
prodction order values in diffrent periods.
V_COMPONENT1 = 15.
V_COMPONENT2 = 111.
DO 16 TIMES.
ADD 1 TO: V_COMPONENT1, V_COMPONENT2.
ASSIGN COMPONENT V_COMPONENT1 OF STRUCTURE COSS TO <FS1>.
ASSIGN COMPONENT V_COMPONENT2 OF STRUCTURE COSS TO <FS2>.
IF COSS-WRTTP EQ '04' AND COSS-KSTAR EQ P_KSTAR1.
ADD <FS1> TO OUT_REC-LABOUR_COST_ACT.
ADD <FS2> TO OUT_REC-LABOUR_HOURS_ACT.
ELSEIF COSS-WRTTP EQ '04'.
ADD <FS1> TO OUT_REC-ADDNL_LABOUR_COST_ACT.
ADD <FS2> TO OUT_REC-ADDNL_LABOUR_HOURS_ACT.
ELSEIF COSS-WRTTP EQ '01' AND COSS-KSTAR EQ P_KSTAR1.
ADD <FS1> TO OUT_REC-LABOUR_COST_PLN.
ADD <FS2> TO OUT_REC-LABOUR_HOURS_PLN.
ELSEIF COSS-WRTTP EQ '01'.
ADD <FS1> TO OUT_REC-ADDNL_LABOUR_COST_PLN.
ADD <FS2> TO OUT_REC-ADDNL_LABOUR_HOURS_PLN.
ENDIF.
ENDDO.
ENDFORM. " GET_VALUES_FROM_COSS -
Planned order and Production order Not appearing cm21 transaction code
Hi
I have created a planned order for a material through MRP run
As soon as the planned order is created its available in the cm21 transaction code . But once i dispatch the planed orders , the planned orders can be seen only as a BAR in the upper right side of the screen .
1.Can any body please let me know how i can view the details of this dispatched planned orders in the same way when the planned orders were un dispatched ?
2.If i create a production order manually or convert a planned order to production order i cannot see these production orders in cm21 neither on cm22 , can any body please let me know what i have to do so that i can view these production orders as well in cm21 or cm22 transaction code.
Thanks and regards
Sankar NHi Pradeep
I have checked the generate capacity requirements and it worked ,Thank you
Presently i can view only the work centre details in cm21 screen extreme left , how can i see the details of the orders that are dispatched at this work centre ,in the similar way we see in the order pool, bottom left of cm21 screen .
Thanks
Sankar -
Purchase order vs planned order vs process order vs production order
Hi,
Kinldy explain difference between the Purchase order, planned order, process order and production order?
Thanks & Regards
Ravi kumarHi Ravi,
In simple terms:
planned order - A procurement proposal generated by the system to meet a need, this can then be converted to a production / process order (for internal procurement) or into a purchase reqn & in-turn to Purchase order (for external procurement)
Purchase order - A firmed procurement proposal which is sent to your vendor (external procurement) to supply the items as per your order
process order - A firmed procurment proposal which is used for in-house procurement, this is used in process industries eg: chemicals, oil & gas etc
production order - A firmed procurment proposal which is used for in-house procurement, this is used in discrete production industries
Based on the above am quite sure you should be able to figure out the differenced. If any doubts revert.
Regards,
Vivek -
Planned order Vs.Purchase order
Hi,
can you tell me major differences between a planned order and a purchse order.Hi,
Planned Order : Planned Order is generated by the planning logic, or arithmetical procedures, of the system itself with MRP set. When MRP is re-run after the closed-loop transactions are fed back into the system, all existing planned orders are deleted and a new set is generated. However, the newly generated planned orders may be identical to the previous set in timing and quantity, so that it will appear to the system user as if the old plans have simply been somewhat revised. The use always of planned orders in closed-loop MRP ensures that plans are always in synchronisation and that the planner does not need to concern himself with rescheduling messages.
Purchase Order: The purchase order is a formal company document which conveys the instructions or detail of a required supply. The legal role of the purchase order in forming the contract of supply will vary with circumstances: most usually, it will be an offer, such that the supplier's acceptance of it at the price mentioned seals the contract, but it might alternatively be the acceptance of an offer (say, an order placed immediately against the supplier's tender.) The document itself may also be used by the company simply to convey detail, perhaps being a call-off for material against a yearly contract already in existence. The purchase order might convey a summary of substantial material to be delivered at various times in the future by special order forms.
For more follow the link:
http://www.xtuple.com/docs/userguide/ch03s09s03.php
Regards,
Biju K -
Fields required for linking production order with sales order
I need to link production order and sales order to get the part no#. need to see in md04.
The link between production order and sales order can be made by using the KDAUF KDPOS fields of AUFK or AFPO and linking them to VBELN and POSNR of VBAP.
Regards,
Rich Heilman -
Open planned orders and production orders
Hi friends,
I have one issue with my client.
Client has 1 lac materials in sap .Now he wants extract all materials open planned orders and open production orders with quantity and dates.
Please tell me the process how i can extract the data from sap for above requirement.
Thanks,
ManojHi Manoj,
For open planned order and production order select the respective box.
But one suggestion. Try to convince client that this report will take a lot of time as you have mentioned 1 lac materials are there.
You can exclude system status and get it with below screen as mentioned already.
But my suggestion is to run the report at night when the system load is very less. Please create a background job one for planned order and another for production order. Then run it in midnight as per the customer requirement in background. You can automate the process by sending automatic mail to customer. Please refer the below link to trigger mail.
Mail Trigger with TEXT file via JOB run
Regards,
Krishnendu. -
How to bifurcate production order and purchase order
hi all,
is it possible to bifurcate all open production order and purchase order quantity of items.
ex:i have one item like ffp001 it is showing 100 order quantity.but i want only open purchase quantity.i checked (item master data-->righ click--->Avail to promise) its showing open production and purchase quantity.so i need only open purchase quantity.
Plz tell me the process of Bifurcation of open orders.
thanks&Regards,
P.PratapHi,
By default there is no option , as a workaround you can use below method,
Create 2 warehouse , for example Purchase , Production
When ever you create purchase order use "Purchase" warehouse, Use production warehouse in production
In the "Available to Promise" Report you have warehouse filter option.
Using this filter you achieve can achieve your requirement.
OR
Right click "Filter Table"
Document -> Start with-> PO
Now you can see only PO
Refer below image -
Open sales order and back orders
hi ,
what is the difference between open sales order and back orders?
thanks
ganeshHi Ram,
A open sales order is the one which is not yet delivered that means u have only created a sales order and saved it( create a sales order, save it and see the document flow, the order shows as open)
Back order is also an order which is not completely fulfilled. may be because of the target quantity or because of not meeting the requested delivery date.
in this case you will pull back the required quantity from other sales order(open sales orders) this is done using T.Code CO06.
cheers,
anil. -
Sales Order / Forecasted Sale Order Report
hi
How to create Sales Order / Forecasted Sale Order Report.Hi Raju,
Are you talking of normal sales order and in the Forecasted sale order report what are the inputs you are giving. -
Settlement of Sale Order to Sale Order
Dear experts
I need help in the following scenario:
At my client place we are doing job work for external material. All the material are supplied by the customer and our client will do the processing and send it back to customer's customer on customers request.
To create Excise Invoice against the Customers Customer we are handling through 2 sale orders.
First One Sale order will be created against the Customer Order and Sale price will be the selling price of Customers to Customer.
Second Sale Order will be created for Job Work Charges for the processing the materials.
On settling the process orders all the cost is settling to Sale Order One, Clients revenue is coming from Sale Order Two.
Here I need to settle the First Sale Order to Second Sale Order. I have given the second sale Order number in first sale order number in Settlement rule.
But when I settle the First sale Order all the amount it going to Price Differance Account.
How to settle the Cost of First Sale Order to Second Sale Order?
Regards
Kiran ADear Experts
any advises.
Can I go for Sale Order to Sale Order Settlement ?
Regards
Kiran -
WBS element , Production Order and Sales Order Link
HI,
I have to get the name of the customer mentioned in the sales order. In Sales order line item assignment WBS element has been assigned as this is a sales order for customer specific.
Now I am doing MRP run against WBS element and getting the planned order.
After that i am doing Conversion of planned order into production Order with transaction code MD04.
In the production order, Assignment tab WBS element is showing.
My query is that against the WBS element and that particular production order how can i trace sales order as well as the customer name.
Note: The WBS element can be assigned to more than one sales Order line item.Asutosh Mahapatra,
Since each production order is created for 1 unique Sale order number you should see the sale order number on the header screen in production order ( General data tab). Also customer number & name will appear there.
Hope this helps. Else please come back.
Thanks,
Ram -
Quantity and Price Totals on Sale Order and Delivery Order
Dear ABAP Gurus,
I want to add totals of line items (Quantity and Price) in sale order and delivery order screens. Can you please guide me how to do this. The price can be any from pricing procedure ie exclusive or inclusive price of sales tax.
regards,
RSA
Moderator message : Requirements dumping not allowed, show the work you have already done, thread locked.
Edited by: Vinod Kumar on Jan 28, 2012 9:23 PMHi,
Try this :
IF @transaction_type in ('A','U') AND (@OBJECT_TYPE='22')
BEGIN
If exists (SELECT t3.docentry FROM OWOR T0 INNER JOIN WOR1 T1 ON T0.DocEntry = T1.DocEntry left join POR1 T2 on T2.[U_JONum] = T0.[OriginNum] and T0.[ItemCode] = t2.U_SubConItem] INNER JOIN OPOR T3 ON T2.DocEntry = T3.DocEntry WHERE T1.[PlannedQty] <> T2.[Quantity] and T1.[ItemCode] = 'subcon' and T3.DocEntry = @list_of_cols_val_tab_del )
Begin
SET @error = 10
SET @error_message = 'Not allowed to add more than planned'
End
End
Thanks & Regards,
Nagarajan
Maybe you are looking for
-
Difference: SAP BW Report iview - Query iView - URL iView
Hi, I want to show BW reports on the portal. Can anybody suggest me the different ways of doing it ? And also let me know about checklist of steps that need to be performed. Can anybody tell me the difference between showing BW reports through URL iv
-
IPhone screen is locked. Unable to slide open?
My phone wored last night but after charging last night, the screen is locked.
-
Microsoft Word Report causes crash
Hi all. I'm using the Report Generation toolkit to write some data to a MS Word file. On several computers here, this works just fine, both in development and as an executable. However, on two computers, I keep getting the following error. This is no
-
How to get focus on a TextInput control without mouse starting an app
Hi everyone, I have a TextInput control and I should to be able to edit it as soon as I start my app without using mouse. My issue is to have the cursor in the TextInput without using the mouse. Unfortunately setFocus() function isn' t enough <?xml v
-
LR2 + Vista 64: Crash when opening the profile list in the Print module
I apologize if this is has been reported/discussed before. I use LR2 on a Vista 64 machine. When I want to select a printer profile in the print module, LR crashes. The "preference list" of profiles is empty and I expect LR2 should open the list of a