Wednesday, August 1, 2012

LOGGING in PO

Debug logging can be enabled at the Document Manager Level to show activities done during processing for deeper analysis. This is done using the following steps;

1. Set the following profile options at the Oracle Purchasing Application level.

Set "PO: Set Debug Workflow ON" to "Yes"

Set "PO: Set Debug Concurrent ON " to "Yes"

2. Set the number of Document Manager processes to 1

3. Clear the debug table by deleting the contents of po_wf_debug table

4. Bounce the Document Manager process.

5. Reproduce the issue.

6. Query the po_wf_debug table so find the log lines written.

7. Revert the profile option settings:

8. Bounce the Document Approval Manager to update the setting changes.

Purchasing approval processing

TROUBLESHOOTING



The following section provides some details on diagnosing some common issues in the Purchasing approval processing

1) Document Approval Logic:

Issue 1

Document remains in Incomplete status after Approval



Cause 1A

The creator of the document is not part of a valid approval hierarchy, and does not have the limits to make the approval. The user needs to be associated to a valid Approval Hierarchy that address the approval limits for the specific document type. If employee / supervisor relation is being used for the document approval routing, then the needed assignments and association for each approval level will need to be done through the Enter Person form for each sequential employee/supervisor. For details on assigning employees, refer to Oracle Purchasing User’s Guide Release 11i (Part No. A82913–06) in 11.5.10 or Oracle Purchasing User's Guide Release 12 (Part No. B28669-01)



Cause 1B

The creator is part of a valid hierarchy, but there is not a level within the hierarchy that covers the elements on the document. The main culprit for this is the Change Account. Verify that for each of the limits under each level, that the number of digits for each segment in the account ranges matches that of the Charge Account. If the segment count appears to be correct, perform a quick test, and move the top of the account for the last level to be ‘Z’ for each digit. (Ex: ZZ.ZZZ.ZZ.ZZZZ.ZZZZ) If the resubmit of the approval now moves through without issue, then it is known that the cause was the Account Range, and new limits just need to be set for the each level.

Issue 2


Document rolls-up to the next approval level, when it should be approved by the owner.



Cause 2A

The assigned approval limits for the owner/creator are not broad or high enough to allow for document approval at the owner level. Review the approval limits and conditions assigned to the owner, and match each against a document that rolled-up to the next level.

Cause 2B

Even though the owner/creator has the correct approval limits for the document approval, the “Owner Can Approve” option under the document type setup has not been set to “Y”. For an owner/creator to be able to approve their own documents, this setting must be defined as “Y”.

Issue 3

Unable to open Requisitions or Purchase Orders from the document summary, for approval.

Cause 3A


The document is in either In Process or Pre-Approved status. A majority of the time, there is an open notification against either the Requisition or Purchase Order. The following query set can be used to determine the current user the notification action is waiting for:

Requisition:


select reqh.segment1 req, wfn.status notify_status, wias.notification_id notify_id,
wfn.to_user name, reqh.org_id org from wf_item_activity_statuses wias, wf_notifications wfn, po_requisition_headers_all reqh
where wias.notification_id is not null and wias.notification_id = wfn.group_id
and wfn.status = 'OPEN' and wias.item_type = 'REQAPPRV'
and wias.item_key = reqh.wf_item_key and reqh.authorization_status = ‘&Req_Number’ order by 5,1,3;

Purchase Order:

select poh.segment1 po, wfn.status notify_status, wias.notification_id notify_id,
wfn.to_user name, poh.org_id org from wf_item_activity_statuses wias,
wf_notifications wfn, po_headers_all poh where wias.notification_id is not null
and wias.notification_id = wfn.group_id and wfn.status = 'OPEN'
and wias.item_type = 'POAPPRV' and wias.item_key = poh.wf_item_key and poh.segment1 = ‘&PO_Number’ order by 4,5,1,3;

Cause 3B


