How to create table field inside the dynamically created table?

Hi, All!
I have created dynamic internal table (using field catalog and CALL METHOD cl_alv_table_create=>create_dynamic_table )
and put this table  into FM REUSE_ALV_GRID_DISPLAY. ALV grid work. Now I need to color rows of my ALV, therefore  I have to insert new column with name "COLORS" and type lvc_t_scol. I  see three ways to do it , but all ones are unsuccessful:
1. Insert column into field catalog. FM REUSE_ALV_FIELDCATALOG_MERGE does not return info about "COLORS" I guess because COLORS is a table.
2. Insert column into field catalog manually. It provides a short dump during dynamic table creating or during call of REUSE_ALV_GRID_DISPLAY.
3. Create dyn table first, then add new field . I could not find a way how to do it :(((((((
Can somebody help me?
Tatiana

Hi,
Here is the solution for this problem, Sample code:
*& Report  ZCHA_ALV_GRID_CELL_COLOR                                    *
REPORT  ZCHA_ALV_GRID_CELL_COLOR                .
TABLES:MARA.
DATA: W_CONTAINER         TYPE SCRFNAME VALUE 'ALV_CONTAINER',
      W_GRID              TYPE REF TO CL_GUI_ALV_GRID,
      W_CUSTOM_CONTAINER  TYPE REF TO CL_GUI_CUSTOM_CONTAINER.
     W_EVENT_RECEIVER    TYPE REF TO LCL_EVENT_RECEIVER.
*layout
DATA: WA_LAYOUT           TYPE LVC_S_LAYO.
*field catalog
DATA: IT_FIELDCAT_WRT_OFF TYPE LVC_T_FCAT,
      WA_FIELDCAT_WRT_OFF TYPE LVC_S_FCAT.
DATA:BEGIN OF IT_MARA OCCURS 0,
     MATNR LIKE MARA-MATNR,
     MAKTX LIKE MAKT-MAKTX,
     CELLCOLORS TYPE LVC_T_SCOL,
     END OF IT_MARA.
SELECT P~MATNR
       Q~MAKTX
       INTO CORRESPONDING FIELDS OF TABLE IT_MARA
       FROM MARA AS P INNER JOIN
            MAKT AS Q ON
            PMATNR = QMATNR.
CALL SCREEN 100.
*&      Module  STATUS_0100  OUTPUT
      text
MODULE STATUS_0100 OUTPUT.
  SET PF-STATUS 'STATUS'.
SET TITLEBAR 'xxx'.
  IF NOT W_CONTAINER IS INITIAL.
    CREATE OBJECT W_CUSTOM_CONTAINER
             EXPORTING CONTAINER_NAME = W_CONTAINER.
    CREATE OBJECT W_GRID
             EXPORTING I_PARENT = W_CUSTOM_CONTAINER.
  ENDIF.
  CLEAR IT_FIELDCAT_WRT_OFF.
  REFRESH IT_FIELDCAT_WRT_OFF.
  WA_FIELDCAT_WRT_OFF-FIELDNAME = 'MATNR'.
  WA_FIELDCAT_WRT_OFF-COL_POS   = '1'.
  WA_FIELDCAT_WRT_OFF-OUTPUTLEN = '35'.
  WA_FIELDCAT_WRT_OFF-SCRTEXT_L = 'Material No'.
  APPEND WA_FIELDCAT_WRT_OFF TO IT_FIELDCAT_WRT_OFF.
  CLEAR WA_FIELDCAT_WRT_OFF.
  WA_FIELDCAT_WRT_OFF-FIELDNAME = 'MAKTX'.
  WA_FIELDCAT_WRT_OFF-COL_POS   = '2'.
  WA_FIELDCAT_WRT_OFF-OUTPUTLEN = '45'.
  WA_FIELDCAT_WRT_OFF-SCRTEXT_L = 'Material Desc'.
  APPEND WA_FIELDCAT_WRT_OFF TO IT_FIELDCAT_WRT_OFF.
  CLEAR WA_FIELDCAT_WRT_OFF.
  DATA LS_CELLCOLOR TYPE LVC_S_SCOL.
  READ TABLE IT_MARA INDEX 5 .
  LS_CELLCOLOR-FNAME = 'MATNR'.
  LS_CELLCOLOR-COLOR-COL = '3'.
  LS_CELLCOLOR-COLOR-INT = '1'.
  APPEND LS_CELLCOLOR TO IT_MARA-CELLCOLORS.
  MODIFY IT_MARA INDEX 5.
  WA_LAYOUT-CTAB_FNAME = 'CELLCOLORS'.
  CALL METHOD W_GRID->SET_TABLE_FOR_FIRST_DISPLAY
    EXPORTING
      IS_LAYOUT       = WA_LAYOUT
    CHANGING
      IT_FIELDCATALOG = IT_FIELDCAT_WRT_OFF
      IT_OUTTAB       = IT_MARA[].
ENDMODULE.                 " STATUS_0100  OUTPUT
*&      Module  USER_COMMAND_0100  INPUT
      text
MODULE USER_COMMAND_0100 INPUT.
  CASE SY-UCOMM.
    WHEN 'BACK'.
      LEAVE TO SCREEN 0.
  ENDCASE.
ENDMODULE.                 " USER_COMMAND_0100  INPUT
Try to assign appropriate points.
Regards,
Suman

Similar Messages

  • How to update ABSKZ field in the table EKPO

    Hi
    Is there any way to update the rejection indicator (ABSKZ) field of table EKPO?.
    I am looking at BAPI_CHANGE_PO FM, But it does not have ABSKZ field in the item structure BAPIMEPOITEM.
    Do I need to extend the BAPI structure with ABSKZ field ?
    Regards
    Raj.

    Hi
    To extend  BAPI_PO_CHANGE  for EKPO-ABSKZ field , we have to add field in the structure BAPI_TE_MEPOITEM to pass it to  EXTENSIONIN. As ABSKZ field already availble in the EKPO it is not allowed to add ABSKZ in the structure BAPI_TE_MEPOITEM. it is throwing below error message.
    Field ABSKZ in table EKPO is specified twice. Please check
    Since it is not Z field and also not availble in the structure BAPIMEPOITEM  not sure how to update ABSKZ field in the EKPO table.
    Please advice.
    Regards
    Raj

  • How to get form fields in a dynamic page as a portlet

    I have a dynamic page(publish as portlet and added to a portal page) with a html form that has many radio button created dynamically (query a table and create as many radio button as records I found) and the name of each radio button is the id of the record from the table it represents.
    When I click the submit button of my form it will recall the same portal page and then I have to check which radio buttons where selected to update the database depending on it.
    The problem is that I can't get the radio buttons inside the dynamic page because they are created dynamically so I can't make them portlet parameters to be associated with page parameters.
    So How can I tell which radio buttons have been selected?
    Please help me.

    Hi,
    Write a procedure which will be called as the form action. This procedure should take an array of parameters like p_arg_names and p_arg_values. For example
    <html>
    <form>
    <input type="checkbox" name="p_radio">
    <input type="checkbox" name="p_radio">
    </form>
    procedure submit_form(p_radio in wwv_utl_api_types.vc_arr)
    begin
    for i in 1..p_radio.count
    loop
    htp.p(p_radio(i));
    end loop;
    wwv_redirect.url(<page_url>);
    end;
    Hope that helps.
    Thanks,
    Sharmila

  • How to add new fields to the system form (Ex.expenses to a/r invoice form)

    hi
    can any one tell me how to add new fields to the system form (Ex.expenses to a/r invoice form)
    i want to add expenses field to system a/r invoice form and connect data base also.
    i used the code of samples\11.system form manipulation(vb.net) but i'm not able to get it....so can any one help with code or concepts.
    reply soon plz..
    thankQ

    If I understood you correctly, you are just trying to add new fields to the invoice form and then use them in your form. you should first go and add the field to your tables, which you would do by going to Tool --> User Defined Fields --> Manage User Fields. There are different documents or categories given. For ex. for invoices, Sales Orders you would add your field under the Marketing Documents. If you want the field to be just one per invoice, add it to the Title, otherwise if you want a field per invoice or Sales Order line, add it to the Rows section. Once you have done that then you can just create a edit box or drop down to represent the field and set the datasource for that to your field. If you want example code to do that, let me know.

  • How to Add IBAN Field in the Bank Details Infotype?

    Hello All,
    I need to know the procedure for How to add IBAN field in the bank details infotype?
    Could anyone help me please.
    I m new to SAP HR.
    Immediate help will be appreciated.
    Thanks.
    Regards,
    Mudassir.Imtiaz

    Hi mudassir,
    For IBAN implementation:
    1. Implement SAP Notes 925410, 1409674, 1405521
    2. Go to t-code FIBF - From menu select Settings - P/S Modules - of an SAP Application - Create entry
    For Turkey we've added the following entry (depends on country) :
    00003040 TR CONVERT_IBAN_2_BANK_ACCOUNT_TR
    3. Go to V_T588M for module pool MP000900 and screen 2000 select IBAN & Q0009-IBAN00 fields as standard.
    4. Go to table T77S0 and make value of ADMIN IBAN entry S.
    Regards,
    Dilek

  • How to select this field  for the extractor?

    Hi Gurus, I hope you are fine!
    I need to extract the field     PRED_OPPT_GUID   form the Data source  0CRM_SRV_CONTRACT_H inside CRM system.
    If I go inside CRM to:   
    Transaction SBIW -> Settings for BW Adapter -> Maintain DataSource and Enhance BW Adapter Metadata ->
    tipe "0CRM_SRV_CONTRACT_H" and press change buttom -> Mapping TAB
    there I can see the field I need "PRED_OPPT_GUID"  but this is not selected at the "BW Selection" Column , I guess this is the cause why I am not receiving this field from the extractor, Am I right?
    If yes, How can I select this field  for the "BW Selection" Column? (the system does not allow me to click it directly)
    if not, what is the proper procedure if I need to extract this field ? because this is the key field  for  the DSO 
    " Service Orders: Header Data "
    Thanks

    This is what i can see inside the  ROOSFIELD table:
    Filtered by data source = 0CRM_SRV_PROCESS_H
    Comparison with another field:
    BILL_TO_PARTY  (working properly)    columns:        SELECTION = X              NOTEXREL= Y
    PRED_OPPT_GUID (Not working)           columns:        SELECTION = (Empty)    NOTEXREL= Y
    I think that if I try to change the Selection field to X it will cause inconsistencies with the SMOXRELP table am I right ?
    I tried to change using the system and not directly into the tables, but thaere was an inconsitecie between these 2 tables.
    Why is no able this field taking into account that this is the KEY FIELD inside the standard DSO? it has no sense to me.
    What do you think?
    regards.

  • CRM  IC Winclient - How to add new fields in the BP Search of TRX CIC0

    Hello Experts,
    I want to know how to add new fields in the BP Search of TRX CIC0. In the HTML that we're using here I need to add the URL of the BP.
    Can you help me?
    Thanks in advance.
    Caíque Escaler

    Hi
    make append to tables in se11 - CCMBP1FIELDS, CCMBP2FIELDS
    in spro in Define customer-specific search control -> mark fields with X.
    and enhance html template CRM_CIC_SEARCH_DISPLAY. -> tcode smw0, look for package CRM_CIC_COMPONENTS for html CRM_CIC_SEARCH_DISPLAY. export it from SAP, edit, and import.
    you will need to enhance function module used for searching - you will find him in spro in Search Strategies.
    Regards
    Radek

  • How can I publish artwork inside the artboard only?

    How can I publish artwork inside the artboard only?
    As I don't want to show anything outside the artboard when I publish it.
    Also, how can I make the published swf file fit to the artboard size? As I don't want to show the white area outside the artboard.
    Hope someone could help! Many thanks!

    One thing I have noticed is that when you embed the .swf, if you don't designate the widht and height, sometimes you will see some of the extra outside the artboard. For example:
    I uploaded my published files to www.website.com/flash and my .swf is at www.website.com/flash/Main.swf. If I just use that url I will see the extra from Main.swf. However, if I create a page where I embed the .swf, like www.website.com/main.html, I no longer see it.

  • How to validate input fields as the user is filling up a form with jQuery?

    Hello EA friends.
    Someone has experimented on how to validate input fields as the user is filling up a form with jQuery?, if the field is numeric and insert an A for example, an alert appears showing "insert a number" or not allowed to enter anything until a number is entered.
    Thanks and regards.
    Fer

    Hi Sudeshna.
    Sorry for not responding on time, how can I be included in this code?
    sym.setVariable("typeActivity", "input")
    var Element_1=document.createElement(typeActivity);
    $(Element_1).css({"text-align": "center"});
    //Answer
    sym.setVariable("Answer_1", "4");
    sym.$("box_1").append(Element_1)
    This code is on my creationComplete and it works fine.
    Would greatly appreciate your help.
    Regards.
    Fer García

  • Anyone can Help on {suppress} [database fields] inside the [fields]

    Reason to put database fields inside the fields
    1. I put in (word and database fields) inside fields box in order to let my word display smoothly one by one.
    Problem is , i am in section report footer d, i plan to suppress {Qrev if the value is "AAA"}
    got this type of function?
    If the Qrev = "AAA" than  suppress/hide it.
    Design screen :
    We will the undersigned, hereby acknowledge my acceptance of the above quote and agreed to the rates, terms and conditions stated herein as per your reference no: {QRef}  dates
    Display screen=
    We will the undersigned, hereby acknowledge my acceptance of the above quote and agreed to the rates, terms and conditions stated herein as per your reference no: 2014    AAA dates 10 march 2009
    wanted display screen
    We will the undersigned, hereby acknowledge my acceptance of the above quote and agreed to the rates, terns and conditions stated herein as per your reference no: 2014   dates 10 march 2009

    As what u say, i try to key in a [formula fields] call Qrev
    here the code :
    if {Quotation.QRev} = "AAA" then
        {Quotation.QRev} = " "
    We will the undersigned, hereby acknowledge my acceptance of the above quote and agreed to the rates,
    terns and conditions stated herein as per your reference no: MKT-2009/05/0018 True dates 19 Jun 2009
    but the Qrev.wouldnt be go delete / as a blank value. The value will only become  true or false
    Edited by: chee85 on Sep 18, 2009 7:40 AM

  • How do we trap exception inside the function module?

    How do we trap exception inside the function module?

    Use ABAP Help - CATCH, RAISE for starters. Or take a look at an existing function module, for example.

  • How to delete a field from a Dynamically created internal table

    Hi friends,
    I have got a requirement in which, I will be entering the table name and Excel file from seletion-screen.
    based on the Table I have entered in the selection-screen I need to create a dynamic internal table so that I can fill that Execel data into that internal table and later i using BDC i can I can fill the database table using SM30 transaction.
    here. my problem is that, When I am creating internal table dynamically, MANDT filed is also getting created in the internal table.
    please, help in deleteing the filed MANDT from the internal able.
    following is the code which creates the dynamic internal table.
    CREATE DATA dy_table TYPE TABLE OF (p_tabname).
    assign dy_table->* to <dyn_table>.
    please provide, if any sample code is available.
    Regards,
    Xavier.P

    Hi,
    You can use this logic,
    While creating the Dynamic filed catalog try to avoid MANDT field.
    Ex:
    *Dynamic creation of a structure
      CREATE DATA LP_STRUCT TYPE (V_TABLE).
      ASSIGN LP_STRUCT->* TO <FS>.
    *Fields Structure
      OF_SDESCR ?= CL_ABAP_TYPEDESCR=>DESCRIBE_BY_DATA( <FS> ).
    LOOP AT OF_SDESCR->COMPONENTS ASSIGNING <COMPONENTS>.
    *Field MANDT not displayed
        IF SY-TABIX = 1 AND <COMPONENTS>-NAME = 'MANDT'.
          CONTINUE. " Next loop
        ENDIF.
    *Build Fieldcatalog
        LS_LVC_CAT-FIELDNAME = <COMPONENTS>-NAME.
        LS_LVC_CAT-REF_TABLE = V_TABLE.
        APPEND LS_LVC_CAT TO LT_LVC_CAT.
        CLEAR LS_LVC_CAT.
      ENDLOOP.

  • JSF Table StyleClass issue for a specific Field inside the Table

    Hi There,
    Am having an issue of dynamically setting the styleClass for a specific field inside a DataTable. Here is how the JSF code is ..
    <h:column>
    <h:panelGrid id="column4" columns="1" cellpadding="0" cellspacing="0">
    <h:inputText id="numberOfApps" value="#{row.submitNumber}" styleClass="#{row.customStyleClass}" maxlength="6" converter="MyNumberConverter" />
    </h:panelGrid>
    </h:column>
    This Table has a specific column which has a input Text Box where user enter's data. This data will be validated in the bean where in after the validation if its exceeding a limit we should throw an error message and also highlight the field with a specific styleClass.
    I am setting the StyleClass dynamically based on the User Input, so that I can display a highlited Error Field on the screen. Strangely enough, styleclass is getting set as expected for the first submit but doesnt show any styles for further submits. Even the existing style is getting removed from the second submit onwards. I am setting this "customStleClass" dynamic parameter as a Bean Property. Am sure these values are properly set coz to make sure I have put an h:output tag inside that table to display the customStyleClass values and they are getting set as expected but I see blank value for the class="" in the source of the Page.
    Any help would be appreciated.
    Thanks
    Edited by: Lalith on Jan 14, 2008 10:23 AM

    One option is you find the data element of that field GUID.
    Now go to SE11 transaction and in data type put that data element and press where used list. In that select tables.
    This will give you a list of tables where that field is used.
    But again if there are lots of them it will be difficult to find.
    The only option in that case is debug the extractor and find out.

  • How to add a new Field in the Dynamic Selection screen section.

    HI,
    There is a requirement in which I need to add a field in existing program of dynamic selections.
    I need to add a field KNKK-DBRTG (Customer Rating) in dynamic selections screen of some existing report
    which has a dynamic selection screen with other fields like customer account, company code etc. Along with this i need to add Customer rating field also in the selection screen.
    I have used GET KNKK statement to select this in the Dynamic selection screen. But I need to make it appear
    on the screen.
    LDB used is the Customer Database.
    I have added GET KNKK statement after GET KNA1 statement.
    Can any one help me how we can make this rating field appear in the selection screen.
    With the GET statement Credit control area Fields can be selected in the selection screen but I have to permanantly add the field in the selection screen.
    Regards
    Prashant Prabhu

    Hi,
    So you need that this new field have data in old records?
    1.- If you are in BI 7.0 and the logic or data for that New field are in the same Dimension, you can use a Remodeling to fill it. I mean if you want if you want to load from a Master Data from other InfoObject in the same Dim.
    2.- If condition "1" is not yours.
    First add the new field, then create a Backup Cube (both cubes with the new field) and make a full update with all information in the original Cube. The new field willl be empty in both cubes.
    Create an UR from BackUp_Cube to Original_Cube with all direct mapping and create a logic in the Start Routine of the UR (modiying the data_package) you can look for the data in the DSO that you often use to load.
    To do that both cubes have to be Datasources ( right click on Cube-> aditional function-> and I think is "Extract Datasource")
    Hope it helps. Regards, Federico

  • Command node inside the dynamic table

    Hi experts,
    I have a problem regarding on using a command node inside a dynamic table in main window.. I tried inserting a command node in the header of the table then when running my print program i will receive an exception = 2 which is internal error and when i tried to execute the smartform using its FM it will have an error saying 'No explicit page break possible in tables'. I also tried putting the command node in nodes MAIN AREA and FOOTER.
    Here's the question.
    How can i explicitly put page break while i'm looping in a table?
    higheest rewards if successful.
    thanks in advance.

    Use a command line node and put
    BREAK-POINT.
    in that node, save and activate.  I have only put such a node in the main section of a table but I don't see why you couldn't put one in the header or footer as well.
    Davis

Maybe you are looking for