Customizing PO number to add a prefix 'AB' on the number generated.

Hi All
I have a requirement to customize the PO number on the Purchase Order form, when a user create a new PO manually.
Below is the code, could someone please point to the right direction on this issue.
form_name VARCHAR2(30) := NAME_IN ('system.current_form');
block_name VARCHAR2(30) := NAME_IN ('system.cursor_block');
item_name VARCHAR2(30) := NAME_IN('system.cursor_item');
l_order_num VARCHAR2(25):= 'MP13/1000'; --:= select 'MP'||to_char(sysdate, 'YY')||'/'||AP.XXAP_VENDOR_NUM_S.NEXTVAL from dual;
Begin
IF event_name = 'WHEN-NEW-FORM-INSTANCE' THEN
IF form_name = 'POXPOEPO' THEN
IF block_name = 'PO_HEADERS' AND item_name = 'VENDOR_ORDER_NUM' THEN
l_order_num := 'MP'||to_char(sysdate, 'YY');
-- if NAME_IN('PO_HEADERS.VENDOR_ORDER_NUM') = 'Y'THEN
IF l_order_num IS NOT NULL THEN
copy (l_order_num,'PO_HEADERS.VENDOR_ORDER_NUM'); --output sample MP13/1000
fnd_message.set_name('FND','Purchase Order Number '||l_order_num||' created - TEST');
ELSE
fnd_message.set_name('FND','Creation of Purchase Order Number NOT created - TEST');
fnd_message.Error;
RAISE FORM_TRIGGER_FAILURE;
END IF;
-- disable the field after being populated
SET_ITEM_PROPERTY('PO_HEADERS.VENDOR_ORDER_NUM',UPDATEABLE,PROPERTY_FALSE);
End if;
-- End if;
End if;
End If;
Running
RDBMS 11.1.7.0
Oracle applications 12.1.3
form Name POXPOEPO
Thanking you in advance

....Someone, anybody please help!