The Purchase Order is in In Process or Pre-Approved status, but does not have any Workflow data. The most common cause for this is that there is an Open Change request against the Purchase Order/Requisition combination. Because the Purge Obsolete Workflow Process may have been run against the document between the last time the Approval took place and the Change Request was raised, the WF data would be missing. The correct action in this case is to have the Buyer, which the Change Request is waiting on, reply to the notification to either except or reject the change. The following query can be used to review the ties between the Purchase Order, Requisition and Change Request.

Purchase Order:


select ref_po_num PO_Num, ref_po_rel_num Rel_Num, document_num Req_Num,
change_request_id CR_Id, change_request_group_id CR_Grp_ID,
last_update_date, document_line_number Doc_Line_Num, action_type,
request_reason, request_status status from po_change_requests where ref_po_header_id =
(select po_header_id from po_headers_all where segment1 = '&PO_NUMBER' and org_id = '&ORG_ID')
and document_type = 'REQ' order by last_update_date

Requisition:

select ref_po_num PO_Num, ref_po_rel_num Rel_Num, document_num Req_Num,
change_request_id CR_Id, change_request_group_id CR_Grp_ID,
last_update_date, document_line_number Doc_Line_Num, action_type,
request_reason, request_status status from po_change_requests where document_header_id =
(select requisition_header_id from po_requisition_headers_all where segment1 = '&Req_NUMBER'
and org_id = '&ORG_ID') and document_type = 'REQ' order by last_update_date

Tuesday, July 31, 2012

How much can you lose in equity?


How much can you lose in equity?
 
 
Posting in Full :
 
People, sometimes, have no rules, limits, and have no clue on how to invest in equities. These people can, should and do lose their shirt, pants and undergarments and full well deserve it.



Let us say you are a well qualified, sensible, boy or girl and wish to invest in equities. Well if you do not want to be an active participant, you could choose a mutual fund. If you do not trust fund managers (I trust only 5 out of the 100 odd that I would have met), choose an index fund – the cheaper (and with lesser tracking error too) the better.
But if you want to be a little more adventurous and wish to invest in direct equities follow these rules so your losses are limited to the minimum.


Let us say you are 35 years and wish to create a portfolio. You are a woman, earning Rs. 8 lakhs, and are not the primary provider of the house. So you can take a little more risk than a man, who is the primary provider.
So let us say you have Rs. 10 lakhs to invest, and influenced by this site, you decide to put Rs. 8 lakhs in equities.



Rule No.1: NOT more than 80% of the SECONDARY earner’s portfolio will be in equities.


Rule No. 2: NOT more than 5% will be invested in ONE Company, as an initial investment. In case the share does well, we will LET it go up to 25% of one’s EQUITY portfolio. Anything in excess will be constantly sold off.
Let us say you are able to add Rs. 20,000 to the equity portfolio every month, and this share is also going up every month, it will take a real long time to breach the upper limit (unless you have picked one diamond and all other duds!).


Rule No. 3: Industry diversification I will learn or copy from a good fund manager’s portfolios, and I will buy only in group A, or B1. I will NOT touch a share in group B2, or T2T….even if someone says these are future blue-chips.


Rule No. 4: I will keep a 25% trailing stop loss. Let me explain. You have bought Rs. 40,000 worth of Carborundum Universal (my examples are obviously from my portfolio, and my cost of this share is Rs. 3.59 per share, thanks to split and bonus, so if you want to copy me, go to 1990, or create your own portfolio). Suddenly the shares value falls to Rs. 30,000. You will do nothing. However on the day it falls below 30,000, you will sell. Knowing how to cut losses is as important as knowing how to let profits run.

Rule No. 5: I will review my portfolio on a quarterly basis. I have no business managing my own portfolio unless I can beat the index. Clearly if you beat the index for the first year, then the second year, then the third year…you are doing well. If you do not beat it for the first four quarters – and are trailing by a huge margin, sell and go to a good fund house.



Now, With all these rules in place how much can you lose?

Rs. 800,000 is the total investment, Rs. 40,000 is the maximum exposure to one stock, 25% is the trailing stop loss- so you can lose about Rs. 10,000.

Considering your liquid net-worth is Rs. 10,00,000 you stand to lose about 1% of your net-worth. Not an amount you need to lose sleep over.

