Can we create a deep structure in RFC?

Hi,
My requirement is to create an RFC which has 3 output tables. out of which 1 table contains deep structure, but SAP is not allowing me to create an RFC with deep structure. Message shows only flat structures support in RFC. can any one tell is there any limitation of creating a deep structure in RFC?
Thanks,
Kumar.

Instead of a deep structure, you can define another internal table in your signature which will hold all of the data for all of th records of the other internal table,  you just need a key value from the other internal table to be able to map which records go with what record in the original internal table.  Does this make sense?
Regards,
Rich Heilman

Similar Messages

  • To create a deep structure for dynamic internal table.

    Hello
    My ALV has fields which are defined dynamically during execution.
    so, i did it in the following way,
    Declared Field symbolds, DREF and fieldcatalog as,
    FIELD-SYMBOLS: <t_dyntable> TYPE STANDARD TABLE,
                  <fs_dyntable>.
    DATA:   dref_dyntab    TYPE REF TO data,
            dref_dynwa     TYPE REF TO data.
    DATA: ts_fieldcatalog TYPE lvc_t_fcat.
    DATA: wa_fieldcatalog TYPE lvc_s_fcat.
    Updated Fieldcatalog dynamically as,
    *function module to read segment structure
        CALL FUNCTION 'SEGMENT_READ'
          EXPORTING
            segmenttyp           = v_segment_name
          TABLES
            segmentstructure     = ts_seg_structure
          EXCEPTIONS
            no_authority         = 1
            segment_not_existing = 2
            OTHERS               = 3.
        IF sy-subrc <> 0.
          CASE sy-subrc.
            WHEN '1'.
              MESSAGE e024.
              STOP.
            WHEN '2'.
              MESSAGE e025 WITH v_segment_name.
              STOP.
            WHEN OTHERS.
              MESSAGE e023.
          ENDCASE.
        ENDIF.
    *FETCH FIELDS FROM STRUCTURE OF SEGMENT AND CREATE FIELDCATALOG FOR
    EACH FIELD OF SEGMENT (DYNAMIC FIELD CATALOG)
        LOOP AT ts_seg_structure INTO wa_seg_structure.
          ADD 1 TO v_counter.
          wa_fieldcatalog-fieldname = wa_seg_structure-fieldname.
          wa_fieldcatalog-col_pos   = v_counter.
          wa_fieldcatalog-ref_table = wa_seg_structure-segtyp.
          APPEND wa_fieldcatalog TO ts_fieldcatalog.
          CLEAR wa_fieldcatalog.
        ENDLOOP.
    and generated dynamic internal table using fieldcatalog as,
    *--Method to get the structure of table using fieldcatalog.
      CALL METHOD cl_alv_table_create=>create_dynamic_table
        EXPORTING
          it_fieldcatalog = ts_fieldcatalog
        IMPORTING
    *--Variable of type REF TO DATA.
          ep_table        = dref_dyntab.
      IF sy-subrc <> 0.
        MESSAGE e023.
      ENDIF.
    *--Dynamic internal tables required when show segments selected
      IF p_selseg IS NOT INITIAL.
        ASSIGN dref_dyntab->* TO <t_dyntable>.
    *--Create dynamic work area and assign to FS
      CREATE DATA dref_dynwa LIKE LINE OF <t_dyntable>.
        ASSIGN dref_dynwa->* TO <fs_dyntable>.
    And then i populated this <t_dyntable> which is being passed as data-table to method
    CL_GUI_ALV_GRID => SET_TABLE_FOR_FIRST_DISPLAY
    for ALV grid Display along with above used filedcatalog ts_fieldcatalog.
    Things are fine till here, but now i have the requirement to edit selected rows of the ALV display..
    As you might be aware, we need a field
            TS_STYLEROW  TYPE lvc_t_styl, (i.e, a field of type 'h' and we can say as an internal table inside an internal table or else as a deep structure)
    in the output internal table <t_dyntable> to meet our requirement.
    My issue is about declaring one such field of type 'h' in this dynamically created internal table ''<t_dyntable>".
    I tried in the following way by adding one such field to fieldcatalog :
    *Field for Styling
      ADD 1 TO v_counter.
      wa_fieldcatalog-fieldname   = 'TS_STYLEROW'.
      wa_fieldcatalog-tabname     = 'TS_STYLE'.
      wa_fieldcatalog-col_pos     = v_counter.
      wa_fieldcatalog-no_out      = 'X'.
      wa_fieldcatalog-inttype     = 'h'.      " I even mentioned this
      APPEND wa_fieldcatalog TO ts_fieldcatalog.
      CLEAR  wa_fieldcatalog.
    But this is creating a field of type 'C' in the table <t_dyntable> instead of what i was expecting
    Guyz and respected,
    Please advice me with the solution or ur ideas....
    Note : The overall requirement is create a deep structure for dynamically generated internal table.
    Your help is highly appreciated and unforgettable..!!!!!!!

    hi,
    Dynamic append
    Dynamic internal table
    Dynamic internal table
    dynamic columns in ALV
    Variant for dynamic selection
    thanks

  • Create a deep structure for dynamic internal table

    Hi All,
    I am creating a dynamic table using method cl_alv_table_create=>create_dynamic_table.
    The normal structure gets created. but now I want to creat a Deep structure for having information of colors also for each column. So I want to add a COLTAB type LVC_T_SCOL for colors information .
    How should I create this using above method?
    Rgds,
    Madhuri

    I created a zcelltab structure as below. But while creating dynamic internal table, I received the error  with
    'Type "ZCELLTAB" is unknown 68 ZCELLTAB-CELLTAB
    Here is the code.
    DATA: BEGIN OF ZCELLTAB,
             CELLTAB LIKE LVC_S_STYL,
         END OF ZCELLTAB.
    FIELD-SYMBOLS <T_CELLTAB> TYPE LVC_T_STYL.
    DATA : LT_CELLTAB TYPE LVC_T_STYL.
    DATA:  WA_CELLTAB TYPE LINE OF LVC_T_STYL.
    DATA: GT_FCAT1 TYPE LVC_T_FCAT,
               GW_FCAT1 TYPE LVC_S_FCAT,
                GT_FCAT2 TYPE LVC_T_FCAT,
                GW_FCAT2  TYPE LVC_S_FCAT.
    After filling the FCAT1, I added the field in FCAT2  like below
      GT_FCAT2[ ] = GT_FCAT1[ ].
      G_TABIX = G_TABIX + 1.
      GW_FCAT2-INTTYPE = 'C'.
      MOVE G_TABIX TO GW_FCAT2-COL_POS.
      GW_FCAT2-OUTPUTLEN = '10'.
      GW_FCAT2-FIELDNAME = 'T_CELLTAB'.
      GW_FCAT2-TABNAME = 'ZCELLTAB'.
      GW_FCAT2-REF_FIELD = 'CELLTAB'.
      GW_FCAT2-REF_TABLE = 'ZCELLTAB'.
      APPEND GW_FCAT2 TO GT_FCAT2
      CLEAR GW_FCAT2.
    While calling the below method, the error with
    CALL METHOD CL_ALV_TABLE_CREATE=>CREATE_DYNAMIC_TABLE
         EXPORTING
          IT_FIELDCATALOG = GT_FCAT2
        IMPORTING
          EP_TABLE        = GT_REQ.
      ASSIGN GT_REQ->* TO <F_TAB>.
      CREATE DATA GWA_REQ LIKE LINE OF <F_TAB>.
      ASSIGN GWA_REQ->* TO <F_WA>.
    LOOP AT ITAB.
    ASSIGN COMPONENT 'MATNR'  OF STRUCTURE <F_WA> TO <F_VAL>
    <F_VAL> = ITAB-MATNR.
    IF ITAB-MATNR IS INITIAL.
    ASSIGN COMPONENT 'T_CELLTAB' OF STRUCTURE <F_WA> TO <T_CELLTAB>
            CLEAR WA_CELLTAB.
            WA_CELLTAB-FIELDNAME = 'MATNR'.
            WA_CELLTAB-STYLE = CL_GUI_ALV_GRID=>MC_STYLE_DISABLED.
            INSERT WA_CELLTAB INTO TABLE <T_CELLTAB>.
    ENDIF.
    APPEND <F_WA> TO <F_TAB>
    ENDLOOP.
    CALL METHOD GR_GRID->SET_TABLE_FOR_FIRST_DISPLAY
            EXPORTING
              I_CONSISTENCY_CHECK  = G_CONSISTENCY_CHECK
              IT_TOOLBAR_EXCLUDING = G_EXCLUDE
              I_SAVE               = G_SAVE
           I_DEFAULT            = 'X'
              IS_LAYOUT            = G_LAYOUT
            CHANGING
              IT_OUTTAB            = <F_TAB>
              IT_FIELDCATALOG      = F_CAT1.
    Please let me know where I was wrong.
    Should I remove the T_CELLTAB as the field name is not mentioned in the structure 'ZCELLTAB'.
    Thanks,
    Kumar.
    Edited by: venn e on May 7, 2010 4:10 PM

  • How can I create a Tree  Structure in java ??

    Hi,
    I want to create a tree structure(objects hierarchy) using java language. Is there any API method for this ?
    Can any one please give me a hint or suggestion how I can do this ??
    Thanks for the help in advance.

    Do you mean graphically?
    You can use a TreeSet or TreeMap if you just want to use tree structures.
    Kaj

  • Can I create a new structure within CIN?

    I can't create following structure using LabVIEW
    typedef struct _I2C_TRANS {
    BYTE byTransType;
    BYTE bySlvDevAddr;
    WORD wMemoryAddr;
    WORD wCount;
    BYTE Data[256];
    } I2C_TRANS, *PI2C_TRANS;
    I need this structure to a DLL-call.
    I tried put all elements to a cluster, but CIN creates two separate structures (see attached) and it doesn't work. I want to know how to create one structure for a DLL call LONG _stdcall DAPI_WriteI2c(HANDLE hDevInstance, I2C_TRANS * TransI2C);
    If there are any solutions for this, please let me know.
    Thanks in advance
    Martti Haro
    Attachments:
    structure.c ‏1 KB

    "Gabriela Tillmann" wrote in message
    news:[email protected]..
    > Hi
    > I'm afraid you'll get not by without writing a little C-wrapper to
    > convert the data types.
    That's not entirely true. It is possible but a little bit tricky.
    typedef struct _I2C_TRANS {
    BYTE byTransType;
    BYTE bySlvDevAddr;
    WORD wMemoryAddr;
    WORD wCount;
    BYTE Data[256];
    } I2C_TRANS, *PI2C_TRANS;
    The byte array inside the structure is fixed size and therefore each
    compiler
    will just embed this into the structure creating really a memory block of
    1 + 1 + 2 + 2 + 256 = 262 bytes.
    LabVIEW uses internally byte packing except on PA-RISC and Sparc systems
    so that you need to make sure that the DLL you want to call uses also that
    or if
    it doesn't adjust for this too on the diagram level.
    Assuming that the underlying DLL uses byte packing too, you can create a
    cluster
    in LabVIEW containing the first four parameters, wire it through the Byte
    Swap
    function and typecast it to a U8 array, append an 256 element U8 array and
    configere the Call Library Node to pass this as a pointer to an U8 array. If
    you
    need to extract data after the call to the DLL you need to typecast it back
    and/or
    extract the data array accordingly. Remember that typecasting on Windows has
    the effect of byte and word swapping data that is why the Byte Swap function
    is
    necessary.
    In general it is very often possible to call DLL functions directly even if
    they take
    compund data types but it is a little hassle. If it is about calling a few
    function the
    hassle may be worth your time as starting up a C development system and
    creating
    a DLL project certainly has some overhead. For more involved API calls it is
    usually always better to create your own wrap
    per DLL, making the parameters
    and function calls more LabVIEW friendly.

  • Can I Create a New Structured App that's a Copy of a Current One?

    Here's the situation:  I am new to using Dita in Framemaker, but have become competent with the authoring process. I do not understand the development end of things very well, however. What I want to do is to have a second dita structured application that is identical to the first in every way except that in topic.template.fm, the page size will be set to 11x17, not 8.5x11.  And I want to be able to apply that structured application to some of my DITA documents, but not all of them.
    I tried to create such a situation, first by copying and then renaming the DITA folder (I called the new one DITA-BIG) in Adobe FrameMaker 8\structure\xml\ and, within DITA-BIG, making that small change to topic.template.fm.
    I then added the renamed structured app to structuredapps.fm (again, I did a copy and paste of the DITA-Topic-FM element already there), changing the name of the element to Dita-TopicBig-FM and the URLs to point to those in the DITA-BIG directory.
    The new structured application appears in Framemaker when I select StructureTools --> Set Structured Application, and I can select/apply it to one of my documents. However, the document's page size doesn't change. I tried saving the document, closing and reopening the document, closing and reopening Framemaker. The new, larger page size set in topic.template.fm in the DITA-BIG structured app. is ignored.
    If I change the page size in the original topic.template.fm file, the document that is supposedly using the new structured app changes size to correspond to the template in the old structured app.  But I need that original template to stay at its original 8.5x11 page size.
    I am new to working with such files so I don't know if I missed something or if what I am attempting cannot be done.
    Any advice?

    Ok, it worked.
    Thank you very much for your help and patience with my followup questions.
    I want to describe one more thing that was not obvious to me.  When I got all of this done and tried to get a help topic to use the new template, I did it wrong at first. What I tried was to open the xml file, then open the StructureTools menu and select "Set StructuredApplication."  From the long list of applications that appears, I chose Dita-Topic-Bigpage-Fm (my applicaiton clone that contained the modified template).  Then I saved the file, but didn't notice any changes in my page size. Even closing and reopening the file and closing and reopening Framemaker, didn't seem to have an effect. When I chose any other structured application (do not try this at home!) I got pretty spectacular results: many error messages, and one time it crashed Framemaker. But nothing happened when I chose my "bigpage" clone application.
    Eventually I tried to set the structured application when I opened up the xml file. At File - Open, a little window always appears that lets you select a few structured application choices among the many available.When I did this, the file finally opened with the large page size specified in my cloned application.
    Keywords:
    clone a template
    clone a structured template
    cloning a template
    copy a template
    copying a template
    use a different structured template
    use two structured templates
    use another template
    apply another structured template
    copy a structured application
    clone structured application
    apply my own structured application
    use two structured templates
    use two structured applications
    dita structured applications

  • How can i create a dynamic structure based on my input from a select-option

    Hello,
    This is to develop a custom report in FI for G/L Balance based on company code.
    I have an input select-option for Company code.
    Based on the range of company code my output layout should be modified.
    I am not very much sure to create a dynamic internal based on the input from a select-option.
    Can any one please let me know how can i do this.
    I would appreciate for anyone who turns up quickly.
    Thank you,
    With regs,
    Anitha Joss.

    See the following program, it builds a dynamic internal table based on the company codes from the select option. 
    report zrich_0001 .
    type-pools: slis.
    field-symbols: <dyn_table> type standard table,
                   <dyn_wa>.
    data: alv_fldcat type slis_t_fieldcat_alv,
          it_fldcat type lvc_t_fcat.
    data: it001 type table of t001 with header line.
    selection-screen begin of block b1 with frame title text-001.
    select-options: s_bukrs for it001-bukrs.
    selection-screen end of block b1.
    start-of-selection.
      select * into table it001 from t001
                     where bukrs in s_bukrs.
      perform build_dyn_itab.
    *  Build_dyn_itab
    form build_dyn_itab.
      data: index(3) type c.
      data: new_table type ref to data,
            new_line  type ref to data,
            wa_it_fldcat type lvc_s_fcat.
      clear wa_it_fldcat.
      wa_it_fldcat-fieldname = 'PERIOD' .
      wa_it_fldcat-datatype = 'CHAR'.
      wa_it_fldcat-intlen = 6.
      append wa_it_fldcat to it_fldcat .
      loop at it001.
        clear wa_it_fldcat.
        wa_it_fldcat-fieldname = it001-bukrs .
        wa_it_fldcat-datatype = 'CHAR'.
        wa_it_fldcat-intlen = 4.
        append wa_it_fldcat to it_fldcat .
      endloop.
    * Create dynamic internal table and assign to FS
      call method cl_alv_table_create=>create_dynamic_table
                   exporting
                      it_fieldcatalog = it_fldcat
                   importing
                      ep_table        = new_table.
      assign new_table->* to <dyn_table>.
    * Create dynamic work area and assign to FS
      create data new_line like line of <dyn_table>.
      assign new_line->* to <dyn_wa>.
    endform.
    Regards,
    Rich Heilman

  • Regarding creation of dynamic deep structure

    Hi all,
    I have to construct the dynamic deep structure.
    for example,
    With the help of information about address and t_table, i have to create the deep structure on runtime.
    In one case i need to create the deep strcuture with address alone and in another case i need to create the deep structure with address and t_table.
    DATA : begin of address ,
        address type string ,
        end of address.
    data : begin of t_tab  ,
      name(10) type c,
      age type i,
      address like address,
      end of t_tab,
      t_table like Table of t_tab.
    data: BEGIN OF wa_vig,
       details1 like address,
       details2 like t_table,
       END OF wa_vig.
    data: BEGIN OF wa_vig,
       details1 like address,
       END OF wa_vig.
    Please guide me, how should i acheive this with the help of dynamic declarion .
    regards
    Vignesh

    Hi All,
    I will be happy if i can acheive this using RTTS concept.
    Regards
    Vignesh

  • Flat structure,deep structure, and info structure

    hi,
    What is meant by flat ,deep ,info structures what is difference among them?

    Flat structure:
    If you have a structure with list of fields on it and You can have a structure with in the structure included
    Deep structure:
    If you have tabletype(internal table) included in the
    structure
    Flat structures contain only elementary data types with a fixed length (no internal tables, reference types, or strings).
    The term deep structure can apply regardless of whether the structure is nested or not
    The technical difference between deep structures and all others is as follows.
    When you create a deep structure, the system creates a pointer in memory that points to the real field contents or other administrative information.
    When you create a flat data type, the actual field contents are stored with the type in memory. Since the field contents are not stored with the field descriptions in the case of deep structures, assignments, offset and length specifications and other operations are handled differently from flat structures

  • Deep Structute in RFC.

    Hi Everybody,
    Does RFC adapter support deep structure.
    Can I have a table with field point to another table.
    Thanks in advance ,
    Regards,
    Bikram

    I'm also stuck with transmitting deep structures in RFC.
    According to the <a href="http://help.sap.com/saphelp_erp2005vp/helpdata/en/22/5a981cfbaa06428abdfa32b81423d2/content.htm">SAP Help</a>:
    <i>The RFC transmits deep structures (structures that have at least one table type) in XML, and codes the text data in UTF-8.</i>
    So far so good, I even can see the result transmitted as XML over the line, however I'm not able to retrieve this XML from RFC. Any pointers where I can find further info on retrieving datastructures sent as XML?
    regards
    Adrian

  • How do I create a physical structure in the data dictionary ?

    Hi all,
    How can I create a data structure using ABAP ? (prefrebly by using a class)
    I want to create a physical data dictionary structure, just like using se11 (data type -> structure).
    Thanx ahead.
    -Tonni

    To create a dynamic table at runtime I use the code below.
    DATA: gt_fcat          TYPE slis_t_fieldcat_alv,
          gs_fcat          LIKE LINE OF gt_fcat,
          gt_fieldcat      TYPE lvc_t_fcat,
          gs_fieldcat      LIKE LINE OF gt_fieldcat. 
    CLEAR: gt_fieldcat, gt_fieldcat[], gs_fieldcat.
      gs_fieldcat-fieldname     = 'SIGN'.
      gs_fieldcat-ref_field     = 'XMSTU'.
      gs_fieldcat-ref_table     = 'T007A'.
      gs_fieldcat-fix_column    = space.
      gs_fieldcat-no_zero       = space.
      APPEND gs_fieldcat TO gt_fieldcat.
      gs_fieldcat-fieldname     = 'OPTION'.
      gs_fieldcat-ref_field     = 'SEQN'.
      gs_fieldcat-ref_table     = 'T159W'.
      gs_fieldcat-fix_column    = space.
      gs_fieldcat-no_zero       = space.
      APPEND gs_fieldcat TO gt_fieldcat.
    Create a new Table
      CLEAR : gt_range2.
      CALL METHOD cl_alv_table_create=>create_dynamic_table
        EXPORTING
          it_fieldcatalog = gt_fieldcat
        IMPORTING
          ep_table        = gt_range2.
    Create a new Line with the same structure of the table.
      ASSIGN gt_range2->* TO <range>.
    To create a structure like this table I use
      CREATE DATA gs_range2 LIKE LINE OF <range>.
      ASSIGN gs_range2->* TO <range1>.

  • Selecting into an internal table with deep structure

    Hi,
    I am working in ECC 6.0 now and it is giving me a syntax error for the following code.
    types: tt_bdc type standard table of bdcmsgcoll
          with default key.
    data:  begin of t_test occurs 0,
            vbeln like vbak-vbeln,
            tab   type tt_bdc,
          end of t_test.
    select vbeln from vbak into table t_test
      where aedat > '20081101'.
    The error is:
    +The work area (or internal table) "T_TEST" is not flat, or contains
    reference or internal tables as components . components. components.
    components. components.+
    I've done this in countless other programs in the past.  How can I use a deep structure this way?  What am I missing?
    Thanks very much!

    Will this solve ur requirement -
    types: tt_bdc type standard table of bdcmsgcoll
          with default key.
    data:  begin of t_test occurs 0,
            vbeln like vbak-vbeln,
            tab   type tt_bdc,
          end of t_test.
    select vbeln from vbak into
      CORRESPONDING FIELDS OF TABLE t_test
      where aedat > '20081101'.

  • Dynamic Table - Deep Structure

    Hi Gurus,
    this is my first posting, so be patient!
    I want to create a deep structure dynamic table via method
    cl_alv_table_create=>create_dynamic_table, is this possible? Are there tricks to make it happen?
    Background: i wanna create an alv with dynamic fieldcatalalog, in this case i want to colour special fields, which is done by lvc_s_layo-?csp_fieldname? in combination with a field in my internal table which is typed ?lvc_t_scol?. Is this possible under 6.2.43
    thanxs for your replies
    juergen
    - ?i dont actually know by rote the correct fieldnames of lvc_xxxxx?

    Hi Jurgen, I took on the challenge.  This program provides a dynamic table with the ability to set the colors of the cells.
    Create the structure ZCDF_CELL_COLOR in the dictionary as described in the program.
    Create screen 100 as empty, with next screen set to 0, and the following flow logic:
    PROCESS BEFORE OUTPUT.
      MODULE initialization.
    PROCESS AFTER INPUT.
    REPORT  zcdf_dynamic_table.
    * Dynamic ALV Grid with Cell Coloring
    DATA:
      r_dyn_table      TYPE REF TO data,
      r_wa_dyn_table   TYPE REF TO data,
      r_dock_ctnr      TYPE REF TO cl_gui_docking_container,
      r_alv_grid       TYPE REF TO cl_gui_alv_grid,
      t_fieldcat1      TYPE lvc_t_fcat, "with cell color
      t_fieldcat2      TYPE lvc_t_fcat, "without cell color
      wa_fieldcat      LIKE LINE OF t_fieldcat1,
      wa_cellcolors    TYPE LINE OF lvc_t_scol,
      wa_is_layout     TYPE lvc_s_layo.
    FIELD-SYMBOLS:
      <t_dyn_table>    TYPE STANDARD TABLE,
      <wa_dyn_table>   TYPE ANY,
      <t_cellcolors>   TYPE lvc_t_scol,
      <w_field>        TYPE ANY.
    START-OF-SELECTION.
    * Build field catalog based on your criteria.
      wa_fieldcat-fieldname = 'FIELD1'.
      wa_fieldcat-inttype   = 'C'.
      wa_fieldcat-outputlen = '10'.
      wa_fieldcat-coltext   = 'My Field 1'.
      wa_fieldcat-seltext   = wa_fieldcat-coltext.
      APPEND wa_fieldcat TO t_fieldcat1.
      wa_fieldcat-fieldname = 'FIELD2'.
      wa_fieldcat-inttype   = 'C'.
      wa_fieldcat-outputlen = '10'.
      wa_fieldcat-coltext   = 'My Field 2'.
      wa_fieldcat-seltext   = wa_fieldcat-coltext.
      APPEND wa_fieldcat TO t_fieldcat1.
    * Before adding cell color table,
    *  save fieldcatalog to pass
    *  to ALV call.
      t_fieldcat2[] = t_fieldcat1[].
    * Add cell color table.
    *  ZCDF_CELL_COLOR is a structure in the
    *   dictionary with one
    *   field called T_CELL_COLOR of type LVC_T_SCOL.
      wa_fieldcat-fieldname = 'T_CELLCOLORS'.
      wa_fieldcat-ref_field = 'T_CELL_COLOR'.
      wa_fieldcat-ref_table = 'ZCDF_CELL_COLOR'.
      APPEND wa_fieldcat TO t_fieldcat1.
    * Create dynamic table.
      CALL METHOD cl_alv_table_create=>create_dynamic_table
        EXPORTING
          it_fieldcatalog           = t_fieldcat1
        IMPORTING
          ep_table                  = r_dyn_table
        EXCEPTIONS
          generate_subpool_dir_full = 1
          OTHERS                    = 2.
      IF sy-subrc <> 0.
        MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                   WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      ENDIF.
    * Get access to new table using field symbol.
      ASSIGN r_dyn_table->* TO <t_dyn_table>.
    * Create work area for new table.
      CREATE DATA r_wa_dyn_table LIKE LINE OF <t_dyn_table>.
    * Get access to new work area using field symbol.
      ASSIGN r_wa_dyn_table->* TO <wa_dyn_table>.
    * Get data into table from somewhere.  Field names are
    *  known at this point because field catalog is already
    *  built.  Read field names from the field catalog or use
    *  COMPONENT <number> in a DO loop to access the fields. 
    *  A simpler hard coded approach is used here.
      ASSIGN COMPONENT 'FIELD1' OF STRUCTURE <wa_dyn_table>
        TO <w_field>.
      <w_field> = 'ABC'.
      ASSIGN COMPONENT 'FIELD2' OF STRUCTURE <wa_dyn_table>
        TO <w_field>.
      <w_field> = 'XYZ'.
      APPEND <wa_dyn_table> TO <t_dyn_table>.
      ASSIGN COMPONENT 'FIELD1' OF STRUCTURE <wa_dyn_table>
        TO <w_field>.
      <w_field> = 'TUV'.
      ASSIGN COMPONENT 'FIELD2' OF STRUCTURE <wa_dyn_table>
        TO <w_field>.
      <w_field> = 'DEF'.
      APPEND <wa_dyn_table> TO <t_dyn_table>.
    * Color cells based on your criteria. 
    *  In this example, a test on
    *  FIELD2 is used to decide on color.
      LOOP AT <t_dyn_table> INTO <wa_dyn_table>.
        ASSIGN COMPONENT 'FIELD2' OF STRUCTURE <wa_dyn_table>
          TO <w_field>.
        ASSIGN COMPONENT 'T_CELLCOLORS'
          OF STRUCTURE <wa_dyn_table> TO <t_cellcolors>.
        CLEAR wa_cellcolors.
        wa_cellcolors-fname     = 'FIELD2'.
        IF <w_field> = 'DEF'.
          wa_cellcolors-color-col = '7'.
        ELSE.
          wa_cellcolors-color-col = '5'.
        ENDIF.
        APPEND wa_cellcolors TO <t_cellcolors>.
        MODIFY <t_dyn_table> FROM <wa_dyn_table>.
      ENDLOOP.
      CALL SCREEN 100.
    *  MODULE initialization OUTPUT
    MODULE initialization OUTPUT.
    * Set up for ALV display.
      IF r_dock_ctnr IS INITIAL.
        CREATE OBJECT r_dock_ctnr
               EXPORTING
                  side  =  
                    cl_gui_docking_container=>dock_at_left
                  ratio = '90'.
        CREATE OBJECT r_alv_grid
               EXPORTING i_parent = r_dock_ctnr.
    *   Set ALV controls.
        wa_is_layout-ctab_fname = 'T_CELLCOLORS'.
    *   Display.
        CALL METHOD r_alv_grid->set_table_for_first_display
          EXPORTING
            is_layout       = wa_is_layout
          CHANGING
            it_outtab       = <t_dyn_table>
            it_fieldcatalog = t_fieldcat2.
      ELSE.     "grids already prepared
    *   Refresh display.
        CALL METHOD r_alv_grid->refresh_table_display
          EXPORTING
            i_soft_refresh = ' '
          EXCEPTIONS
            finished       = 1
            OTHERS         = 2.
      ENDIF.
    ENDMODULE.                 " initialization  OUTPUT

  • How to create An Organisational Structure through Expertmode.

    Hi Experts..
    How can we create an org.structure through Expertmode!What are the different transactions we use to create various types of objects..
    Regards,
    Sai

    hai
    for creating org structure in export mode  u can navigate as Naaga has mentioned.
    or for creating the org unit the TCODE-->po10
    Job-->PO03
    Position-->PO13
    Work center--->PO01
    PFCT---> Task Catalogue
    PPO1--> general
    here when u want to create an object take the required transaction
    take object create  then the mainthing is it will ask for the realtionship
    if it isa root object u can cancel  other objects also u can cancel.
    the various relationships are defined in sap
    the standard AtoB  it reflects when the object relationship is defined from the bottom  like reports
    another one B--A  reflects top to bottom  like line supervisor of
    craete tehe object create the relationship  thsi is the process.
    but it is laborious. each one has to be attended individually.
    when u give one relationship the (A--B) the corresponding reverse relationship is
    B--A is automatically created
    regards
    nalla

  • Creating a Record structure and passing this to a Procedure

    Hi there
    I have a query please.
    Can I create a Record Structure composed of fields
    from different tables and then pass this record structure
    to a procedure.?
    ie Create Procedure ProcedureTest(empRec empStructCreated%ROWTYPE)
    where empStructCreated is the RECORD STRUCTURE created
    and composed of fields from different tables.
    Please can some one help me on this.
    Assume that I have 3 tables and I am creating a record structure
    composed of 6 fields (2 fields from each of the 3 tables),and then
    once this record structure is created,I will be passing this to
    a procedure.

    SQL> create or replace package my_package as
      2  type my_rec is record (empno number,deptno number,dname varchar2(10),hiredate date);
      3  end;
      4  /
    Package created.
    SQL> create or replace procedure my_proc(rec1 my_package.my_rec) is
      2  begin
      3  dbms_output.put_line(rec1.empno||' '||rec1.dname||' '||rec1.hiredate);
      4  end;
      5  /
    Procedure created.
    SQL> declare
      2  rec1 my_package.my_rec;
      3  begin
      4  select empno,emp.deptno,dname,hiredate into rec1
      5  from emp,dept where  emp.deptno = dept.deptno and rownum =1;
      6   my_proc(rec1);
      7  end;
      8  /
    7369 RESEARCH 17-DEC-80
    PL/SQL procedure successfully completed.
    SQL>

Maybe you are looking for