Similar Messages

  • Iphone dialing. A basic phone allows number manipulation to add a prefix on a stored number in contacts, is there a way to do that?

    Iphone dialing. A basic phone allows number manipulation to add a prefix on a stored number in contacts, is there a way to do that?
    This is specially useful while traveling and you need to use numbers stored in a domestic style. Adding the possibility to have a prompt or cursor in the number dialing screen would be very helpful

    Further to my question Ill add an example:
    I'm in the US and need to call to Mexico City, the way to do,it is +52 55 12345678. This number is stored (and has been stored for years in yahoo contacts) as 12345678, the way you dial it locally; so now in order to call I need to add +5255 as a prefix to my stored contact.
    This is extremely easy in other simple phones and smartphones like Blackberry by copying, pasting and editing the final number you need but it seems impossible on iPhone. It requires a great deal of manual copying.
    I travel a lot and would be very thankful for a solution

  • How can I add a line but keep the number I have from tmobile

    How can I add a line but keep the number I have from Tmobile

    Hi, Janice!
    I'm just guessing, but I imagine you'd get your question answered faster in the AE forum.

  • When I input my serial number to activate Photoshop CS4, it said the number is invalid. However, the customer service of Adobe told me that the number is valid. What should I do?

    When I input my serial number to activate Photoshop CS4, it said the number is invalid. However, the customer service of Adobe told me that the number is valid. What should I do?

    Error "The serial number is not valid for this product" | Creative Suite

  • Version number is displayed as a code not the number

    I've created a document template within a  library and added a label to display the version of a document on the footer and I continued to add other columns such "date created, date modified, Revision etc" and now the version number is displayed
    as a code not the number that was displayed before. before the version was displayed as minor versions but now it shows this "{_UIVersionString}". Can anyone
    help please
    Thanks In advance

    Hi Rajendra,
    If i understood your problem correctly then try this
    i am giving one example how to use html tags in sql query
    you can try for other html tags
    but below code only works with PL/SQL Dynamic Content region,so create your report using this region.
    htp.p('<ol type = "circle">');
    htp.p('<li>');
    ----------------your code------
    htp.p('</li>');
    htp.p('</ol>');
    htp.p('<br>');
    hope this helps you,
    Thanks,
    Jitendra

  • How can I create accurate decimal dimensions when creating a new document or using the art board in Illustrator CS6? When I type in a number with a decimal, it automatically rounds the number up.

    How can I create accurate decimal dimensions when creating a new document or using the art board in Illustrator CS6? When I type in a number with a decimal, it automatically rounds the number up.

    For my part you are welcome, sdowers.
    Unfortunately, the uncertainty arising from the rounding has been up several times here in this forum.
    I just came to remember a warning that needs to be given:
    The rounding of the representation of a numerical value may be harmless in itself, but if you use it for any operation that changes the value, such as multiplication or whatever, things will go wrong because the operation will be made on the basis of the rounded value instead of the true value. So, as in your first case in post #2, 39.625 rounded to 39.63 will become 79.26 instead of 79.25.

  • For some reason my phone is using another number and won't let me delete the number and select my own numbers. Any reasons why

    For some reason my phone is using another number and won't let me delete the number and select my own numbers. Any reasons why

    Are you talking about iMessage?

  • How to add 2 decimal places if the number is whole number(Integer)

    Hi Gurus- I had a requirement to add the zeros for two decimal places even the number is an whole number.
    Example: I had a column which i gave the datatype as Number(8,2) .While Inserting from the flat file to the custom table column,i am rounding it to 2 decimal places.But if its the whole number i want that also to be rounded to 2 decimal places.
    1) 3456.89675 It's getting inserted as 3456.89
    2) 123 It's getting inserted as 123 (Instead i want this to be inserted as 123.00)
    3) 123.50000 It's getting inserted as 123.5 (Instead i want this to be inserted as 123.50)
    Can you please let me know how can i achieve it to insert any number(decimal or whole number) from the flat file as 2 decimal places in the custom table column.
    Thanks in advance.

    Please do not post duplicates -- To update the date for the first of the month

  • I deactivated my CS6 and uninstalled on my PC, so I could install CS6 on a Mac. I downloaded CS6 on my Mac, but when I try and put in my serial number it's is telling me that the number is invalid.  What else can I do?

    I deactivated CS6 and uninstalled on my PC, so I could install CS6 on a Mac. I downloaded  CS6  on my Mac, but when I try to put my serial number in it's telling me the number is invalid.  What should I do next?

    IIRC PS CS6 is not Cross platform. It takes a different license key code for each platform. A License key for Windows won't work on a Mac and a key for a Mac won't work on Windows. You'll need to buy another copy/License for Mac OS X.
    At one time Adobe did allow you to switch platforms by paying them some money and getting a Mac license key code which I think then Deactivated the Windows license key.
    IIRC the CC version does allow you to install on EITHER platform. But only one platform at a time. You can't have one copy on Windows and another on a Mac. Adobe does allow you to install on 2 computers with one license key but it must be on the same platform (Operating System) and both computers and or install of PS CC can't be used at the same time.

  • Number of mail messages does not match the number in mail activity

    This is not a big deal but I have noticed that when mail arrives the Mail Activity window tells me how many incoming messages are being downloaded. This number often bears no relationship to the number that arrive. For example it might read 4 messages are downloading when in reality only 1 arrives. If I look at my webmail all messages are listed. Does anyone know what causes these inconsistencies?

    I do not have any answer, but I have the same problem. AND the RSS feeds do not make up the difference; and yesterday I disabled junk mail filtering. And I've made certain that I have no unread mail left over. Yet Mail Activity reported downloading 16 messages, but I only received 8. This happens daily, but the proportion of unaccounted emails varies.

  • Serial number help.  Cant find case with the number.

    Need to install on new computer.  Cant find the original case = no serial number.  The product code is [removed].  Adobe Photoshop CS5 Extended.  Student and Teacher Edition

    Check your Adobe account where?
    We do have CS6, no serial number, wasn't given by the Apple dealer who installes CS6. We want to upgrade to CC. Do all ready have a team. What to do now?
    thanks for your answer!

  • HT204492 When I use remote, it talks to me in a quick voice with number of button choices, then tells me the number, ect.  Very annoying.  She talks so fast as well.  How can I shut that off or make her talk slowly, or not at all.

    When I use mt Appew TV remote it talks to me, in fast voice, telling me where I am, number of choices, etc.  It is annoying and I can't find a way to just have screen on tv and then access whatever without this fast talking voice.

    Turn off Voice Over in the Accessibility section of AppleTV Settings.

  • Can't find email with serial number for Pages, how can I find the number?

    Purchased Pages on 9th September following iWork09 trial, however I must have trashed the email containing serial number
    in error. Does anyone know how to find the serial number. Thanks in advance for any reply...

    You need to delete the trial & then reinstall from the boxed DVD or the Mac App Store. The files to delete are the iWork ’09 folder from the main HD > Applications; the iWork ’09 folder in HD > Library > Application Support & the individual iWork application plist files found in HD > Users > (your account) > Library > Preferences for each user. Yvan Koenig has written an AppleScript that removes the files. You can find it on his box.com account in for_iWork'09 > other_iWork'09 items > uninstall iWork '09.zip.

  • HT1535 Why does the number of tracks in my library and the number on my iPod differ. I have just synced and 'lost' over 20 tracks. Am fuming!

    Why didn't the above display the question I set as originally written? I have just synced and 'lost' over 20 tracks! They are listed on my library but after syncing they have vanished from my ipod yet remain in my library.
    Another question, if I may, I have two ipods and want to merge the separate libraries into one and transfer the lot to another type of MP3 player, any ideas on how I do this please.
    Am so angry I could spit!
    Many thanks,
    An angry English female

    Have you looked at the previous discussions listed on the right side of this page under the heading "More Like This"?
    BTW this is the iPod touch forum

  • How can I view the number of items I have in a folder on Mac 10.9.2 (Mavericks)?

    I have only been using Mac OS X 10.9.2 (Mavericks) for a little while so I'm having to deal with many inconveniences that I didn't have to face with Mac OS X 10.6.3 (Snow Leopard). It's frustrating that 10.9.2 (Mavericks) doesn't let me tap twice on the trackpad in order move or drag something, but at least I figured out how to do this in a different way. One part that I cannot figure out is how to view the number of files in each folder. With Snow Leopard, I was able to view the number of files on that folder automatically by looking at the bottom of the folder (*See the example on the photo). On the bottom of that folder, you will see the number of items, which it 10. Every time I add new files (or folders within that folder), it will update the number of items to the appropriate number. This is especially useful to me if I'm going to have many items within a folder and when I need to make sure that the number I have is exact. For example, sometimes I have to save files in a precise number and order. If I miss saving a file with a specific number, and I don't catch that the number of items is off as early as possible, I may have to waste time looking through files to try to figure out what is missing. For this reason, I have to find a convenient way to view the number of items in each folder with Mac OS 10.9.2 (Mavericks) or else using it will be a hassle. 
    Now that I'm using Mac OS X 10.9.2 (Mavericks), I don't see any information on the folder that tells me how many items are in it (*See photo below). I keep looking to see if it's located somewhere else on the folder or if I can change the folder preferences to make it become visible. I also clicked on the folder and on "Get Info" (which would be inconvenient if I had to do this constantly). This showed me the number of items in that folder but I can't always keep checking like this because it's time-consuming and distractive.
    I need to find a way to make the number of items appear on the folder itself, while it is open.
    Do you know a convenient way to view the number of items in a folder?
    Is there some way I can change the preferences so that the number becomes visible on the folder itself?

    Open the Finder's View menu and choose 'Show Status Bar'.
    (111921)

Maybe you are looking for

  • Why is my music disappearing all the time and why is my ipod not being recognized?

    First off, I'm horrible with computers, so if anyone answers this could please use layman terms? Okay, so i put music from my flash drive onto itunes and when it was taking over 2 minutes for the drive to eject, I just yanked it out (I know, not the

  • Video too fast, Audio correct speed

    I have just returned from a location shoot. I used Panasonic Pro Cameras. Have just captured the footage and itruns much too fast, the audio runs at a normal speed. Do not understand the problem, everything was standard settings. When I play the AVI

  • Set off ofcustomer with vendor

    Can any tell that the config step to be done for setting off the customer and vendor balances. Regs Bharat

  • Photos on iPad

    When I upload photos on my iPad should they transfer to my iPhone? Both devices are up to date with ios5.

  • Need a website to upload HD video

    Ive been looking for the last 3 days and am so confused on how to do this. I want to show people videos i make but either websites cant load my video because its too big. I think ive read right about making your video h26 format which then made my vi