Dynamic Standard text - Appending text with variable

Dear All,
We have a dynamic standard text. The text is being created based on sales order (I don't know how this has been created). Now I want to add text inside the standard text. That text will also contain variable.
Example: "This is a valid sales order 100010000". This is a standard text where the sales order value is fed dynamically, I don't know how?
Now the objective is to add another field "abcd" in the standard text with some other fixed texts. Eg. "I want to add my name sy-uname". So the entire text should be as:-
"This is a valid sales order 100010000. I want to add my name sy-uname."
1.  I am not sure how to identify the original standard text. I would like to add second line there.
2.  I would like to pass variable value dynamically in the standard text.
Please can you help me out in solving the issues.
Best wishes,
Atanu

Hi
Could you please be clear with your question so that some one can provide you with best solution quickly.
I am assuming that when your sales order is being created at the same time ,your dynamic standard text is generated .So now you want to amend this standard text just after the sales order is saved.If so then
Just go to the sales order text tab in change mode and click on the text eidtor window ,it will take to you sapscript editor ,Then from menu Goto-Header .From here you get the details of
Text Name      
Language       
Text ID        
Text Object  
Now Find the userexit after save and their use a read_text function module and read the standard text which is alreday created and take down in it_lines table and modify the text by appending your sy-uname line as second line or you can concetante on the same line. Now then use the save_text function module and save the standard text.
You can use the exit MV45AFZZ In that routine FORM userexit_save_document..
Hope this help you to resolve the issue.
Cheers
Joginder

Similar Messages

  • Anyway to Find text and replace with variable FM10?

    I've just been informed that the current documentation set I've done will have different versions. I've created a brand variable, but I was wondering whether there was a quick way to find the text I need to convert, then replace it with the variable I've created?
    Mark

    Unless Fm10 is different than FM7 in this regard, you can copy an instance of the NewBrand variable in the text flow, then do an
    Edit > Find/Change
    Find [Text:] [OldBrand]
    Change [By Pasting]
    The usual issue is that each paste is not just pasting the variable, but also pasting the formats of the source instance of the variable. If all instances of the target text are the same format, say "Body", then this is not a problem.
    Otherwise, use the [Change & Find] button. Tweak formats as you go.
    I imagine that there are aftermarket enhancements for this. In FM10, you might even be able to script it, but it the number of changes is manageable, [Change & Find] suffices.

  • Dynamic file send port configure with variable store path location

    hi ,
    i done like dynamic file send port:
    Port_7(Microsoft.XLANGs.BaseTypes.Address)="sw"; --> sw is path location  string type variable
    Port_7(Microsoft.XLANGs.BaseTypes.TransportType)="FILE";
    here sw is path location :C:\Users\00134\Desktop\Rec\sqltest\senddate.
    but it is not working where im wrong?

    try this 
    Port_7(Microsoft.XLANGs.BaseTypes.Address)="file://"+
    sw +@"\%MessageID%.xml";

  • Text info  in the variable selection screen

    Hello
      I want to show some text info together with variable selection screen. Is it possible in WAD ? How to do it?
    Help please.
    Thanks.

    Rani,
    Basically its not suggestable by SAP that to modify the variable screen, since that has been directly delivered by SAP Object... If you still wants to modify the variable screen then your F4 will not work ijn the variable screen... Usually dont go and modify your variable screen..
    Rgds,
    Gattu

  • Using alerts with variables-"dynamic text" not working

    Hello all,
    I'm triggering an alert from a BPM, and have set the flag "dynamic text" on for the alert category associated with it. I'm doing it in a similar way to the blog 1382 by Michal:
    [/people/michal.krawczyk2/blog/2005/03/13/alerts-with-variables-from-the-messages-payload-xi--updated|/people/michal.krawczyk2/blog/2005/03/13/alerts-with-variables-from-the-messages-payload-xi--updated]
    The only difference is that I'm just assigning a fixed text instead of a payload element to the container element, which I've defined as simple type - string.
    However, the text of the alert doesn't show anything. I'm getting an email with just "Process <id>" as the subject and "Alert ID: <number>" in the body of the email (the same in the Alert Inbox).
    I'm starting to think that there could be something wrong in PI 7.1 which I'm using, as I've configured other alerts in scenarios without BPM without problem.
    Thanks for your suggestions!

    I've solved it using an alert from the Enterprise Services Builder (Integration Repository). It's a new feature in PI 7.1. It seems the tab "Container" in the alert category didn't exist before (that's why you don't find it in the weblogs of Michal and others) and now you have to use it.

  • Importing a text file with variable values into web reporting

    Hello,
    I'm looking for a possibility to import values from a text file into a variable selection in Web reporting.
    With BEx reporting in Excel this is possible, by clicking on the multiple selection button in the variable popup screen, and subsequently selecting the "Import from Text file" button.
    However, this function seems not to be available for web-reporting...
    It would be great if someone could help me out with this!
    Thanks & regards,
    Arvid

    Hi,
    we could resolve this issue, so i thought it may also be helpful for others:
    In our example we used a file with numbers for materials. This file is stored somewhere in a directory, to which SAP BI must have authorization to read.
    The file looks something like this:
    4711
    4712
    4713
    4714
    The file is named "import.txt" and lays in directory "/usr/sap/EC6/files/bi/"
    *&  Include           ZXRSRU01
    * global variables
    Data: intern_range LIKE LINE OF i_t_var_range,
          l_s_range    TYPE rsr_s_rangesid,
          line(100)    TYPE c,
          p_file(128)  TYPE c,
          length_rangelow  type i,
          tmp_rangelow     like l_s_range-low.
    * internal tables for selection-transfer from transaction
    * Data: BEGIN OF it_file occurs 0,
    *        it_p_file(128) TYPE c,
    *      END of it_file.
    IF i_step = 1.
    ** variables can be changed or set before pop-up appears
      CASE i_vnam.
    * take material from external file to selection-list
         WHEN 'ZSD_UPMA'.
    ** call of transaction, with which the path can be set
    *CALL TRANSACTION 'ZBW_VARIABLE' using it_file
    *MODE 'A'      " call should be visible, so that variable can be set
    *UPDATE 'S'.   " first transaction, then processing
    ** Der Pfad, der in dem Selektionsbild eingegeben wird, wird an die Variable übergeben
    ** Der Set-Parameter ist in Report ZSD_SELECT_VARIABLE
    *  get parameter id 'VAR' field p_file.
    p_file = '/usr/sap/EC6/files/bi/import.txt'.
    * further handling of variable in BI
          OPEN DATASET p_file FOR INPUT IN TEXT MODE ENCODING DEFAULT.
          IF sy-subrc = 0.
            READ DATASET p_file INTO line.
            WHILE sy-subrc = 0.
              IF line(2) <> '//'.
                l_s_range-sign = 'I'.
                l_s_range-opt  = 'EQ'.
                l_s_range-low  = line.
    * fill with leading Zeros
    * in variable tmp_rangelow the value from l_s_range-low is taken
        tmp_rangelow    = l_s_range-low.
    * read the length
        length_rangelow = strlen( tmp_rangelow ).
    * in our case: material has 18 characters
        while length_rangelow lt 18.
          CONCATENATE '0' tmp_rangelow INTO tmp_rangelow.
          length_rangelow = length_rangelow + 1.
        endwhile.
    * initialize l_s_range-low
        clear l_s_range-low.
    * set with filled values
        l_s_range-low = tmp_rangelow.
    * transfer to structure
                APPEND l_s_range TO e_t_range.
              ENDIF.
              READ DATASET p_file INTO line.
            ENDWHILE.
          ENDIF.
          CLOSE DATASET p_file.
        ENDCASE.
    ELSEIF i_step = 2.
    ** in step 2 all variable values from pop-up input can be processed or
    ** User Exit variables can be derived
    * UserExit Ende.
    ENDIF.
    Hope i could help!
    Best regards,
    Tobias

  • Dynamic Standard text in SmartForms

    Hi,
    I have requirwemnt where I need to retrive the data from the Standard text to display.
    But it variews based on SalesOrge and Comany Code u2018Zxxxx_SALES_yyyyu2019 here XXXX is SalesOrge and YYYY Company code.
    How to call the standard text Dynamically in Samrtform?
    Regards
    Irfan

    Hi,
    For displaying standard text dynamically, just follow the following steps:
    1. Create a text element and in general attributes give type as Include Text.
    2. Instead of providing any static Standard text in Text Name field, you need to click on the arrow button pointing right, which is for Dynamic Field Value. There you can provide your variable as &VARIABLE&, which contains the standard text name based on the conditions.
    3. Pass value statically like Text Object-TEXT,  Text ID - ST , Language - EN or else you can passs them dynamically as per your requirement.
    As you will be passing variables in order to print dynamic standard texts, it is better to check the option "No error if no text exists".
    Karthik
    Edited by: Karthik S on Sep 2, 2010 2:40 PM

  • Smartforms : print standard texts or texts out of document with command in.

    We used to have an output via Sapscript (printout of a purchase order) and the output was containing standard texts or text out of the purchase order, which contains commands (a test in the standard text or an include of another standard text). This text was correctly printed via sapsript, command were taken into account.
    Now we have a new output for the purchase order which is working with smartforms. When working in the smartforms with a text type 'include text', commands in the text are not working.
    When working with smartforms, is it not possible to include texts (out of the STXH table) which contains commands? These commands are not taken into account.
    Thanks.

    Thanks for the answers!
    Example how they work here : in the material master, purchasing text => somtimes include of a 'standard' text. This to avoid typing the text in all materials which use this text. We can avoid this by instead of including the text, to 'append' the standard text.
    Also in some standard texts, some tests were done (on output type, purchasing organisation,.....) which we can change by reading the text in the print program and building those tests in the print program itself.
    I just wanted to be sure that there was a possibility or not in Smartforms to work like that because we worked like this using sapscripts and it worked fine.
    We will change this way of working and build the logic into the print program. We will inform the master data team not to use the 'include' command into a material master text but instead append the standard text directly into the material master text.
    Best regards,
    Ann.

  • Problem with append += text in Text Field

    Hi guys
    i have a problem with append text.
    I have one array which contain some city names, like CityArea=["NAME 1", "NAME2" ...etc];
    Then i have one String and one Text Field.
    Using for loop im getting right results. But when im running script again then im getting  same text again.
    F.ex.
    First time:
    City name: Name 1
    City name: Name 2
    Second time:
    City name: Name 1
    City name: Name 2
    City name: Name 1
    City name: Name 2
    I have tried to make TextField to and String to Null and delete it, but it's appearing again.. :/
    How to avoid this?
    Here is script:
    for (var i1:int = 0; i1 < CityArea.length; i1++)
      _CityAreaString1 += "<P ALIGN='LEFT'><FONT FACE='Verdana' SIZE='32' COLOR='#ffffff'>        "+CityArea[i1]+"</FONT></P>";
      _CityAreaString1 += "<P ALIGN='LEFT'><FONT FACE='Verdana' SIZE='5' COLOR='#ffffff'><BR></FONT></P>";
    _CityAreaTF1 = new TextField();
      _CityAreaTF1.border = true;
      _CityAreaTF1.wordWrap = true;
      _CityAreaTF1.multiline = true;
      _CityAreaTF1.selectable = false;
      _CityAreaTF1.antiAliasType = AntiAliasType.ADVANCED;
      _CityAreaTF1.name = "CityAreaTF1";
      _CityAreaTF1.embedFonts = true;
      _CityAreaTF1.htmlText = _CityAreaString1.toUpperCase();

    I think i found why.
    There was no problem with TextField.
    There was a problem with Array. "CityArea"
    So each time I executed script it added new string in Array. And that is because i got like:
    TextField
    City 1
    City 2
    City 1
    City 2
    Running this script is Ok:
    for (var i1:int = 0; i1 < CityArea.length; i1++)
      _CityAreaString1 += "<P ALIGN='LEFT'><FONT FACE='Verdana' SIZE='32' COLOR='#ffffff'>        "+CityArea[i1]+"</FONT></P>";
      _CityAreaString1 += "<P ALIGN='LEFT'><FONT FACE='Verdana' SIZE='5' COLOR='#ffffff'><BR></FONT></P>";
    But outside of this for loop there is another for loop for adding Cities in CityArray.
    I fixed it by adding empty array at the start of function
    function myFunc():void
    CityArea = [ ]; // Empty array fixed this issue
    // LOOP FOR ADDING SHOPS IN CITY AREA
    for (var j:int = 0; j < _Shops; j++)
    CityArea.push(_Shop);
    // FOR LOOP TO ADDING SHOPS IN STRING
    for (var i1:int = 0; i1 < CityArea.length; i1++)
      _CityAreaString1 += "<P ALIGN='LEFT'><FONT FACE='Verdana' SIZE='32' COLOR='#ffffff'>        "+CityArea[i1]+"</FONT></P>";
      _CityAreaString1 += "<P ALIGN='LEFT'><FONT FACE='Verdana' SIZE='5' COLOR='#ffffff'><BR></FONT></P>";
    Thank you for your help kglad

  • Missing texts in WEB with F4-help combined with variable input.

    I've defined a characteristic with text : short text, medium length text and long text. The texts are language independent.
    I've defined a variable for this characteristic and I've defined a BEX-report that provides a variable-filter for this characteristic in the filter area. I've also set the property  <b>Display as</b> to  <i>text</i> or <i>Key  and Text</i>
    When I start the report the prompt-window appears and then I can perform F4 on the input field for this characteristic. Then a selection box opens showing the key and all texts - short desription, medium descr. and long desc.
    If I use this report in the web-Application designer or if I launch this report directly in the WebBrowser I'll also get a selection box <b>but no texts appear.</b>
    What can  I do to see these texts also in WEB ? Where can I influence the search help for the web (in BEX it works perfectly) ?
    Additional information: By defining the info object there is a tab for Business Explorer settings. For general settings I've choosen <b>Text</b> for the property <i>Display</i>. What is really strange is that in Bex-Explorer the property <b>Display as</b> always shows <b>Key</b> as a default although I've entered <b>Text</b> in RSA1. I've also inspected other characteristics where there are no missing texts. Here I've found out that in the info object there is <b>Text</b> choosen as attribut for Display -> in the Bex itself <b>Text</b> is shown as a default too.
    Message was edited by: Stefan Vogler
    Message was edited by: Stefan Vogler

    Hello there,
    I am having a similar problem but I have found this is due to either of two reasons.
    1) The object is compounded
    2) The compounded object is authorisation relavant and the security is stopping the masterdata being read properly.
    Hope this helps narrow down your search.
    Paul

  • How can I do a multiple record data merge, but specify that a specific text frame with variable data only merges on the first record?

    I'm doing a multiple record data merge, I have 2 frames both with variable data placed inside.
    I would like to specify that one of the text frames only merges once(first record) and the other frame multiple times for each record in the data file.
    Is it possible?
    I thought that perhaps if I place the text frame that must merge once on the master page, it would work.  But you are not allowed to place variable text on the master and on the document page.
    I'm going to try it through scripting next, but thought that perhaps there is an easier way that I'm not aware of.
    Thanks,
    Suzanne

    Suzanne,
    If you were trying to post a screen shot, you would need to return to the forum and post it using the "camera" icon at the top of the post editing windows.
    I use a plug-in from Em Software called InData. One of the benefits for what I do is there are no individual frames on a page to deal with post-merge. Individual frames are great for simple merges (address labels, post cards, etc.). But I typically do more other types of merges.
    That said, there is a drawback--one needs to come to an understanding of writing expressions that actually parse the incoming data. So in the spice price list example, that looks like:
    It's reasonably easy once one does it a few times. And it can be far more complicated. The above is from Em Software's samples that has been tweaked. The best thing I can recommend would be to download the trial and see for yourself. They are good at responding to specific questions if you get stumped.
    I imagine this all could be scripted somehow in ID. But I have no idea how and the plug-in just lets me keep working.
    Mike

  • Concatenation text item with variable

    hi to all
    i try to concatenation a item in form with variable.
    i went in a loop to concatenation counter value with 40 text item.
    once text item have a unique name like these:
    text_item_1
    text_item_2
    text_item_3
    i need to concatenation loop counter value with text item name.
    like this*=>:bl.text_item || wdser*
    like this thing that step by step go on all item and insert any value on that.
    PLZ help me.
    Edited by: Eliea on May 25, 2009 4:22 AM

    create a button and write following code.
    while :system.last_record!='TRUE' loop
         :block.text:=:block.TEXT_NAME||variable;
         next_record;
    end loop;
    If :system.last_record='TRUE' then
         :block.text:=:block.TEXT_NAME||variable;
    end if;
    Please mark the answer if it is helpful/correct

  • Generate input text fields dynamically on clicking a image with adf??

    Is it possible to generate input text fields dynamically on clicking a image with adf??
    The functionality to add and remove text field from UI with ADF??

    Yes, you can dynamically add components to a page.
    [url http://www.nearinfinity.com/blogs/michael_bevels/dynamic_forms_using_jsf.html]Here is an example - it demonstrates with ICE Faces components, but the concept is the same for any type of component, including ADF
    John

  • ALV report editable to enter text and print with including the text?

    Hi all,
    I have to display output of a  report in ALV format and i have to make two fileds can be editable to enter texts by user  and able to print the list with that texts .
    Is it possible using standard Function modules or I have to go for OO methods? Please give the sample code ?
    Thanks,
    Vamshi
    Edited by: VAMSHI KRISHNA on Oct 31, 2008 4:25 PM

    Hi Vamshi,
    Check out the Below sample code for the editable ALV.
    *& Report  Z7CC_OOPS_ALV_EDITABLE
    report  z7cc_oops_alv_editable.
    tables sflight.
    data: begin of gt_outtab occurs 0.     "with header line
            include structure sflight.
    data: celltab type lvc_t_styl.
    data: end of gt_outtab.
    data: gt_fieldcat type lvc_t_fcat.
    data: g_carrid like sflight-carrid,
          g_connid like sflight-connid.
    data: gs_spfli type spfli.                                  "#EC NEEDED
    data: g_custom_container type ref to cl_gui_custom_container.
    data:  g_container type scrfname value 'BCALV_GRID_DEMO_0100_CONT1'.
    data: g_grid  type ref to cl_gui_alv_grid.
    data: wa_outtab like gt_outtab.
    *       CLASS lcl_event_receiver DEFINITION
    class lcl_event_receiver definition.
      public section.
        types: begin of sflight_key.
        types:   carrid type s_carr_id.
        types:   connid type s_conn_id.
        types:   fldate type s_date.
        types: end of sflight_key.
        types: sflight_keys type standard table of sflight_key,
               sflight_table type standard table of sflight.
        methods:
          handle_data_changed
             for event data_changed of cl_gui_alv_grid
                 importing er_data_changed.
        methods:
          get_inserted_rows
               exporting
                  inserted_rows type sflight_keys.
        methods:
          get_deleted_rows
              exporting
                  deleted_rows type sflight_table.
        methods:
           refresh_delta_tables.
        methods: set_table_is_initial.
        methods: set_table_is_not_initial.
        methods: table_is_initial
                    returning value(initial) type char01.
      private section.
    * §4.Define internal tables to remember inserted and deleted lines,
    *    thus the delta between input made after the last saving.
        data: inserted_rows type sflight_keys,
              deleted_rows type standard table of sflight.
    * This flag is set if any error occured in one of the
    * following methods:
        data: error_in_data type c.
    * This flag signals that no records were read for the flight
    * table initially:
        data: initial_table type c.
    ** Methods to modularize event handler method HANDLE_DATA_CHANGED:
        methods:
          check_double_entries
             importing
                pr_data_changed type ref to cl_alv_changed_data_protocol.
        methods:
          update_delta_tables
             importing
                pr_data_changed type ref to cl_alv_changed_data_protocol.
        methods:
          perform_semantic_checks
             importing
                pr_data_changed type ref to cl_alv_changed_data_protocol.
        methods:
          get_cell_values
               importing
                 row_id          type int4
                 pr_data_changed type ref to cl_alv_changed_data_protocol
               exporting
                 key             type sflight_key.
    endclass.                    "lcl_event_receiver DEFINITION
    class lcl_event_receiver implementation.
      method handle_data_changed.
    *    data: ls_good type lvc_s_modi,
    *          l_price type s_price,
    *          ls_new type lvc_s_moce.
    *    error_in_data = space.
    ** check if there exist double entries
    *    call method check_double_entries( er_data_changed ).
    ** remember new or deleted lines for saving
    *    call method update_delta_tables( er_data_changed ).
    ** check mt_good_cells semantically
    *    call method perform_semantic_checks( er_data_changed ).
    *    if error_in_data = 'X'.
    *      call method er_data_changed->display_protocol.
    *    endif.
      endmethod.                    "handle_data_changed
      method check_double_entries.
        data: lt_good_cells type lvc_t_modi,
              ls_good type lvc_s_modi,
              ls_key type sflight_key,
              ls_sflight type sflight,
              l_flightdate like gt_outtab-fldate,
              l_del_row type lvc_s_moce,
              ls_outtab like line of gt_outtab,
              l_reentered type c.
    * §5.Check if there exist already other records with equal key fields.
    * Check if the user has entered two new lines where the key fields
    * are equal.
    * Since CARRID and CONNID are read only, the check is restrained
    * to field FLDATE.
    * Algorithm: Copy all entries in MT_GOOD_CELLS to a dummy table.
    *            During the copying procedure check if there exists
    *            already a line with the same Flight date.
    *    loop at pr_data_changed->mt_good_cells into ls_good.
    *      case ls_good-fieldname.
    *        when 'FLDATE'.
    *          call method pr_data_changed->get_cell_value
    *                      exporting
    *                            i_row_id = ls_good-row_id
    *                            i_fieldname = ls_good-fieldname
    *                      importing e_value = l_flightdate.
    *          read table lt_good_cells with key
    *                            value = l_flightdate
    *                            transporting no fields.
    *          if sy-subrc = 0.
    ** There exists already a line with the same flight date!
    *            call method pr_data_changed->add_protocol_entry
    *                         exporting
    *              i_msgid = '0K' i_msgno = '000'  i_msgty = 'E'
    *              i_msgv1 = text-m01
    *              i_fieldname = ls_good-fieldname
    *              i_row_id = ls_good-row_id.
    *            error_in_data = 'X'.
    *          else.
    *            ls_good-value = l_flightdate.
    *            append ls_good to lt_good_cells.
    *          endif.
    *      endcase.
    *    endloop.
    ** Check if any new entries already exist in gt_outtab.
    ** At this point, lt_good_cells contains only lines with
    ** FIELDNAME = 'FLDATE'.
    *    loop at lt_good_cells into ls_good.
    *      l_flightdate = ls_good-value.      "flightdate, see above
    *      read table gt_outtab with key
    *                    carrid = g_carrid
    *                    connid = g_connid
    *                    fldate = l_flightdate
    *                    transporting no fields.
    *      if sy-subrc = 0.
    ** Check if this entry was deleted before, i.e. it is in the table
    ** of deleted rows. If so, the entry does not exist twice. The user
    ** has deleted a line and then reentered it.
    *        l_reentered = space.
    *        loop at pr_data_changed->mt_deleted_rows into l_del_row.
    *          read table gt_outtab into ls_outtab index l_del_row-row_id.
    *          if sy-subrc ne 0.
    *            message i000(0k) with text-e01."Fehler beim Löschen
    *          elseif
    *                    ls_outtab-carrid eq g_carrid
    *                and ls_outtab-connid eq g_connid
    *                and ls_outtab-fldate eq ls_good-value.
    *            l_reentered = 'X'.
    *          endif.
    *        endloop.
    *        if l_reentered ne 'X'.
    *          call method pr_data_changed->add_protocol_entry
    *                         exporting
    *              i_msgid = '0K' i_msgno = '000'  i_msgty = 'E'
    *              i_msgv1 = text-m01
    *              i_fieldname = ls_good-fieldname
    *              i_row_id = ls_good-row_id.
    *          error_in_data = 'X'.
    *        endif.
    *      endif.
    *    endloop.
    ** In this demo report you may prevent the selection
    ** of data by setting parameter 'p_ds'.
    ** If this is done, the next check is required:
    *    if me->table_is_initial( ) eq 'X'.
    *      call method get_cell_values
    *           exporting row_id          = 1
    *                     pr_data_changed = pr_data_changed
    *           importing key             = ls_key.
    *      select single * from sflight into ls_sflight
    *                where carrid = ls_key-carrid
    *                  and connid = ls_key-connid
    *                  and fldate = ls_key-fldate.
    *      if sy-subrc = 0.
    *        call method pr_data_changed->add_protocol_entry
    *                       exporting
    *            i_msgid = '0K' i_msgno = '000'  i_msgty = 'E'
    *            i_msgv1 = text-m01
    *            i_fieldname = 'FLDATE'
    *            i_row_id = 1.
    *        error_in_data = 'X'.
    *      endif.
    ** flag initial_table is reset in method 'update_delta_tables'
    *    endif.
      endmethod.                    "check_double_entries
      method update_delta_tables.
    *    data: l_ins_row type lvc_s_moce,
    *          l_del_row type lvc_s_moce,
    *          ls_key type sflight_key,
    *          ls_sflight type sflight,
    *          ls_outtab like line of gt_outtab.
    ** §6.Use protocol attributes MT_DELETED_ROWS and MT_INSERTED_ROWS
    **    to remember which lines where deleted or inserted. Save this
    **    information in your internal tables.
    ** deleted rows
    *    loop at pr_data_changed->mt_deleted_rows into l_del_row.
    *      read table gt_outtab into ls_outtab index l_del_row-row_id.
    *      if sy-subrc ne 0.
    *        message i000(0k) with text-e01."Fehler beim Löschen
    *      else.
    *        move-corresponding ls_outtab to ls_sflight.
    ** It should no be possible that the same line is deleted twice,
    ** so we just add the new key line to 'deleted_rows'.
    *        append ls_sflight to deleted_rows.
    ** If this line was inserted just before it is deleted:
    *        delete me->inserted_rows
    *             where carrid = ls_outtab-carrid
    *             and   connid = ls_outtab-connid
    *             and   fldate = ls_outtab-fldate.
    *      endif.
    *    endloop.
    ** inserted rows
    ** At this point ALV has not added new lines
    ** to gt_outtab, so you can not access their values
    ** by reading gt_outtab.
    ** Table MT_GOOD_CELLS holds new values that can be
    ** referenced using the ROW_ID.
    *    if me->table_is_initial( ) eq 'X'.
    ** No flights were selected initially. This is the first new line.
    *      call method get_cell_values
    *            exporting row_id          = 1
    *                      pr_data_changed = pr_data_changed
    *            importing key             = ls_key.
    *      append ls_key to inserted_rows.
    *      call method me->set_table_is_not_initial.
    *    endif.
    *    loop at pr_data_changed->mt_inserted_rows into l_ins_row.
    *      call method get_cell_values
    *              exporting row_id          = l_ins_row-row_id
    *                        pr_data_changed = pr_data_changed
    *              importing key             = ls_key.
    **      READ TABLE gt_outtab INTO ls_outtab INDEX l_ins_row-row_id.
    ** Just insert the new row regardless if the input is wrong
    *      append ls_key to inserted_rows.
    *    endloop.
      endmethod.                    "update_delta_tables
      method get_cell_values.
    * get values of key cells of row ROW_ID
    ** CARRIER
    *    call method pr_data_changed->get_cell_value
    *          exporting
    *                 i_row_id    = row_id
    *                 i_fieldname = 'CARRID'
    *               importing
    *                 e_value = key-carrid.
    *    if sy-subrc ne 0.
    *      message i000(0k) with text-e02.  "Fehler beim Einfügen
    *    endif.
    ** CONNID
    *    call method pr_data_changed->get_cell_value
    *          exporting
    *                 i_row_id    = row_id
    *                 i_fieldname = 'CONNID'
    *               importing
    *                 e_value = key-connid.
    *    if sy-subrc ne 0.
    *      message i000(0k) with text-e02.  "Fehler beim Einfügen
    *    endif.
    ** FLDATE
    *    call method pr_data_changed->get_cell_value
    *          exporting
    *                 i_row_id    = row_id
    *                 i_fieldname = 'FLDATE'
    *               importing
    *                 e_value = key-fldate.
    *    if sy-subrc ne 0.
    *      message i000(0k) with text-e02.  "Fehler beim Einfügen
    *    endif.
      endmethod.                    "get_cell_values
      method perform_semantic_checks.
    *    data: ls_good type lvc_s_modi,
    *          l_planetype type s_planetye,
    *          l_seatsmax type s_seatsmax.
    *    loop at pr_data_changed->mt_good_cells into ls_good.
    *      case ls_good-fieldname.
    *        when 'PLANETYPE'.
    *          call method pr_data_changed->get_cell_value
    *             exporting
    *               i_row_id = ls_good-row_id
    *               i_fieldname = ls_good-fieldname
    *             importing
    *               e_value = l_planetype.
    *          select single seatsmax from saplane into l_seatsmax
    *                        where planetype = l_planetype.
    *          if sy-subrc ne 0.
    *            call method pr_data_changed->add_protocol_entry
    *                            exporting
    *                 i_msgid = '0K' i_msgno = '000'  i_msgty = 'E'
    *                 i_msgv1 = text-m02
    *                 i_fieldname = ls_good-fieldname
    *                 i_row_id = ls_good-row_id.
    *            error_in_data = 'X'.
    *          else.
    *            call method pr_data_changed->modify_cell
    *              exporting i_row_id    = ls_good-row_id
    *                        i_fieldname = 'SEATSMAX'
    *                        i_value     = l_seatsmax.
    *          endif.
    *      endcase.
    *    endloop.
      endmethod.                    "perform_semantic_checks
      method get_inserted_rows.
    *    inserted_rows = me->inserted_rows.
      endmethod.                    "get_inserted_rows
      method get_deleted_rows.
    *    deleted_rows = me->deleted_rows.
      endmethod.                    "get_deleted_rows
      method refresh_delta_tables.
    *    clear me->inserted_rows[].
    *    clear me->deleted_rows[].
      endmethod.                    "refresh_delta_tables
      method set_table_is_initial.
    *    initial_table = 'X'.
      endmethod.                    "set_table_is_initial
      method set_table_is_not_initial.
    *    initial_table = space.
      endmethod.                    "set_table_is_not_initial
      method table_is_initial.
    *    if initial_table = 'X'.
    *      initial = 'X'.
    *    else.
    *      initial = space.
    *    endif.
      endmethod.                    "table_is_initial
    endclass.                    "lcl_event_receiver IMPLEMENTATION
    data: g_verifier type ref to lcl_event_receiver.
    data: g_max type i value 100.
    data: gs_layout type lvc_s_layo.
    data: ok_code like sy-ucomm,
          save_ok like sy-ucomm.
    parameters: p_ds type c as checkbox.   "delete selection
    select-options s_carrid for sflight-carrid
                                no intervals no-extension default 'LH'.
    select-options s_connid for sflight-connid
                               no intervals no-extension default '0400'.
    start-of-selection.
      g_carrid = s_carrid-low.
      g_connid = s_connid-low.
    * first check airline and connection
      select single * from spfli into gs_spfli
                         where carrid = g_carrid
                         and connid = g_connid.
      call screen 100.
    *&      Module  STATUS_0100  OUTPUT
    *       text
    module status_0100 output.
      set pf-status 'MAIN100'.
      set titlebar 'MAIN100'.
      if g_custom_container is initial.
        perform create_and_init_alv changing gt_outtab[]
                                             gt_fieldcat.
      endif.
    endmodule.                 " STATUS_0100  OUTPUT
    *&      Form  create_and_init_alv
    *       text
    *      <--P_GT_OUTTAB[]  text
    *      <--P_GT_FIELDCAT  text
    form create_and_init_alv changing pt_outtab like gt_outtab[]
                                      pt_fieldcat type lvc_t_fcat.
      data: lt_exclude type ui_functions.
      create object g_custom_container
             exporting container_name = g_container.
      create object g_grid
             exporting i_parent = g_custom_container.
    * Create Objekt to verify input values.
    * (This object is already needed in form SELECT_DATA).
      create object g_verifier.
    *  SET HANDLER g_verifier->handle_data_changed FOR g_grid.
      perform select_data changing pt_outtab[].
      perform build_fieldcat changing pt_fieldcat.
      perform exclude_tb_functions changing lt_exclude.
      gs_layout-stylefname = 'CELLTAB'.
      call method g_grid->set_table_for_first_display
        exporting
          it_toolbar_excluding = lt_exclude
          is_layout            = gs_layout
        changing
          it_fieldcatalog      = pt_fieldcat
          it_outtab            = pt_outtab[].
    * Set editable cells to ready for input initially
      call method g_grid->set_ready_for_input
        exporting
          i_ready_for_input = 1.
    endform.                    " create_and_init_alv
    *&      Form  select_data
    *       text
    *      <--P_GT_OUTTAB  text
    form select_data changing pt_outtab like gt_outtab[].
      data: lt_sflight type table of sflight,
            ls_sflight type sflight,
            ls_outtab like line of gt_outtab,
            l_index type i,
            ls_spfli type spfli,                                "#EC NEEDED
            lt_celltab type lvc_t_styl.
    * Check parameter 'p_ds'=>optionally select no data
      if p_ds is initial.
    * Select data from sflight
        select * from sflight into table lt_sflight up to g_max rows
                         where carrid = g_carrid
                           and connid = g_connid.
      endif.
      if sy-subrc ne 0 or not p_ds is initial.
    * no flights were found!
    * We provide some default values for the first line that is entered:
        ls_outtab-carrid = g_carrid.
        ls_outtab-connid = g_connid.
        case g_carrid.
          when 'LH'.
            ls_outtab-currency = 'DEM'.
          when others.
            ls_outtab-currency = 'US'.
        endcase.
        ls_outtab-seatsocc = 0.
        ls_outtab-paymentsum = 0.
    * set fields FLDATE, PRICE and PLANETYPE to editable
        perform fill_celltab using 'RW'
                             changing lt_celltab.
        insert lines of lt_celltab into table ls_outtab-celltab.
        append ls_outtab to pt_outtab.
    * Tell Verify-Objekt that the table was initial
        call method g_verifier->set_table_is_initial.
      else.
        call method g_verifier->set_table_is_not_initial.
    * move corresponding fields from lt_sflight to gt_outtab
        loop at lt_sflight into ls_sflight.
          move-corresponding ls_sflight to ls_outtab.
          append ls_outtab to pt_outtab.
        endloop.
    * §3.Set all cells of the table non-editable by using the style table.
        loop at pt_outtab into ls_outtab.
          l_index = sy-tabix.
          refresh lt_celltab.
          perform fill_celltab using 'RO'
                            changing lt_celltab.
    * Copy your celltab to the celltab of the current row of gt_outtab.
          insert lines of lt_celltab into table ls_outtab-celltab.
          modify pt_outtab from ls_outtab index l_index.
        endloop.
      endif.
    endform.                               " select_data
    *&      Form  fill_celltab
    *       text
    *      -->VALUE(P_MODE)  text
    *      -->PT_CELLTAB     text
    form fill_celltab using value(p_mode)
                      changing pt_celltab type lvc_t_styl.
      data: ls_celltab type lvc_s_styl,
            l_mode type raw4.
    * This forms sets the style of columns 'PRICE', FLDATE and PLANETYPE
    * editable
      if p_mode eq 'RW'.
        l_mode = cl_gui_alv_grid=>mc_style_enabled.
      else.                                "p_mode eq 'RO'
        l_mode = cl_gui_alv_grid=>mc_style_disabled.
      endif.
      ls_celltab-fieldname = 'FLDATE'.
      ls_celltab-style = l_mode.
      insert ls_celltab into table pt_celltab.
      ls_celltab-fieldname = 'PRICE'.
      ls_celltab-style = l_mode.
      insert ls_celltab into table pt_celltab.
      ls_celltab-fieldname = 'PLANETYPE'.
      ls_celltab-style = l_mode.
      insert ls_celltab into table pt_celltab.
    endform.                               " FILL_CELLTAB
    *&      Form  BUILD_FIELDCAT
    *       text
    *      <--P_GT_FIELDCAT  text
    form build_fieldcat changing pt_fieldcat type lvc_t_fcat.
      data ls_fcat type lvc_s_fcat.
      call function 'LVC_FIELDCATALOG_MERGE'
        exporting
          i_structure_name = 'SFLIGHT'
        changing
          ct_fieldcat      = pt_fieldcat.
      loop at pt_fieldcat into ls_fcat.
        if    ls_fcat-fieldname eq 'PRICE'
           or ls_fcat-fieldname eq 'PLANETYPE'
           or ls_fcat-fieldname eq 'FLDATE'.
    * §1.Set status of columns FLDATA, PRICE and PLANETYPE to editable.
    *    Since all cells are set to non-editable (see step 3) the cells
    *    of this columns will only be editable for new lines.
          ls_fcat-edit = 'X'.
    * Field 'checktable' is set to avoid shortdumps that are caused
    * by inconsistend data in check tables. You may comment this out
    * when the test data of the flight model is consistent in your system.
          ls_fcat-checktable = '!'.        "do not check foreign keys
          modify pt_fieldcat from ls_fcat.
        elseif ls_fcat-fieldname = 'CARRID'
           or ls_fcat-fieldname = 'CONNID'
           or ls_fcat-fieldname = 'CURRENCY'.
    * §2.Use field AUTO_VALUE of the fieldcatalog to preset values when new
    *    lines are added.
          ls_fcat-auto_value = 'X'.
          ls_fcat-checktable = '!'.   "do not check foreign key relations
          modify pt_fieldcat from ls_fcat.
        endif.
      endloop.
    endform.                    "build_fieldcat
    *&      Form  exclude_tb_functions
    *       text
    *      <--P_LT_EXCLUDE  text
    form exclude_tb_functions changing pt_exclude type ui_functions.
      data ls_exclude type ui_func.
      ls_exclude = cl_gui_alv_grid=>mc_fc_loc_insert_row.
      append ls_exclude to pt_exclude.
      ls_exclude = cl_gui_alv_grid=>mc_fc_loc_undo.
      append ls_exclude to pt_exclude.
      ls_exclude = cl_gui_alv_grid=>mc_fc_loc_copy_row.
      append ls_exclude to pt_exclude.
    endform.                               " EXCLUDE_TB_FUNCTIONS
    *&      Module  USER_COMMAND_0100  INPUT
    *       text
    module user_command_0100 input.
      save_ok = sy-ucomm.
      clear ok_code.
      case save_ok.
        when 'SAVE'.
    *      perform save_data.
        when 'BACK'.
    * §10.Unlock your database table.
    *      perform unlock_sflight.
          leave to screen 0.
        when 'EXIT'.
          perform exit_program.
        when 'ADD'.
          perform add_line_item.
        when others.
    *     do nothing
      endcase.
    endmodule.                 " USER_COMMAND_0100  INPUT
    *       FORM EXIT_PROGRAM                                             *
    form exit_program.
      leave program.
    endform.                    "exit_program
    *&      Form  ADD_LINE_ITEM
    *       text
    *  -->  p1        text
    *  <--  p2        text
    form add_line_item .
    data: lt_rows type lvc_t_row.
    data: wa_rows type lvc_t_row with header line.
    data: tabix type sy-tabix.
    *&Find the  row ( index ) number
    call method g_grid->get_selected_rows
              importing et_index_rows = lt_rows.
    call method cl_gui_cfw=>flush.
    read table lt_rows into wa_rows index 1.
    tabix = wa_rows-index .
    insert gt_outtab  index tabix.
    *REFRESH_TABLE_DISPLAY
    call method g_grid->refresh_table_display
    *  EXPORTING
    *    IS_STABLE      =
    *    I_SOFT_REFRESH =
    *  EXCEPTIONS
    *    FINISHED       = 1
    *    others         = 2
    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.                    " ADD_LINE_ITEM
    Thanks,
    Chidanand

  • Need custom column widths in Append Text Table to Report

    I need to print reports with tables of different column widths specified for each column, as the contained fields vary in width from just 3 characters in one column to 40 characters in another.  Also we are trying to match the reports generated by a non-labview routine.  In the past I have been able to achieve this by editing the Append Table to Report vi, working my way through the inner hierarchy to replace the DBL numeric COLUMN WIDTH control with a DBL numeric array.  The innermost vi, Set Table Column Width, assigns the numeric to a property node in a for loop, so the change is simple: replace the scalor with an array and enable indexing on the for loop.  Of course, after each Labview upgrade, I've had to go back in and repeat these edits on the overwritten upgraded vi's.  This time there is a problem.  The new version of this toolkit is object oriented, and disturbing these vi's wrecks the class methods in a way I don't understand (mostly because I've had no dealings with object oriented programming) and which cannot be undone.  I recently tried this and after not being able to fix the problem even with phone support, I had to spend the next two days unistalling and reinstalling Labview!  I desperately need a way to achieve this functionality without killing the toolkit, which is used (in its original functionality) by another absolutely critical program.  PLEASE HELP!
    The hierarchy is as follows:
    NI report.lvclass:Append Table to Report (wrap)
    NI report.lvclass:Append Table to Report 
    NI Standard report.lvclass:Append Text Table to Report
    NI Standard report.lvclass:tables
    NI Report Generation Core.lvlibet Table Column Width

    There is a highly relevant thread under discussion here:
    http://forums.ni.com/ni/board/message?board.id=fea​tures&thread.id=429
    You may wish to read it and chime in as it is a discussion of LabVIEW's policy (and possible change in policy for the future) concerning the handling of non-palette VIs between LV versions.
    Rob Hingle wrote:
    > Is that to say NI will not be helping me with this?  Pretty disappointing lack of support, seems
    > like a terrible idea to go to object oriented if even your own application engineers can't figure
    > out such a simple fix.  Gotta give NI a huge thumbs down on this one, thanks for nothing.
    I doubt that it is a simple fix -- our AEs are generally top notch at figuring out solutions for customers -- if it were simple, my bet is they'd have solved it. Asking an AE to work around a bug is different from asking them to rearchitect the toolkit. You are asking them to add a feature that the new version of the toolkit is not
    designed to support. The difficulty in doing this is completely independent of the decision to use LabVIEW classes to implement the toolkit. If any piece of software is not designed with a particular use case in mind, what may be a simple tweak under one design may become a very hard problem under another design.
    In your case, the solution is very straightforward: Use the older version of the toolkit. Any time you create a custom modification of the VIs that ship with LV or one of its toolkits, you should make your own copy and have your VIs link against the copy. LabVIEW promises to maintain all the public functionality version over version. Usually we succeed at that. What we do not promise is to maintain our private implementation of that functionality. It is impossible for LabVIEW (or any other software library) to maintain all of its private internal operations while still continuing any development. Using a copy of the original VIs shields you from having to recode your changes every version (something you've already mentioned is a chore) and it guarantees that functionality that you relie upon does not disappear.
    I hope you are willing to be understanding of this situation and not hold it against the AEs working on this. They try hard to provide excellent customer service, and spend lots of time inventing custom solutions for our users.  This happens to be a situation where the correct fix is not to modify the new toolkit version to do something it wasn't designed to do but to modify your development process so that the problem is solved now and into the future. 

Maybe you are looking for

  • It wont let me download apps it says i have to verified my id but i did

    I made a apple id account for my apps and music and it wont let me download it says that I need to verified which I did cause I checked my email it say previously verified and im pretty sure that it is verified. Thank you and let me know what I can d

  • Challan creation

    Dear all, In vendor invoice i have created validation rule for section code as a mandatory and while posting invoice system is asking business place (without that it is not allowing to post vendor invoice) and after this while creating the challan in

  • Acrhitecture of network load balancing solution

    i'm working on a setup that will transition our existing data center setup to a network load balancing solution. i'm far from understanding what components to use and how to approach the problem so any help would be very welcome. here is what we curr

  • 5800 xm backlight notify

    Hey every one I got my new 5800 xm and updated it to the latest firmware only because when I lock the phone keypad and when a new message arrives the LCD does not brightens up the phone gives only the notification sound and the led blinks and when th

  • Why is my Mid-2011 MAC AIR (updated to 10.8.5) keeps on crashing while using safari

    this is the crash report Process:         Safari [147] Path:            /Applications/Safari.app/Contents/MacOS/Safari Identifier:      com.apple.Safari Version:         6.0.5 (8536.30.1) Build Info:      WebBrowser-7536030001000000~6 Code Type: