Dynamic ALV Internal table Problem

Hi all,I have successfully built an IT using method 'create_dynamic_table'.But my problems are :
1)When Iam trying to select the data with multiple tables then it is short dumping.
2)I tried to oselect the data using one table,after selecting the data if I use FM REUSE_ALV_Grid_Display then it is showing short dump with error 'type conflict when calling FM'.
I never used field symbols before.PLZ complete my program or give me suffecient feedback.Here is my program :
DATA : g_tdref TYPE REF TO data,
       g_wdref TYPE REF TO data.
DATA : dats LIKE vbbe-mbdat,
       t_fieldcat TYPE lvc_t_fcat,
       wa_fieldcat TYPE lvc_s_fcat.
FIELD-SYMBOLS : <it_dyn> TYPE STANDARD TABLE,
                <wa_dyn>,
                <dyn_field>.
SELECTION-SCREEN BEGIN OF BLOCK blk1 WITH FRAME TITLE text-001.
SELECT-OPTIONS : s_mbdat FOR dats.
SELECTION-SCREEN END OF BLOCK blk1.
wa_fieldcat-tabname = 'MSKA'.
wa_fieldcat-fieldname = 'WERKS'.
wa_fieldcat-datatype = 'CHAR'.
wa_fieldcat-intlen = '10'.
APPEND wa_fieldcat TO t_fieldcat.
CLEAR : wa_fieldcat.
wa_fieldcat-tabname = 'MSKA'.
wa_fieldcat-fieldname = 'MATNR'.
wa_fieldcat-datatype = 'CHAR'.
wa_fieldcat-seltext = 'Material Number'.
wa_fieldcat-intlen = '18'.
APPEND wa_fieldcat TO t_fieldcat.
CLEAR : wa_fieldcat.
wa_fieldcat-tabname = 'MAKT'.
wa_fieldcat-fieldname = 'MAKTX'.
wa_fieldcat-datatype = 'CHAR'.
wa_fieldcat-intlen = '10'.
APPEND wa_fieldcat TO t_fieldcat.
CLEAR : wa_fieldcat.
wa_fieldcat-tabname = 'VBBE'.
wa_fieldcat-fieldname = 'MBDAT'.
wa_fieldcat-datatype = 'CHAR'.
wa_fieldcat-intlen = '10'.
APPEND wa_fieldcat TO t_fieldcat.
CLEAR : wa_fieldcat.
wa_fieldcat-tabname = 'VBBE'.
wa_fieldcat-fieldname = 'OMENG'.
wa_fieldcat-datatype = 'QUAN'.
wa_fieldcat-intlen = '10'.
APPEND wa_fieldcat TO t_fieldcat.
CLEAR : wa_fieldcat.
DATA : d TYPE i,
       v(02) TYPE n VALUE '0',
       day(8) TYPE c.
d = s_mbdat-high - s_mbdat-low + 1.
DO d TIMES.
  v = v + 1.
  CONCATENATE 'Day' v INTO day.
  wa_fieldcat-tabname = 'VBBE'.
  wa_fieldcat-fieldname = day.
  wa_fieldcat-datatype = 'DATS'.
  wa_fieldcat-seltext = day.
  wa_fieldcat-intlen = '8'.
  APPEND wa_fieldcat TO t_fieldcat.
  CLEAR : wa_fieldcat.
ENDDO.
*-----Building Dynamic internal table.
CALL METHOD cl_alv_table_create=>create_dynamic_table
  EXPORTING
    it_fieldcatalog = t_fieldcat
  IMPORTING
    ep_table        = g_tdref.
ASSIGN g_tdref->* TO <it_dyn>.
CREATE DATA g_wdref LIKE LINE OF <it_dyn>.
ASSIGN g_wdref->* TO <wa_dyn>.
SELECT m~werks m~matnr v~omeng v~mbdat INTO CORRESPONDING FIELDS
OF TABLE <it_dyn> FROM mska AS m INNER JOIN vbbe AS v
ON m~posnr = v~posnr WHERE v~mbdat IN s_mbdat.

*DATA : d TYPE i,
      v(02) TYPE n VALUE '0',
      day(8) TYPE c.
*d = s_mbdat-high - s_mbdat-low + 1.
*DO d TIMES.
v = v + 1.
CONCATENATE 'Day' v INTO day.
wa_fieldcat-tabname = 'VBBE'.
wa_fieldcat-fieldname = day.
wa_fieldcat-datatype = 'DATS'.
wa_fieldcat-seltext = day.
wa_fieldcat-intlen = '8'.
APPEND wa_fieldcat TO t_fieldcat.
CLEAR : wa_fieldcat.
*ENDDO.
*-----Building Dynamic internal table.
CALL METHOD cl_alv_table_create=>create_dynamic_table
  EXPORTING
    it_fieldcatalog = t_fieldcat
  IMPORTING
    ep_table        = g_tdref.
