Function "DDIF_NAMETAB_GET"

Hi,
I am reading a database table's attributed using DDIF_NAMETAB_GET function. My code is:
DATA: IO_TABLE_NAME TYPE tabname,
  it_dfies TYPE TABLE OF dfies,
  is_dfies TYPE dfies.
DATA: is_x030l  TYPE x030l.
*IO_TABLE_NAME is getting from user
CALL FUNCTION 'DDIF_NAMETAB_GET'
           EXPORTING
                tabname   = IO_TABLE_NAME
           IMPORTING
                x030l_wa  = is_x030l
           TABLES
                dfies_tab = it_dfies
           EXCEPTIONS
                OTHERS    = 1.
LOOP AT it_dfies INTO is_dfies.
ENDLOOP.
Above, When I watching the is_dfies, there are some informations as:
"ZCALISAN      ID      0002000004     AKCNT"
I know that ZCALISAN is the name of database table, ID is the attribute of this table, AKCNT is the field type of this attribute.
Now,
1. I don't know 0002000004 mean? Or how to interpret this value?
2. I want to learn this table's primary key(s). But the table "it_dfies" includes only attribute information. How can I read primary keys? Is it possible to read primary keys using  FUNCTION 'DDIF_NAMETAB_GET'?
3. I want to see the field type AKCNT or another field type's Data Type. Is it char? If char what is long? Or is it Decimal? How can I do this operation?
4. The purpose of all of these operations copying one database table. For this purpose, I will read table's information then using EXEC SQL I will create the copied table. Using EXEC SQL can I define DECIMAL like in SAP, or all other types like in SAP? Is there any restriction?

Hi,
There are two problems that I need to solve:
1. In my program I want SRC_TABL and TGT_TABL from user. Then when I called Function 'RS_DD_COPY_OBJ'
CALL FUNCTION 'RS_DD_COPY_OBJ'
  EXPORTING
    SOURCE_NAME              = SRC_TABL
    TARGET_NAME              = TGT_TABL
    OBJTYPE                  = OBJECT_TYPE
  EXCEPTIONS
    NOT_EXECUTED             = 1
    PERMISSION_FAILURE       = 2
    OTHERS                   = 3.
This function has another screen that wants Source Table and Target Table. If user enters Source Table and/or Target Table different from at the beginnig of the program that user entered, I need to learn what user entered. Because, I also need to activate copied table. And also, I will copy all entries of Source Table to Target Table. Because of these, I need to learn what user entered for table names while FUNCTION 'RS_DD_COPY_OBJ' is running
2. As I mentioned above, I need to copy the source table's entries to target table. But source table's and target table's names are defined by user. So, I can not write this:
SELECT * FROM SOURCE_TABLE INTO TABLE ITAB.
INSERT DEST_TABLE FROM TABLE ITAB.
Program gives error about SOURCE_TABLE and DEST_TABLE.
Also, I can not define ITAB because of I do not know which table I will use before starting program.
How can I implement this copy operation? Is there any way? Is there any function that copies source table's entries to target table?
Thanks.
Message was edited by: Huseyin Akturk -- DEU

