Add color to an Additional Field inside a SAP Query (Infoset) in ALV

I made an Infoset (transaction SQ02) out of table MARC. I created an Additional Field called "STATUS" which I coded to get a value of 1 or 2 depending on the value of another field in MARC.
How can I make this cell in the resulting Query to appear in different colors depending on the value? I found the command "FORMAT" but that doesn't work on SAP List Viewer (ALV) mode.
This is what I coded in the additional field called STATUS::
clear: STATUS.
if MARC-DISPO = 001.
  format intensified color = 6.
  move '1' to STATUS.
else.
  format intensified color = 7.
  move '2' to STATUS.
endif.
The coloring didn't work. What ABAP command should I add to this additional field to make the coloring of the STATUS cell work under ALV mode?

field catalog and layout are saved into database aqrdb
just before displaying the results into ALV table, they are retrieved by function RSAQRT_ALV_DISPLAY which does
concatenate rtmode-act_report sy-langu into l_srtfd_pattern.
  import fieldcat = fieldcatalog
         layout   = layout
         sort     = sort
         from database aqrdb(lv) id l_srtfd_pattern.
so in order to display some cells with a different color, you have to
- add an additional field that will contain the color codes of cells
- set values in this field at record level (field is a table of type LVC_T_SCOL)
but also adapt the layout in order to set the field as containing the colors
- put the name of this field into layout (CTAB_FNAME)
- export layout to corresponding entry of aqrdb
this part I don't see exactly where to put it, I guess there is some place where it is possible to manage the layout - if not then you have to do it "manually" i.e. with a small report

