Dynamically format colors in lists

I would like to dynamically set a color for a single in a list.
Ie rather than code:
If var = 'x'. write l_field color col_negative.
elseif var = 'y' write l_field color col_total.
elseif var = 'z' write l_field color col_group.
endif.
I would like to code it as follows:
data: l_color(10) type c.
if l_var = 'x'.
move 'col_negative' to l_color.
elseif l_var = 'y' move 'col_total to l_color.
elseif l_var = 'z' move 'col_group' to l_color.
endif.
write: l_field color l_color.
The color command does not seem to like being passed a variable, rather it has to be told explicitly what the color should be set at.
Is there a way around this?

Check this report...You might find it helpfull:
REPORT Z_ATG_DUMMY.
DATA I TYPE I VALUE 0.
DATA COL(15) TYPE C.
WRITE:/9 'INTENSIFIED ON',27 'INTENSIFIED OFF',48 'INVERSE'.
SKIP 2.
WHILE I < 8.
  CASE I.
    WHEN 0. COL = 'COL_BACKGROUND '.
    WHEN 1. COL = 'COL_HEADING '.
    WHEN 2. COL = 'COL_NORMAL '.
    WHEN 3. COL = 'COL_TOTAL '.
    WHEN 4. COL = 'COL_KEY '.
    WHEN 5. COL = 'COL_POSITIVE '.
    WHEN 6. COL = 'COL_NEGATIVE '.
    WHEN 7. COL = 'COL_GROUP '.
  ENDCASE.
  FORMAT INTENSIFIED COLOR = I.
  WRITE: /(4) I, AT 7 SY-VLINE,
  COL, SY-VLINE,
  COL INTENSIFIED OFF, SY-VLINE,
  COL INVERSE.
  I = I + 1.
ENDWHILE.
Greetings,
Blag.