Kartviryarjun defeated Ravan

Ravan was always looking for somebody who could be a match to him in strength. On finding any such person, Ravan challenged him to a duel.


There was a king named Kartviryarjun. He was also named Sasrarjun because he had thousand hands.(The word Sahasra means thousand). He got thousand hands as a boon from Lord Dattatreya(incarnation of Lord Vishnu). In brief he is also called as Arjun. But one must not confuse him with Arjun of Mahabharat.



Ravan heard of Kartviryarjun power and went to challenge him. Before challenging Kartviryarjun, Ravan saw river Narmada. He went to the bank of Narmada and started offering worship to Lord Shiva. He found that water started flowing in opposite direction. Ravan asked his men to find out the reason. They found that at some distance Kartviryarjun was taking bath in Narmada. Some women of his gynaecium were with him. He made water flow in opposite direction with his thousand hands.

Ravan got angry that his puja was interrupted because of Kartviryarjun and wanted to have war with him. Ravan's ministers advised him that Kartviryarjun was relaxing in the water of Narmada at that time and was also in the company of women, therefore it was not appropriate to challenge him at that time. But Ravan did not listen.

Initially there was war between Ravan's soldiers and Kartviryarjun's soldiers. When Kartviryarjun was still inside water, Ravan's soldiers had upper hand and they were destroying the soldiers of Kartviryarjun. Kartviryarjun came out without any worry and defeated the soldiers of Ravan. He challenged Ravan to have single combat. Ravan and Kartviryarjun fought. Kartviryarjun easily won. He took Ravan to his(Kartviryarjun's) jail and imprisoned him.



Ravan's grandfather Pulastya came to know of this. He reached Mahismati(Kartviryarjun's capital) and requested Kartviryarjun to release Ravan. Since Kartviryarjun defeated Ravan, therefore he had the right to take anything from Ravan. If he wanted, he could also take Ravan's kingdom. But, out of respect for the great sage Pulastya, Kartviryarjun did not ask for anything and released Ravan. Not only that, he even accepted Ravan as his friend.

Some stories say that sage Pulastya asked Kartviryarjun to free Ravan and some say that Lord Brahma did that. It is possible that both Lord Brahma and sage Pulastya went to Kartviryarjun.

Friday, July 27, 2012

regexp_substr Handle CSV Data


REGEXP_SUBSTR(source_string, pattern
[, position [, occurrence
[, match_parameter]]])

  1. 'source_string' is a character expression that serves as the search value.
  2. 'pattern' is the regular expression. It is usually a text literal.
  3. 'position' is a positive integer indicating the character of
  4. 'source_string' where Oracle should begin the search. The default position is 1.
  5. 'occurrence' is a positive integer indicating which occurrence of pattern in source_string Oracle should search for. The default is 1.
  6. 'match_parameter' is a text literal that lets you change the default matching behavior of the function.
  7. 'match_parameter' can be a combination of
    1. i: to match case insensitively
    2. c: to match case sensitively
    3. n: to make the dot (.) match new lines as well
    4. m: to make ^ and $ match beginning and end of a line in a multiline string

-- match 'call', 'caller', 'called', or 'calling' in the string

SELECT REGEXP_SUBSTR('You have called me too often, she said.','call((ing) (er) (ed))')
FROM dual;
 
Handle  CSV data
select '...'||LTRIM(regexp_substr('I had a dog, he had white fur, his name was Bob.','[^,]+', 1,level) ), level from dual
 connect by
regexp_substr('I had a dog, he had white fur, his name was Bob.', '[^,]+', 1, level) IS NOT NULL


DECLARE
--
p_csv VARCHAR2(1000):= '688646,688563,807141';
p_csv1 VARCHAR2(1000):='27057931H,18025414H,18025415H,27057934H,27057937H,27061344H,27061345H,18025405H,18025408H';
--
CURSOR c
IS
SELECT serial_number
FROM mtl_serial_numbers
WHERE rownum < 12
AND inventory_item_id IN (
select regexp_substr(p_csv,'[^,]+', 1,level)
from dual
connect by
regexp_substr(p_csv, '[^,]+', 1, level) IS NOT NULL
);