Similar Messages

  • Error in FM DDIF_NAMETAB_GET when deleting BI objects via transport request

    Dear all,
    when importing a transport request in which several types of BI objects are deleted (Infocubes, DSO's, transformations, routines, DTP's, query elements, infosets, process chains). The import terminates only when transporting from acceptance to production with return code 12 due to an uncaught exception:
    Transporting from development to acceptance did not raise this exception.
    The ST22 dump (see below) refers in the "contents of system fields" section to a DSO, and to post-import activities. The DSO and the associated tables could not be found (rsa1 & se16), since they are deleted as desired.
    Some of the relevant notes that I have found do refer to DSO related problems, but they all indicate to install SP19 which we already have installed (BW 7.0 Patch Level 23)
    Could you please assist in pointing out potential solutions based on the information from the ST22 Runtime Error below?
    Kind regards,
    PJ
    Runtime Errors         UNCAUGHT_EXCEPTION
    Except.                CX_RS_PROGRAM_ERROR
    Date and Time          08.02.2011 10:48:14
    Short text
        An exception occurred that was not caught.
    What happened?
        The exception 'CX_RS_PROGRAM_ERROR' was raised, but it was not caught anywhere
        along the call hierarchy.
        Since exceptions represent error situations and this error was not
        adequately responded to, the running ABAP program
        'CL_RSDD_DS====================CP' has to be
        terminated.
    Error analysis
        An exception occurred which is explained in detail below.
        The exception, which is assigned to class 'CX_RS_PROGRAM_ERROR', was not caught
        and therefore caused a runtime error.
        The reason for the exception is:
        Error in BW: Error in DDIF_NAMETAB_GET
    How to correct the error
        If the error occurs in a non-modified SAP program, you may be able to
        find an interim solution in an SAP Note.
        If you have access to SAP Notes, carry out a search with the following
        keywords:
        "UNCAUGHT_EXCEPTION" "CX_RS_PROGRAM_ERROR"
        "CL_RSDD_DS====================CP" or "CL_RSDD_DS====================CM001"
        "APPEND_DS_TEC_FIELDS"
    System environment
        SAP-Release 700
        Application server... "dp1ci"
        Network address...... "<removed>"
        Operating system..... "HP-UX"
        Release.............. "B.11.23";
        Hardware type........ "ia64"
        Character length.... 16 Bits
        Pointer length....... 64 Bits
        Work process number.. 45
        Shortdump setting.... "full"
        Database server... "spisap02"
        Database type..... "ORACLE"
        Database name..... "DP1"
        Database user ID.. "SAPBIW"
        Terminal................. " "
        Char.set.... "C"
        SAP kernel....... 700
        created (date)... "Dec 14 2009 20:47:35"
        create on........ "HP-UX B.11.23 U ia64"
        Database version. "OCI_102 (10.2.0.1.0) "
        Patch level. 236
        Patch text.. " "
        Database............. "ORACLE 10.1.0.*.*, ORACLE 10.2.0.*.*, ORACLE 11.2.*.*.*"
        SAP database version. 700
        Operating system..... "HP-UX B.11";
        Memory consumption
        Roll.... 5979936
        EM...... 0
        Heap.... 1459888
        Page.... 40960
        MM Used. 6988880
        MM Free. 415648
    User and Transaction
        Client.............. 000
        User................ "DDIC"
        Language key........ "E"
        Transaction......... " "
        Transactions ID..... "4D5111661004210BE10000000AFA2502"
        Program............. "CL_RSDD_DS====================CP"
        Screen.............. "SAPMSSY0 1000"
        Screen line......... 6
    Information on where terminated
        Termination occurred in the ABAP program "CL_RSDD_DS====================CP" -
         in "APPEND_DS_TEC_FIELDS".
        The main program was "RDDEXECU ".
        In the source code you have the termination point in line 61
        of the (Include) program "CL_RSDD_DS====================CM001".
        The program "CL_RSDD_DS====================CP" was started as a background job.
        Job Name....... "RDDEXECL"
        Job Initiator.. "DDIC"
        Job Number..... 10475900
    Source Code Extract
    Line  SourceCde
       31         RAISE EXCEPTION TYPE cx_rs_program_error
       32           EXPORTING
       33             text = 'Invalid DSO subtype'.                   "#EC NOTEXT
       34     ENDCASE.
       35
       36 *   get table name from DDIC
       37     CALL METHOD cl_rsd_odso=>get_tablnm
       38       EXPORTING
       39         i_odsobject = n_infoprov
       40         i_tabt      = l_tab
       41       IMPORTING
       42         e_tablnm    = l_tablnm
       43       EXCEPTIONS
       44         OTHERS      = 1.
       45
       46     IF sy-subrc <> 0.
       47       RAISE EXCEPTION TYPE cx_rs_program_error
       48         EXPORTING
       49           text = 'Error in CL_RSD_ODSO=>get_Tablnm'.        "#EC NOTEXT
       50     ENDIF.
       51
       52     CALL FUNCTION 'DDIF_NAMETAB_GET'
       53       EXPORTING
       54         tabname   = l_tablnm
       55       TABLES
       56         dfies_tab = l_t_comp
       57       EXCEPTIONS
       58         not_found = 1
       59         OTHERS    = 2.
       60     IF sy-subrc <> 0.
    >>>>>       RAISE EXCEPTION TYPE cx_rs_program_error
       62         EXPORTING
       63           text = 'Error in DDIF_NAMETAB_GET'.        "#EC NOTEXT
       64     ENDIF.
       65
       66
       67   ELSE.
       68 *   model table only needed for standard datastore objects, for
       69 *   write optimized DSOs target table is a changelog that is fully described by
       70 *   dta_pro (infoobjects)
       71     CHECK n_s_dta-odsotype = rsdod_c_type-standard.
       72
       73 *   get model table fields to add
       74     CALL METHOD cl_rsd_odso=>get_mod_tab
       75       IMPORTING
       76         e_mod_fld_ur = l_t_comp.
       77   ENDIF.
       78
       79 * according to T.B. ( 13.04.2007) the correct position is
       80 * not needed in the D version
    Contents of system fields
    Name     Val.
    SY-SUBRC 0
    SY-INDEX 0
    SY-TABIX 1
    SY-DBCNT 1
    SY-FDPOS 0
    SY-LSIND 0
    SY-PAGNO 0
    SY-LINNO 1
    SY-COLNO 1
    SY-PFKEY
    SY-UCOMM
    SY-TITLE Execute Post-Import Methods and XPRAs for Transport Request
    SY-MSGTY E
    SY-MSGID DA
    SY-MSGNO 300
    SY-MSGV1 /BIC/AV_AMOFCB40
    SY-MSGV2
    SY-MSGV3
    SY-MSGV4
    SY-MODNO 0
    SY-DATUM 20110208
    SY-UZEIT 104759
    SY-XPROG SAPLSYST
    SY-XFORM SYSTEM_HOOK_OPEN_DATASET

    Hi All
    We are also experiencing this same error when transporting deletions of multiple objects.
    Although the transport was cancelled in the destination system (production) it appears to have largely deleted all objects successfully except for DSOs.
    The DSOs still appear in the table RSDODSO (via SE11) but are not visible anywhere else.  When you try to view the DSO via RSDODS a warning appears saying "DataStore object to be deleted by transport -> delete only allowed".  If you try to delete them in this transaction the same ABAP runtime error as the transport appears.
    Any assistance would be greatly appreciated!
    Regards
    David

  • Replacement function modules/method for obsolete Funtion Modules in ECC 6.0

    We are working on Upgrade Project and need your help in finding the replacement Function module/ Methods for following obsolete Function Modules:
       1.   GET_FIELDTAB
       2.   WS_EXCEL
       3.  HR_DISPLAY_BASIC_LIST
       4.  LOG_SYSTEM_GET_RFC_DESTINATION
       5.  HELPSCREEN_NA_CREATE
       6. TR_RELEASE_COMM
    Thank in Advance.
    Sarita.
    Edited by: Sarita Yalamati on Mar 28, 2008 1:23 PM

    Hi sarita,
    for GET_FIELDTAB use 'DDIF_NAMETAB_GET'..here is sample code
      CALL FUNCTION 'GET_FIELDTAB'
           EXPORTING
                LANGU               = SY-LANGU
                TABNAME             = C_STRUCTURE_NAME
                WITHTEXT            = ' '
           TABLES
                FIELDTAB            = IDFIES
           EXCEPTIONS
               INTERNAL_ERROR      = 01
                NO_TEXTS_FOUND      = 02
                TABLE_HAS_NO_FIELDS = 03
                TABLE_NOT_ACTIV     = 04.
    Replacement :
    CALL FUNCTION 'DDIF_NAMETAB_GET'
      EXPORTING
        TABNAME           =  C_STRUCTURE_NAME
      ALL_TYPES         = ' '
      LFIELDNAME        = ' '
      GROUP_NAMES       = ' '
      UCLEN             =
    IMPORTING
      X030L_WA          =
      DTELINFO_WA       =
      TTYPINFO_WA       =
      DDOBJTYPE         =
      DFIES_WA          =
      LINES_DESCR       =
    TABLES
      X031L_TAB         =
       DFIES_TAB         = IDFIES
    EXCEPTIONS
       NOT_FOUND         = 1
       OTHERS            = 2
    For WS_EXCEL  use GUI_DOWNLOAD.. here is sample code
    CALL FUNCTION 'WS_EXCEL'
    EXPORTING
       FILENAME            = 'D:\FILE1.xls'
      SYNCHRON            = ' '
      TABLES
        DATA                = itab
    EXCEPTIONS
       UNKNOWN_ERROR       = 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.
    Repalcement :
    data : l_filename type string.
    l_filename  = 'D:\FILE1.xls'.
    CALL FUNCTION 'GUI_DOWNLOAD'
      EXPORTING
      BIN_FILESIZE                    =
        FILENAME                        = l_filename
      FILETYPE                        = 'ASC'
    IMPORTING
      FILELENGTH                      =
      TABLES
        DATA_TAB                        = itab
      FIELDNAMES                      =
    EXCEPTIONS
       FILE_WRITE_ERROR                = 1
       NO_BATCH                        = 2
       GUI_REFUSE_FILETRANSFER         = 3
       INVALID_TYPE                    = 4
       NO_AUTHORITY                    = 5
       UNKNOWN_ERROR                   = 6
       HEADER_NOT_ALLOWED              = 7
       SEPARATOR_NOT_ALLOWED           = 8
       FILESIZE_NOT_ALLOWED            = 9
       HEADER_TOO_LONG                 = 10
       DP_ERROR_CREATE                 = 11
       DP_ERROR_SEND                   = 12
       DP_ERROR_WRITE                  = 13
       UNKNOWN_DP_ERROR                = 14
       ACCESS_DENIED                   = 15
       DP_OUT_OF_MEMORY                = 16
       DISK_FULL                       = 17
       DP_TIMEOUT                      = 18
       FILE_NOT_FOUND                  = 19
       DATAPROVIDER_EXCEPTION          = 20
       CONTROL_FLUSH_ERROR             = 21
       OTHERS                          = 22
    IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
             WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    CALL METHOD CL_GUI_FRONTEND_SERVICES=>EXECUTE
      EXPORTING
        DOCUMENT               = 'D:\FILE1.xls'
       APPLICATION            =
       PARAMETER              =
       DEFAULT_DIRECTORY      =
       MAXIMIZED              =
       MINIMIZED              =
       SYNCHRONOUS            =
        OPERATION              = 'OPEN'
      EXCEPTIONS
        CNTL_ERROR             = 1
        ERROR_NO_GUI           = 2
        BAD_PARAMETER          = 3
        FILE_NOT_FOUND         = 4
        PATH_NOT_FOUND         = 5
        FILE_EXTENSION_UNKNOWN = 6
        ERROR_EXECUTE_FAILED   = 7
        SYNCHRONOUS_FAILED     = 8
        NOT_SUPPORTED_BY_GUI   = 9
        others                 = 10
    IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
                WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.

  • Call function 'NAMETAB_GET '

    Hi
    Iam working in upgrade project  , right now i have a problem ,any body please  suggest  new function module in the place of NAMETAB_GET 
    Thanks

    Hi Ravi,
                The replacement for the FM is 'DDIF_NAMETAB_GET'. Here is an example how it has to be replaced.
    Structure of the NAMETAB needs to be changed to DFIES in the new function module.
    CALL FUNCTION 'NAMETAB_GET'
          EXPORTING
               TABNAME = 'FEBMKK_KF'
          TABLES
               NAMETAB =  NAMETAB
          EXCEPTIONS
               OTHERS  = 1.
    DATA BEGIN OF NAMETAB OCCURS 20.
             INCLUDE STRUCTURE DFIES.
    DATA END OF NAMETAB.
    CALL FUNCTION 'DDIF_NAMETAB_GET'
      EXPORTING
        tabname           = 'FEBMKK_KF'
      ALL_TYPES         = ' '
      LFIELDNAME        = ' '
      GROUP_NAMES       = ' '
      UCLEN             =
    IMPORTING
      X030L_WA          =
      DTELINFO_WA       =
      TTYPINFO_WA       =
      DDOBJTYPE         =
      DFIES_WA          =
      LINES_DESCR       =
    TABLES
      X031L_TAB        =
       DFIES_TAB         =  NAMETAB
    EXCEPTIONS
       NOT_FOUND         = 1
       OTHERS            = 2
    The bullets indicate that the line is commented.
    I hope this was helpful.
    Thanks,
    Vasuki

  • DYNAMIC TABLE FUNCTION

    Hi Expert
    I want to build a function that receive a dynamic table , how i do it and how i call this function
    thanks and regardes

    hi,
    check this:
    REPORT zmodtab NO STANDARD PAGE HEADING.
    TYPE-POOLS: rsds.
    DATA: is_x030l  TYPE x030l,
          it_dfies  TYPE TABLE OF dfies,
          is_dfies  TYPE dfies,
          it_fdiff  TYPE TABLE OF field_dif,
          is_fdiff  TYPE field_dif.
    DATA: w_selid   TYPE rsdynsel-selid,
          it_tables TYPE TABLE OF rsdstabs,
          is_tables TYPE rsdstabs,
          it_fields TYPE TABLE OF rsdsfields,
          it_expr   TYPE rsds_texpr,
          it_ranges TYPE rsds_trange,
          it_where  TYPE rsds_twhere,
          is_where  TYPE rsds_where,
          w_active  TYPE i.
    DATA: it_content TYPE REF TO data,
          it_modif   TYPE REF TO data,
          it_fcat    TYPE lvc_t_fcat.
    DATA: w_okcode   TYPE sy-ucomm.
    FIELD-SYMBOLS: <itab> TYPE STANDARD TABLE,
                   <ntab> TYPE STANDARD TABLE.
    Macros
    DEFINE table_error.
      message e398(00) with 'Table' p_table &1.
    END-OF-DEFINITION.
    DEFINE fixed_val.
      is_fdiff-fieldname = is_dfies-fieldname.
      is_fdiff-fixed_val = &1.
      is_fdiff-no_input  = 'X'.
      append is_fdiff to it_fdiff.
    END-OF-DEFINITION.
    Selection screen
    SELECTION-SCREEN: BEGIN OF BLOCK b01 WITH FRAME.
    PARAMETERS: p_table TYPE tabname OBLIGATORY                    "table
                                     MEMORY ID dtb
                                     MATCHCODE OBJECT dd_dbtb_16.
    SELECTION-SCREEN: BEGIN OF LINE,
                      PUSHBUTTON 33(20) selopt USER-COMMAND sel,
                      COMMENT    55(15) selcnt,
                      END OF LINE.
    SELECTION-SCREEN: SKIP.
    PARAMETERS: p_rows  TYPE i.                                    "rows
    SELECTION-SCREEN: END OF BLOCK b01,
                      SKIP,
                      BEGIN OF BLOCK b02 WITH FRAME.
    PARAMETERS: p_displ TYPE c AS CHECKBOX.                        "display
    SELECTION-SCREEN: END OF BLOCK b02.
    Initialization
    INITIALIZATION.
      MOVE '@4G@ Filter records' TO selopt.
    PBO
    AT SELECTION-SCREEN OUTPUT.
      IF w_active IS INITIAL.
        CLEAR: selcnt.
      ELSE.
        WRITE w_active TO selcnt LEFT-JUSTIFIED.
      ENDIF.
    PAI
    AT SELECTION-SCREEN.
      IF p_table NE is_x030l-tabname.
        CALL FUNCTION 'DDIF_NAMETAB_GET'
             EXPORTING
                  tabname   = p_table
             IMPORTING
                  x030l_wa  = is_x030l
             TABLES
                  dfies_tab = it_dfies
             EXCEPTIONS
                  OTHERS    = 1.
        IF is_x030l IS INITIAL.
          table_error 'does not exist or is not active'.
        ELSEIF is_x030l-tabtype NE 'T'.
          table_error 'is not selectable'.
        ELSEIF is_x030l-align NE 0.
          table_error 'has alignment - cannot continue'.
        ENDIF.
      Default values for system fields
        REFRESH: it_fdiff.
        is_fdiff-tabname = p_table.
        LOOP AT it_dfies INTO is_dfies.
          IF is_dfies-datatype = 'CLNT'.
            fixed_val sy-mandt.
          ELSEIF is_dfies-rollname = 'ERDAT'
              OR is_dfies-rollname = 'ERSDA'
              OR is_dfies-rollname = 'AEDAT'
              OR is_dfies-rollname = 'LAEDA'.
            fixed_val sy-datum.
          ELSEIF is_dfies-rollname = 'ERTIM'
              OR is_dfies-rollname = 'AETIM'.
            fixed_val sy-uzeit.
          ELSEIF is_dfies-rollname = 'ERNAM'
              OR is_dfies-rollname = 'AENAM'.
            fixed_val sy-uname.
          ENDIF.
        ENDLOOP.
      Prepare free selection on table
        REFRESH it_tables.
        is_tables-prim_tab = p_table.
        APPEND is_tables TO it_tables.
        CLEAR: w_selid.
      ENDIF.
      IF sy-ucomm = 'SEL'.
        IF w_selid IS INITIAL.
        Init free selection dialog
          CALL FUNCTION 'FREE_SELECTIONS_INIT'
               EXPORTING
                    expressions  = it_expr
               IMPORTING
                    selection_id = w_selid
                    expressions  = it_expr
               TABLES
                    tables_tab   = it_tables
               EXCEPTIONS
                    OTHERS       = 1.
        ENDIF.
      Display free selection dialog
        CALL FUNCTION 'FREE_SELECTIONS_DIALOG'
             EXPORTING
                  selection_id            = w_selid
                  title                   = 'Selection'
                  status                  = 1
                  as_window               = 'X'
             IMPORTING
                  expressions             = it_expr
                  field_ranges            = it_ranges
                  number_of_active_fields = w_active
             TABLES
                  fields_tab              = it_fields
             EXCEPTIONS
                  OTHERS                  = 1.
      ENDIF.
    Start of processing
    START-OF-SELECTION.
      PERFORM f_create_table USING p_table.
      PERFORM f_select_table.
      PERFORM f_display_table.
          FORM f_create_table                                           *
    FORM f_create_table USING in_tabname.
      FIELD-SYMBOLS: <fcat> TYPE lvc_s_fcat.
      CALL FUNCTION 'LVC_FIELDCATALOG_MERGE'
           EXPORTING
                i_structure_name = in_tabname
           CHANGING
                ct_fieldcat      = it_fcat
           EXCEPTIONS
                OTHERS           = 1.
      IF sy-subrc = 0.
      Complete field catalog
        LOOP AT it_fcat ASSIGNING <fcat>.
          <fcat>-tabname = in_tabname.
        ENDLOOP.
        CALL FUNCTION 'LVC_FIELDCAT_COMPLETE'
             CHANGING
                  ct_fieldcat = it_fcat
             EXCEPTIONS
                  OTHERS      = 1.
      ELSE.
        WRITE: 'Error building field catalog'.
        STOP.
      ENDIF.
    Create dynamic table for data
      CALL METHOD cl_alv_table_create=>create_dynamic_table
        EXPORTING
          it_fieldcatalog = it_fcat
        IMPORTING
          ep_table        = it_content.
      IF sy-subrc = 0.
        ASSIGN it_content->* TO <itab>.
      ELSE.
        WRITE: 'Error creating internal table'.
        STOP.
      ENDIF.
    Create dynamic table for modif
      CALL METHOD cl_alv_table_create=>create_dynamic_table
        EXPORTING
          it_fieldcatalog = it_fcat
        IMPORTING
          ep_table        = it_modif.
      IF sy-subrc = 0.
        ASSIGN it_modif->* TO <ntab>.
      ELSE.
        WRITE: 'Error creating internal table'.
        STOP.
      ENDIF.
    ENDFORM.
          FORM f_select_table                                           *
    FORM f_select_table.
      IF w_active = 0.
        SELECT * FROM (p_table)
                 INTO CORRESPONDING FIELDS OF TABLE <itab>
                UP TO p_rows ROWS.
      ELSE.
      Selection with parameters
        CALL FUNCTION 'FREE_SELECTIONS_RANGE_2_WHERE'
             EXPORTING
                  field_ranges  = it_ranges
             IMPORTING
                  where_clauses = it_where.
        READ TABLE it_where INTO is_where WITH KEY tablename = p_table.
        SELECT * FROM (p_table)
                 INTO CORRESPONDING FIELDS OF TABLE <itab>
                UP TO p_rows ROWS
                WHERE (is_where-where_tab).
      ENDIF.
      IF sy-dbcnt = 0.
        WRITE: 'No record selected'.
        STOP.
      ENDIF.
    ENDFORM.
          FORM f_display_table                                          *
    FORM f_display_table.
      DATA: l_answer TYPE c,
            l_eflag  TYPE c.
      CLEAR: w_okcode.
      REFRESH: <ntab>.
    Display table contents
      CALL FUNCTION 'STC1_FULLSCREEN_TABLE_CONTROL'
           EXPORTING
                header       = p_table
                tabname      = p_table
                display_only = p_displ
                endless      = 'X'
                no_button    = space
           IMPORTING
                okcode       = w_okcode
           TABLES
                nametab      = it_dfies
                table        = <itab>
                fielddif     = it_fdiff
                modif_table  = <ntab>
           EXCEPTIONS
                OTHERS       = 1.
      IF sy-subrc = 0.
        IF p_displ IS INITIAL AND w_okcode = 'SAVE'.
        Confirm update
          CALL FUNCTION 'POPUP_TO_CONFIRM'
               EXPORTING
                    titlebar              = p_table
                    text_question         = 'Do you want to update table ?'
                    default_button        = '2'
                    display_cancel_button = ' '
               IMPORTING
                    answer                = l_answer
               EXCEPTIONS
                    OTHERS                = 1.
          IF l_answer = '1'.
          Apply modifications
            IF NOT <ntab>[] IS INITIAL.
              PERFORM f_add_system USING space.
              MODIFY (p_table) FROM TABLE <ntab>.
              IF sy-subrc NE 0.
                l_eflag = 'X'.
              ENDIF.
            ENDIF.
          Apply deletions
            IF l_eflag IS INITIAL.
              REFRESH: <ntab>.
              CALL FUNCTION 'STC1_GET_DATA'
                   TABLES
                        deleted_data = <ntab>
                   EXCEPTIONS
                        OTHERS       = 1.
              IF NOT <ntab>[] IS INITIAL.
                DELETE (p_table) FROM TABLE <ntab>.
                IF sy-subrc NE 0.
                  ROLLBACK WORK.
                  l_eflag = 'X'.
                ENDIF.
              ENDIF.
            ENDIF.
          Apply creations
            IF l_eflag IS INITIAL.
              REFRESH: <ntab>.
              CALL FUNCTION 'STC1_GET_DATA'
                   TABLES
                        new_data = <ntab>
                   EXCEPTIONS
                        OTHERS   = 1.
              IF NOT <ntab>[] IS INITIAL.
                PERFORM f_add_system USING 'X'.
                INSERT (p_table) FROM TABLE <ntab>.
                IF sy-subrc NE 0.
                  ROLLBACK WORK.
                  l_eflag = 'X'.
                ENDIF.
              ENDIF.
            ENDIF.
            IF l_eflag IS INITIAL.
              COMMIT WORK.
              MESSAGE s261(53).
            ELSE.
              MESSAGE s075(3i).
              PERFORM f_select_table.
            ENDIF.
          ENDIF.
        Display table again
          PERFORM f_display_table.
        ENDIF.
      ENDIF.
    ENDFORM.
          FORM f_add_system                                             *
    FORM f_add_system USING new TYPE c.
      FIELD-SYMBOLS: <irec> TYPE ANY,
                     <upd>  TYPE ANY.
      LOOP AT it_fdiff INTO is_fdiff.
        READ TABLE it_dfies INTO is_dfies
                        WITH KEY fieldname = is_fdiff-fieldname.
        LOOP AT <ntab> ASSIGNING <irec>.
          ASSIGN COMPONENT is_fdiff-fieldname OF STRUCTURE <irec> TO <upd>.
          IF is_dfies-datatype = 'CLNT'.
            <upd> = sy-mandt.
          ELSE.
            CASE is_dfies-rollname.
              WHEN 'AENAM'.
                <upd> = sy-uname.
              WHEN 'AEDAT' OR 'LAEDA'.
                <upd> = sy-datum.
              WHEN 'AETIM'.
                <upd> = sy-uzeit.
              WHEN OTHERS.
            ENDCASE.
          ENDIF.
        ENDLOOP.
      ENDLOOP.
    ENDFORM.
    this link will also help:
    http://www.sap-img.com/ab030.htm
    Edited by: AD on Dec 2, 2008 12:26 PM

  • ASSERTION_FAILED with program RGIMOVV0 during XPRA PHASE ; LEDGER SCENARIOS

    Hello guys, i'm having a problem applying support package EHP3 into an ECC system . some short part of the dump text : Runtime Errors ASSERTION_FAILED Date and Time 17.09.2009 15:05:51 -
    |Short text | | The ASSERT condition was violated. | -
    |How to correct the error | | Probably the only way to eliminate the error is to correct the program. | | - | | | | If the error occures in a non-modified SAP program, you may be able to | | find an interim solution in an SAP Note. | | If you have access to SAP Notes, carry out a search with the following | | keywords: | | | | "ASSERTION_FAILED" " " | | "RGIMOVV0" or "RGIMOVV0" | | "FILL_LEDGER_SCENARIOS" | -
    |Information on where terminated | | Termination occurred in the ABAP program "RGIMOVV0" - in | | "FILL_LEDGER_SCENARIOS". | | The main program was "RGZZGLUX ". | | | | In the source code you have the termination point in line 1724 | | of the (Include) program "RGIMOVV0". | | The program "RGIMOVV0" was started as a background job. | | Job Name....... "RDDEXECL" | | Job Initiator.. "DDIC" | | Job Number..... 15054200 | -
    |Source Code Extract | -
    |Line |SourceCde | -
    | 1694| | | 1695|ENDFORM. " create_add_mov_for_gl_ledger | | 1696| | | 1697|&---- | | 1698|& Form fill_ledger_scenarios | | 1699|&--* | | 1700|* text | | 1701|*--
    * | | 1702|FORM fill_ledger_scenarios USING iv_fieldmovement TYPE feldmodif | | 1703| iv_interface TYPE gl_interface | | 1704| is_t881 TYPE t881 | | 1705| it_ledger_scen TYPE ty_ledger_scen_tab | | 1706| it_scen_fields TYPE ty_scen_fields_tab | | 1707| it_cust_fields TYPE ty_cust_fields_tab. | | 1708| | | 1709| DATA: ls_ledger_scen TYPE fagl_ledger_scen, | | 1710| ls_scen_field TYPE fagl_scen_fields, | | 1711| ls_field_move TYPE fagl_field_move, | | 1712| ls_field_movec TYPE fagl_field_movec, | | 1713| ls_cust_field TYPE fagl_cust_fields, | | 1714| lv_lfieldname TYPE dfies-lfieldname. | | 1715| | | 1716| LOOP AT it_ledger_scen INTO ls_ledger_scen. | | 1717| LOOP AT it_scen_fields INTO ls_scen_field | | 1718| WHERE scenario = ls_ledger_scen-scenario | | 1719| AND interface = iv_interface. | | 1720| READ TABLE gt_field_move INTO ls_field_move | | 1721| WITH TABLE KEY totable = is_t881-tab | | 1722| tofield = ls_scen_field-field | | 1723| interface = iv_interface. | |>>>>>| ASSERT sy-subrc = 0. | | 1725|* co-pa interface table is generated, so first check if field really exists | | 1726| IF iv_interface = gc_copa_interface. | | 1727| MOVE ls_field_move-fromfield TO lv_lfieldname. | | 1728| CALL FUNCTION 'DDIF_NAMETAB_GET' | | 1729| EXPORTING | | 1730| tabname = ls_field_move-fromtable | | 1731| lfieldname = lv_lfieldname | | 1732| EXCEPTIONS | | 1733| OTHERS = 1. | | 1734| CHECK sy-subrc = 0. | | 1735| ENDIF. | | 1736| PERFORM append_field USING ls_ledger_scen-client iv_fieldmovement ls_scen_field-field | | 1737| ls_field_move-fromtable ls_field_move-fromfield ls_field_move-exitname. | | 1738| ENDLOOP. | | 1739| ENDLOOP. | | 1740| | | 1741| LOOP AT it_cust_fields INTO ls_cust_field. | | 1742| READ TABLE gt_field_movec INTO ls_field_movec | | 1743| WITH TABLE KEY totable = is_t881-tab | -
    did someone of you experience a problem of this kind?
    Even performing a local copy I experienced the same and running the program RGIMOVV0 from se38 leads to the same dump. Our development is in stuck .
    Regards to all

    we have deleted three entries from a table cuasing the dump. ALL the entries with to field PROJK .
    Do not know but somone maybe started a project in the ledger scenario that put those entries in the table.
    If you go in spro at the voice" assign ledger scenario" it should lead you to the same dump.
    try !

  • ASSERTION_FAILED with program RGIMOVV0 during XPRA PHASE

    Hello guys,
    i'm having a problem applying support package EHP3 into an ECC system .
    some short part of the dump text :
    Runtime Errors         ASSERTION_FAILED
    Date and Time          17.09.2009 15:05:51
    Short text
    The ASSERT condition was violated.
    How to correct the error
    Probably the only way to eliminate the error is to correct the program.
    If the error occures in a non-modified SAP program, you may be able to
    find an interim solution in an SAP Note.
    If you have access to SAP Notes, carry out a search with the following
    keywords:
    "ASSERTION_FAILED" " "
    "RGIMOVV0" or "RGIMOVV0"
    "FILL_LEDGER_SCENARIOS"
    Information on where terminated
    Termination occurred in the ABAP program "RGIMOVV0" - in
    "FILL_LEDGER_SCENARIOS".
    The main program was "RGZZGLUX ".
    In the source code you have the termination point in line 1724
    of the (Include) program "RGIMOVV0".
    The program "RGIMOVV0" was started as a background job.
    Job Name....... "RDDEXECL"
    Job Initiator.. "DDIC"
    Job Number..... 15054200
    Source Code Extract
    Line
    SourceCde
    1694
    1695
    ENDFORM.                    " create_add_mov_for_gl_ledger
    1696
    1697
    1698
    *&      Form  fill_ledger_scenarios
    1699
    1700
          text
    1701
    1702
    FORM fill_ledger_scenarios  USING  iv_fieldmovement TYPE feldmodif
    1703
    iv_interface TYPE gl_interface
    1704
    is_t881 TYPE t881
    1705
    it_ledger_scen TYPE ty_ledger_scen_tab
    1706
    it_scen_fields TYPE ty_scen_fields_tab
    1707
    it_cust_fields TYPE ty_cust_fields_tab.
    1708
    1709
    DATA: ls_ledger_scen TYPE fagl_ledger_scen,
    1710
    ls_scen_field TYPE fagl_scen_fields,
    1711
    ls_field_move TYPE fagl_field_move,
    1712
    ls_field_movec TYPE fagl_field_movec,
    1713
    ls_cust_field TYPE fagl_cust_fields,
    1714
    lv_lfieldname TYPE dfies-lfieldname.
    1715
    1716
    LOOP AT it_ledger_scen INTO ls_ledger_scen.
    1717
    LOOP AT it_scen_fields INTO ls_scen_field
    1718
    WHERE scenario = ls_ledger_scen-scenario
    1719
    AND interface = iv_interface.
    1720
    READ TABLE gt_field_move INTO ls_field_move
    1721
    WITH TABLE KEY totable = is_t881-tab
    1722
    tofield = ls_scen_field-field
    1723
    interface = iv_interface.
    >>>>>
    ASSERT sy-subrc = 0.
    1725
        co-pa interface table is generated, so first check if field really exists
    1726
    IF iv_interface = gc_copa_interface.
    1727
    MOVE ls_field_move-fromfield TO lv_lfieldname.
    1728
    CALL FUNCTION 'DDIF_NAMETAB_GET'
    1729
    EXPORTING
    1730
    tabname    = ls_field_move-fromtable
    1731
    lfieldname = lv_lfieldname
    1732
    EXCEPTIONS
    1733
    OTHERS     = 1.
    1734
    CHECK sy-subrc = 0.
    1735
    ENDIF.
    1736
    PERFORM append_field USING ls_ledger_scen-client iv_fieldmovement ls_scen_field-field
    1737
    ls_field_move-fromtable ls_field_move-fromfield ls_field_move-exitname.
    1738
    ENDLOOP.
    1739
    ENDLOOP.
    1740
    1741
    LOOP AT it_cust_fields INTO ls_cust_field.
    1742
    READ TABLE gt_field_movec INTO ls_field_movec
    1743
    WITH TABLE KEY totable = is_t881-tab
    did someone of you experience a problem of this kind?
    Even performing a local copy I experienced the same  and running the program RGIMOVV0 from se38 leads to the same dump. Our development is in stuck .
    Regards to all

    Dear sirs -
    Were you able to solve your problem?  We are trying to execute a client copy and cannot finish post processing steps.
    We have a note into SAP as well.
    Brenda

  • Master Data is in Revised Version while transporting a request to add an attribute in existing master data infoobject

    Hi Experts,
    I am facing short dump when trying to send a request to add an attribute in Master Data Infoobject from DEV to QA.
    Although the attribute is getting added to main Master data Info object but main master Info object is in Revised Version.
    I have been searching the solution in SCN from couple of days and tried every single solution but none of them works for us.
    When I check in se09 I am getting the following message
    Program terminated (job: RDDEXECL, no.: 09445401)
       Execution of programs after import (XPRA)
    End date and time : 20150420094559
    Ended with return code: ===> 12 <===
    When checking in ST22 IN QA I am getting the following message
    The exception 'CX_RS_PROGRAM_ERROR' was raised, but it was not caught anywhere
      along
    the call hierarchy.
    Since exceptions represent error situations and this error was not
    adequately responded to, the running ABAP program
    'CL_RSDD_DS====================CP' has to be
    terminated.
    When I checked in ST22 in QA I am getting following dump
       31         RAISE EXCEPTION TYPE cx_rs_program_error
       32           EXPORTING
       33             text = 'Invalid DSO subtype'.                   "#EC NOTEXT
       34     ENDCASE.
       35
       36 *   get table name from DDIC
       37     CALL METHOD cl_rsd_odso=>get_tablnm
       38       EXPORTING
       39         i_odsobject = n_infoprov
       40         i_tabt      = l_tab
       41       IMPORTING
       42         e_tablnm    = l_tablnm
       43       EXCEPTIONS
       44         OTHERS      = 1.
       45
       46     IF sy-subrc <> 0.
       47       RAISE EXCEPTION TYPE cx_rs_program_error
       48         EXPORTING
       49           text = 'Error in CL_RSD_ODSO=>get_Tablnm'. "#EC NOTEXT
       50     ENDIF.
       51
       52     CALL FUNCTION 'DDIF_NAMETAB_GET'
       53       EXPORTING
       54         tabname   = l_tablnm
       55       TABLES
       56         dfies_tab = l_t_comp
       57       EXCEPTIONS
       58         not_found = 1
       59         OTHERS    = 2.
       60     IF sy-subrc <> 0.
    >>>>> RAISE EXCEPTION TYPE cx_rs_program_error
       62         EXPORTING
       63           text = 'Error in DDIF_NAMETAB_GET'.        "#EC NOTEXT
       64     ENDIF.
    I have attached the short dump
    Thanks In Advance
    Rashid

    Hi Tom
    Thanks for your reply.
    I am not sure what do you mean by Manually activated in Dev or QA . If you mean Dev then i did and also maintain the infoobject related tables using transaction SE14 but still same error.
    But if you mean in QA then QA is lock for manual activation but i tried though program RSDG_IOBJ_ACTIVATE but again failed. I also maintain the infoobject related tables using transaction SE14 but still same error.
    Regards
    Rashid

  • Upload and display Word Document in WD application

    Hello,
    I have a WD ABAP appl. where the user wants to upload an Word / Excel file (from its own local drive).
    The document shall be saved in SAP and it shall also be possible to display the document later in the WD application.
    I implemented the UI element upload in the view, to determine the path of the document.
    For the display implemented the UI element Office control.
    1. When i browse the document, the properties data, filename and mime type are filled into the bound context elements of the upload UI.
    2. The property datasource of the UI office control I bound to the same context element, that is also bound to the property data of the upload UI.
    The office control opens a word document, but the document is empty.
    Is it possible that the document is not uploaded correct?
    In another application I did an upload for a PDF doc.. There I implemented the following coding as action of the button 'Upload'.
    data lo_nd_pdf type ref to if_wd_context_node.
    data lo_el_pdf type ref to if_wd_context_element.
    data ls_pdf type wd_this->element_pdf.
    data lv_pdf like ls_pdf-pdf.
    navigate from <CONTEXT> to <PDF> via lead selection
    lo_nd_pdf = wd_context->get_child_node( name = wd_this->wdctx_pdf ).
    get element via lead selection
    lo_el_pdf = lo_nd_pdf->get_element( ).
    get single attribute
    lo_el_pdf->get_attribute(
    exporting
    name = `PDF`
    importing
    value = lv_pdf ).
    Get a reference to the from processing class.
    data: l_fp type ref to if_fp.
    l_fp = cl_fp=>get_reference( ).
    Get a reference to the PDF Object class.
    data: l_pdfobj type ref to if_fp_pdf_object.
    l_pdfobj = l_fp->create_pdf_object( ).
    set the pdf in the PDF Object
    l_pdfobj->set_document( pdfdata = lv_pdf ).
    set the PDF Object to extract data the Form data.
    l_pdfobj->set_extractdata( ).
    execute call to ADS
    l_pdfobj->execute( ).
    get the PDF Form data
    data: pdf_form_data type xstring.
    l_pdfobj->get_data(
    importing
    formdata = pdf_form_data ).
    convert the xstring from data to string so it can be processed using the iXML classes
    data: converter type ref to cl_abap_conv_in_ce,
    formxml type string.
    converter = cl_abap_conv_in_ce=>create( input = pdf_form_data ).
    converter->read(
    importing
    data = formxml ).
    pull in the iXML type group.
    type-pools: ixml.
    get a reference to iXML object
    data:l_ixml type ref to if_ixml.
    l_ixml = cl_ixml=>create( ).
    get iStream object from StreamFactory
    data: streamfactory type ref to if_ixml_stream_factory,
    istream type ref to if_ixml_istream.
    streamfactory = l_ixml->create_stream_factory( ).
    istream = streamfactory->create_istream_string( formxml ).
    create an XML document class that will be used to process the XML
    data: document type ref to if_ixml_document.
    document = l_ixml->create_document( ).
    create the parser class
    data: parser type ref to if_ixml_parser.
    parser = l_ixml->create_parser( stream_factory = streamfactory
    istream = istream
    document = document ).
    parse the XML
    parser->parse( ).
    define XML Node type object
    data: node type ref to if_ixml_node,
    attributes type ref to if_ixml_named_node_map.
    get the psi sales data Node and value.
    data ls_psi_sales type wd_this->element_psi_sales.
    data: lt_dfies type table of dfies,
    ls_defies type dfies.
    call function 'DDIF_NAMETAB_GET'
    exporting
    tabname = 'ZCM_PSI_SALES'
    ALL_TYPES = ' '
    LFIELDNAME = ' '
    GROUP_NAMES = ' '
    UCLEN =
    IMPORTING
    X030L_WA =
    DTELINFO_WA =
    TTYPINFO_WA =
    DDOBJTYPE =
    DFIES_WA =
    LINES_DESCR =
    tables
    X031L_TAB =
    dfies_tab = lt_dfies
    exceptions
    not_found = 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.
    data: lv_fieldname type string.
    field-symbols <fs_field> type any.
    loop at lt_dfies into ls_defies.
    lv_fieldname = ls_defies-fieldname.
    node = document->find_from_name( name = lv_fieldname ).
    assign component lv_fieldname
    of structure ls_psi_sales
    to <fs_field>.
    if <fs_field> is assigned.
    <fs_field> = node->get_value( ).
    endif.
    endloop.
    WRITE DATA INTO CONTEXT
    data lo_nd_psi_sales type ref to if_wd_context_node.
    data lo_el_psi_sales type ref to if_wd_context_element.
    navigate from <CONTEXT> to <PSI_SALES> via lead selection
    lo_nd_psi_sales = wd_context->get_child_node( name = wd_this->wdctx_psi_sales ).
    get element via lead selection
    lo_el_psi_sales = lo_nd_psi_sales->get_element( ).
    set all declared attributes
    lo_el_psi_sales->set_static_attributes(
    exporting
    static_attributes = ls_psi_sales ).
    Do I need such a code also to upload a word doc?
    Which interface / class exists for word documents? (for PDF upload there is the interface IF_FP)
    How can I save a document in SAP? (as MIME Object?  with which method?)
    I hope someone can help me!?
    BR

    You can use the fileupload and filedownload uielements.
    Check these links:
    [File Upload|http://help.sap.com/saphelp_nw70ehp1/helpdata/en/b3/be7941601b1d09e10000000a155106/content.htm]
    [File Download|http://help.sap.com/saphelp_nw70ehp1/helpdata/en/09/a5884121a41c09e10000000a155106/content.htm]
    When you upload a file and save in SAP, are you saving it as xstring.
    If yes follow these steps for filedownload.
    Follow these steps for file download:
    1 Create FileDownload uielement in your View
    2.Create an Attribute of type xstring.
    3.Bind this attribute to the data property of your Filedownload uielement.
    4. during fileuplaod as you are saving the document in xstring format, fetch the same from your database table and pass the value to filedownload i.e set the attribute bound to data property of filedownload uielement with the xstring content.

  • Run time column names as parameters

    Hi SDN,
    I am trying to use a FORM/ENDFORM which can work for many internal tables in my project except that a couple of field (table columns) names differ. In other words, just for two assignment statements I may have to repeat rest of the code, unless there is a way to 'reference' these fields.
    Is there a way to pass the field names as a parameter to the FORM? Can someone give me an example if that is possible. I looked at the FIELD SYMBOL but don't know how to use it in a FORM.
    Thanks for the help.
    Saf.

    FM DDIF_NAMETAB_GET retruns a table of field names.
    Sample code follows (hope it helps!)
    call function 'DDIF_NAMETAB_GET'
      exporting
        tabname           = 'Z213'
      tables
        dfies_tab         = lta_dfies
      exceptions
        not_found         = 1
        others            = 2.
    if  sy-subrc         <> 0.
                            message e007 with 'syserr bld bkpf fields.'.
    endif."subrc
    loop at lta_dfies assigning <i>.
            append <i>-fieldname to lta_bkpf_fl.
    endloop."dfies
    select (lta_bkpf_fl)
    from   bkpf
    into   table lth_vbkpf
    where
           bukrs  = p_bukrs
      and  bstat  = space               " normal documant
      and  blart  = 'WE'
      and  gjahr  = p_gjahr
      and  monat in so_monat
      and  budat in so_budat
      and  waers in so_waers
    order  by       belnr.
    if     sy-subrc <> 0.
                       message i008 with 'No BKPF data found for selection'.
                       stop.
    endif."subrc.
    Best,
    Jim

  • Field Symbol Problem

    Hi All,
    I want to select the data of a standard table directly into an internal table but I am not able to get that.
    Note : I am working 4.6C version of SAP
    Please see the below code :
    REPORT zdwnld_tabl_data .
    PARAMETERS : p_tabl1 TYPE dd02v-tabname.
    DATA : ddobtype TYPE dd02v-tabclass.
    DATA : ref TYPE REF TO data.
    FIELD-SYMBOLS : <data_tab> TYPE ANY.
    CALL FUNCTION 'DDIF_NAMETAB_GET'
         EXPORTING
              tabname   = p_tabl1
              all_types = ' '
         IMPORTING
              ddobjtype = ddobtype
         EXCEPTIONS
              OTHERS    = 2.
    IF sy-subrc <> 0 OR ddobtype = 'INTTAB'.
      RAISE tabl_not_found.
    ENDIF.
    CREATE DATA ref type (p_tabl1).
    ASSIGN ref->* TO <data_tab>.
    SELECT * FROM (p_tabl1) INTO <data_tab>.
    ENDSELECT.
    Here if I dont want SELECT....ENDSELECT but want the data directly into an internal table. When I change the select statement as follows :
    SELECT * FROM (p_tabl1) INTO table <data_tab>.
    it throws error saying <data_tab> is not an internal table. I understand the error.
    To resolve this error when I change the FIELD SYMBOL declaration as
    FIELD-SYMBOLS : <data_tab> TYPE TABLE. OR FIELD-SYMBOLS : <data_tab> TYPE ANY TABLE. , the program dumps on ASSIGN ref->  statement saying error as Type conflict with ASSIGN in program.
    Any idea how this can be resolved.
    Regards
    Abhii

    Hi Koen De Ruyck,
    Your answer was very very helpful. I have come to a conclusion that, in 4.6 C we can get the data into an internal dynamic table only by using the method create_dynamic_table of class cl_alv_table_create.
    All the above methods suggested didnt work.
    REPORT zdwnld_tabl_data .
    PARAMETERS : p_tabl1 TYPE dd02v-tabname.
    DATA: dy_table TYPE REF TO data,
          dy_line  TYPE REF TO data.
    DATA : it_fcat TYPE lvc_t_fcat.
    FIELD-SYMBOLS : <data_tab> TYPE STANDARD TABLE,
                    <dyn_wa>.
    CALL FUNCTION 'LVC_FIELDCATALOG_MERGE'
    EXPORTING
    *       I_BUFFER_ACTIVE              =
       i_structure_name             = p_tabl1
    *       I_CLIENT_NEVER_DISPLAY       = 'X'
    *       I_BYPASSING_BUFFER           =
      CHANGING
        ct_fieldcat                  = it_fcat
    *     EXCEPTIONS
    *       INCONSISTENT_INTERFACE       = 1
    *       PROGRAM_ERROR                = 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.
    CALL METHOD cl_alv_table_create=>create_dynamic_table
      EXPORTING
    *        I_STYLE_TABLE             =
        it_fieldcatalog           = it_fcat
      IMPORTING
        ep_table                  = dy_table
    *        E_STYLE_FNAME             =
    *      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.
    ASSIGN dy_table->* TO <data_tab>.
    SELECT * FROM (p_tabl1) INTO TABLE <data_tab>.
    However I have tested this with some tables, its working fine but its giving dump for MARA table, the dump says output table is too small , any idea on how we can overcome this error.
    Regards
    Abhii

  • Replacement for obsolete 'FM NAMETAB_GET'

    Hi,
       We have been upgrading SAP from 4.6B to ECC6.0...During this process we have encountered an obsolete 'FM NAMETAB_GET', but as no documentation is available for the same, we are looking for an alternative / replacement for the 'FM NAMETAB_GET'...All suggestions are welcome...
    Thanks in advance

    Hi Nishant,
    here is the sample code for the function module NAMETAB_GET
    data:    begin of nametab occurs 60.
          include structure dntab.
    data:    end of nametab.
    call function 'NAMETAB_GET'
       exporting
         langu          = sy-langu
        tabname        = table
      tables
         nametab        = nametab
       exceptions
        no_texts_found = 1.
    REPLACEMENT
    data:    begin of nametab occurs 60.
            include structure DFIES.
    data:    end of nametab.
    CALL FUNCTION 'DDIF_NAMETAB_GET'
      EXPORTING
        TABNAME           = table
    TABLES
       DFIES_TAB         = nametab
    EXCEPTIONS
       NOT_FOUND         = 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.
    rewards if useful......

  • Fetch data from Table

    Hi all,
    I am using function module through Call fucntion.
    There i am getting <b>Table Name</b> as import Parameter.
    Now i need to fetch data from that table (Which name we got througfh function module).
    Is there any point to know how can we fetch data from runtime table .
    i need some sample code for this.
    Thanks inn advance,
    Regards,
    Bhaskar

    Hello Bhaskar,
    I don't have an SCM system, so I cannot test out that FM
    However, I modified the above code to update the table as well
    *& Report  ZKRIS_DYNAMIC_TABLE_READ_MOD
    REPORT  ZKRIS_DYNAMIC_TABLE_READ_MOD LINE-SIZE 256.
    DATA : LV_FIELD_DESC TYPE STRING.
    DATA : LV_DATA1 TYPE STRING.
    DATA : LV_DETAIL(128).
    DATA : COMMA TYPE C VALUE ','.
    DATA : LV_TNAME LIKE DD02L-TABNAME.
    DATA : LV_DBTAB1 LIKE DD02L-TABNAME.
    DATA : DREF TYPE REF TO DATA.
    DATA : FLAG_MODIFIED.  " determines if database needs to be updated
    FIELD-SYMBOLS: <ITAB> TYPE ANY TABLE, " used to store dynamic tables
                   <WA>    TYPE ANY,      " used to store record data
                    <WA1> TYPE ANY .      " used to store field data
    * call Fm /SAPAPO/TS_PA_COPY_TABLE_GET here
    LV_DBTAB1 = 'ZGSTSET'. " <-- put your table name here
    DATA: IT_FIELDS TYPE X031L OCCURS 0.
    DATA: WA_FIELDS LIKE LINE OF IT_FIELDS.
    CALL FUNCTION 'DDIF_NAMETAB_GET'
      EXPORTING
        tabname           = LV_DBTAB1
    *   ALL_TYPES         = ' '
    *   LFIELDNAME        = ' '
    *   GROUP_NAMES       = ' '
    *   UCLEN             =
    * IMPORTING
    *   X030L_WA          =
    *   DTELINFO_WA       =
    *   TTYPINFO_WA       =
    *   DDOBJTYPE         =
    *   DFIES_WA          =
    *   LINES_DESCR       =
    TABLES
       X031L_TAB         = IT_FIELDS
    *   DFIES_TAB         =
    EXCEPTIONS
       NOT_FOUND         = 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.
    * we do not know the sized of the table that must be generated beforehand
    * hence we use field symbols to dynamically generate the internal table
      CREATE DATA DREF TYPE STANDARD TABLE OF (LV_DBTAB1)
                                WITH NON-UNIQUE DEFAULT KEY.
      ASSIGN DREF->* TO <ITAB> .
    * selects all data
      SELECT * FROM (LV_DBTAB1) INTO TABLE <ITAB> .
      LOOP AT <ITAB> ASSIGNING <WA>.
        FLAG_MODIFIED = ''.
        LOOP AT IT_FIELDS INTO WA_FIELDS.
          ASSIGN COMPONENT WA_FIELDS-FIELDNAME OF STRUCTURE <WA>
            TO <WA1>.
          IF WA_FIELDS-FIELDNAME = 'FIRSTNAME'. " fieldname in the table you wish to modify
            IF <WA1> = 'Kris'. " old value
              <WA1> = 'NewName'. " new value
              MODIFY TABLE <ITAB> FROM <WA>.
              FLAG_MODIFIED = 'X'.
            ENDIF.
          ENDIF.
          WRITE <WA1>. " comment this line to remove the display
        ENDLOOP.
        IF FLAG_MODIFIED = 'X'. " updates database only if the record was changed
          UPDATE (LV_DBTAB1) FROM <WA>.
    *     note that if the field you choose is a key field, sy-subrc will be set to 4
        ENDIF.
    *   display
        NEW-LINE.
      ENDLOOP.

  • CATS Approval in MSS  - same error, other issue?

    We have upgraded our portal and HR environment to the latest sp and enhancement packs.
    In the testing we get a blocking dump in the time approval in MSS.
    error: Exception condition "NOT_FOUND" raised., error key: RFC_ERROR_SYSTEM_FAILURE
    debug with st22 gives function module DDIF_NAMETAB_GET
    Yes, a lot of topics are handling about this error:
    CATS Approval in MSS
    CATS Approval in MSS
    CATS Approval in MSS
    I've checked the table TPT_FIELD_SEL_C between development and our testing environment and they are the same.
    The only special thing is that we don't use the standard SAP_LINE approval view (see IMG), but our own custom one. The SLIN is not configured ok, but our own "ZLIN" fields are configured ok (into table TPT_FIELD_SEL_C).
    Has anybody an idea?
    Debug info ST22
         DATA DFIES_wa TYPE DFIES.
         IF ALL_TYPES IS INITIAL AND lfieldname IS INITIAL.
            lfieldname = fieldname.
         ENDIF.
         CALL FUNCTION 'DDIF_NAMETAB_GET'
              EXPORTING
                   TABNAME     = tabname
                   ALL_TYPES   = all_types
                   LFIELDNAME  = lfieldname
                   GROUP_NAMES = group_names
                   uclen       = uclen
              IMPORTING
                   X030L_WA    = X030L_wa
                   DTELINFO_WA = dtelinfo_wa
                   TTYPINFO_WA = ttypinfo_wa
                   DDOBJTYPE   = ddobjtype
                   DFIES_WA    = DFIES_wa
              TABLES
                   DFIES_TAB   = DFIES_tab
              EXCEPTIONS
                   OTHERS      = 2.
         IF SY-SUBRC <> 0.
    >        RAISE NOT_FOUND.
         ENDIF.
         IF NOT lfieldname IS INITIAL.
            APPEND DFIES_wa TO DFIES_tab.
         ENDIF.
    ENDFORM.                    " Get_nametab_info

    I think we have got similar issue and raised an OSS message and the reply we got
    This happens due to the missing customisation in Mss.
    ie Configuration for screen areas CTS and CTD is missing. View
    V_PT_FIELD_SEL is meant to hold the relevant information.
    Please have a look at the client 000 for the default customisation.
    So, What you need to do is write table TPT_FIELD_SEL_C on a transport
    and transport it to client . You will then have all the setting
    you need for the application to work.
    Also,
    The solution is to write down all the
    technical field-names from view groups CTS and CTD in table TPT_FIELD_S
    EL_C, then use the config area to select the fields properly. This overwrites the TPT_FIELD_SEL_C table entries with ones that have the "tabname" populated! The application will now work as expected.
    Please try producing a new transport of the entire table TPT_FIELD_SEL_Cas R3TR TABU with appropriate key and transport to yor system, you
    should choose to overwrite the destination table. Please let us know
    the result after.
    Please check the customisation for MSS approval.
    SAP_LINE: Model approval view for line managers. It groups recorded data according to the employees assigned to the line manager.
    For example the above view has been defined? or you can adapt to your
    needs.
    Can you try to import the transport again but make sure that "overwrite
    orginals" in the OPTIONS tab is selected?
    Transactrion SE01
    Select create a the workbench request.
    then doble click into the request
    and push the button Display/Change
    Enter here the entry "R3TR TABU TPT_FIELD_SEL_C"
    Push enter
    Then one icon with a Key appear
    Push the key and enter * for all the table entries or select the
    each one that you need.
    If the changes are correctly available then it will work correctly
    Please ensure that the transport is done correctly
    Thanks
    Bala Duvvuri

  • Dynamically table read / write with field symbols

    Hi,
    I like to read dynamically from a table via field symbols. The reading part is working.
    But now I like to do some changes on the entry and then write it to another table with a similar structure.
    I use SAP 4.6c
    There I have two problems:
    1. At the statement I get a dump:
    <l_sysid> = sy-sysid.
    --> Field symbol has not yet been assigned.
    I think that the problem is somewhere around
    assign <table_to> to <wa_to>.
    2. the data change inside the loop. There I like to add the sysid to the target-wa and then copy the source-wa it to the new target-wa to append it to the target table.
    But this does not work. What kind of code do I need? The "move-correspondig" is not correct.
    --> see code around
    loop at <table_from> assigning <wa_from>.
    Below you can find my code. The problem is within the last loop-statement.
    FUNCTION Z_MIG_COPY_TABLE.
    *"*"Lokale Schnittstelle:
    *"  IMPORTING
    *"     REFERENCE(I_TABNAME_FROM) TYPE  TABNAME
    *"     REFERENCE(I_TABNAME_TO) TYPE  TABNAME
    *"     REFERENCE(I_KOMP_TRANS) LIKE  ZS_KOMP_TRANS STRUCTURE
    *"        ZS_KOMP_TRANS OPTIONAL
    *"  TABLES
    *"      I_SELCON STRUCTURE  ZS_SELCON
    *"  EXCEPTIONS
    *"      NOT_FOUND
    *"      OTHERS
    * zeilenweiser Aufbau Tabelle I_SELCON z.B.:
    * bukrs = 3011
    * AND
    * bstyp = 'F'
    * I_KOMP_TRANS
    * dient zur Uebersetzung von alt/neu, z.B. bei LIFNR
    * der angegebene Funktionsbaustein wird genutzt,
    * um den neuen Wert der übergebenen Komponente zu ermitteln
    * Angabe z.B.:
    * LIFNR
      DATA: dref       TYPE REF TO data,
            dref_to    TYPE REF TO data,
            i_alv_cat  TYPE TABLE OF lvc_s_fcat,
            ls_alv_cat LIKE LINE OF i_alv_cat,
            i_alv_cat_to  TYPE TABLE OF lvc_s_fcat,
            ls_alv_cat_to LIKE LINE OF i_alv_cat.
      DATA: BEGIN OF itab OCCURS 0.
    *        INCLUDE STRUCTURE dntab.
              INCLUDE structure DFIES.
      DATA: END OF itab.
      DATA: BEGIN OF itab_to OCCURS 0.
    *        INCLUDE STRUCTURE dntab.
              INCLUDE structure DFIES.
      DATA: END OF itab_to.
      FIELD-SYMBOLS: <table_from>   TYPE ANY TABLE.
      FIELD-SYMBOLS: <table_to>     TYPE Standard TABLE.
      FIELD-SYMBOLS: <wa_from>      TYPE ANY.
      FIELD-SYMBOLS: <wa_to>        TYPE ANY.
      FIELD-SYMBOLS: <l_komp>       TYPE ANY.
      FIELD-SYMBOLS: <l_sysid>      TYPE ANY.
      Data: l_alt type ELIFN.
      Data: l_neu type ELIFN.
      CALL FUNCTION 'DDIF_NAMETAB_GET'
           EXPORTING
                TABNAME   = i_tabname_from
           TABLES
                DFIES_TAB = itab
           EXCEPTIONS
                NOT_FOUND = 1
                OTHERS    = 2.
      IF SY-SUBRC = 1.
        raise not_found.
      elseif sy-subrc = 2.
        raise others.
      ENDIF.
      LOOP AT itab .
        ls_alv_cat-fieldname = itab-fieldname.
        ls_alv_cat-ref_table = i_tabname_from.
        ls_alv_cat-ref_field = itab-fieldname.
        APPEND ls_alv_cat TO i_alv_cat.
      ENDLOOP.
    * build internal table
      CALL METHOD cl_alv_table_create=>create_dynamic_table
          EXPORTING
            it_fieldcatalog = i_alv_cat
          IMPORTING
            ep_table = dref.
      ASSIGN dref->* TO <table_from>.
      CALL FUNCTION 'DDIF_NAMETAB_GET'
           EXPORTING
                TABNAME   = i_tabname_to
           TABLES
                DFIES_TAB = itab_to
           EXCEPTIONS
                NOT_FOUND = 1
                OTHERS    = 2.
      IF SY-SUBRC = 1.
        raise not_found.
      elseif sy-subrc = 2.
        raise others.
      ENDIF.
      LOOP AT itab_to.
        ls_alv_cat_to-fieldname = itab_to-fieldname.
        ls_alv_cat_to-ref_table = i_tabname_to.
        ls_alv_cat_to-ref_field = itab_to-fieldname.
        APPEND ls_alv_cat_to TO i_alv_cat_to.
      ENDLOOP.
    *  break-point.
    * build internal table
      CALL METHOD cl_alv_table_create=>create_dynamic_table
          EXPORTING
            it_fieldcatalog = i_alv_cat_to
          IMPORTING
            ep_table = dref_to.
      ASSIGN dref_to->* TO <table_to>.
    *Select Ursprungstabelle mit Selektionsbedingungen
      SELECT * FROM (i_tabname_from) up to 5 rows
        INTO CORRESPONDING FIELDS OF TABLE <table_from>
        where (i_selcon).
    *  break-point.
    *Aufbau interne Tabelle mit eventuell geänderten Feldern
      assign <table_to> to <wa_to>.
      if not I_KOMP_TRANS is initial.
        loop at <table_from> assigning <wa_from>.
          assign component I_KOMP_TRANS-KOMP
            of structure <wa_from> to <l_komp>.
          CALL FUNCTION I_KOMP_TRANS-FUBA
               EXPORTING
                    I_KOMP = I_KOMP_TRANS-KOMP
                    I_ALT  = <l_komp>
               IMPORTING
                    E_NEU  = <l_komp>.
          break-point.
          assign component 'SYSID' of structure <wa_to> to <l_sysid>.
          <l_sysid> = sy-sysid.
    *      move-corresponding <wa_from> to <wa_to>.
          append <wa_to> to <table_to>.
        endloop.
    *    break-point.
    *Speichern der ausgelesenen Daten in Zieltabelle
        MODIFY (i_tabname_to) FROM TABLE <table_to>.
        if sy-subrc <> 0.
          MESSAGE E001(ZMESSAGES) WITH i_tabname_to.
    *   Fehler beim Modify von Tabelle '&'.
        endif.
      else.
    *Speichern der ausgelesenen Daten in Zieltabelle
        MODIFY (i_tabname_to) FROM TABLE <table_from>.
        if sy-subrc <> 0.
          MESSAGE E001(ZMESSAGES) WITH i_tabname_to.
    *   Fehler beim Modify von Tabelle '&'.
        endif.
      endif.
      commit work.
      if sy-subrc <> 0.
        MESSAGE E002(ZMESSAGES) WITH i_tabname_to.
    *   Fehler beim Commit von Tabelle '&'.
      endif.
    *  break-point.
    ENDFUNCTION.
    Thanks a lot for any hints.
    Regards
    Tom

    Hi,
    Answers below.
    1) For this...you assigning an internal table to a work area...
    assign <table_to> to <wa_to>.
    This should solve the problem..
    * Create the target work area..
    DATA: new_line  TYPE REF TO data.
    CREATE DATA new_line LIKE LINE OF <table_to>.
    ASSIGN new_line->* TO <wa_to>.
    Now the target work area is created..
    2) For the second one...
    ************New code
       FIELD-SYMBOLS: <FS>,<FS1>.
    ************New code End.
       loop at <table_from> assigning <wa_from>.
          assign component I_KOMP_TRANS-KOMP
            of structure <wa_from> to <l_komp>.
          CALL FUNCTION I_KOMP_TRANS-FUBA
               EXPORTING
                    I_KOMP = I_KOMP_TRANS-KOMP
                    I_ALT  = <l_komp>
               IMPORTING
                    E_NEU  = <l_komp>.
          break-point.
          assign component 'SYSID' of structure <wa_to> to <l_sysid>.
          <l_sysid> = sy-sysid.
    ************New code
          LOOP AT itab .
             ASSIGN COMPONENT itab-fieldname of structure <WA_FROM> TO <FS>.
             CHECK SY-SUBRC = 0.
             ASSIGN COMPONENT itab-fieldname of structure <WA_TO> TO <FS1>.
             CHECK SY-SUBRC = 0.
    * Move from source to target.
             <FS1> = <FS>.
          ENDLOOP.
    ************New code End
          append <wa_to> to <table_to>.
        endloop.
    Thanks
    Naren