Similar Messages

  • COLOR for Lists

    Hi,
    I have created a employee list with 4Columns and 3 Rows using uline and sy-vline.My problem is hoe to give the background color for the Individual field.
    My Lists will be,
    EmpID   EmpName   Age        DOJ
    x            yyyy             23  08/11/2008
    y            xxxxxx          25  08/08/2008
    How to give the color for the header part empid,empname...
    and the detail part.
    please help me to solve this problem.
    Thanx in advance
    Mohana

    Try the following piece of code,
    This is for coloring the backgrounds of table fields. As you can see from the code, it colors the header titles and the rest of the data with different colors.
    *  FORM DISP_TAB_VEND_PROD_GRP                                         *
    *  Subroutine for displaying the data for the grouping based on vendor *
    *  and Product group                                                   *
    *  There are no interface parameters to be passed to this subroutine.  *
    FORM disp_tab_vend_prod_grp .
      CLEAR w_total_amt.
      SORT t_vend_prod_grp BY matkl lifnr.
      LOOP AT t_vend_prod_grp INTO fs_vend_prod_grp.
        w_total_delv = w_total_delv + 1.
        w_total_amt = w_total_amt + fs_vend_prod_grp-dmbtr.
        AT NEW matkl.
    * To display the material group and the header texts for the data
    * grouped by material group and vendor.
          SKIP 1.
          WRITE:/ text-mtk COLOR COL_HEADING
                                   INTENSIFIED,
                  fs_vend_prod_grp-matkl COLOR COL_NORMAL
                                   INTENSIFIED OFF.
          SKIP 1.
          FORMAT COLOR COL_HEADING ON INTENSIFIED.
          ULINE  1(54).
          WRITE:/ sy-vline,
                2 text-ven,
               12 sy-vline,
                  text-dlv,
               26 sy-vline,
               38 text-amt,
                  sy-vline,
               46 text-cur,
               54 sy-vline.
          ULINE /1(54).
          FORMAT COLOR COL_HEADING OFF INTENSIFIED.
        ENDAT.                             " AT NEW MATKL
        AT END OF lifnr.
    * To display the actual data for the grouping based on Material group
    * and Vendor.
          FORMAT COLOR COL_NORMAL ON INTENSIFIED OFF.
          WRITE: / sy-vline,
                 2 fs_vend_prod_grp-lifnr COLOR COL_KEY,
                12 sy-vline,
                   w_total_delv,
                26 sy-vline,
                   w_total_amt CURRENCY text-usd,
                   sy-vline,
                46 text-usd,
                54 sy-vline.
          FORMAT COLOR COL_NORMAL OFF INTENSIFIED OFF.
          CLEAR: w_total_amt,
                 w_total_delv.
        ENDAT.                             " AT END OF LIFNR
        AT LAST.
          ULINE /1(54).
        ENDAT.                             " AT LAST
      ENDLOOP.                             " LOOP AT T_VEND_PROD_GRP
    ENDFORM.                               " DISP_TAB_VEND_PROD_GRP
    I dont know about the exact requirement of yours, but why dont you go for ALV grid display, it would look really good (and without much hand coding).

  • Conditional Color Coded List

    I have done this in excel long time ago and I though it was going to be as simple as it was with excel.
    I'm trying to implement a conditional color coded list with the criteria below:
    Fields:
    - Health (blank cell that will change colors)
    - Due Date (cell with dates)
    Criteria:
    - Red if [due date] < date.now
    - Yellow if [due date] > date.now - 10
    - Green everything else
    How would I implement that in SharePoint?
    Thanks in advance
    ps:I'm not a C# programmer so I don' t know if the syntax for datetime or dude date column are right. 

    Hi mpaulopes,
    Here is a step by step guide reference to provision conditional formatting using SharePoint designer. It will give you proper idea about how to do this. It is for SP2010 however it won't make much difference.
    http://blog.sharepointrx.com/2010/12/03/conditional-formatting-and-date-comparisons-with-sharepoint-designer-2010/
    I hope this helps.
    Regards,
    Tapan

  • Formatting descriptive task list

    Hi All,
    In version 9.3 we have option to format the task list font (like bold, change color, italics) and even insert a picture in it. But when i try to format a task list in 11.1.2, it does nto show the required result.
    In other words i am unable to format the task list in v 11.1.2 by using the same steps that are used in 9.3. Can somebody tell me how can i do it?
    Regards,
    Umair

    In version 11 they took the ability to add html commands away from the forms and task lists, it is because the instructions are now in a html textarea which do not allow html functions.
    Though saying that in a patch for 11.1.1.3 (11.1.1.3.03) it looks to be reverted back :- 9475065 – Users cannot use HTML commands in data form and task list instructions.
    It has not made its way to 11.1.2, maybe it will in a future release or patch.
    Cheers
    John
    http://john-goodwin.blogspot.com/

  • How can we use C# to read dynamic parameter's value list from .rpt?

    I'm using Cystal Report 2008. We know starting from CR XI we can create dynamic parameters, the list of items of this kind of parameter are fetching from database. So in general the SQLs to get the list of values for dynamic parameters are stored in the .rpt.
    In Crystal Report Designer, if I preview a report with dynamic parameters, it will first query the database and then show the input dialog with list of values from database for user to choose. My question is can we implement the same thing by our C# code? I'm planning to use C# code to read this dynamic parameter's value list from .rpt and render them on the web page. Then pass back the user selected values to the .rpt to run the report after user make the choice. I didn't find any APIs can do this. Is it possible?
    Thanks in advance!!

    Hi,
    Can you explain a bit in detail, I have similar scenario. I am using the following code but not getting the Column name for dynamic parameter list.
    foreach (ParameterFieldDefinition prm
                              in reportDocument.DataDefinition.ParameterFields)
                    try
                        string vParameterFieldName;                   
                        *vParameterFieldName = prm.ParameterFieldName.ToString();*
    Shakeel

  • How to change background color in List of Values (LOV) ?

    Hiya
    In Forms 10g, the background color in list of values (LOV) is White whereas it was grey in Form 6i. Also, the position of 3 buttons i.e. Find, OK and Cancel on LOV is different than what it used to be in Forms 6i.
    Is it possible to change the background color and the position of buttons of LOV in Forms 10g ?
    Cheers
    Mayur

    I would like to share the outcome of this issue.
    I had posted this same issue on Metalink yesterday. They (Metalink guys) have confirmed that its an bug in Oracle 10g DS R2 and it would be fixed in subsequent releases.
    Following is an official response from Metalink:
    This issue has been addressed to Oracle Development to be investigated/fixed in the published Bug:
    Bug 1559776 <BACKGROUND COLOR SETTING FOR LOV OBJECT DOES NOT WORK ON WEB>
    Cheers
    Mayur

  • Dynamic Select One Lookup List restricted to a subset of values

    I'm working with JDeveloper 10.1.3. trying to put an application together that needs two Lookup List the first is a Manufacturer Name and the second is items manufactured based on the selection of the first Lookup List choice (Manufacturer Name). I have two tables that make a nice master-detail relationship also I have a view that has the manufacturer name and what they manufacture but I just can't get a handle on how to set up the second lookup list to provide the subset of manufactured items based on the selection made in the first list. So the basic question is how do you restrict a Dynamic Select One Lookup List to a subset of values from the table based on a value stored in the application (on the page or in a bean). This has me stumped and any help would be greatly appreaicated.

    I am not sure if you have tried using the partial trigger on your second lookup list.
    Here's an overview of how you can do it @
    1.) Create a binding on the page to keep the selected value from your first LOV.
    2.) Set autoSubmit = true on your first LOV ) [ so that your binding in the first step gets populated upon selection]
    3.) Set up an ID value for the first LOV component.
    4.) Set up the partial trigger property on your second LOV to the ID of your first LOV.
    5.) In your page definition, use the value from the binding in step1 to assign value to any where clause parameters on the view object for your second LOV.
    HTH,
    Shishir
    donnellypl wrote:
    I'm working with JDeveloper 10.1.3. trying to put an application together that needs two Lookup List the first is a Manufacturer Name and the second is items manufactured based on the selection of the first Lookup List choice (Manufacturer Name). I have two tables that make a nice master-detail relationship also I have a view that has the manufacturer name and what they manufacture but I just can't get a handle on how to set up the second lookup list to provide the subset of manufactured items based on the selection made in the first list. So the basic question is how do you restrict a Dynamic Select One Lookup List to a subset of values from the table based on a value stored in the application (on the page or in a bean). This has me stumped and any help would be greatly appreaicated.

  • Conditional Formating colors not printed

    I have an OBIEE Report that has conditional formating to display results with background colors based on the values like if actuals is greater than goal then display the number in green and if below the goal then red etc. What I am seeing is that when I display the report (Table view) on dashboard on IE6 browser, it shows all the conditional formatting colors on the dashboard but when I do print preview, the colors are lost. When printed, it prints the report without the colors. I developed the reports in IE8 version and when I view and print from IE8 browser, it prints with colors. I feel it might be a bug or incompatibility with IE6 but am not sure about that. Is there any way to resolve this issue. This report will be viewed on IE6 browser and upgrading the company wide browser is not an option.
    Environment - Oracle Business Intelligence 10.1.3.4, OS: Windows, Browser - Internet Explorer 6
    Thanks in advance

    try tools-internet options-advanced-printing-check print background colors.

  • Dynamic formatting of Process Success Message

    I have read through some of the threads that have already been raised re dynamic formatting of the process message and haven't seen how/if I can do what I would like.
    I have a form with multiple process buttons which call a package and return an error code and message.
    I then wrote a function to take the error code and message and a couple of other fields to format an appropriate response.
    The process may return successfully but still have the error codes set (or may be null). I did note that could raise_application_error but would still have to go through some process to format the response.
    But when I use the function as the response message it is just treated as a text string.
    So for example I get
    Action Processed.nva_batch_validate.format_response( 'VALIDATE', VALID, , );
    rather than
    Action Processed - Validation Successful
    or
    Action Processed.nva_batch_validate.format_response( 'SUBMIT', 'APPROVED','-20004' , ' Some error with submission' );
    rather than
    Action Processed - Submit failed Some error with submission
    How can I get the Process Success Message to recognize that this is a function not text?
    Or can I have another process which just uses my format_response that would put message into the Action Processed.
    I don't want to have to go done the raise_application_error as I'd have to format the response within each procedure that is called and who knows what other issues this would raise.

    anonymous - Create an item, say P1_MSG and set its value in your page process, after your API calls, like :P1_MSG := Action Processed.nva_batch_validate.format_response( 'VALIDATE', VALID, , );
    Then put &P1_MSG. in the process success message field.
    Scott

  • Dynamic formating in smartforms

    I'm just curious if there is a possible to create a dynamic formatting in Smartforms. What I mean saying dynamic? Lets imaging that I've a strucure where I've following information;
    LINE_NUMBER
    TEXT
    This structure is used to build a table, where I can assign one or more text to one line.
    So my example data in this table will be:
    LINE_NUMBER | TEXT
    1 | my first item
    1 | first item description
    1 | some other text
    2 | second item
    2 | second item extended name
    2 | second item additional text
    2 | second item summary text
    and so one...
    So I can have varying texts number assigned into one line (max 8).
    Now I want to use paragraph, with 8 prepared tabs.
    Now the problem comes, how to pass this texts into tableline inside smartform and do not prepare separate lines for 1,2,3... elements?
    Any idea? It is possible to prepare data in variable which looks like:
    1,,my first item,,first item description,,some other text
    and display this data in such way, that commas will be recognized as tabs formatting in paragraph instead displaying them?

    hi..try this...
    create table->create a line type as required.
    loop at itab containing ur data.
    in the main area of the table create a row:
    right click on main area->table line
    in the output options of the row assign the line type from the drop down. in the condition of the row give the condition wa-LINE_NUMBER = 1.
    similarly create other rows(table lines) giving the conditions 1 to 8.
    that is you will have 8 table lines with conditions:
    row1 condition -> wa-LINE_NUMBER = 1
    row2 condition -> wa-LINE_NUMBER = 2
    row3 condition -> wa-LINE_NUMBER = 3
    row8 condition -> wa-LINE_NUMBER = 8
    so if line_number = 1 then row 1 will be use..
    if its 8 then row 8 will be used......
    inside the rows u can use different text elements with different para formats...

  • Dynamic Formatting

    I am interested in creating a report that allows the columns and format of those columns to change dynamically.
    For example in one instance the report would contain 3 columns
    Name, Address, Phone Number
    In this example we may want to highlight the Name column
    In another instance the report could contain 2 columns:
    Oder Id, Credit Card Type
    In this example we don't want any highlighting
    In another instance the report would contain 4 columns:
    Name, Order Id, Payment Amount, Account Status
    In this example we want to display the words GOOD if the Account Status column = 1 and Bad if the Account Status = 0
    We have mocked up a report using the Cross Tab type however I am not able to dynamically format each column when the report runs.
    I know I could create six separate reports however, that leaves me in a bad position when upgrading the report(s). Also if I need to introduce another report I have to create and maintain yet another report.
    Any help would be appreciated.

    Hello Wayne;
    I'm not sure if you actually want to work with a crosstab report or if that is an idea you have re. the modification. If it is a crosstab, you want to have a look at [this|http://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/oss_notes_boj/sdn_oss_boj_dev/sap(bD1lbiZjPTAwMQ==)/bc/bsp/spn/scn_bosap/notes.do] note. The note discusses the RAS SDK, but RAS is way more featured than CR, so same applies for CR.
    Other than that, if you want to vary the number of columns in a non crosstab report, you'd have two choices;
    1) RAS SDK. See the sample links in [this|https://wiki.sdn.sap.com/wiki/display/BOBJ/NETRASSDK+Samples] wiki (Report Modification heading)
    2) Using CR SDK. You'd create a report with a number of empty formulas. Then at runtime populate the formulas with the fields;
    Imports CrystalDecisions.CrystalReports.Engine
    Imports CrystalDecisions.Shared
    Public Class Form1
    Inherits System.Windows.Forms.Form
    Dim Report As New CrystalReport1()
    Dim FormulaFields As FormulaFieldDefinitions
    Dim FormulaField As FormulaFieldDefinition
    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
    FormulaFields = Report.DataDefinition.FormulaFields
    FormulaField = FormulaFields.Item(0)
    FormulaField.Text = "[formula text]"
    CrystalReportViewer1.ReportSource = Report
    End Sub
    Ludek

  • Color Definitions List - No Scroll

    I have a large color definitions list that matches my standard swatches in Illustrator.
    I want to go in and thin out some old/obsolete swatches (color definitions).
    I've recently upgraded to FrameMaker 11. I cannot scroll in the Color Definitions Name field. I use the drop down arrow to dig into the list, but the list itself won't scroll. Hovering on the scroll arrow does nothing. Clicking it just selects that color at the bottom of the list.
    Ideas? Is there any other way to scroll through the list or see the list?
    I'm in FrameMaker 11.0.1
    View > Color > Definitions...

    As Van says, it's a very poor implementation of th scroll list. I just created an Indexed PNG to get a large list of values for the colours to test this out.
    You have to click&hold on the arrow at the lower left and then drag the pointer down *outside* of the list window to start to scroll. On a fast machine, it just jumps to the end. If you let go, the list disappears. When you're past the first screen of the list, there's also an up arrow at the top that behaves in a similar way.
    The FM UI designer must have been having a very bad day...

  • Dynamic chart using SharePoint list data

    Is it possible to create dynamic chart from SharePoint List data using OOB.
    I have column Status [ choice - Pending , Submitted, Resolved ] . I want to genrate graph[Pie or Bar] show number of items in each status
    V Jean

    Thanks Lakshmanan,
    But in my environment - chart webpart is not available [ restricted].
    Have tried below using script.. Hope might help for other
    https://www.nothingbutsharepoint.com/sites/eusp/Pages/finally-dynamic-charting-in-wss-no-code-required.aspx
    V Jean

  • HP2000-299 laptop hard drive dynamic format

    Working on a hp2000-299 laptop, restored the hard drive to factory.  Everything works alright. Went to back it up and find the restore is done in the dynamic format which makes it pretty much useless for backing up.
    How does one convert dynamic to basic disk format?.  Is there an option when restoring that i missed?
    Have only come across 3-4 dynamic formats in last 10 years.  Anyway i need to convert it
    Any info welcome

    When you look at the hdd in Windows using Disk Management how is the hdd shown?
    If the hdd shows as dynamic in Disk Management,boot with a utilty cd to convert it. Download the Bootable CD iso here .Get ImgBurn here to burn the image to cd.
    Ghost has always had problems with HP's partitioning scheme in my use,even before the newer 4 primary partition layout but I have seen owners use Paragon with no problems.
    If you haven't burned a Recovery DVD set I would do that before too much messing around with partitions.Changing the hdd partitions will break the F11 recovery function.Create a set of operating system recovery discs
    ******Clicking the Thumbs-Up button is a way to say -Thanks!.******
    **Click Accept as Solution on a Reply that solves your issue to help others**

  • Regarding dynamic formatting on column

    Hi All,
    i have a requirement from client.
    He selects column from prompt and one of the report column changes dynamically.
    i have to do different data formatting for different column .
    so how to do dynamic formatting on same column that, shows different value on basis of prompt selection.
    Please reply.
    Regards,
    manoj

    Hi Manoj,
    generally you can achieve dynamic changes in your dashboard by creating a presentation variable prompt as part of your dashboard prompt and then using the prompt value to change your report.
    For example, you can create a prompt with values 5,10,25 in it and based on it create a report where you can switch between the top 5,10 or 25 records, depending on your selection.
    Because you did not specify what sort of formatting you require, it is hard for me to be more specific.
    Again, generally, if you cannot achieve the desired effect with Presentation Variables, you should resort to JavaScript, assuming the result is worth the effort.
    Cheers,
    Janis R

