Line-logging and protected text on custom control, protect_lines

I have a module pool with various screens which contain texts.  Because of other requirements, it was necessary to create custom controls which show those texts as a sort of preview pane, that it, a white box which shows the text and allows one to enter new text.  Now the customer would like the text to have log lines and have it be protected.  That is to say, once you enter a text and save your work, both the log line and the new text are preserved and grayed-out allowing only new lines to be entered - you can't go back and change old lines.  Research I've done in the past leads me to believe that using the method protect_lines in the C_TEXTEDIT_CONTROL class is the way to go.  However, I have been having all kinds of trouble with it.  Are there examples which show how to use this?  For example, how do I put a protected log line in the white box, allow the customer to add a new line, protect that line on save and, at the same time, if they don't enter a new line, don't save the log line?
I've mostly accomplished the above, however, the following still eludes me:
I have used CL_GUI_TEXTEDIT class to create a custom control for text entry. I am using the PROTECT_LINES method to afix a date/time stamp and then make it non-editable. The problem is, when I am in the editable area and I hit back-arrow until the cursor jumps up to the end of the protected date/time stamp, when I begin typing again, it pulls the last part of the protected text down into the editable area. For example, if your protected text ends in a phone number, say "555-1212", after back-arrowing up to the end of it and beginning to type again, the "1212" will be down in the editable area and will be changeable. Can anyone tell me what I am doing wrong?
Edited by: Buckman Michael on Dec 3, 2008 6:37 PM

Further research has led me to believe that the PROTECT_SELECTION method solves this problem.  Specifically, if you look at include file LIQS0F50 at about line 1065 you can see how QM01/QM02 handles this on screen 7710 of SAPLIQS0 when you have line-logging turned on.