ASSIGN g_tdref->* TO <it_dyn>.
CREATE DATA g_wdref LIKE LINE OF <it_dyn>.
ASSIGN g_wdref->* TO <wa_dyn>.
SELECT OMENG FROM VBBE INTO CORRESPONDING FIELDS OF TABLE <IT_DYN> WHERE MBDAT IN S_MBDAT.
BREAK-POINT.
YOU WILL GET VALUES IN INTERNAL TABLE.
TO SOLVE YOUR ISSUE YOU SHOULD USE NUM INSTEAD OF DATS.

Similar Messages

  • Uploading data from excel file to a dynamically created internal table

    Hi,
    I have a requirement where i have to upload data from an excel file into a database table. I would be able to determine the structure of the table only at runtime based on the user input.. so i have created an internal table dynamically.
    Could you please tell me if its possible to upload data from an excel file to the dynamically created internal table using any function modules?
    I thought of doing this by declaring a generic internal table of one field and then uploading the *.csv file into it and then splitting it based on "," and then assigning it to the field symbol referencing the internal table.. but my file length exceeds 132 characters and i'm only able to get data of lenght 132 char's in my internal table ( generic one).
    Could anyone please show me a way around this.
    Thanks in advance,
    Harsha

    Sure, check this out.
    report zrich_0002.
    type-pools: slis.
    field-symbols: <dyn_table> type standard table,
                   <dyn_wa>,
                   <dyn_field>.
    data: it_fldcat type lvc_t_fcat,
          wa_it_fldcat type lvc_s_fcat.
    type-pools : abap.
    data: new_table type ref to data,
          new_line  type ref to data.
    data: iflat type table of string.
    data: xflat type string.
      data: irec type table of string with header line.
      data: tabix type sy-tabix.
    data: file type string.
    selection-screen begin of block b1 with frame title text .
    parameters: p_file type  rlgrap-filename default 'c:Test.csv'.
    parameters: p_flds type i.
    selection-screen end of block b1.
    start-of-selection.
    * Add X number of fields to the dynamic itab cataelog
      do p_flds times.
        clear wa_it_fldcat.
        wa_it_fldcat-fieldname = sy-index.
        wa_it_fldcat-datatype = 'C'.
        wa_it_fldcat-inttype = 'C'.
        wa_it_fldcat-intlen = 10.
        append wa_it_fldcat to it_fldcat .
      enddo.
    * 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>.
      file = p_file.
      call method cl_gui_frontend_services=>gui_upload
        exporting
          filename                = file
        changing
          data_tab                = iflat
        exceptions
          file_open_error         = 1
          file_read_error         = 2
          no_batch                = 3
          gui_refuse_filetransfer = 4
          invalid_type            = 5
          no_authority            = 6
          unknown_error           = 7
          bad_data_format         = 8
          header_not_allowed      = 9
          separator_not_allowed   = 10
          header_too_long         = 11
          unknown_dp_error        = 12
          access_denied           = 13
          dp_out_of_memory        = 14
          disk_full               = 15
          dp_timeout              = 16
          others                  = 17.
      loop at iflat into xflat.
        clear irec. refresh irec.
        split xflat at ',' into table irec.
        loop at irec.
          tabix = sy-tabix.
          assign component tabix of structure <dyn_wa> to <dyn_field>.
          <dyn_field> = irec.
        endloop.
        append <dyn_wa> to <dyn_table>.
      endloop.
    * Write out data from table.
      loop at <dyn_table> into <dyn_wa>.
        do.
          assign component  sy-index  of structure <dyn_wa> to <dyn_field>.
          if sy-subrc <> 0.
            exit.
          endif.
          if sy-index = 1.
            write:/ <dyn_field>.
          else.
            write: <dyn_field>.
          endif.
        enddo.
      endloop.
    Regards,
    Rich Heilman

  • Populating values in dynamically generated internal table

    Hi,
    We can generate internal tables dynamically and also populate them with values from database.But is there any way to populate the dynamically generated internal table(has 2-3 selected fields) with values from another internal table(has all fields required by the program) being populated within the same program?
    Thanks & Regards,
    Savitha

    Hi
    Dynamic internal table is internal table that we create on the fly with flexible column numbers.
    For sample code, please look at this code tutorial. Hopefully it can help you
    Check this link:
    http://www.****************/Tutorials/ABAP/DynamicInternaltable/DynamicInternalTable.htm
    Reward points if useful
    Regards
    Anji

  • Appending column to an dynamically created internal table

    Hi folks,
    i have an dynamically created internal table <dyn_tab> which is based on a parameter p_table (  containing the table name ). now i want to add one more column to this <dyn_tab> table where i can store further information in. how can i do that ?
    i appreciate your help!

    Hi,
    Please check this sample program.
    type-pools : abap.
    field-symbols: <dyn_table> type standard table,
                   <dyn_wa>,
                   <dyn_field>.
    data: dy_table type ref to data,
          dy_line  type ref to data,
          xfc type lvc_s_fcat,
          ifc type lvc_t_fcat.
    selection-screen begin of block b1 with frame.
    parameters: p_table(30) type c default 'T001'.
    selection-screen end of block b1.
    start-of-selection.
      perform get_structure.
      perform create_dynamic_itab.     
    form get_structure.
      data : idetails type abap_compdescr_tab,
           xdetails type abap_compdescr.
      data : ref_table_des type ref to cl_abap_structdescr.
      * Get the structure of the table.
      ref_table_des ?= 
          cl_abap_typedescr=>describe_by_name( p_table ).
      idetails[] = ref_table_des->components[].
        loop at idetails into xdetails.
        clear xfc.
        xfc-fieldname = xdetails-name .
        xfc-datatype = xdetails-type_kind.
        xfc-inttype = xdetails-type_kind.
        xfc-intlen = xdetails-length.
        xfc-decimals = xdetails-decimals.
        append xfc to ifc.
      endloop.
    *Add your new field(s) into table ifc here.
    endform.
    form create_dynamic_itab.
    * Create dynamic internal table and assign to FS
      call method cl_alv_table_create=>create_dynamic_table
                   exporting
                      it_fieldcatalog = ifc
                   importing
                      ep_table        = dy_table.
        assign dy_table->* to <dyn_table>.
      * Create dynamic work area and assign to FS
      create data dy_line like line of <dyn_table>.
      assign dy_line->* to <dyn_wa>.
    endform.
    Regards,
    Ferry Lianto

  • How to create dynamic nested internal table

    Hi Experts,
    Pleae tell me or give sample code, how to create dynamic nested internal table ?
    I have seen threads saying creation of dynamic internal tables using some table structure only. But now the requirement is to create dynamic nested internal table.
    For example the internal table contains two fields viz., one is field1 of dynamic internal table and other is normal field2 and values as shown below:
    Nested internal table:
    field1                     |     field2 ...
    <table content1>     |     value2..
    <table content1>     |     value2..
    Here the [table content] should also a dynamic internal table.
    Let me know if you need any other info.
    regards
    Saravanan R

    see the complete code..i am currently working in ECC6.0 EHP4. just check which version you are using..
    REPORT  yst_test_000.
    DATA:
          lt_comptab         TYPE cl_abap_structdescr=>component_table,
          ls_comp            LIKE LINE OF lt_comptab,
          lref_newstr        TYPE REF TO cl_abap_structdescr,
          lref_tab_type      TYPE REF TO cl_abap_tabledescr,
          lt_fcat            TYPE lvc_t_fcat,
          ls_fcat            TYPE lvc_s_fcat,
          ls_dd03p           TYPE dd03p,
          lt_data            type ref to data.
    field-symbols: <fs_table> type standard table.
    CALL FUNCTION 'LVC_FIELDCATALOG_MERGE'
      EXPORTING
        i_structure_name       = 'SCARR'
      CHANGING
        ct_fieldcat            = lt_fcat
      EXCEPTIONS
        inconsistent_interface = 1
        program_error          = 2
        OTHERS                 = 3.
    IF sy-subrc NE 0.
      MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
              WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
    ENDIF.
    LOOP AT lt_fcat INTO ls_fcat.
      IF ls_fcat-ref_table IS NOT INITIAL.
        CLEAR ls_dd03p.
        CALL FUNCTION 'BUS_DDFIELD_GET'
          EXPORTING
            i_tabnm         = ls_fcat-ref_table
            i_fldnm         = ls_fcat-fieldname
          IMPORTING
            e_dd03p         = ls_dd03p
          EXCEPTIONS
            field_not_found = 1
            OTHERS          = 2.
        IF sy-subrc EQ 0.
          ls_comp-name = ls_fcat-fieldname.
          ls_comp-type ?= cl_abap_datadescr=>describe_by_name( ls_dd03p-rollname ).
          APPEND ls_comp TO lt_comptab.
          CLEAR ls_comp.
        ENDIF.
      ELSE.
        ls_comp-name = ls_fcat-fieldname.
        ls_comp-type ?= cl_abap_datadescr=>describe_by_name( ls_fcat-rollname ).
        APPEND ls_comp TO lt_comptab.
        CLEAR ls_comp.
      ENDIF.
    ENDLOOP.
    *Now for the Field which you want deep table then you can do like this
    ls_fcat-fieldname  = 'NESTED_TABLE'.
    ls_fcat-inttype    = 'C'.
    ls_fcat-intlen     = '000006'.
    ls_fcat-rollname   = 'SFLIGHT_TAB1'. "For SFLIGHT
    APPEND ls_fcat TO lt_fcat.
    ls_comp-name = ls_fcat-fieldname.
    ls_comp-type ?= cl_abap_datadescr=>describe_by_name( ls_fcat-rollname ).
    APPEND ls_comp TO lt_comptab.
    CLEAR ls_comp.
    lref_newstr = cl_abap_structdescr=>create( lt_comptab ).
    lref_tab_type = cl_abap_tabledescr=>create( lref_newstr ).
    create data lt_data type handle lref_tab_type.
    assign lt_data->* to <fs_table>.
    break-point.
    Edited by: Vijay Babu Dudla on Apr 28, 2009 8:05 AM

  • Dynamic internal table problem in FM - HR_INFOTYPE_OPERATIONS

    Dear All,
    I have a problem when I use a Dynamic internal table in FM - HR_INFOTYPE_OPERTATION..
    Please suggest me on the way to overcome this problem..
    We wanted to have a dynamic Program for Info type operations which can be used for any info types as we are changing only BEGDA and the related actions
    So in my program I have the parameters to accept
    P_BEGDA - 01.10.2007
    P_INFTY - P0008
    P_ACTIO - COPY
    I am able to create a dynamic table based on the parameters P_INFTY and able to read it also using the FM - HR_READ_INFOTYPE
    BUT when I pass the dynamic internal table to a FM - HR_INFOTYPE_OPERTATION I am getting a DUMP
    The DUMP is at the below statement from FM - HR_INFOTYPE_OPERTATION
    ASSIGN record TO <record> CASTING TYPE (tabname). "XDP UniCode
    It gives the below possiblities
    "ASSIGN_BASE_TOO_SHORT" C 
    "SAPLHRMM" or "LHRMMU03"  
    "HR_INFOTYPE_OPERATION"   
    But If I use the below internal table
    Data : g_t_0008 like P0008 occurs 0 with header line.
    And If I use the internal table g_t_0008 instead of dynamic tables then it works. So I strongly feel it's due to not having a header in the dynamic table below see below the sample code on how I am generating a dynamic internal table
    field-symbols: <dyn_table> type standard table.
    data: dy_table type ref to data,
          dy_line  type ref to data,
          xfc type lvc_s_fcat,
          ifc type lvc_t_fcat.
    to get the srurcute
    perform get_structure using l_f_table.
    perform create_dynamic_itab .
    assign dy_table->* to <dyn_table>.
    perform get_data tables <dyn_table01>
                      using pernr-pernr p_infty.
    below are the forms routine….
    form get_structure using p_table.
    data : idetails type abap_compdescr_tab,
           xdetails type abap_compdescr.
    data : ref_table_des type ref to cl_abap_structdescr.
    clear : ifc[], dy_table.
    Get the structure of the table.
      ref_table_des ?=
          cl_abap_typedescr=>describe_by_name( p_table ).
      idetails[] = ref_table_des->components[].
      loop at idetails into xdetails.
        clear xfc.
        xfc-fieldname = xdetails-name .
        xfc-datatype = xdetails-type_kind.
        xfc-inttype = xdetails-type_kind.
        xfc-intlen = xdetails-length.
        xfc-decimals = xdetails-decimals.
        append xfc to ifc.
      endloop.
    endform.
    form create_dynamic_itab.
    Create dynamic internal table and assign to FS
      call method cl_alv_table_create=>create_dynamic_table
                   exporting
                      it_fieldcatalog = ifc
                   importing
                      ep_table        = dy_table.
    endform.
    *&      Form  get_data
    form get_data  tables   p_table
                   using    p_pernr
                            p_infty.
    clear : p_table, p_table[].
      CALL FUNCTION 'HR_READ_INFOTYPE'
           EXPORTING
                PERNR           = P_PERNR
                INFTY           = p_infty
                BEGDA           = p_datum
                ENDDA           = p_datum
           TABLES
                INFTY_TAB       = p_table
           EXCEPTIONS
                INFTY_NOT_FOUND = 1
                OTHERS          = 2.
      CHECK SY-SUBRC EQ 0.
    IF lines( p_table ) GT 0.
    *write :/'Record exist' , 'IT', p_infty.
    clear p_table.
    PERFORM hr_operation tables  p_table
                         using  g_t_t588d-actio g_t_t588d-INFTY
                                g_t_t588d-SUBTY.
    else.
    PERFORM append_status using g_t_itab-pernr p_infty ' '
                                'Error' 'No records'.
    ENDIF.
    endform.                    " get_data
    form hr_operation  tables    p_table
                       using     p_actio P_INFTY P_SUBTY.
    data: l_f_return    LIKE bapireturn1.
    ASSIGN COMPONENT 'BEGDA' OF STRUCTURE p_table TO <l_field>.
          <l_field> = p_begda.
            CALL FUNCTION 'HR_INFOTYPE_OPERATION'
              EXPORTING
                infty         = P_infty
                number        = G_T_ITAB-PERNR
                subtype       = P_subty
                validityend   = g_f_endda
                validitybegin = P_datum
                record        = P_TABLE
                operation     = p_actio
              IMPORTING
                return        = l_f_return.
    IF sy-subrc NE 0.
    ENDIF.
    ENDFORM.

    try
    using field symbol for a wrk area instead of Field symbol for a table
    loop your inernal table (again a field symbol) assigning to <fs_wrkarea>
    in loop call HR_INFO.._OP..
    reward if helpful

  • Dynamic Internal Table problem

    Hello all,
    I have created a Dynamic ALV using RTTS classes like cl_abap_structdescr,cl_abap_tabledescr and cl_abap_datadescr.
    The number of columns to be displayed is dynamic and i am able to display the same.
    Now i need to perform SUBTOTAL on few of the columns.
    In dynamic table how do i assign those columns as Type 'I' so that i can perform DO_SUM.
    I used the method GET_I of class cl_abap_elemdescr but unable to achive the same.
    Kindly suggest.
    Regards,
    Arun

    I know when I need to create a dynamic alv I use the following (plumbing code removed).
    DATA: it_field_catalog      TYPE lvc_t_fcat.
    DATA: dyn_table             TYPE REF TO data.
    FIELD-SYMBOLS: <dyn_table>         TYPE table.
    create your alv as normal. Or auto create the entries based on the tables, whatever conditions you use to determine the structure of the table at run time.
      ls_fcat-fieldname   = '???'.
      ls_fcat-inttype     = '?' .
      ls_fcat-outputlen   = '?' .
      ls_fcat-coltext     = '?' .
      ls_fcat-seltext     = '?' .
      ls_fcat-f4availabl  = '?'.
      ls_fcat-edit        = '?'.
      ls_fcat-key         = '?'.
      APPEND ls_fcat TO it_field_catalog .
        CALL METHOD cl_alv_table_create=>create_dynamic_table
           EXPORTING it_fieldcatalog = it_field_catalog
           IMPORTING ep_table        = dyn_table
           EXCEPTIONS
                  generate_subpool_dir_full = 1.
       ASSIGN dyn_table->* TO <dyn_table>.
    This field symbol to the table can then be passed in place of the table when calling your alv and performing operations on it.

  • 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.

  • Reg:doubt in dynamic generated internal table

    hi everyone,
                 i generated a internal table dynamically,the output is in fied symbol,i want to create a internal table using the field symbol sturture,how to create that????
    plz tell me how to create a internal table referencing field symbol structure........
    very urgent plz help.........
    thanks in advance....
    regards,
    balaji.s

    Hi ,
           check out   a small part of an alv report which is using dynamic internal table
    data: dy_table type ref to data,
          dy_line type ref to data.
    field-symbols: <dyn_table> type standard table,
                   <dyn_wa> type any,
                   <dyn_line> type any.
        call method cl_alv_table_create=>create_dynamic_table
          exporting
            it_fieldcatalog = ifc
          importing
            ep_table        = dy_table.
        assign dy_table->* to <dyn_table>.
    CREATE A DYNAMIC WORK AREA.
        create data dy_line like line of <dyn_table>.
        sort it_mard by matnr werks.
        loop at it_mard into wa_mard.
          at new matnr.
            assign dy_line->* to <dyn_wa>.
            assign component 'MATNR' of structure <dyn_wa> to <dyn_line>.
            <dyn_line> = wa_mard-matnr.
            read table it_mard2 into wa_mard1 with key matnr = wa_mard-matnr.
            v_amount = wa_mard1-v_total * p_unit.
            call function 'SPELL_AMOUNT'
              exporting
                amount = v_amount
           currency        = 'INR'
      FILLER          = ' '
            language        = sy-langu
          importing
            in_words        = v_price
          exceptions
            not_found       = 1
            too_large       = 2
            others          = 3
            if sy-subrc <> 0.
              message id sy-msgid type sy-msgty number sy-msgno
                      with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
            endif.
            assign component 'V_TOTAL' of structure <dyn_wa> to <dyn_line>.
            <dyn_line> = wa_mard1-v_total.
            assign component 'V_PRICE' of structure <dyn_wa> to <dyn_line>.
            <dyn_line> = v_price-word.
          endat.
          concatenate 'STOCK' '-' 'IN' '-' wa_mard-werks into v_new.
          assign component v_new of structure <dyn_wa> to <dyn_line>.
          <dyn_line> = wa_mard-labst.
          at end of matnr.
            append <dyn_wa> to <dyn_table>.
            clear wa_mard.
            clear <dyn_wa>.
            unassign <dyn_line>.
            unassign <dyn_wa>.
          endat.
        endloop.
    rewards points if helpful.

  • Search Help doesn't work with a dynamically created internal table

    Hi Gurus,
    I have a custom report that will display the output through edittable ALV.
    My issue is, even though I've already did the FOREIGN KEY assisgnment to each fields of my custom table,
    when I run my report,some fields F$ functionality aint working.
    In my report, I've declared the table to be passed to ALV display dynamically as below:
    *_Create dynamic internal tables for the Final INTERNAL TABLE
      CALL METHOD cl_alv_table_create=>create_dynamic_table
        EXPORTING
          it_fieldcatalog           = gt_fldcatfin
        IMPORTING
          ep_table                  = gp_fintab
        EXCEPTIONS
          generate_subpool_dir_full = 1
          OTHERS                    = 2.
        ASSIGN gp_fintab->* TO <i_xfintab>.
    Where gt_fldcatfin is a modified fieldcatalog (combination of the cutom table fields and 1 column for CELLCOLOR)
    Please help me with this. Thanks a lot.

    This is one way.
    Import photo into illustrator.
    Draw box around photo, no fill ,no stroke colour and place on top of photo.
    Menu - Object - Envelope Distort - Make with Warp - (warp option will appear)
    Use ‘Direct Selection Tool’ (white arrow)
    Select/click on anchor points to alter, you can also use the rotation tool to turn to required position.
    Hope this info' is of help.

  • Uploading Dynamically created Internal table form Flat file

    I am creating dynamic internal table as follows:
    *-create dynamic internal table
      CALL METHOD cl_alv_table_create=>create_dynamic_table
        EXPORTING
          it_fieldcatalog = i_fldcat[]
        IMPORTING
          ep_table        = i_modify.
      ASSIGN i_modify->* TO <fs_tab>.
    The dymamic internal table is created with the given Ztable in the selection screen.
    Now the problem is when I try to upload this table <fs_table> using function module Call function 'UPLOAD'.
    The first column of flat file is getting updated in Mandt of <fs_table>.
    I want to update sy-mandt in MANDT of <fs_table> and the rest of the fields with flat file data.
    e.g.
    Flat file data:
    100 white
    101 black
    <fs_table> structure is getting uploaded as below
    mandt zcode zdesc
    100     white
    101     black
    if the clint is 700
    it has to be uploaded as
    mandt zcode zdesc
    700    100     white
    700    101     black
    Can someone knows what should be the approach or any other function module to be used ?
    Message was edited by:
            Mahesh Sahu

    See the answer in your previous thread and close this thread. why do you want to have many threads for one question.

  • How to upload an excel to a dynamically generated internal table?

    Hi,
    I have an excel sheet. I have to create an internal table dynamically according to the fields of the excel sheet. The internal table i have created successfully, the fields are exactly coming as the excel sheet. I need to upload the excel sheet directly to my Internal table.
    Similar to the FM GUI_UPLOAD, which directly uploads the text document into the internal table
    I am not able to pass my dynamic internal table to the GUI_UPLOAD, The tables parameter in the GUI_UPLOAD is accepting only the standard tables.
    How to do?
    -Sudheer

    Hi,
    Use TEXT_CONVERT_XLS_TO_SAP  Function  Module.
    AWARD POINTS IF USEFUL

  • Dynamically changing internal table in 'gui_download'

    Hi Experts,
                     i have to download 4 internal tables, each with different structures, to the presentation server using 'gui_download', based on which radio-button is selected in the selection screen. I am hoping to use a single 'form' and 4 'perform' calls. how can I dynamically change the tables in the 'gui_download' function modules.
    plz help.....................

    Hi ,
    Build the field catalog dynamically based on the internal table structure based on the radio button selected.Use the dynamic internal table generated from the filedcatalog and use in GUI_DOWNLOAD.
    See the below code:
    *& Report  ZRAJESH02
    REPORT  zrajesh02.
    Dynamic internal table
    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: lv_monate TYPE f,
          lv_months TYPE i,
          lv_date TYPE sy-datum,
          p_check1 type n value '1'.
    lv_date = sy-datum + 360.
    SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
    PARAMETERS: p_check TYPE c.
    SELECTION-SCREEN END OF BLOCK b1.
    START-OF-SELECTION.
      CALL FUNCTION 'MONTHS_BETWEEN_TWO_DATES'
        EXPORTING
          i_datum_bis   = lv_date
          i_datum_von   = sy-datum
          i_kz_incl_bis = ' '
        IMPORTING
          e_monate      = lv_monate.
      lv_months = lv_monate.
      PERFORM f_fcat USING 'AUFNR' 'CHAR' '12'.
      PERFORM f_fcat USING 'POSNR' 'CHAR' '06'.
      while p_check1 LE p_check.
      PERFORM f_fcat USING p_check1 'CHAR' '1'.
      p_check1 = p_check1 + 1.
      endwhile.
      PERFORM build_dyn_itab.
      LOOP AT <dyn_table> INTO <dyn_wa>.
        WRITE:/ <dyn_wa>.
      ENDLOOP.
    FORM f_fcat USING fieldname dattyp length.
      DATA:wa_it_fldcat TYPE lvc_s_fcat.
      CLEAR wa_it_fldcat.
      wa_it_fldcat-fieldname = fieldname.
      wa_it_fldcat-datatype = dattyp.
      wa_it_fldcat-intlen = length.
      APPEND wa_it_fldcat TO it_fldcat .
    ENDFORM.                    "f_fcat
    *&      Form  build_dyn_itab
          text
    FORM build_dyn_itab.
      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 = 'AUFNR'.
    wa_it_fldcat-datatype = 'CHAR'.
    wa_it_fldcat-intlen = 12.
    APPEND wa_it_fldcat TO it_fldcat .
    CLEAR wa_it_fldcat.
    wa_it_fldcat-fieldname = 'POSNR'.
    wa_it_fldcat-datatype = 'CHAR'.
    wa_it_fldcat-intlen = 6.
    APPEND wa_it_fldcat TO it_fldcat .
    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.                    "build_dyn_itab
    Thanks,
    Rajesh.

  • Bdc upload file data into internal table problem with gui_upload fm

    Hello experts,
    my coding is like this ..
    data : begin of itab occurs 0 .
    field1 like mara-matnr,
    field2......
    etc,
    end of itab.
    data: file1 type string.
    parameter :file like rlgrap-filename.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR file.
    CALL FUNCTION 'KD_GET_FILENAME_ON_F4'
    EXPORTING
    static = 'X'
    mask = space
    field_name = 'FILE'
    CHANGING
    file_name = file.
    START-OF-SELECTION.
    FILE1 = FILE . "HERE I AM PASSING INTO STRING
    CALL FUNCTION 'GUI_UPLOAD'
    EXPORTING
    filename = FILE1
    FILETYPE = 'ASC'
    has_field_separator = 'X'
    TABLES
    data_tab = itab. " here the data is not populating from the file , it is giving the error like speified table not found.
    HERE i am getting the message like "specified table name not recgonised" . the data is not populating into the itab from the file.
    file structure is same as the internal table.
    I stored the file as .txt( ie in notepad).
    my file is like this..
    10000 200 323 sunndarrr.......
    i had a problem with this bdc , i am getting like "specified table name not recgonised" in the fm gui_upload while debugging.
    when i am using the ws_upload it is working fine.
    please guide me where i have done the mistake.
    thank you so much for all the replies.

    Hi,
    Have a look on the following code.
    TABLES: kna1.
    DATA: BEGIN OF itab1 OCCURS 0,
          str(255),
          END OF itab1.
    DATA: itab2 TYPE kna1 OCCURS 0 WITH HEADER LINE.
    CALL FUNCTION 'WS_UPLOAD'
      EXPORTING
        filename                = 'D:\ABAP EVE\ffile1.txt'
        filetype                = 'ASC'
      TABLES
        data_tab                = itab1
      EXCEPTIONS
        conversion_error        = 1
        file_open_error         = 2
        file_read_error         = 3
        invalid_type            = 4
        no_batch                = 5
        unknown_error           = 6
        invalid_table_width     = 7
        gui_refuse_filetransfer = 8
        customer_error          = 9
        no_authority            = 10
        OTHERS                  = 11.
    IF sy-subrc <> 0.
      WRITE:/ 'sorry'.
    ELSE.
      LOOP AT itab1.
        SPLIT itab1-str AT ',' INTO itab2-kunnr itab2-name1.
        APPEND itab2.
      ENDLOOP.
      IF sy-subrc = 0.
        LOOP AT itab2.
          WRITE:/ itab2-kunnr,itab2-name1.
          INSERT INTO kna1 VALUES itab2.
        ENDLOOP.
        IF sy-subrc = 0.
          WRITE:/ 'inserted'.
        ELSE.
          WRITE:/ 'not inserted'.
        ENDIF.
      ELSE.
        WRITE:/ 'fail'.
      ENDIF.
    ENDIF.
    Flat file:
    10001,Sadney
    10003,Yogesh
    20005,Madan
    1.U need to define internal table with one field of max size
    2.upload the flat file data into that internal table
    3.split that internal table data into another internal table(having fields)
    <REMOVED BY MODERATOR>
    thanks,
    Chandu
    Edited by: Alvaro Tejada Galindo on Apr 30, 2008 12:17 PM

  • Passing values to dynamically created internal table

    Hi,
    I have the flat file data as
    f1,f2,f3........so on
    where f1 f2 and f3 are field names.
    I have a variable var which contains the data
    V1,0001,0002.........so on
    data: var type string.
    The value of field f1 is v1
    The value of field f2 is 0001
    The value of field f3 is 0002.......so on
    FIELD-SYMBOLS:     <fs_1> TYPE STANDARD TABLE
    I have dynamically created an internal table for fields f1  f2 f3 ...... using 
      CALL METHOD cl_alv_table_create=>create_dynamic_table
        EXPORTING
          it_fieldcatalog           = lt_fieldcatalog
        IMPORTING
          ep_table                  = <fs_data>
        EXCEPTIONS
          generate_subpool_dir_full = 1
          OTHERS                    = 2.
      IF sy-subrc <> 0.
      ENDIF.
    ASSIGN <fs_data>->* TO <fs_1>.
    Now for <fs_1> I have to pass the corresponding values of the fields f1 f2 f3 .
    How can i solve this.
    Thanks and regards ,
    Parvatha Reddy

    Hi,
    There is no data in <fs_1>.
    I need to pass the data form the string var to the fields of <fs_1>..
    I understand that you want to populate the internal table <fs_1>.
    for that you fist need work area.. use below statement to create work area..
    DATA: new_line TYPE REF TO data.
    CREATE DATA new_line LIKE LINE OF <fs_1>.
    ASSIGN new_line->*  TO <fs_2>.
    <fs_2> is not your work aread...
    to assign value to each field of you work aread <fs_2>. use statement
    ASSIGN COMPONENT 1 OF STRUCTURE <fs_2> TO <fs_3>.
    <fs_3> = f1 .
    now <fs_3> will point to the first field of work area <fs_2>, f1 is value from your string .. repeat above for each field in workarea, by increasing the component number. Once your work area is filled
    append it to table.
    append <fs_2> to <fs_1>
    apologies if I am not getting the requiremnt correctly..

Maybe you are looking for

  • Error while purchasing an item in Apple Store

    Hello ... I Live in Iraq and my problem started yesterday when i tried to purchase the item Part number: MD827LL/A         ( price is 29$, shipped to US address ). I entered the 16 number of my credit card correctly but i incorrectly entered the secu

  • Two computers for the same website, need help!

    Hello everybody, I really need some help here! I am working on a website at the office and to save some time, I've send by email all the files related to it to my pc at home. When I tried to open the pages at home, I've found problems with visualizin

  • 2011 iMac won't install Windows 7 in Boot Camp

    I'm attempting to install Windows 7 x64 on my 2011 (Thunderbolt) iMac via a burned, bootable DVD which was previously used to install Windows 7 x64 on my friend's MacBook Pro. Apparently, the disc works. After partitioning one of my internal drives i

  • How do I update iphone 4 with ios 4.2?

    How do I update iphone 4 with ios 4.2?

  • HTML Images not showing in Emails

    Hi, Strange things are happening in Mail (Version 2.1.3 (753.1)) on my G5 OS 10.4.11 - images within email are not appearing i.e images of items from companies or newsletter etc only getting '?' marks where images should be.As a side issue I cannot o