DYNAMIC INTERNAL TABLE CREATION BASED ON THE CONTENT OF ANOTHER INTERNAL TA

Hi All
I need to create an internal table at runtime.
I have a selection screen parameter which is specific to country, Which can take values below
eg:- IT_AREA for Italy(IT)
FR_AREA for France(FR)
IE_AREA for Ireland(IE).....And similary for other countries
Based on the Above parameter, I need to create Internal Table as below
DATA: itab TYPE italy_data Occurs 0.
If I declare as above, Then itab has fields from italy_data. And this internal table i will be sending it to Function Module to get data into it.
My Requirement is to Create the Internal table itab during runtime for tables italy_data OR france_data OR ireland_data based on selection screen parameter. Tables on Country may have different number of fields in it.
Can anyone help me on this??

Hi,
Here is a sample code to create a dynamic internal table.
REPORT ytrab03.
TABLES: mara, makt.
TYPE-POOLS: slis.
DATA: it_fcat TYPE slis_t_fieldcat_alv,
is_fcat LIKE LINE OF it_fcat,
ls_layout TYPE slis_layout_alv.
DATA: it_fieldcat TYPE lvc_t_fcat,
is_fieldcat LIKE LINE OF it_fieldcat.
DATA: new_table TYPE REF TO data,
new_line TYPE REF TO data,
ob_cont_alv TYPE REF TO cl_gui_custom_container,
ob_alv TYPE REF TO cl_gui_alv_grid,
vg_campos(255) TYPE c,
i_campos LIKE TABLE OF vg_campos,
vg_campo(30) TYPE c,
vg_tables(60) TYPE c.
DATA: e_params LIKE zutsvga_alv_01.
FIELD-SYMBOLS: <l_table> TYPE table,
<l_line> TYPE ANY,
<l_field> TYPE ANY.
PARAMETERS: p_max(2) TYPE n DEFAULT '20' OBLIGATORY.
is_fcat-fieldname = 'COL01'.
is_fcat-ref_fieldname = 'MATNR'.
is_fcat-ref_tabname = 'MARA'.
APPEND is_fcat TO it_fcat.
is_fcat-fieldname = 'COL02'.
is_fcat-ref_fieldname = 'MAKTX'.
is_fcat-ref_tabname = 'MAKT'.
APPEND is_fcat TO it_fcat.
LOOP AT it_fcat INTO is_fcat.
is_fieldcat-fieldname = is_fcat-fieldname.
is_fieldcat-ref_field = is_fcat-ref_fieldname.
is_fieldcat-ref_table = is_fcat-ref_tabname.
APPEND is_fieldcat TO it_fieldcat.
CONCATENATE is_fieldcat-ref_table is_fieldcat-ref_field
INTO vg_campos SEPARATED BY '~'.
APPEND vg_campos TO i_campos.
ENDLOOP.
*... Create the dynamic internal table
CALL METHOD cl_alv_table_create=>create_dynamic_table
EXPORTING
it_fieldcatalog = it_fieldcat
IMPORTING
ep_table = new_table.
*... Create a new line
ASSIGN new_table->* TO <l_table>.
CREATE DATA new_line LIKE LINE OF <l_table>.
ASSIGN new_line->* TO <l_line>.
SELECT (i_campos) FROM mara INNER JOIN makt
ON mara~matnr = makt~matnr
UP TO p_max ROWS
INTO TABLE <l_table>.
LOOP AT <l_table> INTO <l_line>.
LOOP AT it_fcat INTO is_fcat.
ASSIGN COMPONENT is_fcat-fieldname
OF STRUCTURE <l_line> TO <l_field>.
IF sy-tabix = 1.
WRITE: /2 <l_field>.
ELSE.
WRITE: <l_field>.
ENDIF.
ENDLOOP.
ENDLOOP.
Regards,
Karuna.