Similar Messages

  • How to display text in custom control?

    Im doing a module pool program. There I have a Input field ,if user input there, some text I have to show in custom control. I have created custom control . But how to display some text there? what method I have to use?
    I have use this code for creating custom control.
    CREATE OBJECT EDITOR_CONTAINER
          EXPORTING
            CONTAINER_NAME              = 'TEXTEDITOR'
          EXCEPTIONS
            CNTL_ERROR                  = 1
            CNTL_SYSTEM_ERROR           = 2
            CREATE_ERROR                = 3
            LIFETIME_ERROR              = 4
            LIFETIME_DYNPRO_DYNPRO_LINK = 5.
        CREATE OBJECT TEXT_EDITOR
          EXPORTING
            PARENT           = EDITOR_CONTAINER
            WORDWRAP_MODE    = CL_GUI_TEXTEDIT=>WORDWRAP_AT_FIXED_POSITION
            WORDWRAP_POSITION          = LINE_LENGTH
            WORDWRAP_TO_LINEBREAK_MODE = CL_GUI_TEXTEDIT=>TRUE.

    Hi,
    You will have to use the method 'set_text_as_r3table' to display your text in the object.
    The text will have to be passed as an internal table to the method.
    Regards,
    Ankur Parab

  • Ruler with line numbering and cury text underline

    Hi,
    I've just started programming in java and as an exercise i was trying to make an simple text editor. Uptil now i've been able to make a textarea and a menu with items and such, but i have 2 things that i'm very curious about.
    1. How can I make a vertical ruler with line numbers in it? (like in JBuilder/Eclipse editors) I'm planning on putting it next to the text so I can see at which line in the document i'm at.
    2. How can I underline (mark) text with those curly lines you often see in applications? (i.e. Marking grammar and spelling errors in MS Word or marking programming errors in editors like JBuilder/Eclipse)
    I hope that these things can be done in Java. If someone could help me out with this, i'd be very grateful.
    Kayhne

    Try this.
    regards,
    Stas
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import javax.swing.text.*;
    import java.util.*;
    class Test {
        public Test() {
            JFrame fr = new JFrame("TEST");
            fr.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            JEditorPane pane = new JEditorPane();
            pane.setEditorKit(new NewEditorKit());
            pane.setText("test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test ");
            StyledDocument doc = (StyledDocument) pane.getDocument();
            MutableAttributeSet attr = new SimpleAttributeSet();
            StyleConstants.setLineSpacing(attr, 5f);
            doc.setParagraphAttributes(0, doc.getLength(), attr, false);
            JScrollPane sp = new JScrollPane(pane);
            fr.getContentPane().add(sp);
            fr.setSize(300, 300);
            fr.show();
        public static void main(String[] args) {
            Test test = new Test();
    class NewEditorKit extends StyledEditorKit {
        public ViewFactory getViewFactory() {
            return new NewViewFactory();
    class NewViewFactory implements ViewFactory {
        public View create(Element elem) {
            String kind = elem.getName();
            if (kind != null) {
                if (kind.equals(AbstractDocument.ContentElementName)) {
                    return new JaggedLabelView(elem);
                else if (kind.equals(AbstractDocument.ParagraphElementName)) {
                    return new ParagraphView(elem);
                else if (kind.equals(AbstractDocument.SectionElementName)) {
                    return new BoxView(elem, View.Y_AXIS);
                else if (kind.equals(StyleConstants.ComponentElementName)) {
                    return new ComponentView(elem);
                else if (kind.equals(StyleConstants.IconElementName)) {
                    return new IconView(elem);
            // default to text display
            return new LabelView(elem);
    class JaggedLabelView extends LabelView {
        public JaggedLabelView(Element elem) {
            super(elem);
        public void paint(Graphics g, Shape allocation) {
            super.paint(g, allocation);
            paintJaggedLine(g, allocation);
        public void paintJaggedLine(Graphics g, Shape a) {
            int y = (int) (a.getBounds().getY() + a.getBounds().getHeight());
            int x1 = (int) a.getBounds().getX();
            int x2 = (int) (a.getBounds().getX() + a.getBounds().getWidth());
            Color old = g.getColor();
            g.setColor(Color.red);
            for (int i = x1; i <= x2; i += 6) {
                g.drawArc(i + 3, y - 3, 3, 3, 0, 180);
                g.drawArc(i + 6, y - 3, 3, 3, 180, 181);
            g.setColor(old);
    }

  • Problem with custom control and focus

    I've a problem with the focus in a custom control that contains a TextField and some custom nodes.
    If i create a form with some of these custom controls i'm not able to navigate through these fields by using the TAB key.
    I've implemented a KeyEvent listener on the custom control and was able to grab the focus and forward it to the embedded TextField by calling requestFocus() on the TextField but the problem is that the TextField won't get rid of the focus anymore. Means if i press TAB the first embedded TextField will get the focus, after pressing TAB again the embedded TextField in the next custom control will get the focus AND the former focused TextField still got the focus!?
    So i'm not able to remove the focus from an embeded TextField.
    Any idea how to do this ?

    Here you go, it contains the control, skin and behavior of the custom control, the css file and a test file that shows the problem...
    control:
    import javafx.scene.control.Control;
    import javafx.scene.control.TextField;
    public class TestInput extends Control {
        private static final String DEFAULT_STYLE_CLASS = "test-input";
        private TextField           textField;
        private int                 id;
        public TestInput(final int ID) {
            super();
            id = ID;
            textField = new TextField();
            init();
        private void init() {
            getStyleClass().add(DEFAULT_STYLE_CLASS);
        public TextField getTextField() {
            return textField;
        @Override protected String getUserAgentStylesheet() {
                return getClass().getResource("testinput.css").toExternalForm();
        @Override public String toString() {
            return "TestInput" + id + ": " + super.toString();
    }skin:
    import com.sun.javafx.scene.control.skin.SkinBase;
    import javafx.beans.value.ChangeListener;
    import javafx.beans.value.ObservableValue;
    import javafx.event.EventHandler;
    import javafx.scene.control.TextField;
    import javafx.scene.input.KeyCode;
    import javafx.scene.input.KeyEvent;
    public class TestInputSkin extends SkinBase<TestInput, TestInputBehavior> {
        private TestInput control;
        private TextField textField;
        private boolean   initialized;
        public TestInputSkin(final TestInput CONTROL) {
            super(CONTROL, new TestInputBehavior(CONTROL));
            control     = CONTROL;
            textField   = control.getTextField();
            initialized = false;
            init();
        private void init() {
            initialized = true;
            paint();
        public final void paint() {
            if (!initialized) {
                init();
            getChildren().clear();
            getChildren().addAll(textField);
        @Override public final TestInput getSkinnable() {
            return control;
        @Override public final void dispose() {
            control = null;
    }behavior:
    import com.sun.javafx.scene.control.behavior.BehaviorBase;
    import javafx.beans.value.ChangeListener;
    import javafx.beans.value.ObservableValue;
    import javafx.event.EventHandler;
    import javafx.scene.input.KeyCode;
    import javafx.scene.input.KeyEvent;
    public class TestInputBehavior extends BehaviorBase<TestInput> {
        private TestInput control;
        public TestInputBehavior(final TestInput CONTROL) {
            super(CONTROL);
            control = CONTROL;
            control.getTextField().addEventFilter(KeyEvent.KEY_PRESSED, new EventHandler<KeyEvent>() {
                @Override public void handle(final KeyEvent EVENT) {
                    if (KeyEvent.KEY_PRESSED.equals(EVENT.getEventType())) {
                        keyPressed(EVENT);
            control.focusedProperty().addListener(new ChangeListener<Boolean>() {
                @Override public void changed(ObservableValue<? extends Boolean> ov, Boolean wasFocused, Boolean isFocused) {
                    if (isFocused) { isFocused(); } else { lostFocus(); }
        public void isFocused() {
            System.out.println(control.toString() + " got focus");
            control.getTextField().requestFocus();
        public void lostFocus() {
            System.out.println(control.toString() + " lost focus");
        public void keyPressed(KeyEvent EVENT) {
            if (KeyCode.TAB.equals(EVENT.getCode())) {
                control.getScene().getFocusOwner().requestFocus();
    }the css file:
    .test-input {
        -fx-skin: "TestInputSkin";
    }and finally the test app:
    import javafx.application.Application;
    import javafx.scene.Scene;
    import javafx.scene.control.TextField;
    import javafx.scene.layout.GridPane;
    import javafx.stage.Stage;
    public class Test extends Application {
        TestInput input1;
        TestInput input2;
        TestInput input3;
        TextField input4;
        TextField input5;
        TextField input6;
        Scene     scene;
        @Override public void start(final Stage STAGE) {
            setupStage(STAGE, setupScene());
        private Scene setupScene() {
            input1 = new TestInput(1);
            input2 = new TestInput(2);
            input3 = new TestInput(3);
            input4 = new TextField();
            input5 = new TextField();
            input6 = new TextField();
            GridPane pane = new GridPane();
            pane.add(input1, 1, 1);
            pane.add(input2, 1, 2);
            pane.add(input3, 1, 3);
            pane.add(input4, 2, 1);
            pane.add(input5, 2, 2);
            pane.add(input6, 2, 3);
            scene = new Scene(pane);
            return scene;
        private void setupStage(final Stage STAGE, final Scene SCENE) {
            STAGE.setTitle("Test");
            STAGE.setScene(SCENE);
            STAGE.show();
        public static void main(String[] args) {
            launch(args);
    The test app shows three custom controls on the left column and three standard textfields on the right column. If you press TAB you will see what i mean...

  • ALV Display on the Custom Control

    Hi Friends,
    Iam developing a Module Pool program where I call a ALV grid on a custom control.
    I have only one screen in which i have a input field and a custom control.
    when I enter a material number in the input field and press ENTER the custom control should be populated with some of the material details. I have written all the logic. But the problem is when i press enter the custom control is not filled but after I press the REFRESH button present by default on the grid, the details are displayed.
    What is the problem??
    Regards,
    Raju...

    HI,
    Use the method <b>REFRESH_TABLE_DISPLAY</b> after filling the new values into <b>it_outtab</b> table. in the PBO flow logic of your Module pool program.
    <b>CALL METHOD grid1->refresh_table_display.</b>
    Regards,

  • How do I retrieve my recent calls and recent text messages after I restored the settings

    How do I retrieve my recent call log and recent text messages after I had to restore the settings?

    If they were in your most recent back up and you restore your phone to that back up, you'll get them back. If they're not in the back up, there's no way to get them back.

  • JavaFX, Display Line Chart with additional text

    Hello:
    I am new to Java and JavaFX. I have been able to create a line chart that has four series using example code from the Oracle Javafx Documentation home. Below is the syntax used to create the line chart once the series info has been populated:
    Scene scene = new Scene(lineChart,800,600);
    lineChart.getData().addAll(series1, series2, series3, series4);
    When I display the chart, I would also like to display additional text.
    My chart measures four different averages by month. I would like to use the text to give more info about each series (ex: 6 month and 1 year total avg for each series). The Line Chart and the text that I want to add do not need to be related. I will calculate the 6 & 12 month avg and list it in the text separately.
    I am struggling to find a way to display the line chart with a separate text field. If anyone can point me to some sample code that does something similar I would greatly appreciate it.
    Thanks,
    Troy

    Hi,
    My data points in my line chart are an average for a single month for each series.
    Ideally I would like a table as shown below centered under the Line Chart if possible (I was unable to use underscores or spaces to build the example. The + signs would really just be a line and the ' are used for spaces):
    ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
    ++``````````````++``Series 1```++```Series 2```++``Series 3```++``Series 4``++
    ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
    ++6 Month Avg````++```5.6`````++``````7.8 ```++ ````4.8`````++`````8.4``++
    ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
    ++12 Month Avg```++```6.9`````++``````9.3 ```++ ````2.5`````++```5.7````++
    ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
    Edited by: user8835022 on Jul 26, 2012 3:35 AM

  • Tape deck pauzes when closing Log and Capture window

    Hello,
    I've got a weird situation here. I have a Hi8 tape deck (Sony Evo 9800P) hooked up on Final Cut Pro 6 and I control it by remote.
    It works great, except when I close my Log and Capture window it sets the tape deck on pauze. Even when I already stopped the tape.
    It's not too bad, but I find it interesting to figure out why it does that.
    Does anyone experienced this before or do you have a suggestion?
    Thanks in advance

    I don't know that deck, but if it is like most sony products, you can probably change that to "stop" instead of "pause."
    When you close log and capture, you are relinquishing control of the deck and it is going to its default.

  • Custom Control Help: Draw a line and output start and end points

    I'm looking to find or make a custom control (or simple subVI) that will appear as a 100x100 unit grid and allow me to draw a line from one point to another on that grid. It will then output the (x,y) of the starting and end point of that line on the grid.  Any help or ideas?
    Thanks,
    Steve
    LabVIEW 2009 SP1
    Solved!
    Go to Solution.

    What you basically want is a loop with an event structure where you process Mouse Down, Move and Up events for your controls. There are any number of ways of implementing something like this, but this one will probably be the simplest:
    Use a multicolumn listbox or a table for your grid. Hide the scrollbars and headers.
    You can use the ActiveCell property with -2,-2 to select all cells. You can then use the cell size property to set the exact size of the cell.
    Next, you put a picture control on top of the table and color its background transparent so that the table shows through. You use property node to make sure the two are aligned to exactly the same spot and size.
    You use the mouse events on the picture control to detect the clicks and moves.
    You use the table's Point to Row Column method to translate the event's position data to a cell.
    You use the picture control VIs to draw the line on the picture based on that data.
    You can even color the selected cells in the table using the table properties.
    If you want to simplify things somewhat, you can also use the timeout event instead of the Mouse Move event to draw the line, but then you'll need to keep the timeout value in a shift register and reset it to -1 (no timeout) when the Mouse Up event happens.
    I would also suggest processing Mouse Enter and Leave events to change the cursor and cancel if the user leaves in the middle of dragging.
    Try to take over the world!

  • Billing document text in customer line item.

    Dear SD Champs,
    While posting collections from customers, our users are entering some text in the "Text" field. BSEG-SGTXT.
    Whatever text is entered over can be displayed in customer line items fbl5n.
    Users want the same facility in billing document. i.e., they want to enter some text in either the sales order or billing document. This text should be displayed in the same text field in fbl5n against the billing document.
    Kindly help.

    Hi sagar,
    If I understood you correctly, I think the best way is to set a text at sales order with a control copy to the billing document and this one with a control copy to the accounting document.
    If it is so, you only have to maintain the copy control for the sales documents.
    regards,
    Edgar

  • Dynamic screen and custom control

    Hi,
    I have to create a screen and custom control dynamically within a method and display alv grid. Is this possible?
    regards,
    Madhu

    hi,
    this is a smple program just try in this way.plz do reward points if it is of some use
    data:obj type ref to zcl_test_alv.
    parameter:p_mblnr type zbshd-mblnr.
    start-of-selection.
    set screen 100.
    *&      Module  STATUS_0100  OUTPUT
          text
    module STATUS_0100 output.
    SET PF-STATUS 'xxxxxxxx'.
    SET TITLEBAR 'xxx'.
    if obj is initial.
    create object obj
    exporting p_con = 'MATERIAL_DOC'.
    endif.
    CALL METHOD obj->get_data
        exporting p_mat = p_mblnr.
    endmodule.                 " STATUS_0100  OUTPUT
    The above is an executable program.
    zcl_test_alv is a class which u need to create in se24 according to ur requirement
    u need to define methods and attributes.
    for example there are 3 methods
    constructor
    get_data
    put_data
    method GET_DATA.
    SELECT mblnr
             mblpo
             matnr
             maktx
             meins
             menge
             waers
             dmbtr
             INTO corresponding fields of TABLE it_mm
             FROM  zbsit
             WHERE mblnr = p_mat.
    if sy-subrc = 0.
    call method put_data.
    endif.
    endmethod.
    method PUT_DATA.
    DATA : it_fldcat TYPE lvc_t_fcat.
      DATA : wa_fldcat LIKE LINE OF it_fldcat.
      DATA : it_sort TYPE lvc_t_sort,
             wa_sort LIKE LINE OF it_sort.
    CALL FUNCTION 'LVC_FIELDCATALOG_MERGE'
    EXPORTING
      I_BUFFER_ACTIVE              =
       I_STRUCTURE_NAME             = 'ZBMDC'
      I_CLIENT_NEVER_DISPLAY       = 'X'
      I_BYPASSING_BUFFER           =
      I_INTERNAL_TABNAME           = 'ZBSIT'
      CHANGING
        ct_fieldcat                  = it_fldcat[]
    EXCEPTIONS
      INCONSISTENT_INTERFACE       = 1
      PROGRAM_ERROR                = 2
      OTHERS                       = 3
    IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      EXIT.
      ELSE.
        LOOP AT it_fldcat INTO wa_fldcat.
          CASE wa_fldcat-fieldname.
            WHEN 'MBLNR'.
              wa_fldcat-reptext   = 'Material Doc no'.
            WHEN 'MBLPO'.
              wa_fldcat-reptext   = 'Item Material Doc'.
              wa_fldcat-ref_table = 'X'.
            WHEN 'MATNR'.
              wa_fldcat-reptext   = 'Material No'.
              wa_fldcat-ref_table = 'X'.
            WHEN 'MAKTX'.
              wa_fldcat-reptext   = 'Description'.
              wa_fldcat-do_sum    = 'X'.
            WHEN 'MEINS'.
              wa_fldcat-reptext   = 'UOM'.
              wa_fldcat-do_sum    = 'X'.
            WHEN 'MENGE'.
              wa_fldcat-reptext   = 'QUAN'.
              wa_fldcat-do_sum    = 'X'.
            WHEN 'WAERS'.
              wa_fldcat-reptext   = 'CurrKey'.
              wa_fldcat-do_sum    = 'X'.
            WHEN 'DMBTR'.
              wa_fldcat-reptext   = 'curr'.
              wa_fldcat-do_sum    = 'X'.
          ENDCASE.
          MODIFY it_fldcat FROM wa_fldcat INDEX sy-tabix.
        ENDLOOP.
        wa_sort-fieldname = 'MBLNR'.
        wa_sort-up        = 'X'.
        wa_sort-subtot    = 'X'.
        APPEND wa_sort TO it_sort.
    ENDIF.
    CALL METHOD o_grid->set_table_for_first_display
    EXPORTING
       i_buffer_active               =
       i_bypassing_buffer            =
       i_consistency_check           =
       i_structure_name              =
       is_variant                    =
       i_save                        =
       i_default                     = 'x'
       is_layout                     =
       is_print                      =
       it_special_groups             =
       it_toolbar_excluding          =
       it_hyperlink                  =
       it_alv_graphics               =
       it_except_qinfo               =
       ir_salv_adapter               =
      CHANGING
        it_outtab                     = it_mm[]
        it_fieldcatalog               = it_fldcat[]
        it_sort                       = it_sort
       it_filter                     =
    EXCEPTIONS
       invalid_parameter_combination = 1
       program_error                 = 2
       too_many_lines                = 3
       others                        = 4
    IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
               WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    endmethod.
    method CONSTRUCTOR.
    CREATE OBJECT o_con
        EXPORTING
           container_name      = p_con .
      IF sy-subrc = 0.
        CREATE OBJECT o_grid
          EXPORTING
             i_parent          = o_con .
      ENDIF.
    endmethod.
    Attributes are
    o_con type ref to CL_GUI_CUSTOM_CONTAINER
    o_grid type ref to CL_GUI_ALV_GRID
    it_mm type zmdoc
    to get alv grid ,in layout editor u need to create custom control
    for constructor method u should have a parameter p_con with default value as 'MATERIAL_DOC'
    Im just explaining the above program use this as reference and try.

  • How to create a custom control of a button where the look will be applied to all others but not the Boolean text?

    Hi all
    I would like to create a customized button as a master so that if I change the look of the master all other buttons will change too.
    I have done this with a custom control as a "strict type def" otherwise the look will not change BUT If I do this as a strict type def I cannot change the Boolean text anymore which should be different on every button.
    How can I create a master control of a button where the look will be applied to all others but not the Boolean text?
    Stay Hungry, Stay Foolish
    Solved!
    Go to Solution.

    Steve Chandler wrote:
    I don't think you can do that. I just looked and as I suspected the Boolean text property is read only for strict typedefs so you cannot use property nodes to change the text.
    As a workaround just make it a typedef. When you want to change the look open the typedef and make it strict, make your changes, then make it non strict again. You will have to update the Boolean text again for all instances. Kind of a pain. Maybe this is something for the idea exchange.
    Kudos for being sneaky.
    I like these creative work-arounds!
    Ben
    Ben Rayner
    I am currently active on.. MainStream Preppers
    Rayner's Ridge is under construction

  • SAP SCRIPT Header text and Item text not printing in customized PO

    Hello Experts,
                          I have copied the standard MEDRUCK to ZMEDRUCK and customized the form according to the requirement.
    I want to print the header text and Item text in my form.
    For Header text I have used :
    /: INCLUDE &EKKO-EBELN& OBJECT EKKO ID F01
    Problem 1: The text what I enter in header text is flowing only when I hit on print preview without saving the form. Once I save the SAP SCRIPT  and click on print preview the field is appearing blank. I also tried to print the form, but the field is appearing blank even on the print out.
    Problem 2: For item text the field is concatenation of  EBELN & EBELP. Can anyone suggest me how to concatenate and fetch the text in item text.

    Hi,
        Im getting an error in my subroutine pool for i_xtline which is to fetch ITEM TEXT., It says its not a in any internal table nor defined as data. How can I proceed further. I have pasted my code below. Please check and revert ASAP
    PROGRAM  ZMEDRUCK_SUBP1.
    TABLES: EKPO, EKKO.
    FORM fetch_table_data TABLES in_tab STRUCTURE itcsy
                                 out_tab STRUCTURE itcsy.
    data xname like THEAD-TDNAME.
    data i_xtline like xtline.
    clear i_xtline.
    refresh i_xtline.
    CONCATENATE EKPO-ebeln EKPO-ebelp INTO v_item_text.
    MOVE v_item_text to ITEMTXT.
    CALL FUNCTION 'READ_TEXT'
      EXPORTING
      CLIENT                        = SY-MANDT
        id                            = F01
        language                      = EN
        name                          = ITEMTXT
        object                        = EKPO
      ARCHIVE_HANDLE                = 0
      LOCAL_CAT                     = ' '
    IMPORTING
      HEADER                        =
      tables
        lines                         = i_xtline
    EXCEPTIONS
       ID                            = 1
       LANGUAGE                      = 2
       NAME                          = 3
       NOT_FOUND                     = 4
       OBJECT                        = 5
       REFERENCE_CHECK               = 6
      WRONG_ACCESS_TO_ARCHIVE       = 7
      OTHERS                        = 8
    IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    ENDFORM.

  • Folder action to find and replace text and change line feeds

    I want to use a folder action to find and replace text and change Mac carriage returns to DOS line feeds inside text files.
    The text to be replaced is: "/Users/wim/Music/iTunes/iTunes Music/Music" (without the quotes)
    This text has to be removed (i.e. replaced by an empty string)
    The text occurs many times within each file.
    The files are playlists exported from iTunes in the M3U format (which are text files). They contain Mac carriage returns. These need to be changed to DOS line feeds.
    I have found the following two perl commands to achieve this:
    To find and replace text: perl -pi -w -e 's/THIS/THAT/g;' *.txt
    To change carriage returns to line feeds: perl -i -pe 's/\015/\015\012/g' mac-file
    I know that it's possible to make a folder action with Automator that executes a shell script.
    What I want to do is drop the exported playlists in M3U format in a folder so that the folder action will remove the right text and change the carriage returns.
    My questions are:
    Is it possible to make a folder action that executes command line commands instead of shell scripts?
    What is the correct syntax for the two commands when used in a folder action shell script? Especially, how do I escape the slashes (/) in the string to be removed?
    Thanks for your help

    Ok, I've include an applescript to run a shell command. The applesript command quoted form makes a string that will end up as a single string on the bash command line.  Depending on what you want to do, you may need multiple string on the bash command lines.  I've included some information on folder actions.
    It is easier to diagnose problems with debug information. I suggest adding log statements to your script to see what is going on.  Here is an example.
        Author: rccharles
        For testing, run in the Script Editor.
          1) Click on the Event Log tab to see the output from the log statement
          2) Click on Run
        For running shell commands see:
        http://developer.apple.com/mac/library/technotes/tn2002/tn2065.html
    on run
        -- Write a message into the event log.
        log "  --- Starting on " & ((current date) as string) & " --- "
        --  debug lines
        set desktopPath to (path to desktop) as string
        log "desktopPath = " & desktopPath
        set unixDesktopPath to POSIX path of desktopPath
        log "unixDesktopPath = " & unixDesktopPath
        set quotedUnixDesktopPath to quoted form of unixDesktopPath
        log "quoted form is " & quotedUnixDesktopPath
        try
            set fromUnix to do shell script "ls -l  " & quotedUnixDesktopPath
            display dialog "ls -l of " & quotedUnixDesktopPath & return & fromUnix
        on error errMsg
            log "ls -l error..." & errMsg
        end try
    end run
    How to set up a folder action.
    1) right click on folder. click on Enable folder actions
    2) Place script in
    /Library/Scripts/Folder Actions Scripts
    3) right click on folder. click on attach folder action
    pick your script.
    Create a new folder on the desktop & try.
    You can put multiple folder actions on a folder. There are other ways of doing this.
    Here is my test script:
    on adding folder items to this_folder after receiving dropped_items
        repeat with dropped_item_ref in dropped_items
           display dialog "dropped files is " & dropped_item_ref & " on folder " & this_folder
        end repeat
    end adding folder items to
    How to  make the text into an AppleScript program.
    Start the AppleScript Editor
    /Applications/AppleScript/Script Editor.app
    In Snow Leopard it's at: /Applications/Utilities/AppleScript Editor
    Copy the script text to the Applescript editor.
    Note: The ¬ is typed as option+return.  ption+return is the Applescript line continuation characters.
    You may need to retype these characters.
    Save the text to a file as an script and do not check any of the boxes below.

  • Is there a way to create a heading with shading behind the text and thin lines above and below?

    I'm working with InDesign CS6, Windows 7.
    Is there a way, using paragraph rules, to create a heading with shading behind the text and thin lines above and below the text?
    I'd like to create headings that look like these:
    Thank you!

    I have a document where I almost do such, but without the fill. I use a Head Style which Spans Columns for this instance; it allows the haeds to flow and fill the width.
    Paragraph Rules above and below are turned on with plenty of offset.
    I tweaked my setting to accomodate your need - It required only one instance, not above and below, and changing the stroke to a double stroke. 
    It may be necessary to create a custom stroke to modify the proportion of stroke vs fill. There is a difference of thin-thin and  thick-thick, neither of which seemed perfect but might be dependent on the Character height.
    Creating custom strokes is accomplished via the Strokes Panel.

Maybe you are looking for