US legal regulation: CCATS codes used in compliance checks

Hello All,
in the US LR framework some dual-use product can need a CCATS from BIS as their ECCN (mainly 5A002* classification code) means they are fro "information security...cryprographic function, digital signature, authentication...".
1-we want to maintain that as an additional attribute of the product classification using the peculiarity code field, and using it in the license determination strategy to asisgn relevant products shipped to defined customer ship-to (see provision ENC 740.17 b ...)
2-an altenative could be to set up a separate LR for only this code...
--> do you know how US company using GTS are handling this (when concerned) ?
--> do you have soe recommendations or best practices to share?.
--> do you know if SAP Walldorf have any recomendations on that?, so far I didn't find any
--> do you have some experience on that?
thanks a lot for all comments

the issue resolved i skipped one configuration

Similar Messages

  • What is "Type of Legal Code" in legal regulation setting used for?Thanks

    There are several  options for "Type of Legal Code" in legal regulation settings.What are they used for? We found that if "others" is selected in this field for certain legal regulation, this legal regulation can't be found in the configuration of "Activate legal regulation " under legal control service or embargo service.Does anyone know what this field used for?thanks

    Define the legal regulations is done for all import and export processes you use with SAP Global Trade Services (SAP GTS).
    If, for example, you want to use the embargo, sanctioned party list screening, and license determination services in SAP GTS, you must create a legal regulation for each service.
    Type of Legal Code : help in indentifing for which purpose its used.
    for example:
    US Automated Customs Environment (ACE)
    Customs Processing - Germany (ATLAS)
    German Foreign Trade Regulations
    EU Common Agricultural Policy (CAP) - Restitution
    Customs Processing - Austria (eZoll)
    Customs Processing - Belgium
    Customs Processing - Switzerland
    Customs Processing - Denmark
    Customs Processing - France
    Customs Processing - Great Britain
    Customs Processing - Netherlands
    Export Administration Regulations
    Embargo - United Nations
    Numbering System - European Union
    Letter of Credit Processing
    North American Free Trade Agreement (CA/MX/US)
    Pan-European Agreement (EC/EFTA
    PAN-EURO-MED
    Vinmar Sanctioned Party List Screening
    Sanctioned Party List Screening
    (NCTS) Transit Procedure Austria - eZoll Transit
    (NTCS) Transit Procedure Belgium
    (NCTS) Transit Procedure Switzerland - Transit
    (NCTS) Transit Procedure Germany - ATLAS Transit
    (NCTS) Transit Procedure France - Transit
    (NCTS) Transit Procedure The Netherlands
    (NCTS) Transit Procedure Slovenia
    Others doesn't have relavance. so only i doesn't need activation.

  • Compliance Document Multiple Legal Regulations

    Export in the GTS Compliance Area....We know the FTO is based on the company code of the sales order.  And we know that the country of the shipping point or plant drives the legal regulations. However, can you have line items with different ship from countries in a document?
    I mean normally the FTO represent downstream, the customs authority, like US, CA, etc.  But having line items with different ship from countries, therefore bringing in different legal regulations, does this make sense?  Does GTS allow this scenario?
    Regards, Dean.

    Dave/Dean, the legal regs will be determined at both the item level - based on the country of origin of the shipping plant and the header level - based on the ship to partner/country of destination.  The FTO really only factors into which administrative unit preference would be done in, it doesn't factor into physical shipping location like legal determination does.
    If you create a sales order with multiple plants, it will be the country of origin for each line, which can vary vs the destination country of the ship to partner (which will be constant for all lines) that determins which legal reg to draw on.  One thing to keep in mind is that while you can have multiple plants - or even multiple ship points within the plant(s) on a single sales order - there will always only ever be a one to one plant/ship point at the delivery level.  So even if you have items shipping out of the US and MX like in your scenario on one sales order, they will create as two distinct deliveries.  Those items will be determined separately based on however you have US-GE and MX-GE regs defined.  Should you only have a block on say MX-GE portion, the US based shipping department will be able to process their portion of the order regardless of the MX block.
    In the example below you can see where I've created a sales order split between Canada and the US with each line shipping to CA.  I have materials set up within regs for each country to block orders for exports and domestic.  Lines 1 and 2 are US-CA with 4 and 5 being CA-CA.  In the log view you can see where the US line items are being determined against 4 US based regulations while the Canadian lines are only looking at the 2 Can based regs
    Hopefully that helps a little bit.  It gets even muddier if you should want to bring Import controls into place as well and have to deal with POs vs Sales orders!
    -Graham

  • Numbering Scheme for Legal Regulations

    When we assign the same Numbering  Scheme(1 scheme) to more than 2 legal regulations,
    we cannot have more than 2 Export Control Classification Numbers in GTS material master.
    (We cannot have more than 2 ECCNs for 1 item.)
    We customize bellow,
    (Legal Regulation) JPACT1-(Numbering Scheme) JPECCN1
    (Legal Regulation) JPACT2-(Numbering Scheme) JPECCN1
    (Legal Regulation) JPACT3-(Numbering Scheme) JPECCN1
    In this case, we cannnot have different Numbers for 1 item, if we have below,
    (Item) GTS10000-(ECCN) 1A001
    (Item) GTS10000-(ECCN) 2A001
    (Item) GTS10000-(ECCN) 3A001
    ->2A001,3A001 changes 1A001.
    If we have different ECCNs for 1 item, do we divide Numbering Scheme?
    (Legal Regulation) JPACT1-(Numbering Scheme) JPECCN1
    (Legal Regulation) JPACT2-(Numbering Scheme) JPECCN2
    (Legal Regulation) JPACT3-(Numbering Scheme) JPECCN3
    If you know another ideas, could you tell me the way.
    Regards,
    Naoya Kaneda.

    Hi,
    Iam little confused as to why you want to assign 2 or more ECCN's to one product.
    Multiple products with identical features and attributes can be assigned to the same ECCN's but what is the use of doing vice versa.
    I know of a concept called set numbers. Number sets enable you to group tariff numbers from several numbering schemes together. You can then assign a set to a product or multiple products to classify that product with multiple tariff numbers at the same time, to simplify the classification process.
    This not only allows cross-country grouping of tariff numbers but also cross application grouping. If you use several areas of SAP Global Trade Services, such as SAP Compliance Management and SAP Customs Management and SAP Risk Management for your import and export processing, you can group the numbering schemes for the relevant number types together in a set.
    Regards
    Vivek

  • Separate legal regulation for customers and vendors / sanctioned party list

    Hi,
    since we want to separate responsibilities and mails for checking sanctioned party lists concerning customers (sales department) and vendors (purchasing department) we would like to split business partners using different legal regulations within the GTS system.
    But customers as well as vendors are connected to both regulations after uploading, since there is only the country to separate them.
    All checks concerning sanctioned party list screening should be separated according to the responsibilities as well.
    Is there a way in customizing to solve this? If not: how best could this be done using programming?
    Thanks for your help!

    Hi Pici,
    Take a look at the BAdI Method ACTIVE_LEGAL_REGULATIONS_GET.  There you should be able to use the Partner attributes to influence which Legal Regulation is used for the checks.
    Regards,
    Dave

  • Customs Declaration - Legal Regulation incorrect

    I believe there is an issue with how the legal regulation determined during creation of an export customs declaration.  My first thought, and from what I have read, the customs declaration legal regulation is determined based of the country where the goods are physically shipped.  However, in our situation it appears the determination happens based on the country of the foreign trade organization.  Can anyone else confirm this is the case?  I have been searching the OSS site for some documentation but apparently have been unable to find the right combination of search keys.
    Our situation is this, we have a drop ship sales order where:
    Sales Org in ECC: Netherlands
    Supplying Plant:  United States
    Receiving Customer: Serbia
    We expected that the customs declaration would have determined an US legal regulation (thus determining US HTS numbers) however, instead, the document determined an EU legal regulation and therefore EU HTS codes.  The Geography tab clearly shows the country of departure as US.  Does this seem wrong to anyone else?  Am I just not understanding the proper determination method for customs declarations?
    I did debug and trace to ensure we are not overwriting this information anywhere during the transfer from ECC --> GTS, so I have ruled out code customization as an issue.  Any thoughts, comments would be appreciated.
    Thanks,
    Rachael

    Hi Rachael,
    For the Export Declaration, GTS determines the Legal Regulation from the country of the Company Code of the Billing Document.
    If that does not suit your purpose, you can over-write the data in the ERP BAdI /SAPSLL/IFEX_SD0C_R3.
    Regards,
    Dave

  • Import/Export Legal Regulation Control w/ One Legal Regulation

    Hi,
    In a separate thread, Dhillipan helped me configure a legal regulation using Country/Country Group (config activity: Activate Legal Regulations at Country/Country Group Level) which was very helpful to restrict Sales Orders / Deliveries from a specific country to a specific country group.  In addition to those export documents, I would also like to use the same legal regulation to prevent the export of inter-company purchase orders (import document) from Country BE to any country in the world. I assume I would have to reverse my logic and prevent the export of Product 123 from any country in the world to Country BE.
    What are some suggestions to leverage the existing legal regulation for both import and export control from/to BE?
    For instance...
    Sales Orders / Deliveries:
    Product 123 cannot be exported from BE to RU, AR and US, but can be exported to any other country using sales orders/deliveries (this has already been configured)
    Purchase Orders (Inter-Company):
    Product 123 cannot be exported from BE to RU, AR and US, but can be imported to any other country using I/C purchase orders.
    Thanks for your help.

    Hi Chris,
    Just to make sure my understanding is right. You need same kind of export check for Inter-company Purchase orders right? the same kind of check that we had configured for SO and Deliveries?
    In standard all purchase orders are considered under Application level MM0A, which will be shown under Legal Control Import for Imports check. Relevant outbound deliveries will be used for export check.
    So, performing export check on PO is not possible when you have this in MM0A level. There is a note available to alter the application level for I/C POs from MM0A to SD0A. But I don't think you should think of it just considering this particular requirement. But I believe your requirement will be taken care when a delivery is created for your I/C PO- Did you check that already?
    But you may give a try with following settings for the same legal regulation in addition to whatever you have setup for export.
    Country Group for RU, AR and US- Which u had created already. Activate imports check for same legal regulation at Country Group/Country level.
    LR1
             ZGRP1 --- Not activated for Import
                      BE- Activated for Import.
    This way, your STO will be blocked when there is an Import to RU, AR and US from Belgium. I assume this is what you needed.
    As you know, you will need this strategy added in your determination procedure. Just ensure there isn't any impact to the existing SO/Del level checks.
    Please try this once in sandbox. I haven't checked this in system like last time. So, I am not 100% sure this will work.
    Regards
    Dhilipan

  • Legal control--- legal regulation.

    Hi
    Can anyone please give the difference between legal control and legal regulation.
    I have little bit confusion between these two.
    please provide some examples.

    Hi Gopala, In legal control maintain master data and business transactions in accordance with the legal requirements for imports and exports. Also use monitoring and simulation tools that help to  ensure that your business is compliant with current import and export laws. Legal control includes checking business transactions for products that require licenses, as well as the check for embargo situations for these business transactions. Activate legal control for imports and exports, along with embargo checks. Whereas the legal regulation defines how the system determines suitable export licenses based on the determination sequence, license types (which differ according to the government agency), and the export control classification number (ECCN). Legal regulations for export are based on the country of departure and should therefore be activated to check for export licenses. Legal regulations for import are based on the country of destination and should therefore be activated to check for import licenses. Ashish

  • Customs Declaration: determination of Legal Regulation

    Hi, given that the determination of Legal Regs should be based on
    1Country,
    2Country of dep/country of dest,
    3Country of dep/country group of dest,
    4Country group,
    5Country group of dep/country of dest,
    6Country group of dep/country group of dest,
    On our system, using only country (no country groups are specified) the system only determines the legal regulation based on the country of the FTO which is wrong when you consider the FTO Austria selling goods from plant DE (and so legal unit)  to customer in CH.
    Here I would give
    Country of dep: DE
    Country of dest: CH
    so under rule 1 (above) the system should look at DE - ATLAS
    or under rule 2 DE and CH - ATLAS (we changed the config on legal reg determination)
    However none of the above applies, it goes and considers the country of dep = AT (from the FTO!!)
    Anyone else seen this? Anyone else fixed this?
    Cheers
    Philip

    Have sent detail to your email id please check

  • "No active legal regulations found for country US "  while trying to create the Customs Import Declaration

    Dear Experts,
    As part of creating Customs Import Declaration manually, when I selected the FTO and try to use create button I am getting error message .
    Can you please help me in this regard .
    No active legal regulations found for country US
    Ram

    Hi Ram,
    As the error message straight away tells , you need to activate Legal Regulation for Customs Management ( in standard case, it will be ACE) for US country through the below path:
    SPRO-->SAP Global Trade Services-->Customs Management-->Activate Leagl Regulation for Customs Management at Country/Country Group level
    In case of any further queries, please let me know it.
    Regards,
    Aman

  • Documentation about Legal Entities (company Code)

    Hi,
    I have found some interesting documentation about Legal Entities (company Code).
    The url is http://help.sap.com/saphelp_46c/helpdata/fr/5d/a77d9bec1111d2bc1000105a5e5b3c/content.htm .
    I would replace this documentation in its context, but I don't find where it is coming from.
    I searched in help.sap.com and I don't find the same documentation.
    Does anybody know the path for finding the same documentation from help.sap.com ?
    Or is this obsolete documentation ?

    Hi Henri,
    It seems that this documentation is not used anymore in ERP ECC5/6, but was used only for 4.6. So, it looks obsolete to me. But, you are right, it's indeed quite interesting, especially for those who start with SAP implementation.
    http://help.sap.com/saphelp_46c/helpdata/fr/7e/d42640455911d189400000e8323c4f/frameset.htm
    Regards,
    Eli

  • What is the difference between the 4 options available while we activate a Legal Regulation

    Hi All
    Please help me to understand the difference between the below 4 options available while we activate a Legal Regulation
    1.Check Dispatch (Exclusively)
    2.Check Export (Exclusively)
    3.Check Dispatch/Export (Excluding Domestic)
    4.Check Dispatch/Export (Including Domestic)
    Thanks
    Akhil..

    Hi Akhil,
    Actually, there are three different business scenario's when we talk in terms of trade. These are as follows:-
    1.Domestic Trade:- This is internal to a country and needs to adhere to only country's internal rules/regulations.
    2.Dispatch:- It is cross border trade but withing an Economic Zone of the concerned country. Economic zone is an area or group of countries to promote trade between themselves for example EU. Dispatch is further subjected to cross border trade rules/regulations but also enjoys benefits of certain agreements.
    3.Export:- When we talk in terms of cross border trade with a third country with whom we didn't have any trade relation/ agreements, that is known as an Export. Export is further subjected to more scutinisning by authorities when it is processed as compared to other's.
    Hence, to conclude Domestic trade is internal trade(within the country) while Dispatch/Export is the cross border trade subjected to more rules and regulation and keeping these in mind ,business can take a desicion to use a legal regulation for any of your above mentioned 4 options.
    Hope I answered your question.
    Regards,
    Aman

  • Which table Embargo legal regulation on customs document can be found?

    Hi,Expert:
      Do you know in which table the embargo legal regulation on customs document item can be found? In table:/SAPSLL/LEGCON, there is no embargo legal regulation information.
    Thanks

    In our company, we have defined two embargo legal regualations,for instance,EMB01 and EMB02 which are determined according to the departuring country of sales item.
    But I can not find a table in GTS which has the information regarding which embargo legal regulation is used on the sales item.In table:/SAPSLL/LEGCON, you can find the legal control related legal reguation but not embargo legal regulation.
    I am not wondering if the embargo checking result are not stored in table at all but generated as a view when you check it.

  • [b]Tutorial:[/b] Simplify Developing OLE Automation Code Using VBA

    INTRODUCTION
    Automating Office applications from Oracle Forms can be a tedious, frustrating, and time-consuming process. Because the OLE2 and CLIENT_OLE2 built-ins do not validate the automation commands that they relay, code that compiles without errors often dies at runtime with a not-so-helpful error code. This tutorial will demonstrate how to simplify the development of automation code using a tool that ships with all Microsoft Office editions -- the Visual Basic for Applications (VBA) IDE.
    The VBA IDE, a core Office component, is a full-fledged development environment featuring code completion, basic syntax highlighting, context-driven help and a runtime debugger. Its Object Browser provides a convenient means of browsing the Word object model, as well as searching by keyword.
    For those who may not interested in following this tutorial in detail, I would like to stress the usefulness of the Object Browser as a tool for inspecting the functions supported by OLE server applications and, perhaps more importantly, valid values for function arguments. Whether/not anyone buys the assertion that starting with VBA prototypes is far more productive than pounding out OLE2 code from the very start, they will find the Object Browser invaluable as a reference -- I rely on it exclusively for this sort of documentation.
    A BRIEF INTRODUCTION TO THE VBA IDE & THE OBJECT BROWSER UTILITY
    Try this:
    1. Open Word
    2. Launch the VBA IDE by pressing <Alt><F11>
    3. Open the Object Browser by pressing <F2>
    The Object Browser allows you to visually navigate Word's class hierarchy. Its user interface is a bit crowded, so controls are unlabeled. Hovering the mouse cursor above a control will display a tooltip explaining that control's purpose. The browser's scope can be narrowed by using the Project/Library combo. Typing a keyword or substring in the Search Text combo and clicking on the Search button will cause all classes/members whose name contains the specified search text to be listed in the Search Results pane. Selecting an item from this list will update the two panes below it, showing the selected class, and its members. Beneath the Classes and Members panes is an untitled pane, gray in color, which displays details for the selected class/member, including hyperlinks to relevant information such as arguments, their types and allowable values. If Visual Basic Help is installed, pressing <F1> will display help on a selected class/member. (This feature can be installed from your Office install CD, if necessary.)
    NOTE: While it is possible to cut-and-paste the code examples that follow, I highly recommend that they be typed in by hand. Doing so will provide a better understanding of how the IDE's code completion behaves. Use code completion most efficiently by not using the mouse or <Enter> key when selecting from completion lists. Instead, just type enough letters to select the desired list element, then continue along as if you had typed the entire element, typing the next operator in your statement. It really is slick!
    HELLO WORLD - VBA-STYLE
    1. Open Word
    2. Launch the VBA IDE by pressing <Alt><F11>
    3. Select Module from the Insert menu.
    4. In the blank area that appears, enter the following code:
      Public Sub HelloWorld()
          Documents.Add
          Selection.TypeText ("Hello, world!")
      End Sub5. Press <F5> to run the code.
    If you switch back to Word by pressing <Alt><F11>, there should appear a newly-created document containing the text Hello, world!.
    A MORE AMBITIOUS EXAMPLE
    In this example, we will launch Word, type some text, and alter its formatting. For the purposes of this tutorial, consider it the process we wish to automate from within Forms.
    1. If Word is running, close it.
    2. Open any Office application except Word, such as Excel, Outlook or PowerPoint
    3. Launch the VBA IDE by pressing <Alt><F11>.
    4. Select References from the Tools menu -- a dialog should pop up.
    5. From within this dialog, locate and select Microsoft Word <version> Object Library, then click OK.
    6. Select Module from the Insert menu.
    7. In the blank area that appears, enter the following code:
    Public Sub LaunchWord()
        Dim app As Word.Application
        Set app = CreateObject("Word.Application")
        app.Visible = True                          '!!! IMPORTANT !!!
        app.Documents.Add
        With app.Selection
            .TypeText "This is paragraph 1."
            .TypeParagraph
            .TypeText "This is paragraph 2."
            .TypeParagraph
            .TypeText "This is paragraph 3."
        End With
        With ActiveDocument
            .Paragraphs(1).Range.Words(3).Bold = True
            .Paragraphs(2).Range.Words(3).Italic = True
            .Paragraphs(3).Range.Words(3).Underline = True
        End With
    End Sub8. Press <F5> to run the code.
    A new Word session should have been launched. Switch to it, to view the results of our handiwork!
    TAILORING VBA CODE INTENDED FOR OLE2 CONVERSION
    Now, things get a bit uglier. The code listed above gives a good idea of how concise VBA code can be, but With blocks and chained object references do not translate readily into OLE2 code. Here's the same process, rewritten in a more OLE2-friendly style. Note the numerous intermediate object references that have been declared.
    Public Sub LaunchWord()
        Dim app As Word.Application
        Dim doc As Word.Document
        Dim docs As Word.Documents
        Dim pars As Word.Paragraphs
        Dim par As Word.Paragraph
        Dim wrds As Word.Words
        Dim sel As Word.Selection
        Dim rng As Word.Range
        Set app = CreateObject("Word.Application")
        app.Visible = True                          '!!! IMPORTANT !!!
        Set doc = app.Documents.Add
        Set sel = app.Selection
        sel.TypeText "This is paragraph 1."
        sel.TypeParagraph
        sel.TypeText "This is paragraph 2."
        sel.TypeParagraph
        sel.TypeText "This is paragraph 3."
        Set pars = doc.Paragraphs
        'select third word of first paragraph and make it bold
        Set par = pars.Item(1)
        Set rng = par.Range
        Set wrds = rng.Words
        Set rng = wrds.Item(3)
        rng.Bold = True
        'select third word of second paragraph and italicize it
        Set par = pars.Item(2)
        Set rng = par.Range
        Set wrds = rng.Words
        Set rng = wrds.Item(3)
        rng.Italic = True
        'select third word of second paragraph and underline it
        Set par = pars.Item(3)
        Set rng = par.Range
        Set wrds = rng.Words
        Set rng = wrds.Item(3)
        rng.Underline = True
    End Sub
    TRANSFORMATION: CONVERTING VBA CODE INTO PL/SQL
    Here is the PL/SQL counterpart to our previous VBA routine. Compare printouts of the two and note their similarities. Notice the need for argument lists -- this causes the code to fluff up quite a bit, and really interferes with readability.
    PROCEDURE LAUNCH_WORD IS
      v_app OLE2.OBJ_TYPE;     -- Application
      v_doc OLE2.OBJ_TYPE;     -- Document
      v_docs OLE2.OBJ_TYPE;    -- Documents collection
      v_pars OLE2.OBJ_TYPE;    -- Paragraphs collection
      v_par OLE2.OBJ_TYPE;     -- Paragraph
      v_wrds OLE2.OBJ_TYPE;    -- Words collection
      v_sel OLE2.OBJ_TYPE;     -- Selection
      v_rng OLE2.OBJ_TYPE;     -- Range
      v_args OLE2.LIST_TYPE;   -- OLE2 argument list
    BEGIN
      /* launch Word and MAKE IT VISIBLE!!! */ 
        v_app := OLE2.CREATE_OBJ('Word.Application');
        OLE2.SET_PROPERTY(v_app, 'Visible', TRUE);
      /* initialize key object references */ 
        v_docs := OLE2.GET_OBJ_PROPERTY(v_app, 'Documents');
        v_doc := OLE2.INVOKE_OBJ(v_docs, 'Add');
        v_sel := OLE2.GET_OBJ_PROPERTY(v_app, 'Selection');
      /* type first paragraph */
        v_args := OLE2.CREATE_ARGLIST;
        OLE2.ADD_ARG(v_args, 'This is paragraph 1.');
        OLE2.INVOKE(v_sel, 'TypeText', v_args);
        OLE2.DESTROY_ARGLIST(v_args);
        OLE2.INVOKE(v_sel, 'TypeParagraph');
      /* type second paragraph */
        v_args := OLE2.CREATE_ARGLIST;
        OLE2.ADD_ARG(v_args, 'This is paragraph 2.');
        OLE2.INVOKE(v_sel, 'TypeText', v_args);
        OLE2.DESTROY_ARGLIST(v_args);
        OLE2.INVOKE(v_sel, 'TypeParagraph');
      /* type third paragraph */
        v_args := OLE2.CREATE_ARGLIST;
        OLE2.ADD_ARG(v_args, 'This is paragraph 3.');
        OLE2.INVOKE(v_sel, 'TypeText', v_args);
        OLE2.DESTROY_ARGLIST(v_args);
      /* set reference to Paragraphs collection */
        v_pars := OLE2.GET_OBJ_PROPERTY(v_doc, 'Paragraphs');
      /* select third word of first paragraph and make it bold */
        v_args := OLE2.CREATE_ARGLIST;
        OLE2.ADD_ARG(v_args, 1);
        v_par := OLE2.INVOKE_OBJ(v_pars, 'Item', v_args);
        OLE2.DESTROY_ARGLIST(v_args);
        v_rng := OLE2.GET_OBJ_PROPERTY(v_par, 'Range');
        v_wrds := OLE2.GET_OBJ_PROPERTY(v_rng, 'Words');
        v_args := OLE2.CREATE_ARGLIST;
        OLE2.ADD_ARG(v_args, 3);
        v_rng := OLE2.INVOKE_OBJ(v_wrds, 'Item', v_args);
        OLE2.SET_PROPERTY(v_rng, 'Bold', TRUE);
      /* select third word of second paragraph and italicize it */
        v_args := OLE2.CREATE_ARGLIST;
        OLE2.ADD_ARG(v_args, 2);
        v_par := OLE2.INVOKE_OBJ(v_pars, 'Item', v_args);
        OLE2.DESTROY_ARGLIST(v_args);
        v_rng := OLE2.GET_OBJ_PROPERTY(v_par, 'Range');
        v_wrds := OLE2.GET_OBJ_PROPERTY(v_rng, 'Words');
        v_args := OLE2.CREATE_ARGLIST;
        OLE2.ADD_ARG(v_args, 3);
        v_rng := OLE2.INVOKE_OBJ(v_wrds, 'Item', v_args);
        OLE2.SET_PROPERTY(v_rng, 'Italic', TRUE);
      /* select third word of second paragraph and underline it */
        v_args := OLE2.CREATE_ARGLIST;
        OLE2.ADD_ARG(v_args, 3);
        v_par := OLE2.INVOKE_OBJ(v_pars, 'Item', v_args);
        OLE2.DESTROY_ARGLIST(v_args);
        v_rng := OLE2.GET_OBJ_PROPERTY(v_par, 'Range');
        v_wrds := OLE2.GET_OBJ_PROPERTY(v_rng, 'Words');
        v_args := OLE2.CREATE_ARGLIST;
        OLE2.ADD_ARG(v_args, 3);
        v_rng := OLE2.INVOKE_OBJ(v_wrds, 'Item', v_args);
        OLE2.SET_PROPERTY(v_rng, 'Underline', TRUE);
    END;
    REFACTORING FOR REUSABILITY AND READABILITY
    While the previous procedure runs without errors, it suffers from poor readability which, in turn, makes it difficult to maintain. Here, we address those issues by moving repetetive low-level operations into separate procedures.
      PROCEDURE LAUNCH_WORD IS
        v_app OLE2.OBJ_TYPE;    -- Application
        v_doc OLE2.OBJ_TYPE;    -- Document
        v_docs OLE2.OBJ_TYPE;   -- Documents collection
        v_sel OLE2.OBJ_TYPE;    -- Selection
        v_args OLE2.LIST_TYPE;  -- OLE2 argument list
      BEGIN
        /* launch Word and MAKE IT VISIBLE!!! */ 
          v_app := OLE2.CREATE_OBJ('Word.Application');
          OLE2.SET_PROPERTY(v_app, 'Visible', TRUE);
        /* create a new Word document */ 
          v_docs := OLE2.GET_OBJ_PROPERTY(v_app, 'Documents');
          v_doc := OLE2.INVOKE_OBJ(v_docs, 'Add');
          v_sel := OLE2.GET_OBJ_PROPERTY(v_app, 'Selection');
        /* add a few paragraphs */
          PRINT_PARAGRAPH(v_sel, 'This is paragraph 1.');
          PRINT_PARAGRAPH(v_sel, 'This is paragraph 2.');
          PRINT_PARAGRAPH(v_sel, 'This is paragraph 3.');
        /* apply formatting */
          APPLY_FORMATTING(v_doc, 1, 3, 'Bold', TRUE);
          APPLY_FORMATTING(v_doc, 2, 3, 'Italic', TRUE);
          APPLY_FORMATTING(v_doc, 3, 3, 'Underline', TRUE);
      END;
      PROCEDURE APPLY_FORMATTING(
        v_doc OLE2.OBJ_TYPE,
        v_paragraph_num NUMBER,
        v_word_num NUMBER,
        v_attribute VARCHAR2,
        v_value BOOLEAN) IS
        v_pars OLE2.OBJ_TYPE;   -- Paragraphs collection
        v_par OLE2.OBJ_TYPE;    -- Paragraph
        v_wrds OLE2.OBJ_TYPE;   -- Words collection
        v_rng OLE2.OBJ_TYPE;    -- Range
        v_args OLE2.LIST_TYPE;  -- OLE2 argument list
      BEGIN
        /* set reference to Paragraphs collection */
          v_pars := OLE2.GET_OBJ_PROPERTY(v_doc, 'Paragraphs');
        /* get specified paragraph */   
          v_args := OLE2.CREATE_ARGLIST;
          OLE2.ADD_ARG(v_args, v_paragraph_num);
          v_par := OLE2.INVOKE_OBJ(v_pars, 'Item', v_args);
          OLE2.DESTROY_ARGLIST(v_args);
        /* get words for specified paragraph */
          v_rng := OLE2.GET_OBJ_PROPERTY(v_par, 'Range');
          v_wrds := OLE2.GET_OBJ_PROPERTY(v_rng, 'Words');
        /* apply formatting to word found at specified index */
          v_args := OLE2.CREATE_ARGLIST;
          OLE2.ADD_ARG(v_args, v_word_num);
          v_rng := OLE2.INVOKE_OBJ(v_wrds, 'Item', v_args);
          OLE2.SET_PROPERTY(v_rng, v_attribute, v_value);
      END;
      PROCEDURE PRINT_PARAGRAPH(v_sel OLE2.OBJ_TYPE, v_text VARCHAR2) IS
        v_args OLE2.LIST_TYPE;
      BEGIN
        v_args := OLE2.CREATE_ARGLIST;
        OLE2.ADD_ARG(v_args, v_text);
        OLE2.INVOKE(v_sel, 'TypeText', v_args);
        OLE2.DESTROY_ARGLIST(v_args);
        OLE2.INVOKE(v_sel, 'TypeParagraph');
      END;
    CONCLUSION
    It is my hope that this tutorial, despite it's introductory nature, has demonstrated the value of the VBA IDE, the ease with which automation processes can be prototyped using VBA, the noticeable similarity between VBA automation routines and their Forms PL/SQL counterparts, and the advantages of testing automation processes within the VBA IDE. Please feel free to follow up with any specific questions or concerns you may have.
    Thanks,
    Eric Adamson
    Lansing, Michigan
    FINAL NOTE: These examples use the OLE2 built-in, and will operate correctly when called from forms running in the Form Builder OC4J. Deploying them to an Oracle Application Server will launch Word on the server itself (if available), which is usually not the developer's intent! Automating Word client-side via web forms requires adding WebUtil support. Adapting the code for WebUtil is trivial -- just replace all instances of OLE2 with CLIENT_OLE2. Adapting forms for WebUtil and configuring OLE support into your Oracle Application Server, however, are beyond the scope of this tutorial.
    REVISION HISTORY
    This promises to be something of a 'living document'. I've snuck changes through without comment in the past, but in the future, I'll try to document significant changes here.
    2006-08-21
      * Prefaced boring subject line with text: 'Tutorial:' to clarify purpose
      * Added emphasis on value of Object Browser as a reference

    Thanks James, for your kind words. I do hope this information will help folks out. I honestly believe that tinkering around in the VBA IDE will prove highly gratifying for automation developers. It can be assured that learning to make Word jump through hoops is much more straight-forward in this environment. I'm not one for mottos, but if I were pressed for a cheesy motto, I would say: First, make it work. Then, make it work in Oracle!
    Once the idea has sunk in, that Visual Basic routines for automating Word are exact analogs to their OLE2 counterparts, we can remove keywords like Oracle and PL/SQL from our Google searches on Word automation which, at least in this context, are the proverbial kiss of death. Suddenly we find ourselves liberated by the possibility of steal-, ahem... borrowing ideas from the Visual Basic* community!
    As for links, my link of choice is invariably http://groups.google.com -- if you don't already use it at least ten times a day, you must try it. This is the venerable USENET archive, including the holdings of now-extinct DejaNews. Another possible site of interest is http://word.mvps.org/FAQs/MacrosVBA, which may serve as a good starting point for those who wish to learn how to do fancy tricks with Word using VBA.
    If these links don't prove immediately helpful, please feel free to give specifics on the sort of operations you are interested in automating, and I'll see if I can post an example that addresses it.
    Regards,
    Eric Adamson
    Lansing, Michigan
    PS: I do hope, as people read my posts, with every other acronym being VBA, that they are not mistakenly hearing a call to learn Visual Basic. I say this, not because I believe learning VB would be a Bad Thing, but because I assume that few of us feel we have the time to learn a new programming language. Despite having come to the Oracle camp already knowing VB/VBA, and having acquired a fair bit of experience with automating Office applications as an Access developer, I remain confident that what I am suggesting people attempt does not rise to the level of learning a language. What I am suggesting is that they learn enough of the language to get by.
    *VB vs. VBA
    Just a quick word on this, as readers may wonder why I seem to use these terms interchangeably. Visual Basic (VB) can refer to either a development platform or a programming language. Visual Basic for Applications (VBA) is a language -- more precisely, it is a subset of the Visual Basic language. One purchases VB, usually quite intentionally. VBA is included with Microsoft Office, as is VBA's development environment, the VBA IDE. The key distinction between VB and VBA is that VBA cannot be used to create self-contained executables. Rather, VBA relies on VBA-enabled applications, such as Microsoft Office applications, to serve as a container for VBA code, and to provide a runtime environment for that code. For the purposes of discussing OLE Automation, VB and VBA are quite interchangeable.

  • Error in linking C++ STL code  using CC 5.0 on Solaris 2.6

    Hi All,
    When building a shared dynamic library from C/C++ code using
    STL features, I get an a link error, referring to the STL objects in
    use.
    I use CC WorkShop C++ Compiler 5.0 running on Solaris 2.6.
    For example:
    using a vector<int> we get :
    Undefined Symbol
    __1cDstdGvector4Cin0AJallocator4Ci___M__insert_aux6Mpirki_v_
    In File aaa.o
    using a multimap<int,int> we get :
    Undefined Symbol
    __1cH__rwstdJ__rb_tree4CinDstdEpair4CkiCi__n0AL__select1st4n0C_Ci__n0BEless4Ci__n0BJallocator4n0C____U__deallocate_buffers6M_v_
    In File aaa.o
    etc.
    Switching (for testing) from shared lib to an exe does not seem
    to solve this issue.
    Same goes for toggling libCstd & libCrun's link mode (dyn/stat).
    Any suggestions would be appreciated!
    Thank you,
    Gilad

    Hi Gilad,
    I have a suggestion concerning the std::vector::__insert_aux error:
    http://forum.java.sun.com/thread.jspa?forumID=850&threadID=5069680
    Some recommended link options are provided in:
    http://forum.java.sun.com/thread.jspa?forumID=850&threadID=5104725
    Hope this is useful.
    Bye.

Maybe you are looking for

  • What is the best software for creating SCC/MCC files for closed captioning in Premiere pro?

    I have experiemented with the demo version of MacCaption to create SCC/MCC files that I am importing into Premiere Pro for Closed Captioning. It seems to work okay, but before I purchase it I was wondering if it is the best software choice for my wor

  • How can I select number of mails that stall be shown in the Inbox

    I have an mailaccount synchronised with my Outlook account. But in the Inbox  (on the IPad) only the latest 50 mails are available. How can I increase this number?

  • Preinstalled dictionary is not working on 808

    Hi I was using Nokia's preinstalled dictionary from a long time but I update my phone on 14th feb afterthat it is not working. The problem is that as I'm an Indian so I need Hindi support for some english words. But after that update in place of Hind

  • Using Timestamp Object with day light saving time

    Hi, I am getting problem while using timestamp object with daylight saving time. I am in 'Europe/London' time zone. The summer time for this year starts on 30 March(last sunday) at 0200 hours. For hour 30/03/2003 01:00, I created a date object using

  • Gradient Mesh Help

    I like the idea of the tool, but whenever I could really use apply it, it seems I mess with it way too much. My particular problem at the moment is shading a kind of boomerang shape...like the sun was hitting it from the top. I draw the boomerang sha