Maybe you are looking for

  • Product Recovery shuts down unexpectedly on Satellite 1900-303

    I have the correct Product Recovery disk and have got the recovery screen by holding down "C". I press 1 and the 1 again to do a full wipe clean. The progress indicator bar then show progress until about the 25% level (takes around 5 mins) then machi

  • Win 7 "Default Programs" does not include MS Office 2007 Programs, the missing Programs are missing ICONs as well

    I installed Windows 7 in an upgrade from Windows XP.  As part of the process MS gave me a URL to download a Office 2007 Pro I could activate with the license key I owned.  I got similar URLs for Visio Professional and Project Professional.  Downloade

  • Problem with sdk

    I have installed the newewst version of java and I can't compile anything Ihave this message Note: Okno.java uses or overrides a deprecated API. Note: Recompile with -Xlint:deprecation for details. how can I fix this ??

  • The name of Artist can't be find? Need advice!

    Hi everyone! I have Ipod Classic 80GB and I do experience problem to find the name of few artists after transferring them on the Ipod. They appear on Device/Ipod/music/artist on my iTunes but I can't find the artist by Search on the Ipod. If I search

  • Re: scripts

    Hi,     I facing one problem regarding scripts. I have used one main window, in that i have to populate notification number and date.  Then by using that notification number i have to read the concerned long text  and i have to populate that in this