Similar Messages

  • [ADF BC] Showing a list of values based on the contents of another list

    I have tried to make a simplified example to illustrate what I want to do. Here is a picture of my example schema:
    Example Schema Image
    There are three entity tables: Employee, Department and Location.
    There are also two intersection tabels: Employee_Location and Department_Location.
    My ADF BC model layer is based on this schema.
    What I am trying to do is have a creation process for an employee where you first fill in the employee details (forname and surname), then you assign the employee to a department, then - based on the locations assigned to the department - assign one or more locations to the employee.
    Imagine that the employee is a door-to-door salesman and that each department in is company has several areas of a town that they cover (locations). Each employee will cover a subset of the locations that the department covers.
    The first two steps are easy - the details page can be created using a form on the employee view and the department assignment can be done with a list of values drop down on the departments view.
    The third step is a little more complex. You can use a shuttle to assign one or more locations to the employee, but you shouldn't just show a list of all locations, since some of these will not be covered by the department and therefore not be available to the employee. What I want is only the locations associated with the employee's department to appear in the list.
    So my question is how do I model this using ADF Business Components?
    Also, if an employee is allowed to be assigned to more than one department (adding another intersection table between the employee and department tables), how would I model that?

    Hi,
    For your reference variable name should be simply any name i.e resorts_resort.No need to put @ in front when declaring variable and to refer presentation variable you should use the below syntax
    @{Variable_name}{Default_value} where default_value is some default value you want to give.
    Now coming to your problem you can fulfill your requirement by simply checking constrain checkbox.If you choose all values instaed of SQL results constrain checkbox will appear.Approach followed by you should also work but constrain is an easy option.
    Thanks
    Sandeep
    Edited by: Sandeep Saini on 10-Sep-2010 00:59
    Edited by: Sandeep Saini on 10-Sep-2010 00:59

  • Looking to set the result of a variable based on the content of another (new to scripts)

    Hi,
    I'm new to scripts, new to acrobat forms to be honest, so be gentle with me
    I have a text field Acc1pnt which can accept either Y or N as an entry. Based on the answer, text field Acc1snd would always be N/A if the result of Acc1pnt is N. I'm looking for a script that will add N/A to the second text field and skip over it (make read only?) if the answer to the first field is N.
    Sorry if I'm making this look like hard work. Basically a check is made as to whether an accessory is received and, if it is, whether it is 'sound' or 'damaged'. Obviously if it isn't received then it's condition is irrelevant hence N/A in the senond text field.
    Also, is there something simple I can add to convert an entry to a capital letter?
    Thanks in advance
    Cliff

    Hi Gilad
    I've shied away from radio buttons as the users are used to tabbing through the fields and 'clicking' a radio button would mean taking their hands from the keyboard, I will certainly consider it though.
    Acc1snd (the 2nd variable) should be editable ONLY if the answer to Acc1pnt (the 1st variable) is Y. If the value of the 1st variable is N then Acc1snd can only be N/A (not applicable) and should not be editable.
    Obviously if the user makes an initial mistake and needs to change the value of the 1st variable to Y then the 2nd variable would then need to be editable.
    I will run through the tutorials this evening

  • Populate one cell based on the contents of another

    Greetings to all
    I am entering street addresses into numbers. In an effort to save time I would like the entry into column B to determine what is automatically entered into column C
    Example:
    If I enter Jones in column B, I want Street to automatically populate column C in the same row
    If I enter Smith in column B, I want Avenue to automatically populate column C in the same row.
    Thanks in advance for any help.
    AJ

    I assume that "Jones" is "Jones Street" and "Smith" is "Smith Avenue".
    You will need a lookup table with a column containing all of the road names you will be entering, and a second column listing the the matching road type (Street, Avenue, Boulevard, Place, etc.) for each name. Fill the formula shown in the illustration down to all the cells in column C of the Main table.
    I've used IFERROR to flag street names that are not found in the table. To omit the "no match" message and instead show an empty cell, change "no match" to "" in the formula.
    Regards,
    Barry

  • How can I dynamically reference a sheet based upon the contents of a cell

    I'm using Numbers to store specifications for various products. Each sheet stores specifications in a standard manner (i.e. same table and cell names) and the sheet is named according to the name of the product.
    On another sheet I've got a dropdown list containing the names of the product tabs. I'd like to dynamically pull data for a particular product when it's sheet is selected in the dropdown list by using the dropdown cell in a reference like:
    =B1::STC::A4, where B1 is the dropdown list and STC::A4 is the product specification table and cell reference.
    When I use this, the B1 reference fails.
    Any suggestions would be greatly appreciated.
    Thanks.

    Amos,
    you will have to use the indirect function to convert the string you are creating into a valid reference.
    Note:  The Sheet names, Table names and cell references must all match exacty.
    If the sheets are named "B1", "C1" and "D1" and the popup menu is in the cell A1 and contains the strings:
    B1
    C1
    D1
    The table name is "STC"
    then you can create a valid reference like this:
    = indirect(A1&"::STC::A4")
    if the table name were also dynamic and were stored in cell A2 you could create the reference like this:
    = indirect(A1&"::"&A2&"::A4")

  • Changing content of one label, based on the content of another

    Hello all,
    I need some advice on how to go about doing something that should be simple.
    Basically, I have two labels, that will be used in a marquee animation. When label one gets changed, I want label two to mimic label one's content. Since there is no ContentChanged Event for labels, I have been relying on the SizeChanged event of label one
    to do the job.
    However, the issue arises when label one's content extends past that of its parent container, thus no longer firing SizeChanged.
    When label one's supposed length is equal to or greater than that of its container, is when I would start the marquee animation.
    Basically, I need a sure fire, reliable, 100% accurate way to update label two's content to match that of label one's despite its length.
    I have read the following: Label.Content Changed Event
    However this does not solve the issue, as the event fires for "all" custom label classes, due to the ContentProperty being declared Static/Shared.
    Thanks in advance!

    <UserControl x:Class="CustomControls.UserControls.ValidationUserControl"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    mc:Ignorable="d" Height="36" Width="120">
    <Grid x:Name="z">
    <TextBox x:Name="txtBase" Text="TextBox" Margin="0,0,0,13"/>
    <Label x:Name="lblStatus" Content="Status" HorizontalAlignment="Left" Margin="5,0,0,0" VerticalAlignment="Bottom" FontSize="10" Foreground="#FFE12828" FontWeight="Bold">
    <Label.Effect>
    <DropShadowEffect BlurRadius="5" ShadowDepth="1"/>
    </Label.Effect>
    </Label>
    <Label x:FieldModifier="Friend" x:Name="lblMarquee" Content="{Binding ElementName=lblStatus, Path=Content}" HorizontalAlignment="Right" Margin="0,23,-29,0" FontSize="10" Foreground="#FFE12828" FontWeight="Bold" Background="Transparent" Height="13" VerticalAlignment="Top">
    <Label.Effect>
    <DropShadowEffect BlurRadius="5" ShadowDepth="1"/>
    </Label.Effect>
    </Label>
    </Grid>
    </UserControl>

  • The drop down list values want to vary based on the contents of another drop down field

    hi,
    hi in search page i have two drop down list. i have two tables and one mapping tables. service line and subservice line are tables and i have one mapping table. using rapid application i create one component using mapping table. now in search page i have two drop list. one is servline and another is sub serviceline. in service line i have values like 1,2 k  for subservice 3,4.5,6 for one service line ex. for 1 i have two subservice 3,4 and for 2 i have 5,6. now my requirment in if i choose service line 1 in first drop down list, automatically in second drop down list want to contain values 3, 4. before both the drop down list have values.if i chose one value the correponding mapping value want to come in drop down list in same context node.

    Hi,
    This requirement involves defining p-getter for the service type, and the v-getter of you sub type.
    Since this involves to populate the values of subtype attribute depending on value of service type, u need a round trip.
    This is done in the p-getter of the 1st attribute(service type in your case).
    In the v-getter of the 2nd attribute, 1st fetch the current value of attribute 1, then filter the value in the dropdown table according to ur logic.
    Ref :Drop down values in table view
    Regrads
    Anish

  • Retrive Records based on the content in a Clob Feild

    Retrive Records based on the content in a Clob Feild
    I have a Table NoteFile which contains a Clob Feild NoteFileContent
    and is refrenced by PK DocID
    i need to Match DocID with other Tables Document and folderdocument
    My Query is as Below
    SELECT Doc.Pap_Doc_ID, Doc.Pap_Doc_Name , NF.NoteFileContent
    From NoteFile NF , Document Doc, folderdocument FD
    Where Doc.Pap_Doc_ID = FD.FoldDoc_ID and FD.FoldDoc_ParentID <> 3 and
    NF.DocID = DOC.Pap_Doc_ID And NF.NoteFileContent Like '%a%'
    The above query throws
    ORA-00600: internal error code, arguments: [504], [0x7ADEBE00], [2], [1],
    [cache buffers chains], [723], [0], [0x7ADEBE00]

    Hi,
    We can resize it.Always give the height and weight in
    percentage format. and turn off the horizontal n vertical scroll
    policy in u r main application.
    Hopes it helps you...

  • Duplicate checking based on the content of the incoming file

    Hi,
    We have a requirement where in we have to check whether a file has been duplicated or not based on the contents of an incoming file.The threads which I have seen in SDN deal with the duplicate checking based on the filename of the incoming file.
    The incoming file has the following structure :
    Recordset                                     Occurance-1
           |....... Idoc                              Occurance 1...unbounded
                       |...... segment             Occurance 1
    We are required to make a check based on certain fields which occur in the segment.There are about 4 fields which we will have to take from the incoming file and carry out the check.These 4 fields exist in different segments.We will have to update a ztable with these 4 fields and then perform an rfc lookup to check for the contents of the incoming files with this table,and reject or process the file based on whether the entries exist in the table or not.
    Please let me know if there is any way this can be achieved.
    Appreciate if anyone could help me on this.
    Thanks and Regards,
    Induja

    SAP PI 7.1 Mapping Enhancements Series: Graphical Support for JDBC and RFC Lookups
    Use this crazy piece for any RFC Mapping Lookups!
    The specified item was not found.
    https://www.sdn.sap.com/irj/sdn/weblogs?blog=/pub/wlg/5877---- [original link is broken] [original link is broken] [original link is broken]
    Imp
    SAP NetWeaver Process Integration 7.1: Mapping Enhancements Blog Series
    SAP PI 7.1 Mapping Enhancements Series: Mapping Enhancements Demo
    /people/siva.maranani/blog/2005/08/23/lookup146s-in-xi-made-simpler
    How to check JDBC SQL Query Syntax and verify the query results inside a User Defined Function of the  Lookup API
    The specified item was not found.
    The specified item was not found.
    Making CSV File Lookup Possible In SAP XI !!!
    SAP PI 7.1 Mapping Enhancements Series: Parameterized Message Mappings
    https://www.sdn.sap.com/irj/sdn/weblogs?blog=/pub/wlg/1888-----Imp [original link is broken] [original link is broken] [original link is broken]
    Triggering XI Alerts from a User Defined Function
    Aspirant to learn SAP XI...You won the Jackpot if you read this!-Part II

  • Resizing Accordian based on the content in each component within in it.

    Hi,
    I wanted to know whether is there a way to resize Accordion
    component based on the content in the present tab.In my Accordion I
    am using four Canvas as its four children.The data in each of the
    canvas changes based on the Accordian tab selected. I want to
    dynamically resize the entire accordion based on the content in the
    canvas for that tab.
    In short the height of the Accordion need to change
    dynamically based on the tab selected. I have tried using the
    resizeToContent property but this didn't solve the problem.
    Thanks,
    amar.

    Hi,
    We can resize it.Always give the height and weight in
    percentage format. and turn off the horizontal n vertical scroll
    policy in u r main application.
    Hopes it helps you...

  • Can we control the PDF file name that is generated by BI Publisher based on the content in the input PDF

    can we control the PDF file name that is generated by BI Publisher based on the content in the input PDF?

    No, there isn't. The way you're using the file is not recommended. You
    should use a review tracker to avoid getting in the way of one another.

  • Searching based on the content of an uploaded document

    Hi,
    Is it possible to search based on the content of the document I have uploaded. The system used is ECC 5.0.
    Eg : I have uploaded resumes of employees and I have search based on their skills. Is it possible to search based on the skill which is mentioned in the resumes and provide the output.
    Thanks,
    Sarath.C

    I can't do that without knowing the structure of your document, it all depends on wether the data you need is in a fixed position in a fixed line or it's in a variable position and the correct line or position needs to be found before using it.

  • OBIEE Report - filter based on the result from another analysis

    Hi,
    I am using OBIEE 11g,
    I am trying to use a filter which is based on the result from another analysis. I have an analysis A which is as table 1, and I want to filter the respective columns of analysis B (Table B) based on analysis A to remove the duplicates for march 01, 02, and 07 , but it is not working properly. I took a max of start and end time when I created analysis A. Please let me know if I did anything wrong. thanks.
    Table 1
    Employee Number
    Date
    IN
    Out
    Start Time
    End Time
    xxxxxxx
    2015-02-26
    9:00
    13:00
    00:00:00
    00:00:00
    2015-02-27
    12:00
    18:00
    00:00:00
    00:00:00
    2015-02-28
    8:00
    14:00
    00:00:00
    00:00:00
    2015-03-01
    14:00
    20:00
    14:00:00
    20:00:00
    2015-03-02
    16:00
    20:00
    16:00:00
    20:00:00
    2015-03-07
    14:06
    20:02
    14:00:00
    20:00:00
    2015-03-11
    16:00
    20:00
    16:00:00
    20:00:00
    2015-03-14
    8:00
    14:00
    00:00:00
    00:00:00
    2015-03-25
    14:00
    20:00
    16:00:00
    20:00:00
    Table 2
    Employee Number
    Date
    IN
    Out
    Start Time
    End Time
    Hours
    xxxxxxx
    2015-02-26
    9:00
    13:00
    00:00:00
    00:00:00
    -3
    2015-02-27
    12:00
    18:00
    00:00:00
    00:00:00
    6
    2015-02-28
    8:00
    14:00
    00:00:00
    00:00:00
    6
    2015-03-01
    14:00
    20:00
    00:00:00
    00:00:00
    6
    14:00:00
    20:00:00
    6
    2015-03-02
    16:00
    20:00
    00:00:00
    00:00:00
    4
    16:00:00
    20:00:00
    4
    2015-03-07
    14:06
    20:02
    00:00:00
    00:00:00
    6
    14:00:00
    20:00:00
    6
    2015-03-11
    16:00
    20:00
    16:00:00
    20:00:00
    4
    2015-03-14
    8:00
    14:00
    00:00:00
    00:00:00
    6
    2015-03-25
    14:00
    20:00
    16:00:00
    20:00:00
    4

    Why avg here?
    What columns you want to show in the report?
    for a employee for given date if he have 2 rows then you may sum up hours right?
    Employee Number
    Date
    IN
    Out
    Start Time
    End Time
    Hours

  • Validating an attribute based on the value of another while inserting

    Hi guys
    I need to validate an attribute based on the value of another attribute.
    Example:
    inside some entity I have the following validation function
    public boolean validateAtt1(Number data){
         if (this.getAtt2() < some vlaue)
              return false;
         return true;
    this function works fine when I'm updating a record, but when I'm inserting a new record the this.getAtt2 return null, now I don't want to override the validateEntity function I want to override the validate function for att1; so in other words is there a way to reach att2 in the validation function of att1 when I'm inserting a new record, because the this.getAtt2() returns null if I'm inserting a new record.

    Using attribute-level setter methods won't work because when the value of a particular attribute is being set, the values of the other attributes might not yet have been set. This explains for example why it does not work when inserting a new record. You therefore have to validate at entity level.
    Rather than coding on the validateEntity() method you use a built-in Validator or Method Validator. When recording validators like this, you can provide a separate message for each business rule. If you also have the bundled exception mode enables (which will be the case by default for web applications), then multiple messages can be shown at the same time.
    If you have one business rule involving two different attributes, for example a and b, and you must provide different messages based on if a is causing the violation or b, you can do it like this:
    - implement one method doing the validation and that will indicate which attribute is causing the violation
    - implement two different method validators (with two different messages) that call the method doing the actual validation and return false based on the attribute causing the violation
    For more information about implementing business rules in ADF BC, you might have a look at this white paper:
    http://www.oracle.com/technology/products/jdev/collateral/papers/10131/businessrulesinadfbctechnicalwp.pdf
    Jan Kettenis

  • How to Visible/Hide an Item based on the value of another Item

    Hi
    I need to visible and hide a textitem based on the value of another item.This form has 3 blocks, and the both item is in the first Master Block.
    My code is:
    if :RECORDTYPE=7 then
         Set_Item_Property('BLOCK.ITEM',VISIBLE,PROPERTY_TRUE);
         Set_Item_Property('BLOCK.ITEM',ENABLED,PROPERTY_TRUE);
    ELSE
         Set_Item_Property('BLOCK.ITEM',VISIBLE,PROPERTY_FALSE);
    Set_Item_Property('BLOCK.ITEM',ENABLED,PROPERTY_FALSE);
    :BLOCK.ITEM:=NULL;
    end if;     
    I wrote the code in the Validate Trigger, but not working when moving Next Record & Previous Record
    Thanks in advance
    Rizly

    Read the 'Propagation of Property Changes' section towards the end of the page for Set_Item_Property in the online help. I'm not sure what you mean by locking automatically but perhaps it's because of this.
    You should also ensure the item you're setting to invisible is not the current item (check :system.cursor_item and go to a different item if necessary).

Maybe you are looking for

  • Ipad 2 and Iphone 4 hybernates after upgrade to IOS 6

    Hi , After upgrading my iphone 4 and Ipad 2 to IOS 6 , both devices go in "hibernate" mode after being idle for a while. The only way to open them is by hard rebooting. Have you expirienced similar problems ? Is there any solution to fix it ? BR Robe

  • Questions about master-detail update and delete!!

    I have created a view object with two entity objects. These two entity objects map master-detail tables in DB. I want to update both tables when the user input, and delete the record in detail table (keeping master table unchanged) when the user clic

  • Managing PDF's without Adobe Reader

    Now that I have a new MBP and 10.6 I'm without Adobe Reader and everything is going to "preview". How do I get long documents to open with a straight on view for every page instead of preview showing them side ways? I can get each single page to turn

  • Issues with the New Cloud

    Missing options in Media Encoder, Premiere, and After Effects. Just got done with this chat with Richa. It appears that there are some issues with your new version of several of your flagship programs. No way to create SMALL size video files for use

  • Connection Message Archiver problems

    Hoping someone can help. I'm attempting to capture voicemail messages from multiple users. I need to preserve message headers and voicemail messages. I've downloaded and installed the Unity Connection Message Archiver program from http://www.ciscouni