Skip to Content
avatar image
Former Member

How to add a new sales order number to a user defined field

Hello,


While the user creating a new sales order, I want to see if at the same time the new "Sales Order Number" automatically populate in the user defined field. Can I use a SQL query or any other options. Below is screenshot of the sales order.


Thanks for any help in advance.

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

8 Answers

  • Best Answer
    Nov 09, 2016 at 10:33 PM

    From the image it looks like you already have a Formatted Search on the field so you're on your way.

    First, create a simple query in Query Manager that says only “SELECT $[$8.0.0]”.This refers to the Order Number field.

    Then, while in the user defined field enter Shift-Alt-F2 (Top Menu/Tools/Customizations Tools/User Defined Value - Setup). This will open a small window that will look something like this when you're done.

    This says to execute the query when the BP Name changes as it will when the user enters a Customer number.It can be tied to any field on the screen in this way.This should trigger and fill the UDF Order field when the user enters a customer on a new sales order.

    If I understand you, this should work.

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Nov 14, 2016 at 12:55 PM

    Hi,

    The format is not changing. Keping your sales order form open, if you open this user defined query, then it gets executed. Because FMS is meant to capture the information form the active screen.

    Regards

    Pradnya

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      Hi Pradnya,
      Thank you for your comment.

      I just created a new Sales Order then checked the "Order No" field in UDF and noticed it was empty. Does it matter to place "Order No" query under General category instead FMS in Query Manager? I am not sure if this is cause of the problem.

      Thanks.

  • avatar image
    Former Member
    Nov 15, 2016 at 05:34 AM

    Hi,

    Try $[ORDR.DocNum] instead of $[$8.0.0].

    This worked.

    Regards

    Pradnya

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      Hi Pradnya,

      Your query ($[ORDR.DocNum]) works now! The only problem is the sales order number didn't populate automatically and I have to click twice on the search icon in order to populate the sales order number. Please see the image.


      Thanks.

  • Nov 21, 2016 at 06:59 PM

    Hi Bill - can you show us the FMS setup screen you have on the field (under shift-alt-F2 when in your new Order No. field)? Not sure what might be getting in its way. I changed mine to fire on change of the Customer Number on my demo database and it's working. I am still using the $[$8.0.0] syntax as well.

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      Hi Scott,

      Thanks for your time and effort. Noticed that I used "BP Name Overwritten" for the use defined value that is why your formula did not work. When I selected "Customer/Vendor Code", your formula worked fine.
      Thanks again.

  • avatar image
    Former Member
    Nov 15, 2016 at 05:30 AM

    Hi,

    Category does not matter at all. I executed your FMS query through query manager. It is not capturing order number.

    Regards

    Pradnya

    Add comment
    10|10000 characters needed characters exceeded

  • Nov 22, 2016 at 07:16 AM

    Hi Bill,

    Why would you want to display the order number, that is already prominently visible, again in a user defined field (which is less prominently visible)? It makes no sense, because for any and all purposes you can use the existing DocNum system field. With this solution you are only doubling data in the database.

    Did you mean to display the order number this way in a user field on the Delivery Note form? That would make sense to me. Or did you simply want to test the principle?

    Regards,

    Johan

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      Hi Johan,

      Thanks for replying to my posting. I need to have SO# when am invoicing. Do you know any method to use so I can auto populate the SO# (using UDF) when I am invoicing?

      Thanks.

  • Nov 22, 2016 at 08:29 PM

    Bill, look at the field Ref1 on OINV. That should tell you the Sales Order number assuming you've used the Copy To or Copy From functions. Too bad we can't surface hidden system fields (or does someone know a way?). If that works you should be able to use the table syntax shown above in a formatted search on the UDF.

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Nov 23, 2016 at 08:04 AM

    Hi,

    Sorry to have responded late. I was not around and busy in SAP activities.

    If you are maintaining SAP standard document trail like SO --> A/R Delivery --> A/R Invoice with the help of copy from or copy to functionality then you will find that complete document trail in the remarks field.

    Regards

    Pradnya

    Add comment
    10|10000 characters needed characters exceeded