Maybe you are looking for

  • HI Regarding smartforms

    HI, 1.  I downloaded one smartform.     If in that text in the text element is written ater some spaces.     IF i upload the same form ,will the layout come same, or text in the textelements is moved left? 2. How can i see history of changes done to

  • 2012 Honda Accord // Software Upgrade from 7.1.x to 8.2

    Hi, I just upgraded my iphone5 from 7 point something to 8.2.  (I held off so long because of previous bad experience).  Now, I am unable to control the ipod/itunes through my Honda Stereo controls.  When I try to advance a song through the steering

  • Immediate attention please help

    please help me determine if i have to use bmp in this scenario, I am positive i have to use bpm in this case: Sender: r3<idoc> async Rcv: webservice sync I need to update the status of the idoc outbound from R3. Now i know that i can use the systat01

  • HTTPS Receiver Scenario

    Hi, My Scenario is File-XI-HTTP I have configured an HTTPS receiver scenario for which I have created an external HTTP destination and also certificates. When I do the test connection I am able to connect successfully. Also in SXMB_MONI the status of

  • Next firmware for To

    There is one thing that has really bugged me about the Zen touch's firmware. I owned an iPod but returned it cause I didn't enjoy it's batterylife, but one thing it had that the Zen doesn't have is when playing music from an album, it plays by track