Invoice ship to State and Country

For a query I am doing, I need to be able to get the state and country out of the oinv.address2 field which stores the state and country as part of the complete address file.
For example:
121 Any Street Cleveland,OH 44111 USA
Is there a way of getting the state (OH) and USA
Has anyone done this?

The brackets are there because you wrote it there too
Without brackets is as
select
coalesce(
substring(
substring(address2,
charindex(',' ,address2, 0) + 1, len(address2)
), 0, charindex(' ', address2,0) - 1)
, '')   as state
from oinv
For country use
select
coalesce(
ltrim(substring(
substring(
substring(address2,
charindex(',' ,address2, 0) + 1, len(address2)
), 5, 100)
, charindex(' ',
substring(
substring(address2,
charindex(',' ,address2, 0) + 1, len(address2)
), 5, 100)
) ,100
, '')   as country
from oinv
if helps reward points or let me know the problem

Similar Messages

  • User - defined functions for calculating the taxes of state and country

    hi expects,
        how can write user-defined function in message mapping in which i want to calculate the states taxes (2500) and country taxes (5000) and give the result as grand total in output.please help me?

    Hi,
    Activities
    1. To create a new user-defined function, in the data-flow editor, choose Create New Function (This
    graphic is explained in the accompanying text), which is located on the lower left-hand side of the
    screen. In the menu, choose Simple Function or Advanced Function.
    2. In the window that appears, specify the attributes of the new function:
    Name
    Technical name of the function. The name is displayed in the function chooser and on the data-flow
    object.
    Description
    Description of how the function is used.
    Cache
    Function type (see above)
    Argument Count
    In this table, you specify the number of input values the function can process, and name them. All
    functions are of type String.
    3. In the window that appears, you can create Java source code:
    a. You can import Java packages to your methods from the Imports input field, by specifying them
    separated by a comma or semi-colon:
    You do not need to import the packages java.lang., java.util., java.io., and java.lang.reflect. since
    all message mappings require these packages and therefore import them. You should be able to
    access standard JDK and J2EE packages of the SAP Web Application Server by simply specifying the
    package under Import. In other words, you do not have to import it as an archive into the Integration
    Repository. You can also access classes of the SAP XML Toolkit, the SAP Java Connector, and the
    SAP Logging Service (see also: Runtime Environment (Java-Mappings)).
    In addition to the standard packages, you can also specify Java packages that you have imported as
    archives and that are located in the same, or in an underlying software component version as the
    message mapping.
    b. Create your Java source text in the editor window or copy source text from another editor.
    4. Confirm with Save and Close.
    5. User-defined functions are limited to the message mapping in which you created the function. To
    save the new function, save the message mapping.
    6. To test the function, use the test environment.
    The new function is now visible in the User-Defined function category. When you select this category,
    a corresponding button is displayed in the function chooser pushbutton bar. To edit, delete, or add the
    function to the data-flow editor, choose the arrow next to the button and select from the list box
    displayed.
    Regards
    Seshagiri

  • Extensions for "State" and "Country"

    At one time I thought I saw free extensions or snippets for
    drop down boxes to be used in input forms, but cannot find them
    now. I am looking for drop down boxes for US states and one for
    countries. I could always type them in by hand, but it would be
    much easier if someone already had that.

    Did you check the Adobe Exchange?
    Murray --- ICQ 71997575
    Adobe Community Expert
    (If you *MUST* email me, don't LAUGH when you do so!)
    ==================
    http://www.dreamweavermx-templates.com
    - Template Triage!
    http://www.projectseven.com/go
    - DW FAQs, Tutorials & Resources
    http://www.dwfaq.com - DW FAQs,
    Tutorials & Resources
    http://www.macromedia.com/support/search/
    - Macromedia (MM) Technotes
    ==================
    "Mr. Brownie" <[email protected]> wrote in
    message
    news:ep7f8u$kq4$[email protected]..
    > At one time I thought I saw free extensions or snippets
    for drop down
    > boxes to
    > be used in input forms, but cannot find them now. I am
    looking for drop
    > down
    > boxes for US states and one for countries. I could
    always type them in by
    > hand, but it would be much easier if someone already had
    that.
    >

  • How to add new picklist value to states and countries to Address object

    Hi,
    I like to query and update picklists, state and country, in the address. What're the record type and filed name for them?
    I tried record type, Address and field name, State and Country, with no luck.
    Thanks

    Hi,
    As far as I know you cannot modify the address object at this point of time.
    If you want to add values or modify the picklists for State & Country, you would need to use custom fields and add all required values and then use those fields. (You can remove the Addres Object completely from the layout and then substitue it with the custom picklists that you have designed - possibly cascading picklists with Country as parent and State as child )
    Hope it helps.

  • HT1051 Trying to change Shipping and Delivery address for one in the US, from Canada, and can't do it. State and zip code appears in red but no change in country name.  Using French (Canada) iPhoto app.

    Trying to change Shipping and Delivery address for one in the US, from Canada, and can't do it. State and zip code appears in red but no change in country name.  Using French (Canada) iPhoto app.

    Larry's right, You can still use your credit card, you just need to change the "billing address" to the recievers address. It gets billed to your CC and delivered to the US

  • How do I add State/Province and Country to my drop down list?

    How do I add State/Province and Country to my drop down list?

    Hi Gen,
    My problem is that I'm working with the free version of Form Central - I'm willing to purchase a version.  Earlier in my form I have States as a drop down menu (see below) but can't copy it to make it appear later in the same document. I was trying to avoid recreating the entire form. Any tips on copying or duplicating a field inside a document.
    Best Regards,
    Gina Grant
    ink + thread
    312.970.1106 (p)
    773.435.6474 (f)
    www.inknthread.com
    CPS Vendor #: 98626
    The information contained in this email is confidential, proprietary and may be legally privileged. This email is intended solely for the addressee(s). If you are not the intended recipient, you are hereby notified that any use, dissemination, or reproduction is strictly prohibited and may be unlawful. If you are not the intended recipient, please contact ink + thread by e-mail ([email protected]) and destroy all copies of this email.

  • List of country,state and city???

    hi,
    does anybody know from where i can get
    list of countries,state and cities of the world.
    i want to populate in one of my oracle forms.
    thanks in advance.

    Hello
    If your looking for the 2 or 3 digit or numbered ISO values as well as the actual name of every country in the world then check this site out:
    http://userpage.chemie.fu-berlin.de/diverse/doc/ISO_3166.html
    cheers
    Q

  • Sql Server Script for the List of all Country State and City

    I am searching for the Sql Server Script of all country State and City with the Following type
    For the Country only 2 Columns are there i.e. CountryId and CountryName(CountryId is primary Key)
    For the State 3 Columns are there i.e. CountryId, StateId and StateName(StateId is Primary Key and CountryId is Foreign Key)
    For the City 3 Columns are there i.e. StateId ,CityId and CityName(CityId is PrimaryKey and StateId is foreign Key).
    I need this type of Script with Column name. plzzz help me out i m stuck i didnt get the list as i want.
    Thanx and Regrads,

    Hi Vishnu,
    According to your description, you want to list all countries, states and cities, right?
    I have tested it on my local environment, here is a sample script for you reference.
    select
    [dbo].[Country].[CountryId]
    , [dbo].[Country].[CountryName]
    , [dbo].[State].[StateId]
    , [dbo].[State].[StateName]
    , [dbo].[City].[CityId]
    , [dbo].[City].[CityName]
    from
    [dbo].[Country]
    left join [dbo].[State] on [dbo].[Country].[CountryId]=[dbo].[State].[CountryId]
    left join [dbo].[City] on [dbo].[State].[StateId]=[dbo].[City].[StateId]
    Regards,
    Charlie Liao
    TechNet Community Support

  • Country ,state and city checklist XML by JAVA

    Hi friends,
    I have textboxes for entering the country ,state and city values and all these 3 fields are related by primary/foreign keys.
    I wan now store and retrieve values entered by users for country state and city by xml files .I also wan all these 3 field to be interrelated so that based on value of country I can populate the related states dropdownlist and based on value of state I can populate the related cities dropdownlist.Can some one pls answer my question about STORING AND RETRIEVING COUNTRY STATE AND CITY FIELDS USING XML FILES?
    I also did this application using string(short cut) way but is not efficient and all I want is direct modification in XML file by java?
    I didnt put my codes here bcos it so long and still if any one want my codes i wll email u sperately.
    All I need is any example approach for this kind?
    Any one help will be appreciated...

    Using XMLEncoder
    by Philip Milne
    This article covers advanced use of XMLEncoder, showing how it can be configured to create archives of any Java objects -- even when they don't follow the JavaBeans conventions. We include examples of how to make properties 'transient' and how to create archives that call constructors with arguments, use static factory methods, and perform non-standard initialization steps. We also cover exception notification, the 'owner' property (which can be used to a link an archive to the outside world), and methods for creating internationalized archives.
    http://java.sun.com/products/jfc/tsc/articles/persistence4/index.html

  • HT1918 on my account settings the shipping address is set on United States and it seems I cannot change it to UK... so my address is not accepted, what can I do?

    on my account settings the shipping address is set on United States and it seems I cannot change it to UK... so my address is not accepted, what can I do?

    To change it, you have delete the existing account.  However you can avoid losing any pictures in the process.  To avoid losing photo stream photos, save them to your camera roll (if not already there) before deleting the account.  To do this, open your my photo stream album, tap Edit, tap the photos, tap Share, then tap Save to Camera Roll.  (Camera roll photos are not effected by deleting the account.)
    Then go to Settings>iCloud, tap Delete Account, then sign back in with the new ID.  This deletes the account and your iCloud data from your device, but not from iCloud.  Provided you are signing back into the same account, your iCloud data will reappear on your device when you sign back in.

  • Is it possible to buy an iphone 5 in the states and take it back to another country for use?

    Is it possible to buy an iphone 5 in the states and take it back to another country for use?

    Apple has not yet announced the availability of unlocked iPhones in
    the US, but they are for sale in Canada, parts of Europe, and elsewhere.
    Warranty is not international. Service and repair/replacement only in
    country of original purchase. LTE/4G may or may not work in other
    country depending on bands and frequencies used.

  • Shipping Charges and Country of Destination

    In a B2C environment is it possible to configure Webtools to calculate shipping charges dependant upon country of destination?
    I don't think so but I'd like to be proved wrong.

    Sorry, I've just seen that the same question was asked recently on 18th June 2009 - I suspect customisation is the only answer but it would be good to have this confirmed

  • Can't modify address2, province and country

    I tried to modify my user profile. Some columns keep recalling old data or reset to default values when next logon. Those columns are "address2" in company address, "state/province" and "country" in shipping address.
    For address2, it keeps recalling the old information when next logon.
    For "state/province" and "country", they always reset to default value which are "Please select" and "United States" when next logon.

    We will investigate; thanks for your patience...
    Regards, OTN

  • Lead Time - Customizatiou0131n steps: Shipping point, route, and loading group

    It says about delivery scheduling that "The lead time considers the shipping point, route, and loading group". Can anybody explain me briefly the customization menu steps about this sentence?
    Thanks in advance.

    Please go through this document it will help you
    1) Maintain transportation planning point through Menu as follows:
    IMG Maintain&#61664; Logistic Execution &#61664; Definition &#61664;Enterprise Structure &#61664; transportation planning point.
    Create your own like BP01 enter the general data¡¯s required
    2) Defining modes of transport:
    &#61664;IMG Routes&#61664;Basic Transportation Functions &#61664; Transportation &#61664;Logistic Execution Define modes of transport&#61664;Define routes&#61664;
    Use the standard like:
    Shipping type: 01
    Description: Road
    3) Define shipping types :
    Basic Transportation&#61664; Transportation &#61664;Logistic Execution&#61664;IMG Define shipping types&#61664; Route &#61664;Functions
    Or through T-code: SM30
    PT: 01
    Description: Truck
    Mdtr: 01
    STPG: 0001
    4) Define transportation connecting point :
    Logistic&#61664;IMG Define&#61664;Routes &#61664; Basic Transportation Functions &#61664; Transportation &#61664;Execution Define transportation connection points&#61664;routes
    Copy the std point and make it FB01 as departure zone and FB02 as destination zone
    5) Define routes and stages.
    &#61664; Logistic Execution &#61664;IMG Define&#61664; Define routes &#61664;Routes &#61664; Basic Transportation Functions &#61664;Transportation routes and stages
    Use the standard route and copy it as FB0001 and enter the departure zone and destination as what we created.
    6) Defining Transportation Zone:
    Basic&#61664; Transportation &#61664;Logistic Execution &#61664;IMG Define transportation&#61664; Router determination &#61664; Route &#61664;Transportation Functions zones
    Use the standard transportation zone depending on the route so as for the example use 0000000003 - Southern Region
    7) Maintain country or transportation zone for shipping points
    &#61664; Logistic Execution &#61664;IMG &#61664; Route determination &#61664; Route &#61664; Basic Transportation Functions &#61664;Transportation Maintain country and transportation zone for shipping point
    Shipping point be ASH1 and route as 0000000003 which is assigned to country India
    8) Maintain route determination:
    Logistic Execution&#61664;IMG Route determination&#61664; Route &#61664; Basic Transportation Functions &#61664; Transportation &#61664; Maintain route determination&#61664;
    Country of departure: India
    Departure Zone: 0000000003
    Country of destination: India
    Destination Zone: 0000000003
    And enter the data’s needed like shipping condition 01, etc.
    Maintain Transportation relevance for shipping point, sales document type and delivery types.
    9) Now create shipping types
    &#61664;IMG Define shipment&#61664; Shipments &#61664; Transportation &#61664;Logistic Execution types
    Copy the standard 0001 and make it to AFIL
    10) Define and assign traffic zones through T-Code: T_76 (or) thru menu as follows
    &#61664;IMG Define&#61664; Basic functions &#61664; Shipments cost &#61664; Transportation &#61664;Logistic Execution and assign tariff zones
    Copy the standard and make it to FABTARIFF and assign our transportation planning point as ATP1, ATP2 assign tariff zone to every particular transportation planning point
    11) Define and assign pricing procedures
    Shipments&#61664; Transportation &#61664; Logistic Execution &#61664;IMG define and assign pricing&#61664; Price control &#61664; Pricing &#61664;cost procedures
    Copy the standard shipping cost pricing procedure SDFC00 to FBSC01
    12) Assign purchasing data:
    &#61664; Logistic Execution &#61664;IMG Assign purchasing data&#61664; Settlement &#61664; Shipments cost &#61664;Transportation
    13) Assign transportation planning point to shipping condition, purchase organization, purchasing group and to plants.
    14) Define Automatic G/L account determination:
    &#61664; Transportation &#61664; Logistics Execution &#61664;IMG Automatic G/L Account Determination&#61664; Settlement &#61664;Shipment Costs
    Or through T-code: OMWB
    Use G/L account 614000 as used in standard
    15) Automatic determination of CO assignments:
    &#61664;IMG Automatic&#61664; Settlement &#61664; Shipment Costs &#61664; Transportation &#61664;Logistics Execution Determination of CO Assignments
    Or T-code: OKB9
    16) Maintain shipping point address.
    &#61664; Logistics Execution &#61664; Definition &#61664;Enterprise Structure Define, copy, delete, check shipping point
    17) Creating G/L account centrally.
    Financial Accounting&#61664;Accounting &#61664; Master Records &#61664; General Ledger &#61664;
    &#61664;Individual Processing Centrally
    Or through T-Code: FS00
    18) Enter the G/L account 614000 to the company code AFIL
    19) Create transportation condition records:
    &#61664; Shipment cost &#61664; Transportation &#61664; Master data &#61664;Logistic Execution create&#61664;Prices
    Or thru T-code: TK11
    Enter condition type FB00 that is freight condition type, which is used as standard in the shipping cost pricing procedure.
    Enter the price and save it
    Process:
    1. The system determines the pricing procedure for the shipment cost item-using transportation planning point, service agent and shipment cost item category
    2. Calculation Basis
    3. Condition Record
    4. Access sequence.
    For the sales order, create a delivery using VL01N and pick the goods. Now create a shipment using VT01N and assign the delivery to the shipment document. Make sure to enter the carrier and other details before performing the transportation planning and execution. Save the shipment document and PGI for the delivery would be done automatically.
    A shipment represents a physical goods movement between two or more locations.
    For the system to create a shipment, shipping-relevant deliveries must exist.
    You use Transportation Planning to group pending deliveries into shipments and then to perform the shipments.
    The outbound delivery documents contain routes that the system calculates in route determination, and a transportation planning date for the delivery.
    Dynamic transportation planning is responsible for grouping together outbound deliveries into shipments that have at least the same route, visit plan type and the same transportation planning date.
    The following restrictions can be taken into account for a shipment in Dynamic Transportation Planning:
    • Weight
    • Volume
    • Variable capacity
    • Number of stops
    • Maximum duration
    • Loading units
    Create Shipment Document
    Use
    After the status of the delivery is open for transportation planning, it is possible to create a shipment document to schedule the transportation.
    Transportation&#61664; Create &#61664;Single document Logistics&#61614; Logistic Execution &#61664; Transportation&#61664;Planning
    T.code: VT01n
    Enter your transportation planning point and shipment type. Press enter.
    Creating the shipment cost document
    Use
    After the deliveries are scheduled by shipment and the shipment is executed, now it is time to maintain and close the shipment document in order to record all relative information and ready for the shipment cost settlement.
    &#61664;Single document Logistics&#61614; Logistic Execution &#61664; Transportation&#61664; Shipment cost &#61664;Create
    T.code: VI01.
    After creation of shipment cost doc. You settle the Shipment cost.
    Go to VI02, enter shipment cost no.and press enter.
    Then go to Overview -- Fright cost items, Select the line item and double click it.
    Go as main menu: Item --> Acc. assignment, you enter G/L acc. and cost center to which the transportation cost will be posted.
    On the Standard change, details – Freight cost items screen, then check the check box “Transfer”, which means you will transfer the relative transportation cost to FI/CO, in this case, the system should determined which Purchase Order will used to settle the cost, so after you check the “Transfer” check box.
    Press save button on the current screen.
    Shipment cost settlement and documents:
    Use
    After the shipment cost settled in shipment cost document, it has the following affects:
    It creates a service entry sheet that refers to the purchase order determined.
    It posts acceptance of services performed.
    It creates an accounting document for the accruals.
    Further subsequent documents are created in FI.
    Create Delivery:
    T.code: Vl01n
    Create TO:
    T.code: LT03
    Create Shipment Document
    Use
    After the status of the delivery is open for transportation planning, it is possible to create a shipment document to schedule the transportation.
    &#61664; Transportation Planning &#61664; Create &#61664;Single document Logistics&#61614; Logistic Execution &#61664;Transportation
    T.code: VT01n
    Enter your transportation planning point and shipment type. Press enter.
    Creating the shipment cost document
    Use
    After the deliveries are scheduled by shipment and the shipment is executed, now it is time to maintain and close the shipment document in order to record all relative information and ready for the shipment cost settlement.
    &#61664;Single document Logistics&#61614; Logistic Execution &#61664; Transportation&#61664; Shipment cost &#61664;Create
    T.code: VI01.
    After creation of shipment cost doc. You settle the Shipment cost.
    Go to VI02, enter shipment cost no.and press enter.
    Then go to Overview -- Fright cost items, Select the line item and double click it.
    Go as main menu: Item --> Acc. assignment, you enter G/L acc. and cost center to which the transportation cost will be posted.
    On the Standard change, details – Freight cost items screen, then check the check box “Transfer”, which means you will transfer the relative transportation cost to FI/CO, in this case, the system should determined which Purchase Order will used to settle the cost, so after you check the “Transfer” check box.
    Press save button on the current screen.
    Shipment cost settlement and documents:
    Use
    After the shipment cost settled in shipment cost document, it has the following affects:
    It creates a service entry sheet that refers to the purchase order determined.
    It posts acceptance of services performed.
    It creates an accounting document for the accruals.
    Further subsequent documents are created in FI.
    Generally process is-
    1) VL01N
    2) VT01
    3) VL02N - PGI
    4) VI01
    5) ML81N – Service Entry Sheet
    6) MIRO – Invoice Verification
    Shipping docs (VT01) are created before PGI...
    You cannot carry out transportation planning or creation of shipment after the goods issue has been executed. Once goods issue is done it means that the material has left your premises so there is no need for a transportation planning after it.
    In case you need carry out the shipment documents at the end of the day you could just create the delivery documents during the day and at end of the day create the shipment documents and the goods issue
    This link is also usseful:
    http://help.sap.com/printdocu/core/Print46c/en/data/pdf/LETRA/SDTRA.pdf
    Hope this helps you.
    Regards
    nitin

  • Ship to state is not avilable in the DTW Templet

    HI experts
    I want to Import business Partner Through but in the Template of BP Master in DTW Ship to State field and Ship to Block is
    not available so how can i import this field through DTW without Address template of BP in DTW because i have only one Ship to address
    Regads
    Rajani P. Patel.

    Hi
    U have to use like this:BP Address template
    RecordKey     LineNum     AddressNameAddressType    Block     City     Country     State
           1     0     Mr.R.B.Sharmabo_BillTo             Khadia Market,Khadia     Sonebhadra     IN     UP
    1     1     Mr.R.B.Sharma bo_ShipTo             Khadia Market,Khadia     Sonebhadra     IN     UP
    Giri

Maybe you are looking for