CURSOR c1
IS
SELECT inventory_item_id
FROM mtl_serial_numbers
WHERE 1=1
AND serial_number IN (
select regexp_substr(p_csv1,'[^,]+', 1,level)
from dual
connect by
regexp_substr(p_csv1, '[^,]+', 1, level) IS NOT NULL
);

BEGIN

--
FOR i IN C
LOOP
--
dbms_output.put_line(i.serial_number);
--
END LOOP;
--
FOR i IN C1
LOOP
--
dbms_output.put_line(i.inventory_item_id);
--
END LOOP;
--
END;

Tuesday, July 24, 2012

MTL_RESERVATIONS


On 11.5.10.2 in Production:
Find that when Customer creates Org Level Reservations for Internal  Sales
Orders. If  partial quantity  gets Pick  released and Shipped,  the Org
Level Reservation  for the remaining Back ordered qty  gets relieved.

EXPECTED BEHAVIOR
-----------------------
Expect the reservation should split , and the new line should carry the Org
Level reservation of the remaining qty.

STEPS
-----------------------
The issue can be reproduced at will with the following steps:

Item Number : XXXXXX
OHQ Picture:
Sub: Secondary LPN1 : 100 qty
Sub: Secondary LPN2 : 100 qty
Sub: Primary Loose : 25 (Not packed)

1) Internal  requisition / Internal Sales Order created for 150 qty
2) Org   Level reservation is created for 150  qty

3) Pick  Release  WITH  PRIOR RESERVATION
4) Based on the WMS Rule (Allocate Full LPN)  system can allocate only  125
(Lpn1 100qty + 25 loose)
5) At this point  the STF shows the following
Released to  Warehouse : 125 , Back  Ordered : 25
6) At  this Point, the mtl_reservations shows
reservation_quantity = 150   and  detailed_quantity = 125
7) After  the Pick  Confirmation , in the mtl_reservations , the
reservation_quantity  changes to
125 , with  Staged_flag = Y
8) Expect the reservation should split , and the new line should carry the
Org Level reservation of the remaining 25 qty.

BUSINESS IMPACT
-----------------------
The issue has the following business impact:
Due to this issue, the  Business Rules which  were set up  for reservations
now have no meaning because of the problem, and it is causing considerable
loss of Business of the organization.

Monday, July 23, 2012

Sri datta Sharanaashhtakam

dattaatreya thava sharaNaM, dattanaadha thava sharaNam. ..

Oh Dattatreya, Datta natha, I surrender to you.

triguNaatmaka triguNaateetha
tribhuvana paalaka thava sharaNam. .
shaashvatha muurthe thava sharaNaM
shyaama sundara thava sharaNam. .. 1..


1. You are the three gunas - Satva, Rajas and Tamas. You are beyond the three Gunas. You are the protector of the three worlds. I surrender to you. You are eternal. You are Vishnu, the dark blue one. I surrender to you.

seshhaabharaNaa seshabhuushaNa
seshhasaayi guru thava sharaNam..
shaDbhuja muurthe thava sharaNaM
shaDbhuja yathivara thava sharaNam... 2..



2. A serpent is your ornament. You are adorned with a serpent. You are Vishnu reclining on the serpent Shesha. To that Guru I surrender. You have six arms and you are all pervading. You are a yathi with six arms. To that one I surrender.

danDa kamanDalu gadaa padmakara
shankha chakradhara thava sharaNam..
karuNaa nidhe thava sharaNaM
karuNaa saagara thava sharaNam. .. 3..


3. You are adorned with Danda, Kamandalu, Gada, Padma, Shanka and Chakra. To that Vishnu I surrender. You are an ocean of compassion. To that Dattatreya, I surrender.

shreepaada shree vallabha guruvara
narasiMha sarasvathi thava sharaNam.
shree gurunaatha thava sharaNaM
sadguru naatha thava sharaNam... 4..