Similar Messages

  • Adding code to additional fields in Ad Hoc Query

    Hello,
    I am trying to add code to existing additional fields available in IT0001 - Field SYHR_A_P0001_AF_PL_CTRY.
    I have added code in the field code section, but the field does not get populated.
    I also tried to add code to Start of selection / Record processing sections, but the values are not populated.
    What am I doing wrong?
    Thanks,
    Vaishali

    Hi Vaishali,,
       Your question is not clear, no probs. you plz check  this code !!
      FUNCTION zhrintf_om_pernr_info_adhocqry .
    ""Local Interface:
    *"  IMPORTING
    *"     VALUE(FI_PERNR) TYPE  PA0001-PERNR
    *"     VALUE(FI_BEGDA) TYPE  PA0001-BEGDA
    *"  EXPORTING
    *"     VALUE(L_MC_STEXT) TYPE  HRP1000-MC_STEXT
      DATA: dep_text(40) TYPE c,
            l_plans TYPE pa0001-plans,
            l_sobid TYPE hrp1001-sobid,
            l_mc_short TYPE hrp1000-mc_short.
    Get Employee Position ID
      SELECT SINGLE plans
        FROM pa0001
        INTO l_plans
        WHERE pernr = fi_pernr
              AND begda LE fi_begda
              AND endda GE fi_begda.
      l_sobid = l_plans.
    Check if OU is Department
      IF ( l_sobid NE '00000000' ) AND ( l_sobid NE '99999999' ). " Terminated Employee
        WHILE NOT ( ( l_mc_short(1) EQ '2' ) OR ( l_mc_short(1) EQ '1' ) OR ( l_mc_short(1) EQ 'X' ) ).
          SELECT SINGLE sobid FROM  hrp1001
                 INTO l_sobid
                 WHERE  objid  = l_sobid
                 AND    rsign  = 'A'
                 AND    sclas  = 'O'
                 AND    begda LE fi_begda
                 AND    endda GE fi_begda.
          SELECT SINGLE mc_short mc_stext FROM  hrp1000
                 INTO (l_mc_short, l_mc_stext)
                 WHERE  otype  = 'O'
                 AND    objid  = l_sobid
                 AND    begda LE fi_begda
                 AND    endda GE fi_begda.
    Empty l_mc_stext if OU is not Department
          IF NOT ( ( l_mc_short(1) EQ '2' ) OR ( l_mc_short(1) EQ 'X' ) ).
            l_mc_stext = ''.
          ENDIF.
        ENDWHILE.
      ENDIF.
    ENDFUNCTION.
      Regards
    Zulfikhar Ali

  • How to control field length in SAP query's report output

    HI everybody,
    I have one scenario in SAP query in which there are two fields in the report output:
    Milestone descrition and milestone description Long Text.
    In CJ02 (WBS element overview), these two fields are populated with some text.
    If description is exactly same as LOng text, long text is NOT getting displayed in output.
    If long text is having more characters than description then only long text gets displayed in the output.
    Do we need to change infoset or query settings? I haven't handled SAP query programming before.
    PLease give some suggestions how to achieve this or I have to write custom report.
    Any inputs on this will be highly appreciated.
    Regards
    Kaushal

    Hi,
    Refer to this link..Additional field in SAP Query
    [Creating Additional Fields |http://help.sap.com/saphelp_nw04/helpdata/en/d9/9958e0c50a11d396f80000e82de14a/frameset.htm]
    [Code|http://help.sap.com/saphelp_nw04/helpdata/en/d9/9958e0c50a11d396f80000e82de14a/frameset.htm]

  • Change the description of a field in a SAP QUERY

    Can i change the description of a field in a SAP QUERY report in the output of the report.or only the standard descriptions can be displayed.
    Edited by: mysap query on May 12, 2009 7:23 AM

    HI,
    in query maintenance (sq01) you can change the text of the field at the selection screen (change the selection text in the screen where you choose the selection fields) and the header text in the output list (basiclist maintennace , go to "basic list header", double-click each header field to maintain the text). This change is only for the particular query. No ABAP-er required to do so.
    BR Christian

  • How to add Additional fields in standard SAP Report RMCLOBJVN ,TCODE CL6BN

    i am facing problem in Report RMclobjvn , TCODE is CL6BN
    i have to add some additional fields on the result screen.
    but when i search inside the report i could not retrieve any user exits but through a search utility i got 4 user exits of which 2 seem to be useful.these are
    <b>Exit name
    CLCLRS01  Additional Fields on the Result Screen
    CLCLRS02  Fill the Additional Fields on the Result Screen</b>
    i activated the these exits and have tried putting in break point in side the include.
    But the problem is this that
    [<b>b]that CL6BN Tcode is not triggering anyhow these userexits.</b></b>
    does anyone has any solution for adding the additional fields.

    Hai Manish
    Check the following Links
    You can do it in two ways using append structure or include structure of that standard table.
    once you added , you need to adjust it and activate using the menu utilities->data base utulity-> Activate and Adjust .
    check this SAP help..
    for append structure
    http://help.sap.com/saphelp_nw04/helpdata/en/cf/21eb61446011d189700000e8322d00/frameset.htm
    for include structure.
    http://help.sap.com/saphelp_nw04/helpdata/en/cf/21eb54446011d189700000e8322d00/content.htm
    Regards
    Sreeni

  • Adding additional fields on standard SAP pop up box

    Hi Experts!!
    I have to enhance IT0378(Adjustment Reasons) with additional fields. Same time I have to enhance a pop box wich is generating  in IT0171( General Benefits) in CE workbench.
    ( if you click on workbench, we get a popbox with a statement ' Benefit data for other Personnel assignments' . Selet green right mark with name 'work bench'. It will take you to Concurrent Employment Benefit Workbench screen. Choose any position in the left side then select create Adjustement reason button. you will get a pop box. Exaclty here i have to add the fields whatever i am going to enhace in IT0378 )
    Could you please give some easy steps to get it done.
    Regards,
    Ravi Visarapu.

    http://wiki.ittoolbox.com/index.php/Implement_a_screen_exit_to_a_standard_SAP_transaction

  • How to add new codes into SAP Query/Infoset

    Hi Experts,
    First time working with SAP Query.
    I need to enhance an existing Query to add a new field into a report.  I have added new tables into this Infoset and joined my new  tables with existing tables and able to extract the new fields out on the report.  But here are my problems:
    Example of original output:
    X88888 500000
    X99999 400000
    Example of new output after adding my 2 new tables to get 1 new field to output:
    X88888 50000  01/08/2009
    X88888 50000  01/25/2009      <--- for X88888 customer, I want only this record w/ latest date to be output
    X88888 50000  01/22/2009   
    X99999 40000  03/09/2009
    X99999 40000  04/18/2009
    X99999 40000  04/19/2009      < -- for X99999, I want only this record w/ latest date to be output
    Where/How i can add the code to control this logic so that only 1 record per customer with the highest date can be output.  I looked at the query program and it looks very confusing and hard to understand.
    Please advise,
    Thanks,
    Sam

    Hi Sam,
    Instead on adding new table/tables , better way to use Direct Read from your single table.
    Please read the below steps to suffice your requirement.
    Assumption: Let your original table be A and second table is B.
                            Tables A and B are having field X1 and X respectively, using these fields, they can be joined.
                             You want field date1 of table B.
    Infoset Changes:
    1. Go to SQ02 (Enter Infoset name, click on Change button)
    2. Create an extra field E_date of type date (Sy-datum), by clicking on 'Extras' (F5) button.
    3. Select that field in one of the field group of your Infoset.
    4. Click on Code Icon (Shift+F8) displayed on application bar, you will be getting lists events in 'Code section'.
    5. In Data Section , declare an internal table like below code (here pseudo code)
    data: begin of itab_date occurs 0,
                       date1  like B-date1,
                       end of itab_date.
    6. In Recod processing Event write the following code.
    CLEAR itab_date.
    CLEAR E_date.
    SELECT date1 FROM B into table itab_date                           " Retrieving date field from table B
    WHERE X = A-X1.
    Sort itab_date by itab_date-date1  DESCENDING.                 "Sort internal table B in decendind order on date1
    READ TABLE itab_date index 1.                                            "Read first record of interanal table
    E_date  = itab_date-date1                                                      "Assigning top most date of internal table into field E_date.
    7. Generate the Infoset
    Query changes
    1.Go To SQ01 (in a new session),
    2.Give your Query name, click on change button, and select that field group in which you have added extra field.
    3.Select extra field.
    4.Go to basic list to select that field in your O/p list.
    5.Click on Test button, and see if you are getting desired result.
    Please let me know if you need further details.
    Regards,
    Dinesh

  • Field selection in SAP query

    Hello Team,
    I have a query on SAP query. I have the field MSEG-KZEAR and RESB_KZEAR. Now the MSEG field is visible in sq01 and is selected as output but the table has no entries for this field. Also the entries are maintained in RESB field. But RESB table is not visible for selection in sq01; however I can see the table in sq02 but unable to select the said field as output.
    I want to select the RESB-KZEAR field for output but i am unable to do so in SQ01.
    SQ01
    SQ02
    Please help to do so.
    Thanks again for your time,
    Beryl

    Hi Beryl,
    Please move your RESB-KZEAR field into Group fields using drag and drop in SQ02.
    and activate your SAP Infoset aafter that you can use  infoset in Query.
    Then value will be moving from RESB table.
    Regards,
    Prasenjit Mishra

  • Show  colored circles for a field inside table view

    HI
    I need to show Colored circles based on some conditions for a field (priority) inside a table view. HOw do i implement this solution.
    PLease help

    Hi,
    You have two possibilities:
    1. HTMLB charting
    See http://www.sapdesignguild.org/resources/ma_guidelines_3/LAYOUT/chart_types.html for more info
    2. IGS charting. See this weblog for info
    /people/thomas.jung3/blog/2004/08/31/bsp-150-a-developer146s-journal-part-x--igs-charting
    You will be certainly interested in this web log
    /people/thomas.jung3/blog/2005/09/08/igs-charting-altering-the-customizing-xml-at-runtime
    I don't know if you can combine stuff in a tableview.
    See also chart graphics
    http://help.sap.com/saphelp_nw04/helpdata/en/9b/d9883672d57c73e10000009b38f889/frameset.htm
    Alternatively, you can try out the canvas tag in new browsers like Firefox. See /people/eddy.declercq/blog/2005/12/09/blank-canvas
    for this
    Eddy

  • How do I add color to a text field?

    I'm setting up a simple Flash contact form that sends a mail message using PHP. I'm using the Text Input and Text Field components and would love to style the background tint of the text fields so as to not be white. I want to be able to enter my own hexidecimal number. This seems like it should be easy, like a button or property or something, but I can't figure it out. Please help!
    Using Flash CS4 on a Mac, in an ActionScript 2.0 file. (Can make a 3.0 file if necessary).

    I'm not sure how to create an input textfield other than dragging out a component. What's the difference?
    Also, this is a difficult one to search for, since all of my attempts have given me answers on how to style the text in the field, but not the background color of the field.
    Any good tutorials on how to create custom skins?

  • Additional Field and writing code in Infoset

    Hello experts
    I need to use infoset as a data source in segmentation. We created our own infoset by joining 2 table (sales table and pricing table). We need to use total gross value per customer, so we need addtional field in ınfoset for storing it. (first we calculate the total gross value and store it in additonal field in infoset.)
    We create additonal field and write a code (create internal table and try to fill it etc.) However it doesn't work, we checked the same code from se38, ABAP editor and it works.
    So we'd like to learn that whether the syntax in infoset different, or how can we write our own code and store value in additonal value in infoset.
    Thanks in advance
    M.

    Hi Saipriya
    the code :
    data : begin of itab occurs 0,
    partner_no like crmd_order_index-partner_no,
    gross_value like crmd_pricing_i-gross_value,
    end of itab .
    data : begin of wa occurs 0,
    partner_no like crmd_order_index-partner_no,
    gross_value like crmd_pricing_i-gross_value,
    end of wa .
    data : begin of itab2 occurs 0,
    partner_no like crmd_order_index-partner_no,
    gross_value like crmd_pricing_i-gross_value,
    end of itab2 .
    data : begin of wa2,
    partner_no like crmd_order_index-partner_no,
    gross_value like crmd_pricing_i-gross_value,
    end of wa2 .
    START-OF-SELECTION.
    select partner_no
           gross_value
    into CORRESPONDING FIELDS OF TABLE itab
    from crmd_order_index join crmd_pricing_i on crmd_order_index~item eq
    crmd_pricing_i~guid
    where crmd_order_index~process_type_ix = 'ZTA'
      and crmd_order_index~pft_1 = 'X'  .
    LOOP AT itab INTO wa .
          MOVE-CORRESPONDING wa TO itab2.
      COLLECT itab2.
    ENDLOOP.
    LOOP AT itab2 INTO wa2 .
    APPEND BP_GROSS.
    actually we don't know how can we benefit from this code in infoset.
    table1 :CRMD_ORDER_INDEX (the table we take customer number (CRMD_ORDER_INDEX-PARTNER_NO))
    table2 : CRMD_PRICING_I (We take gross value form this table)
    We added BP_GROSS field (adtiona filed to infoset) and would like to append the value we have from the code (Total gross per Customer) but it doesn't work in infoset.
    Thanks in advance.
    M.

  • Add additional field on query

    Dear ,
    I have created a quick viewer.
    I need to add an additional field on a SAP query.
    This new field must be calculated as a multiplication of two fields displayed in the query.
    How can I do that ?
    Thanks

    Hello,
    In Quick Viewer, you cannot define local fields. You may convert (In SQ01->Query->Convert Quickview) SQVI Query into an SQ01 Query and then define local field.
    Thanks,
    Venu

  • Adding additional fields in Sql Query (SQ01)

    Hi..
    please tell me all the steps to use additional fields option in  sap query (transaction code: SQ01)? can i use mandt field as additional field?
    Thanks and Regards
    Sri.

    Hi,
    You can add it in infoset using extra button.
    Here you can add the filed and the respective code for this field and add this in SQ01 in oytput list.
    Thanks
    Ajay

  • SAP Query - Additional field that collects information from table RESB

    Hello gurus. I have a question.
    I want to create a SAP Query that shows me the stock level of a list of materials, and also show me the total quantity of order reservations in an additional field.
    I created an InfoSet with table MARD, which is the one that holds the Stock information in a plant. Then I created an additional field which would read information from table RESB, the table that holds order reservations per material.
    So I wrote this piece of code:
    SELECT * FROM RESB
    WHERE MATNR EQ MARD-MATNR and
           WERKS EQ MARD-WERKS.
    ENDSELECT.
    if ( sy-dbcnt NE '0').
          MOVE RESB-BDMNG to ZQTY.
    ELSE.
          MOVE '' to ZQTY.
    ENDIF.
    This works fine. However, this is currently just catching the first record in table RESB that matches my condition.
    What I would like is to collect every instance of RESB-BDMNG and add them to field "ZQTY", have it loop in RESB until it finishes finding every record that match the MATNR and WERKS. With this I could get the total number of order reservations that this material has in that table.
    Could someone share some coding that would help me achieve this?

    Yes! That did it. That's what I needed to do. Thank you so much.
    While I'm at it, let me ask you a related question.
    When I execute the query, in the first records of the query where there's no value from RESB to transfer, the value of field ZQTY appears empty. Once it finds the first record in RESB and it populates ZQTY with a value, then the rest of the records with no hit get the proper value of 0.
    Do you know why the first records in the query appear empty and not with a 0? Is there anything I should add to the coding to fix this?

  • How to add new customise field in standard SAP ME28 Report?

    Hi Anybody,
             How to add new customise field inside Standard SAP Screen report ME28?.
    Anybody, Please tell me how to do?.
    Thanks,
    Regards,
    S.Muthu.

    Hi Subramaniyam,
    You can find enhancement in me28 by following steps and then apply your logic in include of this enhancement.
    cmod>Give a project name>in enhancement column give the package name ME >f4>in package write ME-->ENTER>It will show you all enhancements available in me28> find which ever suits your requirement>save > click on components> from there you can make changes in include program.to add that particular field.

Maybe you are looking for

  • Sharepoint web part Page Load issue

    Hi ,  We are developing Sharepoint 2013 Integration application, We are fetching the data from third party application and dumping data into sharepoint List for offline analysis. Synchronization steps 1) fetch data from third party application 2) del

  • Issue in Transport Request

    Hi, I am trying to understand how does transport works. I have a issue while moving some SAP BW objects. Transport X - Containts - A process chain , Transformations, some newly created variants and routines. - Moved to Q. Now the problem is I dont ne

  • How to disable block and delete button in me22n transaction

    Hi experts !, as per my requirement i want to disable delete and block button in me23n . for this i wrte my logic but problem is when my logic satisfies then i want to disabele those two buttons . those block button function code is 'MEPO1211LOCK' if

  • BSOD ntoskrnl.exe?

    Got a bsod with 0x00000124 . Heard blue screen viewer can be wrong sometimes but it said ntoskrnl.exe was the problem? Not sure if I'm using this thing correctly but this is the minidump http://1drv.ms/1wvmcmq Also am running driver verifier and rest

  • Re 2000

    anyone have suggestions for bringing the re2000 online.  i have tried setup and it is unsuccessful.  currently i have the extender hardwired into the wireless router..  I had support online but cannot get back to that part of the web.