Dynamic color selection in Smartforms using tables

I am printing a smartform in pdf, i am using  tables in smartforms where the number of column is dynamic, and say there can be cases where there will be no data in a particular column and if that is the case than i have to print a particular color say grey, so my question is how to achieve this functionality in smartform dynamically, i am printing it in PDF.
Regards & thank,
Pritam.

you need to create the 2 text elements , and put the condtion like below
if not value is initial.
display text1
else
display text2.
endif.
in text2 element > Output options> put the color. which you want...

Similar Messages

  • Dynamic Tray Selection in Smartforms

    Hi all,
    I am looking for a solution, to set the tray in a Smartform dynamically.
    It is not sufficient to set the Tray statically on the "Output Options" tab -> Ressource Name.
    Can anybody help me?!?
    Thanks and best regards,
    SteCee

    Normally, tray selection is done using GET_PRINT_PARAMETER FM.
    Refer to these threads, may be helpful -
    Print to different output tray in SAPscript/Print Workbench
    Automatic tray selection for printing
    Regards,
    Amit

  • Dynamic style selection in smartform depending on language

    Hi
    Today I assign a style to a smartform statically in form attributes. I don't assign styles to any subnodes.
    Is it possible to make the assignment of style to the smartform dynamically at runtime?
    (If you can suggest a completely other solution for my problem, that will also be very much appreciated).
    Reason: I have a requirement to translate a lot of smartform (maybe 100+) from English to Chinese, Japanese, Korean, Russian etc.
    I'm in a Unicode environment and the translation itself seems to work quit simple.
    But there seems to be a major problem about the font.
    In our smartforms we use smartstyles with 2 fonts helve and times.
    So far we have just translated a few smartforms to Chinese with SE63. We have also translated some material texts and addresses and we have defined a test printer with CNSAPWIN.
    Test prints now shows that we can print all the Chinese texts, but all the texts and numbers that is not translated into Chinese (i.e. quantity, price, net value etc.) is printed with a bigger font size.
    Now this is a know problem discussed in more forum threads and OSS nodes, and the solution seems to be, to change the style to use special Chinese fonts and adjust the font size.
    We have tested this at it seems to solve the problem. But all the threads and notes discussing this issue is talking about "the English smartform" and u201Cthe Chinese smartform" and so on. This is not very smart.
    If we follow this strategy and creates a form for each special language (special from our perspective), we will need 5 different versions of every smartform and the time needed for future maintenance will increase dramatically.
    A much better solution would be to have one smartform that is translated with SE63 and only make 5 different styles to handle the different fonts etc. This solution requires however that we can assign the styles to the smartforms dynamically at runtime.
    Yours sincerely / Med venlig hilsen / 此致敬礼 / Mit freundlichen Grüßen / Pozdrawiam
    Thomas Madsen Nielsen

    Hi!
    In SAPScript there is an option for this, using the STYLE keyword. However I don't know will it work in Smartforms or not.
    If it is not working, I think you have to different character and paragraph formats within 1 smartstyle for each language.
    About the STYLE keyword:
    Changing the Style: STYLE Locate the document in its SAP Library structure
    The STYLE control command allows you to change the style within a text. The new style is in force until another STYLE command is issued. If you specify * as the name of the style, then the system reverts to the default paragraph of the original style or form.
    Syntax:
    /: STYLE style
    /: STYLE *
    A style set with this command has no effect in a text included with INCLUDE. The system takes the paragraph and character formats from the calling text. To use the style set with STYLE in the INCLUDE text as well, you must add DOMINANT to the command.
    Note
    If the INCLUDE text has a style assigned to it, in both cases, the system always takes the paragraph and character formats from the directly assigned style.
    Regards
    Tamá

  • How to do column calculation in smartforms using table

    Hi,
    In Smartform Table..I created main area ( as TABLE) having  columns 
    POSNR(CELL7),   MATNR(CELL8),  FKIMG(CELL9),  VRKME(CELL10),  UPRICE(CELL11),  NETWR(CELL12)....
    Here UPRICE--- Calculate this field as Unit price = Amount / Billed Qty.
    For this....I created a Flow Logic at CELL11
    CELL11(Right click)
    CREATE---FLOW LOGIC -
    PROGRAM LINE
    Provided code:
    UPRICE = WA-NETWR / WA-FKIMG.
    Its showing the run time error
    Reference field WA-NETWR unknown in form
    what i have to do now for calculating UPRICE in this case...
    <offer removed by moderator>
    Thanks
    Lohit
    Edited by: Thomas Zloch on Jan 11, 2011 11:36 AM

    retreived the five column ( POSNR MATNR FKIMG VRKME NETWR )  values by providing code in GLOBAL SETTINGS -- INITIALISATION (TAB)
    SELECT POSNR MATNR FKIMG VRKME NETWR  INTO CORRESPONDING FIELDS OF TABLE
       ITAB FROM VBRP WHERE VBELN EQ PVBELN.
    And in  MAIN AREA-----Table -
    DATA (Tab) provided
    Loop
    Internal Table   ITAB  TO  WA.
    Created Text at each cell as
    WA-POSNR(for Cell 7),
    WA-MATNR (for Cell 8),
    WA-FKIMG(for CELL9),
    WA-VRKME(for Cell 10),
    UPRICE(for Cell 11),
    WA-NETWR(for Cell 12)

  • Dynamic color selection

    Hi
    Is is possiable to display the color palatte of developer during run time so that the user can chose the color for some fields based on his choice.
    null

    you need to create the 2 text elements , and put the condtion like below
    if not value is initial.
    display text1
    else
    display text2.
    endif.
    in text2 element > Output options> put the color. which you want...

  • Unable to  use Table name in a variable

    Hi,
    I am trying to build a select statement which uses table name in a variable. Please help me in building such statements.
    Regards
    Kishore

    Hi,
    I am trying to build a select statement which uses table name in a variable. Please help me in building such statements.
    Regards
    Kishore

  • To color selected cells in dynamically created table in ALV.

    Hi,
           The requirement is to display a table (whose columns are dynamic) using ALV n to color few cells of the table based on some condition.
    For creating the table dynamically i have used the method cl_alv_table_create=>create_dynamic_table.
    Now for coloring the cells i tried to use the field EMPHASIZE .
    But when I try this method the whole column is getting colored.
    So any suggestions on how to color only particular cells.

    Hi,
    Try this one...
    DATA: gs_layout TYPE slis_layout_alv, "Define layout
    gt_color TYPE lvc_t_scol WITH HEADER LINE. "Define Internal Table for Cell Colouring
    Use below Sample Code after building a Field Catalog:
    gs_layout-coltab_fieldname = 'COLINFO'.
    " 'it' is the final internal table which contain positive & negative value of Field 'MENGE'
    LOOP AT it.
    REFRESH gt_color.
    CLEAR gt_color.
    IF it-menge GE 0.
    CLEAR gt_color.
    gt_color-fname = 'MENGE'.
    gt_color-color-col = cl_gui_resources=>list_col_positive.
    gt_color-color-int = 0.
    APPEND gt_color.
    ELSEIF it-menge LE 0.
    CLEAR gt_color.
    gt_color-fname = 'MENGE'.
    gt_color-color-col = cl_gui_resources=>list_col_negative.
    gt_color-color-int = 0.
    APPEND gt_color.
    ENDIF.
    it-colinfo[] = gt_color[].
    MODIFY it.
    ENDLOOP.
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
    EXPORTING
    i_callback_program = g_repid
    is_layout = gs_layout
    it_fieldcat = ct_fieldcat
    i_save = 'A'
    TABLES
    t_outtab = it
    EXCEPTIONS
    program_error = 1
    OTHERS = 2.
    Hope this solves your problem.
    Regards,
    Tarun

  • How to retrieve values from Dynamic Selection screen while using LDB  - PSJ

    I am having problem in PSJ Logical database. In a custom report which is using PSJ LDB, we are using PROJ and PRPS_R tables.
    When I run program it displays one dynamic selection screen, there we are giving selection criteria for PRPS (Master data WBS element) - Created on (giving some range like 2011/01/01 to 2011/01/31).
    So I want to display all WBS element which are created during the period (2011/01/01 - 2011/01/31).
    How do I retrieve the select-option low and high value of the field Created on Of WBS element if we Select data from any table based on this condition.
               Please help me.
    Thanks.

    in fact you don't have to get the values, you only need to tell to the program to take them into account :
    GET PRPS.
      CHECK SELECT-OPTIONS.

  • Dynamic data select from table is giving dump

    Hello Experts,
       Below statement is giving Dump after it move all the data in my dynamic table.
    When i see in debug. All my recored are avilable in <T_TAB> Table.
    SELECT * FROM (pa_tab) INTO CORRESPONDING FIELDS OF TABLE <T_TAB>.
    > IF SY-SUBRC = 0.
    Information on where terminated
    The termination occurred in the ABAP program "ZFIR_ZTABLE_UPLOAD" in
    "F_DOWNLOAD".
    The main program was "ZFIR_ZTABLE_UPLOAD ".
    The termination occurred in line 403 of the source code of the (Include)
    program "ZFIR_ZTABLE_UPLOAD"
    of the source code of program "ZFIR_ZTABLE_UPLOAD" (when calling the editor
    4030).
    Processing was terminated because the exception "CX_SY_OPEN_SQL_DB" occurred in
    the
    procedure "F_DOWNLOAD" "(FORM)" but was not handled locally, not declared in
    the
    RAISING clause of the procedure.
    The procedure is in the program "ZFIR_ZTABLE_UPLOAD ". Its source code starts
    in line 399
    of the (Include) program "ZFIR_ZTABLE_UPLOAD ".
    please help me.
    Regards,
    Amit
    Message was edited by:
            Amit Gupta

    Hi Amit,
    Check if you are doing the following in your program
    FIELD-SYMBOLS <T_TAB> TYPE STANDARD TABLE.
    DATA: g_tabref type ref to data.   "Reference to your table structure
    CREATE DATA g_tabref type standard table of (pa_tab).
    ASSIGN g_tabref->* to <T_TAB>.
    SELECT * FROM (PA_TAB) INTO TABLE <T_TAB>.
    Hope this solves your problem.
    Let me know if you require any further info.
    Enjoy SAP. Reward points of useful
    Rajasekhar

  • Using Table name in Read statement dynamically

    Hi Experts,
    I have the following requirement.
    Based on a country code say "A" , "B", "C" and based on this i have to read different internal tables lt_tabA, lt_tabB and lt_tabC.
    The table key can be given dynamically, but how can i use the internal table name dynamically without using if statements.
    Please help.
    Thanks!
    Best Regards,
    Gayathri

    Hi Gayathri,
    something like
    DATA:
        lt_t100 TYPE TABLE OF t100,
        lt_t000 TYPE TABLE OF t000.
      FIELD-SYMBOLS:
        <table> TYPE table,
        <rec>   TYPE ANY,
        <field> TYPE ANY.
      SELECT:
        * INTO CORRESPONDING FIELDS OF TABLE lt_t100 FROM t100 UP TO 10 ROWS,
        * INTO CORRESPONDING FIELDS OF TABLE lt_t000 FROM t000 UP TO 10 ROWS.
      CASE abap_true.
        WHEN space.
          ASSIGN  lt_t100 TO <table>.
        WHEN OTHERS.
          ASSIGN  lt_t000 TO <table>.
      ENDCASE.
      READ TABLE <table> with key ('MANDT') = sy-mandt ASSIGNING <rec>.
    Regards,
    Clemens

  • How can I pop up a Color Selection table?

    When I click on a color box control in the front panel,it will pop up a color selction table.My question is how can I control the pop up of the color selection table in the diagram?for example,if a boolean control is clicked then I want to pop up the color selection table,If the color selection table is an Active Control,what's the name if it?
    Any help will be appreciated.

    Just use a color control.
    Attached is an example. The example run as a dialog box
    Best regards;
    EJV
    www.vartortech.com
    Attachments:
    select_color.vi ‏11 KB

  • Problem in using table name dynamically in PL/SQL

    I tried to create a procedure to use table name dynamically and got the following error. Anything wrong with my procedure?
    NFADV>declare
      2   cnt number;
      3   cursor cur is select table_name from user_tables where table_name in ('EMP','DEPT');
      4  begin
      5   for c1 in cur
      6   loop
      7    execute immediate select count(*) into cnt from c1.table_name;
      8      dbms_output.put_line('Count is : '||cnt);
      9   end loop;
    10  end;
    11  /
    declare
    ERROR at line 1:
    ORA-06550: line 7, column 21:
    PLS-00103: Encountered the symbol "SELECT" when expecting one of the following:
    ( - + case mod new not null <an identifier>
    <a double-quoted delimited-identifier> <a bind variable> avg
    count current exists max min prior sql stddev sum variance
    execute forall merge time timestamp interval date
    <a string literal with character set specification>
    <a number> <a single-quoted SQL string> pipe
    <an alternatively-quoted string literal with character set specification>
    <an alternatively-quo
    ORA-06550: line 8, column 5:
    PLS-00103: Encountered the symbol "DBMS_OUTPUT"
    ORA-06550: line 8, column 45:
    PLS-00103: Encountered the symbol ";" when expecting one of the following:
    . ( , * % & - + / at mod remainder rem <an identifier>
    <a double-quoted delimited-identifier> <an exponent (**)> as
    from into || multiset bulkThanks and Regards
    Kaustubh

    Hi,
    The wrong part is in execute immediate, it should be as follows:
    execute immediate ('select count(*) from '|| c1.table_name)
    into cnt
    (not tested)
    Regards
    AK

  • Dynamic field Select from table

    Hi,
    I have to select certain field from table. The field which I have to select I do not know.
    It will come dynamically from program.
    Plz help me what is correct statement to execute.
    Thanks.
    S Sahoo

    Hi Sahoo,
    Pllease follow below steps.
    1, Create internal table with field Fieldname TYPE FIELDNAME (Say ITAB)
    2. Append Fields (thats you want to select) to internal table [at run time]
    3. Use
    SELECT (ITAB)
                  into table <table>
                  from <DB>
                  where <cond>
    Hope this helps,
    Nag

  • Can I use table function inside Dynamic query ?

    Dear Gurus,
    I have following code
    DECLARE
    TYPE CRITERIA_LIST_TABLE AS TABLE OF VARCHAR2(20);
    OtherNoList CRITERIA_LIST_TABLE; /* CRITERIA_LIST_TABLE is index by table*/
    QUERY_STRING VARCHAR2(4000);
    BEGIN
    OtherNoList := CRITERIA_LIST_TABLE();
    SELECT DISTINCT REGEXP_SUBSTR('1,5,6,4', '[^\,]+',1, LEVEL ) BULK COLLECT INTO OtherNoList
    FROM DUAL
    CONNECT BY LEVEL <= REGEXP_COUNT('1,5,6,4', '\,') + 1 ;
    QUERY_STRING := 'INSERT INTO TAB1 (C1,C2) '||
    'SELECT C1,'||
    'C2 '||
    'FROM TAB1 ,'||
    'TABLE( '||
              'CAST (OtherNoList AS CRITERIA_LIST_TABLE) '||
                   ') OTHRNOS '||
    'WHERE TAB1.C1 = OTHRNOS.COLUMN_VALUE ';
    DBMS_OUTPUT.PUT_LINE('Query String is '||QUERY_STRING);
    EXECUTE IMMEDIATE QUERY_STRING;
    END;
    Can I use Table function inside dynamic query.
    Thanking in advance
    Sanjeev

    Try:
    DECLARE
    TYPE CRITERIA_LIST_TABLE AS TABLE OF VARCHAR2(20);
    OtherNoList CRITERIA_LIST_TABLE; /* CRITERIA_LIST_TABLE is index by table*/
    QUERY_STRING VARCHAR2(4000);
    BEGIN
    OtherNoList := CRITERIA_LIST_TABLE();
    SELECT DISTINCT REGEXP_SUBSTR('1,5,6,4', '[^\,]+',1, LEVEL ) BULK COLLECT INTO OtherNoList
    FROM DUAL
    CONNECT BY LEVEL <= REGEXP_COUNT('1,5,6,4', '\,') + 1 ;
    QUERY_STRING := 'INSERT INTO TAB1 (C1,C2) '||
    'SELECT C1,'||
    'C2 '||
    'FROM TAB1 ,'||
    'TABLE( '||
    'CAST (:OtherNoList AS CRITERIA_LIST_TABLE) '||
    ') OTHRNOS '||
    'WHERE TAB1.C1 = OTHRNOS.COLUMN_VALUE ';
    DBMS_OUTPUT.PUT_LINE('Query String is '||QUERY_STRING);
    EXECUTE IMMEDIATE QUERY_STRING using OtherNoList;
    END;p.s. not tested
    Amiel Davis

  • How to dynamically display the data from a table base on row selection of another table in ADF

    Hi ,
    I have a requirement in ADF. I need to change the data of a table  based on row selection of another Table . Both the table have a Parent Child relationship between them. They have a common attribute say department_id.
                                                                                         For this I created bind variable in view object of employees table and wrote a where clause in the sql query using that bind variable. Then I created method for selection listener of department Table in java bean.
    My method is following
        public void onrowselection(SelectionEvent selectionEvent) {
            RichTable richTable = (RichTable)selectionEvent.getSource();
                            CollectionModel tableModel = (CollectionModel)richTable.getValue();
                            JUCtrlHierBinding adfTableBinding = (JUCtrlHierBinding)tableModel.getWrappedData();
                            Object selectedRowData = richTable.getSelectedRowData();
                            JUCtrlHierNodeBinding nodeBinding = (JUCtrlHierNodeBinding)selectedRowData;
                    oracle.jbo.domain.Number newVal = (oracle.jbo.domain.Number) nodeBinding.getAttribute("DepartmentId");
                    Number pallet = newVal.bigDecimalValue();
                    System.out.println("Selected values " + pallet);
            BindingContext bindingctx = BindingContext.getCurrent();
                          BindingContainer bindings = bindingctx.getCurrentBindingsEntry();
                          DCBindingContainer bindingsImpl = (DCBindingContainer) bindings;
                  DCIteratorBinding dciter = bindingsImpl.findIteratorBinding("EmployeesView1Iterator");//access the iterator by its ID value in the PageDef file
                          ViewObject vo =dciter.getViewObject();
                          vo.setNamedWhereClauseParam("DepartmentId", pallet);//enter your value
                          vo.executeQuery();
    It is printing the selected value of department id from department table in the log. But it is not able to pass the value to employees view. It is showing the following error in the log
    "Definition DepartmentId of type Variable is not found in EmployeesView1."
    I will be very thankful if someone helps me to solve this errror or is there any other way to achieve the same requirement.
    Thanks
    Nilesh

    Note quite sure why you simply wont create a viewlink for the viewobject the tables are based on..
    The viewlink attribute will be based on the departmentId and it's a simple master detail relationship which automatically uses ppr.
    However, if both tables are on the same page; using your hack about;
    On the underlying viewobject, define a viewcriteria e.g. "listById" and set your bind variable here.
    I would bind table two to a RichTable component:
    RichTable t2;
    public void onrowselection(SelectionEvent selectionEvent) {
            RichTable richTable = (RichTable)selectionEvent.getSource();
                            CollectionModel tableModel = (CollectionModel)richTable.getValue();
                            JUCtrlHierBinding adfTableBinding = (JUCtrlHierBinding)tableModel.getWrappedData();
                            Object selectedRowData = richTable.getSelectedRowData();
                            JUCtrlHierNodeBinding nodeBinding = (JUCtrlHierNodeBinding)selectedRowData;
                    oracle.jbo.domain.Number newVal = (oracle.jbo.domain.Number) nodeBinding.getAttribute("DepartmentId");
                    Number pallet = newVal.bigDecimalValue();
                    System.out.println("Selected values " + pallet);
                   refreshTable2(pallet);
            BindingContext bindingctx = BindingContext.getCurrent();
                          BindingContainer bindings = bindingctx.getCurrentBindingsEntry();
                          DCBindingContainer bindingsImpl = (DCBindingContainer) bindings;
                  DCIteratorBinding dciter = bindingsImpl.findIteratorBinding("EmployeesView1Iterator");//access the iterator by its ID value in the PageDef file
                          ViewObject vo =dciter.getViewObject();
                          vo.setNamedWhereClauseParam("DepartmentId", pallet);//enter your value
                          vo.executeQuery();
    private void refreshTable2(Number pallet){
    RichTable x=getT2();
    CollectionModel cm=(CollectionModel)x.getValue();
    JUCtrlHierBinding jcb=(JUCtrlHierBinding)cm.getWrappedData();
    BindingContainer bindings = bindingctx.getCurrentBindingsEntry();
    DCBindingContainer bindingsImpl = (DCBindingContainer) bindings;
    DCIteratorBinding dciter = bindingsImpl.findIteratorBinding(jcb.getName()+"Iterator");
    ViewObject vo =dciter.getViewObject();
    ViewCriteriaManager vcm=vo.getViewCriteriaManager();
    ViewCriteria vc=vcm.getViewCriteria("listById");
    vo.applyViewCriteria(vc);
    vo.setNamedWhereClauseParam("DepartmentId",pallet);
    vo.executeQuery();
    AdfFacesContext.getCurrentInstance().addPartialTarget(getT2());

Maybe you are looking for

  • Cmd+W and cmd+Q non-functional. Must force quit Logic 9.1.4 (SL 10.6.8)

    Upgraded from 10.5.8 all the way to 10.6.8 via combo update. The only app that has been adversely affected is Logic 9.1.4 in both 32-bit and 64-bit modes. It's really only two items regarding closing and quitting. Frankly, it seems only the shortcuts

  • Button in the Adobe Frorm

    Hi I have developed one application ( Interactive Form ) in Webdynpro for Java ..Iam getting the data by executing the FM . I need to place a button in the adobe form . How can i bind the action to button...(Interactive form) Thanks Kirankumar M

  • [Java]Java Library for CVS and SVN

    Hi! I need Java libraries for my application. I want to manage repository CVS and SVN directly form Java code and not with a graphic interface. I've found some SVN library(for example SVNKit) but I don't found any CVS library. Can you help me? Thanks

  • All 3 usb ports not working on windows 8.1

    Hi  i will try again Hi i was trying to download music via my ipod 6th Generation, but itunes did not reconise my ipod this has never happened before, i uninstalled and re installed several times. so went and looked into devices and the yellow triang

  • IS-U - CRM integration

    Hi, I'm setting up an initial load between IS-U (472) and CRM4.0 Does anybody have any experience with this? - The initial load concerns an enormous amount of data (up to 1.3 million contracts): does anybody have an idea of the average runtime to upl