4. You are Guru Sripada Vallabha, Narasimha Saraswati. You are Gurunatha and Sadgurunatha. To that Guru I surrender.

kRishNaa sangama tharuvara vaasi
bhaktha vatsala thava sharaNam.
kRipaa nidhe thava sharaNaM
kRipaa saagara thava sharaNam... 5..


5. You live in the Sangam of the Krishna river. You have love for devotees. You are an ocean of kindness. To that one I surrender.

kRipaa kaTaaksha kRipaavalokana
kRipaa nidhe prabhu thava sharaNam.
kaalaanthaka thava sharaNaM
kaala naashaka thava sharaNam.. 6..


6. Your very glance is grace for your devotees. You are a treasury of mercy. You are Time and you are the annihilator of Time, to that one I surrender.
poornananda poorna paresha
puraaNa purushha thava sharaNam.
jagadeesha thava sharaNaM
jagannaatha thava sharaNam.. 7..


7. You are full of bliss. You are perfect. You are Iswara, the giver of salvation. You are Vishnu, Lord of the three
worlds. To that Lord I surrender.


jagath paalaka jagadaadeesha
jagadoddhaara thava sharaNam.
akhilaanthaka thava sharaNaM
akhileshvarya thava sharaNam. .. 8..


8. Oh protector of the universe, you are the Lord of the whole world. You are the redeemer of the world. You are entire time and space. I surrender to you.
bhakta priya vajra panjara
prasanna vaktra thava sharaNam.
digaMbaraa thava sharaNaM
deenadayaa ghana thava sharaNam. .. 9..


9. You have love for devotees. Oh Lord Shiva, you are always the embodiment of peace. You are blue in color and you are the sky. You have compassion for the poor and the humble. To that one I surrender.

deenaanaatha deenadayaaLa
deenoddhaara thava sharaNam.
thapo muurthe thava sharaNaM
tejoraashi thava sharaNam. .. 10..


10. You are the Lord of the poor, you have mercy for the poor and you are the redeemer of the poor. Oh all pervading ascetic, you are brilliance. To that one I surrender.
brahmaananda brahma sanaathana
brahma mohana thava sharaNam.
vishvaatmaka thava sharaNaM
vishva rakshaka thava sharaNam. .. 11..

11. You are the Supreme bliss. You are ancient, timeless. You are Brahman engaged in divine play. Oh protector of the universe, you are the Supreme Being. I surrender to you.

vishvaaMbhara vishva jeevana
vishva paraatpara thava sharaNam.
vighnaanthaka thava sharaNaM
vighna naashaka thava sharaNam.. 12..



12. You are the Supreme Spirit, the all-pervading Vishnu. You are the giver of life for the universe. You are the
remover of obstacles. To that one I surrender.


praNavaateetha premavardhana
prakaasha muurthe thava sharaNam.
nijaananda thava sharaNaM
nijapada daayaka thava sharaNam. .. 13..



13. You are the OM. You are all pervading brilliance. You are bliss and the giver of salvation. To that one I surrender.

nitya niranjana niraakaara
niraadhaara thava sharaNam.
chidaatma roopa chidaananda
chitsukha kanDa thava sharaNam. .. 14..


14. You are ever-lasting, without blemish and formless. You are the support of all and the Supreme Spirit. You are
full of bliss and full of peace. To that Brahma, I surrender.


anaadi muurthe thava sharaNaM
akhilaavathaara thava sharaNam. .
ananthakoTi brahmaanDa naayaka
aghatitha ghaTana thava sharaNam. .. 15..


15. You are the beginning, the eternal and the complete avatar. You are infinite, endless. You are the Lord of the Universe. You are the movable and immovable Brahman. To that one, I surrender.
bhakthoddhaara thava sharaNaM
bhakta rakshaka thava sharaNam. .
bhaktaanugraha guru bhakta priya
pathithoddhaara tava sharaNam. .. 16..



16. You are the redeemer of devotees, the protector of devotees. One who has devotion towards Guru will receive the grace of Him who is the redeemer of the poor and humble. To that one I surrender.




http://stotraratna.sathyasaibababrotherhood.org/o36.htm