Problem in filling field catalog as table is dynamic

Hi All,
    I have to populate the data using the below function module and i am passing dynamic internal table <f_list> in place of list.
   i have to populate the field catalog fc_hier which is getting field by standard program but i have to add additional fields which are coming from dynamic internal table .
fc_hier-fieldname   = l_fld_name.
  fc_hier-tabname     = <f_list>.
  fc_hier-seltext_s  = wa_char-name_char.
append fc_hier  .                                                    >>>> but it is not allowing  this fc_hier-tabname     = <f_list> statement..*
  CALL FUNCTION 'REUSE_ALV_HIERSEQ_LIST_DISPLAY'
    EXPORTING
      i_interface_check        = g_interface_check          "n777869
      i_callback_program       = alv_repid
      i_callback_pf_status_set = 'SET_STATUS'
      i_callback_user_command  = 'USER_COMMAND'
      is_layout                = alv_layout
      is_print                 = alv_pri
      it_fieldcat              = fc_hier[]
      i_default                = 'X'
      i_save                   = 'A'
      is_variant               = alv_variant
      it_events                = gt_events[]                "n777869
      i_tabname_header         = 'HEADER'
      i_tabname_item           = 'LIST'
      is_keyinfo               = alv_keyinfo
    TABLES
      t_outtab_header          = header[]
      t_outtab_item            = <f_list>
     t_outtab_item            = list[]
    EXCEPTIONS
      program_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.
How can i assign  table name to fc_hier-tabname    as it is not taking <f_list> as input.
Thanks in advance......
Ankur

>
ankur garg wrote:
>  fc_hier-fieldname   = l_fld_name.
>   fc_hier-tabname     = <f_list>.
>   fc_hier-seltext_s  = wa_char-name_char.
> append fc_hier  .                                                    >>>> but it is not allowing  this fc_hier-tabname     = <f_list> statement..*
>
> How can i assign  table name to fc_hier-tabname    as it is not taking <f_list> as input.
TABNAME is the name of the table & not the body of the table (TYPE slis_tabname CHAR30). You have to pass the name of the table & not the table contents !!
Something like this :
fc_hier-fieldname = l_fld_name.
fc_hier-tabname = '<F_LIST>'.
fc_hier-seltext_s = wa_char-name_char.
append fc_hier.
Anyways personally if i have dynamic tables to be used in ALV i prefer SALV which doesn't need a fieldcat
BR,
Suhas

Similar Messages

  • Field catalog & internal table are not mutually convertible

    Hi friends,
              please help me for this problem, actually i m trying to display three alv reports from the three buttond i have given on my first basic report. its working fine till first & getting the data into the internal table for the second also. but when coming to the field catalog for the second report its giving syntax error as my "field catalog and internal table are not mutually convertible'".i have tried by giving different fieldcatalog also but its giving the same problem.please help for this & try to give an example if u can. Thanks a lot.
    Regards
    Pankaj

    This is my code :
    TABLES: PLAF,
            MARA,
            MAKT,
            AFPO,
            T023T,
            VSAUFK,
            T006A,
            MBEW,
            ZCDR_D.
    Type Pools for ALV *************************
    TYPE-POOLS: SLIS,
                ABAP.
               KKBLO.
    DATA DECLARATION.  ****************************
    DATA: FLAG TYPE I,
          FLAG1 TYPE I,
          FLAG2 TYPE I,
          FLAG3 TYPE I,
          FLAG4 TYPE I,
          FLAG5 TYPE I.
    ********Declaration for field catalog
    DATA: LAYOUT TYPE SLIS_LAYOUT_ALV,
          IT_FIELDCAT TYPE SLIS_T_FIELDCAT_ALV,
        IT_SORT TYPE SLIS_T_SORTINFO_ALV,
        WA_SORT TYPE SLIS_SORTINFO_ALV,
        WA_SUBT LIKE SLIS_EV_SUBTOTAL_TEXT,
        IT_EVENTS TYPE TABLE OF slis_alv_event WITH NON-UNIQUE DEFAULT KEY
         WITH HEADER LINE INITIAL SIZE 0,
          WA_FIELDCAT TYPE SLIS_FIELDCAT_ALV,
          LAYOUT1 TYPE SLIS_LAYOUT_ALV,
          IT_FIELDCAT1 TYPE SLIS_T_FIELDCAT_ALV,
        IT_SORT TYPE SLIS_T_SORTINFO_ALV,
        WA_SORT TYPE SLIS_SORTINFO_ALV,
        WA_SUBT LIKE SLIS_EV_SUBTOTAL_TEXT,
        IT_EVENTS TYPE TABLE OF slis_alv_event WITH NON-UNIQUE DEFAULT KEY
         WITH HEADER LINE INITIAL SIZE 0,
          WA_FIELDCAT1 TYPE SLIS_FIELDCAT_ALV,
          LAYOUT2 TYPE SLIS_LAYOUT_ALV,
          IT_FIELDCAT2 TYPE SLIS_T_FIELDCAT_ALV,
        IT_SORT TYPE SLIS_T_SORTINFO_ALV,
        WA_SORT TYPE SLIS_SORTINFO_ALV,
        WA_SUBT LIKE SLIS_EV_SUBTOTAL_TEXT,
        IT_EVENTS TYPE TABLE OF slis_alv_event WITH NON-UNIQUE DEFAULT KEY
         WITH HEADER LINE INITIAL SIZE 0,
          WA_FIELDCAT2 TYPE SLIS_FIELDCAT_ALV,
          LAYOUT3 TYPE SLIS_LAYOUT_ALV,
          IT_FIELDCAT3 TYPE SLIS_T_FIELDCAT_ALV,
        IT_SORT TYPE SLIS_T_SORTINFO_ALV,
        WA_SORT TYPE SLIS_SORTINFO_ALV,
        WA_SUBT LIKE SLIS_EV_SUBTOTAL_TEXT,
        IT_EVENTS TYPE TABLE OF slis_alv_event WITH NON-UNIQUE DEFAULT KEY
         WITH HEADER LINE INITIAL SIZE 0,
          WA_FIELDCAT3 TYPE SLIS_FIELDCAT_ALV.
    TYPES DECLARATION.  ****************************
    TYPES: BEGIN OF TY_MARA,
           MATNR LIKE MARA-MATNR,                  " Material Number
           MATKL LIKE MARA-MATKL,                  " Material Group
           END OF TY_MARA.
    TYPES: BEGIN OF TY_PLAF,
           PERTR LIKE PLAF-PERTR,                  " Date
           PLNUM LIKE PLAF-PLNUM,                  " Planned Order Number
           MATNR LIKE PLAF-MATNR,                  " Material number
           PLWRK LIKE PLAF-PLWRK,                  " Plant
           KDAUF LIKE PLAF-KDAUF,                  " Sales Order Number
           KDPOS LIKE PLAF-KDPOS,                  " SO Line Item
           END OF TY_PLAF.
    TYPES: BEGIN OF TY_MAKT,
           MATNR LIKE PLAF-MATNR,                  " Material Number
           MAKTX LIKE MAKT-MAKTX,                  " Material Description
           END OF TY_MAKT.
    TYPES: BEGIN OF TY_AFPO,
           PLNUM LIKE AFPO-PLNUM,                  " Planned Order Number
           MATNR LIKE AFPO-MATNR,                  " Material Number
           KDAUF LIKE AFPO-KDAUF,                  " Sales Order Number
           KDPOS LIKE AFPO-KDPOS,                  " SO Line Item
           AUFNR LIKE AFPO-AUFNR,                  " Production Order
           STRMP LIKE AFPO-STRMP,
           DWERK LIKE AFPO-DWERK,
           END OF TY_AFPO.
    TYPES: BEGIN OF TY_ZCDR_D,
           MANDT LIKE ZCDR_D-MANDT,                " Client
           CBNO LIKE ZCDR_D-CBNO,                  " Customs Book Number
           PLNUM LIKE ZCDR_D-PLNUM,                " Planned Order Number
           MATNR LIKE ZCDR_D-MATNR,                " Material Number
           MAKTX LIKE ZCDR_D-MAKTX,                " Material Description
           KDAUF like ZCDR_D-KDAUF,                " Sales Order Number
           KDPOS like ZCDR_D-KDPOS,                " SO Line Item
           AUFNR LIKE ZCDR_D-AUFNR,                " Production Order
           END OF TY_ZCDR_D.
    TYPES: BEGIN OF TY_VSAUFK,
           INACT LIKE VSAUFK-INACT,                " Status Indicator
           END OF TY_VSAUFK.
    TYPES: BEGIN OF TY_PLAF_MAKT,
           CBNO LIKE ZCDR_D-CBNO,                  " Customs Book Number
           PLNUM LIKE PLAF-PLNUM,                  " Planned Order Number
           CHK TYPE C,                             " Check Box
           MATNR LIKE PLAF-MATNR,                  " Material Number
           MAKTX LIKE MAKT-MAKTX,                  " Material Description
           KDAUF LIKE PLAF-KDAUF,                  " Sales Order Number
           KDPOS LIKE PLAF-KDPOS,                  " SO Line Item
           AUFNR LIKE AFPO-AUFNR,                  " Production Order
           END OF TY_PLAF_MAKT.
    TYPES: BEGIN OF TY_HELP_ITEM,
           CBNO TYPE ZCDR_D-CBNO,                  " Customs Book Number
           PLNUM LIKE ZCDR_D-PLNUM,                " Planned Order Number
           MATNR LIKE ZCDR_D-MATNR,                " Material Number
           MAKTX LIKE ZCDR_D-MAKTX,                " Material Description
           KDAUF LIKE ZCDR_D-KDAUF,                " Sales Order Number
           KDPOS LIKE ZCDR_D-KDPOS,                " SO Line Item
           AUFNR LIKE ZCDR_D-AUFNR,                " Production Order
           END OF TY_HELP_ITEM.
    WORK AREA ******************************
    DATA: WA_MARA TYPE TY_MARA,
          WA_PLAF TYPE TY_PLAF,
          WA_MAKT TYPE TY_MAKT,
          WA_AFPO TYPE TY_AFPO,
          WA_ZCDR_D TYPE TY_ZCDR_D,
          WA_VSAUFK TYPE TY_VSAUFK,
          WA_PLAF_MAKT TYPE TY_PLAF_MAKT,
          WA_HELP_ITEM TYPE TY_HELP_ITEM.
    INTERNAL TABLES ****************************
    DATA: IT_MARA TYPE TABLE OF TY_MARA,
          IT_PLAF TYPE TABLE OF TY_PLAF,
          IT_MAKT TYPE TABLE OF TY_MAKT,
          IT_AFPO TYPE TABLE OF TY_AFPO,
          IT_ZCDR_D TYPE TABLE OF TY_ZCDR_D,
          IT_VSAUFK TYPE TABLE OF TY_VSAUFK,
          IT_PLAF_MAKT TYPE TABLE OF TY_PLAF_MAKT,
          IT_HELP_ITEM TYPE TABLE OF TY_HELP_ITEM.
    *it_events TYPE TABLE OF slis_alv_event WITH NON-UNIQUE DEFAULT KEY
    *WITH HEADER LINE INITIAL SIZE 0.
    TYPES: BEGIN OF TY_BOM,
              MATMK LIKE STPOX-MATMK,
              MTNRV LIKE ZCDR_D-MATNR,
              IDNRK LIKE STPOX-IDNRK,
              MNGLG LIKE STPOX-MNGLG,
              MMEIN LIKE STPOX-MMEIN,
             VPRSV LIKE STPOX-VPRSV,
              UPRICE LIKE MBEW-STPRS,
              TPRICE LIKE MBEW-STPRS,
            END OF TY_BOM,
            BEGIN OF TY_QUAN,
              MATMK LIKE STPOX-MATMK,
              MTNRV LIKE ZCDR_D-MATNR,
              IDNRK LIKE STPOX-IDNRK,
              MNGLG LIKE STPOX-MNGLG,
              MMEIN LIKE STPOX-MMEIN,
              UPRICE LIKE MBEW-STPRS,
              TPRICE LIKE MBEW-STPRS,
            END OF TY_QUAN,
            BEGIN OF TY_T023T,
              MATKL LIKE T023T-MATKL,
              WGBEZ LIKE T023T-WGBEZ,
            END OF TY_T023T,
            BEGIN OF TY_T006A,
              MMEIN LIKE T006A-MSEHI,
              MSEHT LIKE T006A-MSEHT,
            END OF TY_T006A,
            BEGIN OF TY_IMP_FINAL,
              SNO TYPE SY-INDEX,
              HSCODE LIKE ZHSCODE-HSCODE,
              WGBEZ TYPE T023T-WGBEZ,
              SPEC(20) TYPE C,
              MNGLG LIKE STPOX-MNGLG,
              MSEHT LIKE T006A-MSEHT,
              CNTRY(13) TYPE C,
              UPRICE TYPE P LENGTH 16 DECIMALS 2,
              TPRICE TYPE P LENGTH 16 DECIMALS 2,
              CURRCODE TYPE C LENGTH 5,
            END OF TY_IMP_FINAL,
            BEGIN OF TY_MBEW,
              MATNR LIKE MBEW-MATNR,
              VPRSV LIKE MBEW-VPRSV,
              STPRS LIKE MBEW-STPRS,
              VERPR LIKE MBEW-VERPR,
            END OF TY_MBEW.
      DATA: WA_BOM TYPE TY_BOM,
            WA_QUAN TYPE TY_QUAN,
            WA_IMP_FINAL TYPE TY_IMP_FINAL,
            WA_T023T TYPE TY_T023T,
            WA_T006A TYPE TY_T006A,
            WA_MBEW TYPE TY_MBEW.
      DATA: IT_BOM TYPE TABLE OF TY_BOM,
            IT_QUAN TYPE TABLE OF TY_QUAN,
            IT_IMP_FINAL TYPE TABLE OF TY_IMP_FINAL,
            IT_MBEW TYPE TABLE OF TY_MBEW.
    SELECTION-SCREEN **************************
    SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE TEXT-001.
    PARAMETERS : PR_CBNO LIKE ZCDR_D-CBNO OBLIGATORY.      "Customs Book number
    SELECTION-SCREEN END OF BLOCK b1.
    INITIALIZATION  **************************
    INITIALIZATION.
    **PERFORM CLEAR_DATA.
    **CLEAR: wa_layout.
    *PERFORM set_events USING it_events[].
    SELECT OPTION ****************************************
    SELECTION-SCREEN : BEGIN OF BLOCK BLK WITH FRAME TITLE TEXT-002.
    SELECTION-SCREEN SKIP 1.
    SELECT-OPTIONS:
            SO_PERTR for PLAF-PERTR,              "----
    Date
            SO_MATNR for MARA-MATNR,              "----
    Material
            SO_MATKL for MARA-MATKL,              "----
    Material Group
            SO_PLWRK for PLAF-PLWRK OBLIGATORY,   "----
    Plant
            SO_KDAUF for PLAF-KDAUF.              "----
    Sales Order
    SELECTION-SCREEN : END OF BLOCK BLK.
    SELECTION SCREEN F4 HELP  *********************
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR PR_CBNO.
    DATA: DYNFIELDS TYPE TABLE OF DYNPREAD WITH HEADER LINE.
          DYNFIELDS-FIELDNAME = PR_CBNO.
          APPEND DYNFIELDS.
         CALL FUNCTION 'DYNP_VALUES_READ'
              EXPORTING
                    DYNAME                               = SY-CPROG
                    DYNUMB                               = SY-DYNNR
                    TRANSLATE_TO_UPPER                   = 'X'
                  REQUEST                              = ' '
                  PERFORM_CONVERSION_EXITS             = ' '
                  PERFORM_INPUT_CONVERSION             = ' '
                  DETERMINE_LOOP_INDEX                 = ' '
                  START_SEARCH_IN_CURRENT_SCREEN       = ' '
                  START_SEARCH_IN_MAIN_SCREEN          = ' '
                  START_SEARCH_IN_STACKED_SCREEN       = ' '
                  START_SEARCH_ON_SCR_STACKPOS         = ' '
                  SEARCH_OWN_SUBSCREENS_FIRST          = ' '
                  SEARCHPATH_OF_SUBSCREEN_AREAS        = ' '
              TABLES
                    DYNPFIELDS                           = DYNFIELDS
              EXCEPTIONS
                    INVALID_ABAPWORKAREA                 = 1
                    INVALID_DYNPROFIELD                  = 2
                    INVALID_DYNPRONAME                   = 3
                    INVALID_DYNPRONUMMER                 = 4
                    INVALID_REQUEST                      = 5
                    NO_FIELDDESCRIPTION                  = 6
                    INVALID_PARAMETER                    = 7
                    UNDEFIND_ERROR                       = 8
                    DOUBLE_CONVERSION                    = 9
                    STEPL_NOT_FOUND                      = 10
                     OTHERS                               = 11
            IF SY-SUBRC <> 0.
              MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
                  WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
              ENDIF.
         READ TABLE DYNFIELDS WITH KEY FIELDNAME = 'CBNO'.
            PR_CBNO = DYNFIELDS-FIELDVALUE.
            SELECT
                CBNO
                PLNUM
                MATNR
                MAKTX
                KDAUF
                KDPOS
                AUFNR
                FROM ZCDR_D
                INTO TABLE IT_HELP_ITEM .
      CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
        EXPORTING
        DDIC_STRUCTURE         = ' '
          RETFIELD               = 'CBNO'
        PVALKEY                = ' '
         DYNPPROG               = SY-CPROG
         DYNPNR                 = SY-DYNNR
         DYNPROFIELD            = 'PR_CBNO'
        STEPL                  = 0
        WINDOW_TITLE           =
        VALUE                  = ' '
         VALUE_ORG              = 'S'
        MULTIPLE_CHOICE        = ' '
        DISPLAY                = ' '
        CALLBACK_PROGRAM       = ' '
        CALLBACK_FORM          = ' '
        MARK_TAB               =
      IMPORTING
        USER_RESET             =
        TABLES
          VALUE_TAB              = IT_HELP_ITEM
        FIELD_TAB              =
        RETURN_TAB             =
        DYNPFLD_MAPPING        =
      EXCEPTIONS
        PARAMETER_ERROR        = 1
        NO_VALUES_FOUND        = 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.
    ***********************SELECTION SCREEN VALIDATION.*******************
    AT SELECTION-SCREEN ON PR_CBNO.
      SELECT SINGLE *
      FROM ZCDR_D
      WHERE CBNO = PR_CBNO.
      IF SY-SUBRC EQ 0.
        MESSAGE E000(ZCBR) WITH PR_CBNO.
      ENDIF.
    AT SELECTION-SCREEN ON SO_PERTR.
      IF SO_PERTR IS NOT INITIAL.
        SELECT SINGLE *
        FROM PLAF
        WHERE PERTR IN SO_PERTR.
        IF SY-SUBRC NE 0.
          MESSAGE W001(ZCBR) WITH SO_PERTR-LOW.
        ENDIF.
      ENDIF.
    AT SELECTION-SCREEN ON SO_MATNR.
      IF SO_MATNR IS NOT INITIAL.
        SELECT SINGLE *
          FROM MARA
          WHERE MATNR IN SO_MATNR.
        IF SY-SUBRC NE 0.
          MESSAGE W002(ZCBR) WITH SO_MATNR-LOW.
        ENDIF.
      ENDIF.
    AT SELECTION-SCREEN ON SO_MATKL.
      IF SO_MATKL IS NOT INITIAL.
        SELECT SINGLE *
          FROM MARA
          WHERE MATKL IN SO_MATKL.
        IF SY-SUBRC NE 0.
          MESSAGE W003(ZCBR) WITH SO_MATKL-LOW.
        ENDIF.
      ENDIF.
    AT SELECTION-SCREEN ON SO_PLWRK.
      IF SO_PLWRK IS NOT INITIAL.
        SELECT SINGLE * FROM PLAF
          WHERE PLWRK IN SO_PLWRK.
        IF SY-SUBRC NE 0.
          MESSAGE W004(ZCBR) WITH SO_PLWRK-LOW.
        ENDIF.
      ENDIF.
    AT SELECTION-SCREEN ON SO_KDAUF.
      IF SO_KDAUF IS NOT INITIAL.
        SELECT SINGLE * FROM PLAF
        WHERE KDAUF IN SO_KDAUF.
        IF SY-SUBRC NE 0.
          MESSAGE W005(ZCBR) WITH SO_KDAUF-LOW.
        ENDIF.
      ENDIF.
    *********************START-OF-SELECTION.*****************************
    START-OF-SELECTION.
      IF so_pertr IS NOT INITIAL.
        FLAG = 1.
      ENDIF.
      IF SO_MATNR IS NOT INITIAL.
        FLAG1 = 1.
      ENDIF.
      IF so_matkl IS NOT INITIAL.
        FLAG2 = 1.
      ENDIF.
      IF so_plwrk IS NOT INITIAL.
        FLAG3 = 1.
      ENDIF.
      IF so_kdauf IS NOT INITIAL.
        FLAG4 = 1.
      ENDIF.
       Select data into its internal table from different database tables
      SELECT
        MATNR
        MATKL
       MTART
        INTO CORRESPONDING FIELDS OF TABLE IT_MARA
        FROM MARA
        WHERE MTART = 'ZFGS'.
      IF FLAG2 NE 0.
        DELETE IT_MARA WHERE
        NOT ( MATKL IN SO_MATKL )
      ENDIF.
      IF FLAG1 NE 0.
        DELETE IT_MARA WHERE
        NOT ( MATNR IN SO_MATNR )
      ENDIF.
      SELECT
         PERTR
         PLNUM
         MATNR
         PLWRK
         KDAUF
         KDPOS
         FROM PLAF
         INTO CORRESPONDING FIELDS OF TABLE IT_PLAF
         FOR ALL ENTRIES IN IT_MARA
         WHERE PLWRK IN SO_PLWRK
         AND MATNR = IT_MARA-MATNR.
        SELECT
          MATNR
          PLNUM
          AUFNR
          KDAUF
          KDPOS
          STRMP
          DWERK
        INACT
          FROM AFPO
          INTO CORRESPONDING FIELDS OF TABLE IT_AFPO
          FOR ALL ENTRIES IN IT_MARA
          WHERE DWERK IN SO_PLWRK
          AND MATNR = IT_MARA-MATNR.
         WHERE MATNR = IT_MARA-MATNR
         AND STRMP = IT_PLAF-PERTR
         AND KDAUF = IT_PLAF-KDAUF
         AND DWERK = IT_PLAF-PLWRK.
        End of Data selection
       Keep only those records which the user wants from his selection screen
      IF FLAG NE 0.
        DELETE IT_PLAF WHERE
        NOT ( PERTR IN SO_PERTR )
        DELETE IT_AFPO WHERE
        NOT ( STRMP IN SO_PERTR )
      ENDIF.
      IF FLAG3 NE 0.
        DELETE IT_PLAF WHERE
        NOT ( PLWRK IN SO_PLWRK )
        DELETE IT_AFPO WHERE
        NOT ( DWERK IN SO_PLWRK )
      ENDIF.
      IF FLAG4 NE 0.
        DELETE IT_PLAF WHERE
        NOT ( KDAUF IN SO_KDAUF )
        DELETE IT_AFPO WHERE
        NOT ( KDAUF IN SO_KDAUF )
      ENDIF.
        SELECT
         MATNR
         MAKTX
         FROM MAKT
         INTO CORRESPONDING FIELDS OF TABLE IT_MAKT
         FOR ALL ENTRIES IN IT_PLAF
         WHERE MATNR = IT_PLAF-MATNR
         AND SPRAS = 'EN'.
      SELECT
        FROM ZCDR_D
        INTO TABLE IT_ZCDR_D.
              Put data into final internal table from different internal tables
    LOOP AT IT_MARA INTO WA_MARA.
      LOOP AT IT_PLAF INTO WA_PLAF WHERE MATNR = WA_MARA-MATNR.
        READ TABLE IT_ZCDR_D
        INTO WA_ZCDR_D
        WITH KEY PLNUM = WA_PLAF-PLNUM.
        IF SY-SUBRC <> 0.
          MOVE WA_PLAF-PLNUM TO WA_PLAF_MAKT-PLNUM.
          MOVE WA_PLAF-MATNR TO WA_PLAF_MAKT-MATNR.
          MOVE WA_PLAF-KDAUF TO WA_PLAF_MAKT-KDAUF.
          MOVE WA_PLAF-KDPOS TO WA_PLAF_MAKT-KDPOS.
          READ TABLE IT_AFPO INTO WA_AFPO WITH KEY PLNUM = WA_PLAF-PLNUM.
              MOVE WA_AFPO-AUFNR TO WA_PLAF_MAKT-AUFNR.
           SELECT
             SINGLE * FROM VSAUFK
             INTO TABLE IT_VSAUFK
             WHERE AUFNR = WA_AFPO-AUFNR
             AND STAT = 'I0012'.
           IF SY-SUBRC <> 0.
             MOVE WA_AFPO-AUFNR TO IT_PLAF_MAKT-AUFNR.
           ELSE.
             CHECK IT_VSAUFK-INACT = 'X'.
             MOVE WA_AFPO-AUFNR TO IT_PLAF_MAKT-AUFNR.
           ENDIF.
        ENDLOOP.
             READ TABLE IT_MAKT
                INTO WA_MAKT
                WITH KEY MATNR = WA_MARA-MATNR.
                MOVE WA_MAKT-MAKTX TO WA_PLAF_MAKT-MAKTX.
                APPEND WA_PLAF_MAKT TO IT_PLAF_MAKT.
                CLEAR WA_PLAF_MAKT.
        ENDIF.
      ENDLOOP.
    ENDLOOP.
    LOOP AT IT_PLAF_MAKT .
    LOOP AT IT_MARA INTO WA_MARA.
    LOOP AT IT_PLAF INTO WA_PLAF WHERE MATNR = WA_MARA-MATNR.
       LOOP AT IT_AFPO INTO WA_AFPO WHERE MATNR = WA_MARA-MATNR.
        READ TABLE IT_ZCDR_D
        INTO WA_ZCDR_D
        WITH KEY PLNUM = WA_AFPO-PLNUM.
        IF SY-SUBRC <> 0.
           LOOP AT IT_AFPO INTO WA_AFPO.
             WHERE MATNR IN SO_MATNR
             AND STRMP = SO_PERTR
             AND PLNUM IN SO_PLNUM
             AND KDAUF IN SO_-KDAUF
             AND MATKL IN SO_MATKL.
            SELECT
              SINGLE INACT FROM VSAUFK
              INTO WA_VSAUFK
              WHERE AUFNR = WA_AFPO-AUFNR
              AND STAT = 'I0012'.
            IF SY-SUBRC <> 0.
              WA_PLAF_MAKT-PLNUM = WA_AFPO-PLNUM.
              WA_PLAF_MAKT-KDAUF = WA_AFPO-KDAUF.
              WA_PLAF_MAKT-KDPOS = WA_AFPO-KDPOS.
              WA_PLAF_MAKT-MATNR = WA_AFPO-MATNR.
              WA_PLAF_MAKT-AUFNR = WA_AFPO-AUFNR.
              READ TABLE IT_MAKT INTO WA_MAKT WITH KEY MATNR = WA_AFPO-MATNR.
              WA_PLAF_MAKT-MAKTX = WA_MAKT-MAKTX.
              APPEND WA_PLAF_MAKT TO IT_PLAF_MAKT .
             APPEND WA_AFPO TO IT_PLAF_MAKT.
             MOVE WA_AFPO-AUFNR TO IT_PLAF_MAKT-AUFNR.
            ELSE.
              CHECK WA_VSAUFK-INACT = 'X'.
              WA_PLAF_MAKT-PLNUM = WA_AFPO-PLNUM.
              WA_PLAF_MAKT-KDAUF = WA_AFPO-KDAUF.
              WA_PLAF_MAKT-KDPOS = WA_AFPO-KDPOS.
              WA_PLAF_MAKT-MATNR = WA_AFPO-MATNR.
              WA_PLAF_MAKT-AUFNR = WA_AFPO-AUFNR.
              READ TABLE IT_MAKT INTO WA_MAKT WITH KEY MATNR = WA_AFPO-MATNR.
              WA_PLAF_MAKT-MAKTX = WA_MAKT-MAKTX.
              APPEND WA_PLAF_MAKT TO IT_PLAF_MAKT .
             APPEND WA_AFPO TO IT_PLAF_MAKT.
             MOVE WA_AFPO-AUFNR TO IT_PLAF_MAKT-AUFNR.
            ENDIF.
            ENDIF.
        ENDLOOP.
         EXIT.
       ENDIF.
      ENDLOOP.
    ENDLOOP.
      LOOP AT IT_PLAF_MAKT INTO WA_PLAF_MAKT.
        WA_PLAF_MAKT-CBNO = PR_CBNO.
        MODIFY IT_PLAF_MAKT FROM WA_PLAF_MAKT TRANSPORTING CBNO.
      ENDLOOP.
    ENDLOOP.
      PERFORM CHANGE_CATALOG.
      PERFORM ALV_DISPLAY.
    *&      Form  CHANGE_CATALOG
          text
    FORM CHANGE_CATALOG.
       LAYOUT-ZEBRA = 'X'.
      DATA: L_POS TYPE I.
      L_POS = L_POS + 1.
      WA_FIELDCAT-col_pos   = L_POS.
      WA_FIELDCAT-SELTEXT_M = 'Planned Order Nos.'.
      WA_FIELDCAT-TABNAME = WA_PLAF_MAKT.
      WA_FIELDCAT-FIELDNAME = 'PLNUM'.
      APPEND WA_FIELDCAT TO IT_FIELDCAT.
      CLEAR WA_FIELDCAT.
      L_POS = L_POS + 1.
      WA_FIELDCAT-COL_POS   = L_POS.
      WA_FIELDCAT-INPUT = 'X'.
      WA_FIELDCAT-SELTEXT_M = 'Check Box'.
      WA_FIELDCAT-TABNAME = WA_PLAF_MAKT.
      WA_FIELDCAT-CHECKBOX  = 'X'.
      WA_FIELDCAT-EDIT = abap_true.
      WA_FIELDCAT-FIELDNAME = 'CHK'.
      APPEND WA_FIELDCAT TO IT_FIELDCAT.
      CLEAR WA_FIELDCAT.
      L_POS = L_POS + 1.
      WA_FIELDCAT-COL_POS   = L_POS.
      WA_FIELDCAT-OUTPUTLEN = '12'.
      WA_FIELDCAT-SELTEXT_M = 'Material'.
      WA_FIELDCAT-TABNAME = WA_PLAF_MAKT.
      WA_FIELDCAT-FIELDNAME = 'MATNR'.
      APPEND WA_FIELDCAT TO IT_FIELDCAT.
      CLEAR WA_FIELDCAT.
      L_POS = L_POS + 1.
      WA_FIELDCAT-COL_POS   = L_POS.
      WA_FIELDCAT-OUTPUTLEN = '35'.
      WA_FIELDCAT-SELTEXT_M = 'Material Description'.
      WA_FIELDCAT-TABNAME = WA_PLAF_MAKT.
      WA_FIELDCAT-FIELDNAME = 'MAKTX'.
      APPEND WA_FIELDCAT TO IT_FIELDCAT.
      CLEAR WA_FIELDCAT.
      L_POS = L_POS + 1.
      WA_FIELDCAT-COL_POS   = L_POS.
      WA_FIELDCAT-SELTEXT_M = 'Sales Order Number'.
      WA_FIELDCAT-TABNAME = WA_PLAF_MAKT.
      WA_FIELDCAT-FIELDNAME = 'KDAUF'.
      APPEND WA_FIELDCAT TO IT_FIELDCAT.
      CLEAR WA_FIELDCAT.
      L_POS = L_POS + 1.
      WA_FIELDCAT-COL_POS   = L_POS.
      WA_FIELDCAT-SELTEXT_M = 'S O Line Item'.
      WA_FIELDCAT-TABNAME = WA_PLAF_MAKT.
      WA_FIELDCAT-FIELDNAME = 'KDPOS'.
      APPEND WA_FIELDCAT TO IT_FIELDCAT.
      CLEAR WA_FIELDCAT.
      L_POS = L_POS + 1.
      WA_FIELDCAT-COL_POS   = L_POS.
      WA_FIELDCAT-OUTPUTLEN = '13'.
      WA_FIELDCAT-SELTEXT_M = 'Production Order'.
      WA_FIELDCAT-TABNAME = WA_PLAF_MAKT.
      WA_FIELDCAT-FIELDNAME = 'AUFNR'.
      APPEND WA_FIELDCAT TO IT_FIELDCAT.
      CLEAR WA_FIELDCAT.
    *GS_LAYOUT-TOTALS_BEFORE_ITEMS = 'X'.
    *data : text like slis_ev_subtotal_text value 'total'.
    *gs_layout-subtotals_text = text.
    *gs_layout-totals_only = 'X'.
    gs_layout-subtotals_text = 'total'.
    endform. "  CHANGE_CATALOG
    *********************event*************************************
    *&      Form  ALV_DISPLAY
          text
    FORM ALV_DISPLAY.
    *data: LC_GLAY TYPE LVC_S_GLAY.
       LC_GLAY-EDT_CLL_CB = 'X'.
       gs_layout-colwidth_optimize = 'X'.
       gs_layout-zebra = 'X'.
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
       EXPORTING
                       I_INTERFACE_CHECK                 = ' '
                       I_BYPASSING_BUFFER                = ' '
                       I_BUFFER_ACTIVE                   = ' '
         I_CALLBACK_PROGRAM                = SY-REPID
         I_CALLBACK_PF_STATUS_SET          = 'SET_PF_STATUS'
         I_CALLBACK_USER_COMMAND           = 'USER_COMMAND'
                       I_CALLBACK_TOP_OF_PAGE            = ' '
                       I_CALLBACK_HTML_TOP_OF_PAGE       = ' '
                       I_CALLBACK_HTML_END_OF_LIST       = ' '
                       I_STRUCTURE_NAME                  =
                       I_BACKGROUND_ID                   = ' '
         I_GRID_TITLE                      = 'PLANNED ORDERS'
                       I_GRID_SETTINGS                   = LC_GLAY
        IS_LAYOUT                         = LAYOUT
         IT_FIELDCAT                       = IT_FIELDCAT[]
                       IT_EXCLUDING                      =
                       IT_SPECIAL_GROUPS                 =
                       IT_SORT                           =
                       IT_FILTER                         =
                       IS_SEL_HIDE                       =
                       I_DEFAULT                         = 'X'
        I_SAVE                            = 'X'
                       IS_VARIANT                        =
                       IT_EVENTS                         = IT_EVENTS[]
                       IT_EVENT_EXIT                     =
                       IS_PRINT                          =
                       IS_REPREP_ID                      =
                       I_SCREEN_START_COLUMN             = 0
                       I_SCREEN_START_LINE               = 0
                       I_SCREEN_END_COLUMN               = 0
                       I_SCREEN_END_LINE                 = 0
                       I_HTML_HEIGHT_TOP                 = 0
                       I_HTML_HEIGHT_END                 = 0
                       IT_ALV_GRAPHICS                   =
                       IT_HYPERLINK                      =
                       IT_ADD_IT_FIELDCAT                   =
                       IT_EXCEPT_QINFO                   =
                       IR_SALV_FULLSCREEN_ADAPTER        =
                     IMPORTING
                       E_EXIT_CAUSED_BY_CALLER           =
                       ES_EXIT_CAUSED_BY_USER            =
        TABLES
          T_OUTTAB                          = IT_PLAF_MAKT
                     EXCEPTIONS
                       PROGRAM_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.
    REFRESH IT_FIELDCAT[].
    ENDFORM.                    "ALV_DISPLAY
    *&      Form  USER_COMMAND
          text
         -->UCOMM      text
         -->SELFIELD   text
    FORM USER_COMMAND
      USING UCOMM LIKE SY-UCOMM
      SELFIELD TYPE SLIS_SELFIELD.
      Data: REF1 TYPE REF TO CL_GUI_ALV_GRID.
    DATA WA LIKE LINE OF IT_PLAF_MAKT.
      CALL FUNCTION 'GET_GLOBALS_FROM_SLVC_FULLSCR'
        IMPORTING
          E_GRID = REF1.
      CALL METHOD REF1->CHECK_CHANGED_DATA.
      CASE UCOMM.
        WHEN '&BACK'.
          LEAVE TO SCREEN 0.
        WHEN  '&EXIT'.
          LEAVE TO SCREEN 0.
        WHEN '&CANC'.
          LEAVE TO SCREEN 0.
        WHEN '&SAVE'.
          CLEAR IT_ZCDR_D[].
          LOOP AT IT_PLAF_MAKT INTO WA_PLAF_MAKT WHERE CHK = 'X'.
            CLEAR WA_ZCDR_D.
            WA_ZCDR_D-MANDT = SY-MANDT.
            WA_ZCDR_D-CBNO = WA_PLAF_MAKT-CBNO.
            WA_ZCDR_D-plnum = WA_PLAF_MAKT-PLNUM.
            WA_ZCDR_D-MATNR = WA_PLAF_MAKT-MATNR.
            WA_ZCDR_D-MAKTX = WA_PLAF_MAKT-MAKTX.
            WA_ZCDR_D-KDAUF = WA_PLAF_MAKT-KDAUF.
            WA_ZCDR_D-KDPOS = WA_PLAF_MAKT-KDPOS.
            WA_ZCDR_D-AUFNR = WA_PLAF_MAKT-AUFNR.
            APPEND WA_ZCDR_D to IT_ZCDR_D.
          ENDLOOP.
          LOOP AT IT_ZCDR_D INTO WA_ZCDR_D.
            INSERT ZCDR_D FROM WA_ZCDR_D.
            CLEAR WA_ZCDR_D.
          ENDLOOP.
          IF SY-SUBRC EQ 0.
            MESSAGE S021(ZCBR) WITH PR_CBNO.
          ENDIF.
          IF IT_ZCDR_D IS INITIAL.
            MESSAGE 'Select Atleast one Check Box' TYPE 'E' .
          ENDIF.
        WHEN 'IMPORT_INF'.
          PERFORM IMPORT_REPORT.
       WHEN 'EXPORT_INF'.
         PERFORM EXPORT_REPORT.
       WHEN 'UNIT_CONSU'.
         PERFORM UNIT_CONSUMPTION.
      ENDCASE.
    ENDFORM.                    "USER_COMMAND
    FORM set_events USING it_events TYPE slis_t_event.
    DATA: x_event TYPE slis_alv_event.
    clear x_event.
    x_event-name = 'USER_COMMAND'.
    x_event-form = 'USER_COMMAND'.
    append x_event to it_events.
    CLEAR x_event.
    call function 'REUSE_ALV_EVENTS_GET'
      EXPORTING
        I_LIST_TYPE           = 0
      IMPORTING
        ET_EVENTS             = IT_EVENTS
      EXCEPTIONS
        LIST_TYPE_WRONG       = 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.
    read table it_events into x_event with key name = slis_ev_user_command.
          if sy-subrc = 0.
          x_event-form = 'USER_COMMAND'.
          modify it_events from x_event index sy-tabix transporting form .
          endif.
    ENDFORM.
    *&      Form  set_pf_status
          text
         -->RT_EXTAB   text
    FORM SET_PF_STATUS USING RT_EXTAB TYPE SLIS_T_EXTAB.
      SET PF-STATUS 'Z_PFSTAT'.
    ENDFORM.            " set_pf_status
    FORM IMPORT_REPORT.
    TYPES: BEGIN OF TY_BOM,
             MATMK LIKE STPOX-MATMK,
             MTNRV LIKE ZCDR_D-MATNR,
             IDNRK LIKE STPOX-IDNRK,
             MNGLG LIKE STPOX-MNGLG,
             MMEIN LIKE STPOX-MMEIN,
             VPRSV LIKE STPOX-VPRSV,
             UPRICE LIKE MBEW-STPRS,
             TPRICE LIKE MBEW-STPRS,
           END OF TY_BOM,
           BEGIN OF TY_QUAN,
             MATMK LIKE STPOX-MATMK,
             MTNRV LIKE ZCDR_D-MATNR,
             IDNRK LIKE STPOX-IDNRK,
             MNGLG LIKE STPOX-MNGLG,
             MMEIN LIKE STPOX-MMEIN,
             UPRICE LIKE MBEW-STPRS,
             TPRICE LIKE MBEW-STPRS,
           END OF TY_QUAN,
           BEGIN OF TY_T023T,
             MATKL LIKE T023T-MATKL,
             WGBEZ LIKE T023T-WGBEZ,
           END OF TY_T023T,
           BEGIN OF TY_T006A,
             MMEIN LIKE T006A-MSEHI,
             MSEHT LIKE T006A-MSEHT,
           END OF TY_T006A,
           BEGIN OF TY_IMP_FINAL,
             SNO TYPE SY-INDEX,
             HSCODE LIKE ZHSCODE-HSCODE,
             WGBEZ TYPE T023T-WGBEZ,
             SPEC(20) TYPE C,
             MNGLG LIKE STPOX-MNGLG,
             MSEHT LIKE T006A-MSEHT,
             CNTRY(13) TYPE C,
             UPRICE TYPE P LENGTH 16 DECIMALS 2,
             TPRICE TYPE P LENGTH 16 DECIMALS 2,
             CURRCODE TYPE C LENGTH 5,
           END OF TY_IMP_FINAL,
           BEGIN OF TY_MBEW,
             MATNR LIKE MBEW-MATNR,
             VPRSV LIKE MBEW-VPRSV,
             STPRS LIKE MBEW-STPRS,
             VERPR LIKE MBEW-VERPR,
           END OF TY_MBEW.
    DATA: WA_BOM TYPE TY_BOM,
           WA_QUAN TYPE TY_QUAN,
           WA_IMP_FINAL TYPE TY_IMP_FINAL,
           WA_T023T TYPE TY_T023T,
           WA_T006A TYPE TY_T006A,
           WA_MBEW TYPE TY_MBEW.
    DATA: IT_BOM TYPE TABLE OF TY_BOM,
           IT_QUAN TYPE TABLE OF TY_QUAN,
           IT_IMP_FINAL TYPE TABLE OF TY_IMP_FINAL,
           IT_MBEW TYPE TABLE OF TY_MBEW.
      DATA:  IT_STPO TYPE STANDARD TABLE OF STPOX,
             WA_STPO TYPE STPOX.
          SELECT
              MATNR
              VPRSV
              STPRS
              VERPR
               FROM MBEW
                INTO CORRESPONDING FIELDS OF TABLE IT_MBEW.
                    WHERE MATNR EQ IT_MARA-MATNR.    "MBEW
    *I_STPO2 TYPE STANDARD TABLE OF STPOX.
    LOOP AT IT_PLAF_MAKT INTO WA_PLAF_MAKT WHERE CHK = 'X'.
      LOOP AT IT_ZCDR_D INTO WA_ZCDR_D .
          CALL FUNCTION 'CS_BOM_EXPL_MAT_V2'

  • Problem when filling Node and Item tables for the metho add_nodes_and_items

    Hi Experts,
    I am facing problem when filling  Node and Item internal tables for the method add_nodes_and_items.
    as i have written the below logic:
      LOOP AT gt_partner INTO wa_partner.
        CLEAR lvs_tc_root.
        l_key = l_key + 1.
        lvs_tc_root-node_key   = l_key. "wa_partner-sndprn.
    *  lvs_tc_root-relatkey  = lvf_tc_node_key.
    *  lvs_tc_root-relatship = cl_gui_column_tree=>relat_last_child.
        lvs_tc_root-last_hitem = wa_partner-sndprn.
        lvs_tc_root-hidden     = ' '.
        lvs_tc_root-disabled   = ' '.
        lvs_tc_root-isfolder   = 'X'.
        lvs_tc_root-n_image    = icon_folder.
        lvs_tc_root-exp_image  = icon_folder.
        lvs_tc_root-expander   = 'X'.
        APPEND lvs_tc_root TO gvt_tc_node_table.
        CLEAR lvs_tc_root.
        lvs_tc_root-node_key   = 'A'.  "Successfull
        lvs_tc_root-relatkey   = l_key.
        lvs_tc_root-relatship  = cl_gui_column_tree=>relat_last_child.
        lvs_tc_root-last_hitem = wa_partner-sndprn.
        lvs_tc_root-hidden     = ' '.
        lvs_tc_root-disabled   = ' '.
        lvs_tc_root-n_image    = icon_green_light.
        APPEND lvs_tc_root TO gvt_tc_node_table.
        CLEAR lvs_tc_root.
        lvs_tc_root-node_key   = 'B'.  "Errors
        lvs_tc_root-relatkey   = l_key    .
        lvs_tc_root-last_hitem = wa_partner-sndprn.
        lvs_tc_root-hidden     = ' '.
        lvs_tc_root-disabled   = ' '.
        lvs_tc_root-n_image    = icon_red_light.
        APPEND lvs_tc_root TO gvt_tc_node_table.
        CLEAR lvs_tc_root.
        lvs_tc_root-node_key  = 'C'.  "Deleted
        lvs_tc_root-relatkey  = l_key .
        lvs_tc_root-last_hitem = wa_partner-sndprn.
        lvs_tc_root-hidden    = ' '.
        lvs_tc_root-disabled  = ' '.
        lvs_tc_root-n_image   = icon_yellow_light.
        APPEND lvs_tc_root TO gvt_tc_node_table.
    *   LOOP AT gt_partner_item INTO wa_partner_item WHERE sndprn = wa_partner-sndprn
        LOOP AT gt_partner INTO wa_partner_item WHERE sndprn = wa_partner-sndprn.
          CLEAR lvs_item.
          lvs_item-node_key   = l_key.
          lvs_item-item_name  = 'Column1'.
          lvs_item-text       = wa_partner-sndprn.
          lvs_item-class      = cl_gui_column_tree=>item_class_text.
          APPEND lvs_item TO gvt_tc_item_table. CLEAR lvs_item.
          lvs_item-node_key   = 'A'.
          lvs_item-item_name  = 'Column1'.
          lvs_item-text       = 'Successful'.
          lvs_item-class      = cl_gui_column_tree=>item_class_text.
          APPEND lvs_item TO gvt_tc_item_table. CLEAR lvs_item.
          lvs_item-node_key   = 'B'.
          lvs_item-item_name  = 'Column1'.
          lvs_item-text       = 'Errors'.
          lvs_item-class      = cl_gui_column_tree=>item_class_text.
          APPEND lvs_item TO gvt_tc_item_table. CLEAR lvs_item.
          lvs_item-node_key   = 'C'.
          lvs_item-item_name  = 'Column1'.
          lvs_item-text       = 'Deleted'.
          lvs_item-class      = cl_gui_column_tree=>item_class_text.
          APPEND lvs_item TO gvt_tc_item_table. CLEAR lvs_item.
        ENDLOOP.
      ENDLOOP.
      CALL METHOD go_tree->add_nodes_and_items
        EXPORTING
          node_table                     = gvt_tc_node_table
          item_table                     = gvt_tc_item_table
          item_table_structure_name      = 'MTREEITM'
        EXCEPTIONS
          failed                         = 1
          cntl_system_error              = 3
          error_in_tables                = 4
          dp_error                       = 5
          table_structure_name_not_found = 6.
    If the internal table has more than 1 record getting dump...Runtime Errors         MESSAGE_TYPE_X
    Plase let me know how to overcome the problem..
    Thanks,
    Rajasekhar
    Edited by: RajasekharReddy Nevali on Nov 29, 2010 3:43 PM
    Edited by: Neil Gardiner on Nov 30, 2010 12:41 PM

    Hi ,
    U can undestand the code and one more thing dynamically display record for automcally here i am using root nodes please look at that one Same requiremtn i done previously.
    cLEAR item.
      item-node_key = c_nodekey-root.    "partner1
      item-item_name = c_column-column1.
      item-class = cl_gui_column_tree=>item_class_text.
      item-alignment = cl_gui_column_tree=>align_at_top.
      item-font = cl_gui_column_tree=>item_font_prop.
      item-text = 'APPLICATION'.
      item-length = 30.
      APPEND item TO item_table.
      DATA:lv_name TYPE tv_itmname VALUE '1',
           lv_nkey TYPE i,
           lv_nkey2 TYPE i,
           lv_nkey_c TYPE string,
           lv_nkey_c2 TYPE string,
           lv_nkey_c3 TYPE string,
           lv_nkey_c4 TYPE string,
           LV_NKEY_C5 TYPE STRING,
           lv_itmkey TYPE i,
           lv_itmkey_c TYPE string,
           LV_INDEX TYPE I.
    ************************************************LOOP FOR APPLICATION*********
      LOOP AT i_otypes INTO wa_otypes.
        read table it_appl into wa_appl with key appl = wa_otypes-applic." BINARY SEARCH.
              if sy-subrc = 0.
                lv_apdes = wa_appl-text1.
              endif.
        CLEAR:item,lv_nkey_c.
        lv_nkey_c = sy-tabix.
        LV_INDEX = SY-TABIX.
        CONDENSE lv_nkey_c.
        CONCATENATE 'N' lv_nkey_c INTO lv_nkey_c.
        node-node_key = lv_nkey_c.
        node-relatkey = c_nodekey-root.
        node-relatship = cl_gui_list_tree=>relat_last_child.
        node-isfolder = 'X'.
        APPEND node TO node_table.
        CLEAR item.
        item-node_key = lv_nkey_c.
        item-item_name = c_column-column1.
        item-class = cl_gui_column_tree=>item_class_text.
        item-font = cl_gui_column_tree=>item_font_prop.
        item-text = wa_otypes-APPLIC.
        item-length = 30.
        APPEND item TO item_table.
         CLEAR item.
          item-node_key = lv_nkey_c.
          item-item_name = c_column-column2.
          item-class = cl_gui_column_tree=>item_class_text.
          item-font = cl_gui_column_tree=>item_font_prop.
          item-text = lv_apdes.
          item-length = 30.
          APPEND item TO item_table.
         v_acount = v_acount + 1.
         v_acount1 = v_acount1 + 1.
    clear lv_apdes.
    *****************************************LOOP FOR ARCHIV OBJECTS***************************
        loop at it_obj into wa_obj where applic = wa_otypes-applic.
          CLEAR:item,lv_nkey_c2.
          lv_nkey_c2 = SY-TABIX.
          CONDENSE lv_nkey_c2.
          CONCATENATE 'SN' lv_nkey_c2 INTO lv_nkey_c2.
          node-node_key = lv_nkey_c2.
          node-relatkey = lv_nkey_c.
          node-relatship = cl_gui_list_tree=>relat_last_child.
          node-isfolder = 'X'.
          APPEND node TO node_table.
          CLEAR item.
          item-node_key = lv_nkey_c2.
          item-item_name = c_column-column1.
          item-class = cl_gui_column_tree=>item_class_text.
          item-font = cl_gui_column_tree=>item_font_prop.
          item-text = wa_obj-object.
          item-length = 30.
          APPEND item TO item_table.
          CLEAR item.
          item-node_key = lv_nkey_c2.
          item-item_name = c_column-column2.
          item-class = cl_gui_column_tree=>item_class_text.
          item-font = cl_gui_column_tree=>item_font_prop.
          item-text = wa_obj-objtext.
          item-length = 30.
          APPEND item TO item_table.
    ****count all object for final displaying*******
         v_ocount1 = v_ocount1 + 1.
          LV_STR = LV_STR + 1.
         ENDLOOP.
    *********************LOOP FOR ARCH OBJECT ALL PROGRAMS*******************************************
       LOOP AT IT_PRG INTO WA_PRG WHERE OBJECT = WA_OBJ-OBJECT.
    ****************1PRG**********************
    IF wa_PRG-REORGA_PRG IS NOT INITIAL.
      read table it_trdirt into wa_trdirt with key name = wa_prg-reorga_prg BINARY SEARCH.
                  if sy-subrc = 0.
                  lv_text = wa_trdirt-text.
                  endif.
         CLEAR:item,lv_nkey_c3.
          data : v_no type sy-tabix.
          v_no = v_no + 1.
          lv_nkey_c3  =  v_no.
          CONDENSE lv_nkey_c3.
          CONCATENATE 'SSN' lv_nkey_c3 INTO lv_nkey_c3.
          node-node_key = lv_nkey_c3.
          node-relatkey = lv_nkey_c2.
          node-relatship = cl_gui_list_tree=>relat_last_child.
          node-isfolder = 'X'.
          NODE-N_image =' '.
          APPEND node TO node_table.
           CLEAR NODE.
          CLEAR item.
          item-node_key = lv_nkey_c3.
          item-item_name = c_column-column1.
          item-class = cl_gui_column_tree=>item_class_text.
          item-font = cl_gui_column_tree=>item_font_prop.
          item-text = 'WRIT'."wa_PRG-REORGA_PRG.
          item-length = 30.
          APPEND item TO item_table.
          CLEAR item.
          item-node_key = lv_nkey_c3.
          item-item_name = c_column-column2.
          item-class = cl_gui_column_tree=>item_class_text.
          item-font = cl_gui_column_tree=>item_font_prop.
          item-text = 'WRITE PROGRAM'."lv_text."'WRITE PROGRAM'.
          item-length = 30.
          APPEND item TO item_table.
           clear lv_text.
    ************************SSSN NODE***********************
            CLEAR:item,lv_nkey_c4.
          data : v_no1 type sy-tabix.
          v_no1 = v_no1 + 1.
          lv_nkey_c4  =  v_no1.
          CONDENSE lv_nkey_c4.
          CONCATENATE 'SSSN' lv_nkey_c4 INTO lv_nkey_c4.
          node-node_key = lv_nkey_c4.
          node-relatkey = lv_nkey_c3.
          node-relatship = cl_gui_list_tree=>relat_last_child.
         node-isfolder = 'X'.
          NODE-N_image =' '.
          APPEND node TO node_table.
           CLEAR NODE.
          CLEAR item.
          item-node_key = lv_nkey_c4.
          item-item_name = c_column-column1.
          item-class = cl_gui_column_tree=>item_class_text.
          item-font = cl_gui_column_tree=>item_font_prop.
          item-text = wa_PRG-REORGA_PRG.
          item-length = 30.
          APPEND item TO item_table.
          CLEAR item.
          item-node_key = lv_nkey_c4.
          item-item_name = c_column-column2.
          item-class = cl_gui_column_tree=>item_class_text.
          item-font = cl_gui_column_tree=>item_font_prop.
          item-text = lv_text."'WRITE PROGRAM'.
          item-length = 30.
          APPEND item TO item_table.
            clear lv_text.
    *******COUNT TYPE WRITE PROGRAMS****************
          V_WCOUNT = V_WCOUNT + 1.
    CLEAR item.
    V_WCOUNT = V_WCOUNT.
          item-node_key = lv_nkey_c3.
          item-item_name = c_column-column3.
          item-class = cl_gui_column_tree=>item_class_text.
          item-font = cl_gui_column_tree=>item_font_prop.
          item-text = V_WCOUNT."lv_text."'WRITE PROGRAM'.
          item-length = 30.
          APPEND item TO item_table.
          CLEAR V_WCOUNT.
    ENDIF.
    *endif.
    *****************2PRG*****************
    IF wa_PRG-RETRIE_PRG IS NOT INITIAL.
    read table it_trdirt into wa_trdirt with key name = wa_prg-retrie_prg.
                  if sy-subrc = 0.
                  lv_text = wa_trdirt-text.
                  endif.
         CLEAR:item, NODE, lv_nkey_c3.
          v_no = v_no + 1.
          lv_nkey_c3  =  v_no.
          CONDENSE lv_nkey_c3.
          CONCATENATE 'SSN' lv_nkey_c3 INTO lv_nkey_c3.
          node-node_key = lv_nkey_c3.
          node-relatkey = lv_nkey_c2.
          node-relatship = cl_gui_list_tree=>relat_last_child.
          node-isfolder = 'X'.
          APPEND node TO node_table.
          CLEAR item.
          item-node_key = lv_nkey_c3.
          item-item_name = c_column-column1.
          item-class = cl_gui_column_tree=>item_class_text.
          item-font = cl_gui_column_tree=>item_font_prop.
          item-text = 'successful'."wa_PRG-RETRIE_PRG.
          item-length = 30.
          APPEND item TO item_table.
          CLEAR item.
          item-node_key = lv_nkey_c3.
          item-item_name = c_column-column2.
          item-class = cl_gui_column_tree=>item_class_text.
          item-font = cl_gui_column_tree=>item_font_prop.
          item-text = 'sucessful PROGRAM'.
          item-length = 60.
          APPEND item TO item_table.
    *********************************SSSN NODE*******************************
           CLEAR:item,lv_nkey_c4,node.
         data : v_no1 type sy-tabix.
          v_no1 = v_no1 + 1.
          lv_nkey_c4  =  v_no1.
          CONDENSE lv_nkey_c4.
          CONCATENATE 'SSSN' lv_nkey_c4 INTO lv_nkey_c4.
          node-node_key = lv_nkey_c4.
          node-relatkey = lv_nkey_c3.
          node-relatship = cl_gui_list_tree=>relat_last_child.
         node-isfolder = 'X'.
          NODE-N_image =' '.
          APPEND node TO node_table.
           CLEAR NODE.
          CLEAR item.
          item-node_key = lv_nkey_c4.
          item-item_name = c_column-column1.
          item-class = cl_gui_column_tree=>item_class_text.
          item-font = cl_gui_column_tree=>item_font_prop.
          item-text = wa_PRG-RETRIE_PRG.
          item-length = 30.
          APPEND item TO item_table.
          CLEAR item.
          item-node_key = lv_nkey_c4.
          item-item_name = c_column-column2.
          item-class = cl_gui_column_tree=>item_class_text.
          item-font = cl_gui_column_tree=>item_font_prop.
          item-text = lv_text."'WRITE PROGRAM'.
          item-length = 30.
          APPEND item TO item_table.
            clear lv_text.
    **********COUNT THE RELOADPR*******************
              V_WCOUNT = V_WCOUNT + 1.
    CLEAR item.
    V_WCOUNT = V_WCOUNT.
          item-node_key = lv_nkey_c3.
          item-item_name = c_column-column3.
          item-class = cl_gui_column_tree=>item_class_text.
          item-font = cl_gui_column_tree=>item_font_prop.
          item-text = V_WCOUNT."lv_text."'WRITE PROGRAM'.
          item-length = 30.
          APPEND item TO item_table.
          CLEAR V_WCOUNT.
    ENDIF.
    ENDIF.
    ****************3PRG**********************
    IF wa_PRG-DELETE_PRG IS NOT INITIAL.
    read table it_trdirt into wa_trdirt with key name = wa_prg-delete_prg.
                  if sy-subrc = 0.
                  lv_text = wa_trdirt-text.
                  endif.
         CLEAR:item, NODE, lv_nkey_c3.
          v_no = v_no + 1.
          lv_nkey_c3  =  v_no.
          CONDENSE lv_nkey_c3.
          CONCATENATE 'SSN' lv_nkey_c3 INTO lv_nkey_c3.
          node-node_key = lv_nkey_c3.
          node-relatkey = lv_nkey_c2.
          node-relatship = cl_gui_list_tree=>relat_last_child.
          node-isfolder = 'X'.
          APPEND node TO node_table.
          CLEAR item.
          item-node_key = lv_nkey_c3.
          item-item_name = c_column-column1.
          item-class = cl_gui_column_tree=>item_class_text.
          item-font = cl_gui_column_tree=>item_font_prop.
          item-text = 'DELETE'."wa_PRG-DELETE_PRG.
          item-length = 30.
          APPEND item TO item_table.
          CLEAR item.
          item-node_key = lv_nkey_c3.
          item-item_name = c_column-column2.
          item-class = cl_gui_column_tree=>item_class_text.
          item-font = cl_gui_column_tree=>item_font_prop.
          item-text = 'NAME OF DELETE PROGRAM'.
          item-length = 60.
          APPEND item TO item_table.
           CLEAR:item,lv_nkey_c4,node.
         data : v_no1 type sy-tabix.
          v_no1 = v_no1 + 1.
          lv_nkey_c4  =  v_no1.
          endloop.

  • Updating problem stcd1,stcd2 fields in bsec table (one time account)

    Hi.
    I have problem to use one time customer.
    stcd1,stcd2 fields in bsec table did not input.
    Other fields have no problem.
    how can i solve it?
    Our SAP version is 4.7. package level is  SAPKH47025 (SAP_APPL).

    done

  • Problem Modifying ALV Field Catalog

    Hi,
    One grid of my ALV report displays material numbers as 0100.2000. But when I use method FILE_SAVE_DIALOG to save ALV report to Excel, the material number changes to 100.2.
    I have tried modifying my field catalog as shown at end of this message, but it doesn't change the output in Excel.
    Does anyone have a fix for this problem? I will award points! - Beth
    FORM build_fieldcatalog.
      DATA: ls_fieldcat TYPE lvc_s_fcat.
      CALL FUNCTION 'LVC_FIELDCATALOG_MERGE'
           EXPORTING
                i_structure_name = 'ZBOM_ALV'
           CHANGING
                ct_fieldcat      = gt_fieldcat.
      LOOP AT gt_fieldcat INTO ls_fieldcat where fieldname eq 'COLUMN3'.
            ls_fieldcat-DATATYPE = 'NUMC'.
            ls_fieldcat-LZERO = 'X'.
            ls_fieldcat-REF_TABLE = ''.
            ls_fieldcat-DECIMALS_O = '4'.
            ls_fieldcat-INTTYPE = 'N'.
            ls_fieldcat-OUTPUTLEN = '20'.
        MODIFY gt_fieldcat FROM ls_fieldcat.
      ENDLOOP.
    ENDFORM.                               " build_fieldcatalog

    Hi,
    If you want to save any data like 0100.2000 in the excel, you need to write it as Number with decimal places 4, so it will take 4 decimal places . coming to your ALV, you need to pass the same structure to the Excel i mean the passing variable should be lilke Number with 4 decimal places ..
    Regards
    Sudheer

  • Problem in filling the final internal table

    Hi,
    I am working on a code in which i have to fill up the final internal table which will store the values coming form different internal tables.Here's the code which i am trying to do but it is not giving the execat functionality.In this code ITOUTPUT is the final itab which is storing the values of all other internal tables.
    Here's the code:-
    loop at itab1.
      select single maktx into v_item from makt where matnr = itab1-matnr.
          ITOUTPUT-banfn = ITab1-banfn.
          ITOUTPUT-badat = ITab1-badat.
          ITOUTPUT-meins = ITab1-meins.
          ITOUTPUT-menge = ITab1-menge.
          ITOUTPUT-lfdat = ITab1-lfdat.
      IF ITAB1-MEINS = 'KG'.
        V_TOTREQ = V_TOTREQ + ITAB1-MENGE.
      ELSEIF ITAB1-MEINS = 'TO'.
        V_TOTREQ = V_TOTREQ + ( ITAB1-MENGE * 1000 ).
      ELSEIF ITAB1-MEINS = 'G'.
        V_TOTREQ = V_TOTREQ + ( ITAB1-MENGE / 1000 ).
      ENDIF.
      v_tpo = 0.
      v_por = 0.
      LOOP AT ITPO WHERE BANFN = ITAB1-BANFN AND bnfpo = ITAB1-bnfpo.
        if v_por <> '0'.
          write : / '  '.
        endif.
          ITOUTPUT-ebeln = ITPO-ebeln.
          ITOUTPUT-aedat = ITPO-aedat.
          ITOUTPUT-lifnr = ITPO-lifnr.
          ITOUTPUT-menge = ITPO-menge.
          ITOUTPUT-EINDT = ITPO-EINDT.
        IF ITAB1-MEINS = 'KG'.
          V_TOTPO = V_TOTPO + ITPO-MENGE.
        ELSEIF ITPO-MEINS = 'TO'.
          V_TOTPO = V_TOTPO + ( ITPO-MENGE * 1000 ).
        ELSEIF ITPO-MEINS = 'G'.
          V_TOTPO = V_TOTPO + ( ITPO-MENGE / 1000 ).
        ENDIF.
        v_tpo = v_tpo + itpo-menge.
        v_tgr = 0.
        v_por = 1.
        v_grr = 0.
        loop at itmrn where ebeln = itpo-ebeln and ebelp = itpo-ebelp.
          if v_grr <> '0'.
            write : / '  '.
          endif.
          select single budat from mkpf into v_grdate where MBLNR = itmrn-MBLNR.
          write: 143 Itmrn-menge,v_grdate .
            itoutput-PMENGE = itmrn-menge.
          v_tgr = v_tgr + itmrn-menge.
          v_grr = 1.
        endloop.
        p_po = itpo-menge - v_tgr.
       write: 173 p_po.
      ENDLOOP.
      p_req = itab1-menge - v_tpo.
      write :  195 p_req.
    endloop.
    loop at itoutput.
      write:/ itoutput-banfn,12 itoutput-badat,24 v_item,50 itoutput-meins,53 itoutput-menge,itoutput-lfdat,
              89 ITPO-ebeln,100 ITPO-aedat,111 ITPO-lifnr,(10) itpo-menge, ITPO-eindt.
      MODIFY itoutput.
    endloop.

    Hi,
    Ok,i ha d checked my code by using your logic and giving the run time error ......
    i had debugged my code (orignal onementioned in above thread with little modification) in which  i am able to see that finaloutput (intrenal table) is getting filled properly and the  problem arises when  the cursor comes to the write statement ... it is repeating some of the values when output is displayed where as before displaying output this iternal table is having the correct data. i am using the following code :-
    append itoutput.
      ENDLOOP.
      p_req = itab1-menge - v_tpo.
      write :  195 p_req.
      append itoutput.          ,<---  added this
      clear itoutput.               <--- added this
    endloop.
    loop at itoutput.
      write:/ itoutput-banfn,12 itoutput-badat,24 v_item,50 itoutput-meins,53 itoutput-menge,itoutput-lfdat,
              89 ITPO-ebeln,100 ITPO-aedat,111 ITPO-lifnr,(10) itpo-menge, ITPO-eindt.
      MODIFY itoutput.         <------ not removed
    endloop.

  • Urgent problem: grouping by fields of internal table

    Hi friend,
    i have a urgent problem and i hope that you can help me out:
    i have an internal table containing data, and i sorted it by 3 fields.
    now what i want to do is kind of grouping that means that all the lines that are the same should be written into another internal table like this:
    A
    A
    B
    B
    B
    C
    D
    would give me:
    A                       1
    A                       1
    B                       2
    B                       2
    B                       2
    C                       3
    D                       4
    How could i do this ( especially avoiding nested loops ? ) Is there a handy trick to do this efficiently ?
    thank you, i will give points immediately,
    Clemens

    Hello,
    The field position is important for the fields that are using in the control break statements..Also SORT internal table is required.
    http://help.sap.com/saphelp_nw2004s/helpdata/en/fc/eb381a358411d1829f0000e829fbfe/content.htm
    DATA: BEGIN OF ITAB OCCURS 0,
    MATNR TYPE MATNR,
    WERKS TYPE WERKS_D,
    VALUE TYPE NETPR,
    END OF ITAB.
    ITAB-MATNR = 'ABC'.
    ITAB-WERKS = '0100'.
    ITAB-VALUE = '10.00'.
    APPEND ITAB.
    ITAB-MATNR = '1ABC'.
    ITAB-WERKS = '0100'.
    ITAB-VALUE = '10.00'.
    APPEND ITAB.
    SORT ITAB BY MATNR WERKS.
    LOOP AT ITAB.
    AT FIRST.
      WRITE : 'AT FIRST'.
    ENDAT.
    AT NEW MATNR.
      WRITE : 'AT NEW MATERIAL NUMBER'.
    ENDAT.
    AT END OF MATNR.
      SUM.
      WRITE: / ITAB-MATNR, 'MATERIAL TOTAL - ', ITAB-VALUE.
    ENDAT.
    AT END OF WERKS.
      SUM.
      WRITE: / ITAB-WERKS, 'PLANT TOTAL - ', ITAB-VALUE.
    ENDAT.
    AT LAST.
      WRITE : 'AT LAST'.
    ENDAT.
    ENDLOOP.
    Regards,
    Deepu.K

  • Problem in filling up the setup tables for 2LIS_11_VAHDR (All SD Data sources)

    Hello All,
    I have been  trying to fillup the setup tables for SD datasources( Application-11 Ex:2LIS_11_VAHDR), but it was not allowing me to do that.
    Below are the steps i have followed,
    1.Deleted the setup tables using tcode-LBWG- Application-11
    2.Cleared the queues in RSA7 and found 0 queues for 2LIS_11_VAHDR D.S by triggereing the I.P till it get zeroes.
    3.Checked the data in RSA3-No data found.
    4.Filling the setup tables using OLI7BW t-code, got a popu(Data for 2LIS_11_VAHDR has to still transfered)
    Do i need clear all the queues for SD-Billings,Orders e.t.c  since i have 8 data sources to be cleared apart from 2LIS_11_VAHDR .
    Could you please suggest any other option to fillup the setup tables.
    Regards,
    Siva

    Did you run the infopackage twice pertaining to 2lis_11_vahdr.One for delta and another time for repeat delta.As delta queue will hold the records in repeat delta mode as well.
    Also in case of Direct Delta --Data is transferred to Base tables and delta queue (RSA7) at the same time.So extraction queue (LBWG )and update tables(SM13) does not come into the picture.
    Regards,
    AL

  • Problem updating date field on user table

    Hi,
    I am having difficulty updating the value for a date field on a user defined table.  All of the other fields update fine.  Below is the code I am using.  Does anyone have any suggestions?  I have tried updating to both a date variable or a string variable.  Thanks in advance for your help
    Dim d As Date
        d = CDate("01/01/2004")
        pRecord.GetByKey (editForm.Items("Code").Specific.String)
        pRecord.UserFields("U_CardCode").Value = editForm.Items("CardCode").Specific.String
        pRecord.UserFields("U_CardNbr").Value = editForm.Items("CardNbr").Specific.String
        pRecord.UserFields("U_CardType").Value = editForm.Items("CardType").Specific.String
        pRecord.UserFields("U_ExpDate").Value = d
        pRecord.UserFields("U_Name").Value = editForm.Items("Name").Specific.String
        pRecord.UserFields("U_CVN").Value = editForm.Items("CVN").Specific.String
        pRecord.UserFields("U_Addr1").Value = editForm.Items("Addr1").Specific.String
        pRecord.UserFields("U_Addr2").Value = editForm.Items("Addr2").Specific.String
        pRecord.UserFields("U_City").Value = editForm.Items("City").Specific.String
        pRecord.UserFields("U_State").Value = editForm.Items("State").Specific.String
        pRecord.UserFields("U_Zip").Value = editForm.Items("Zip").Specific.String
        If editForm.Mode = fm_UPDATE_MODE Then
            pRecord.Update
        End If

    I think I have figured it out.  The cardtype field (which I was also updating) has a list of valid values.  If I didn't specify a value for this field none of the other fields would update either.  I'm still not sure of the reason for this behavior.

  • Problem in field catalog -help

    hi,
        i have problem while i try to pass my field catalog internal table to IT_FIELDCAT in REUSE_ALV_HIERSEQ_LIST_DISPLAY .
    FORM FIELD_CATALOG .
    CLEAR  WA_FIELDC.
    CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
    EXPORTING
        I_PROGRAM_NAME               = WA_REPID
        I_INTERNAL_TABNAME           = 'IT_HEAD' "I_INTERNAL_TABNAME
        I_STRUCTURE_NAME             = 'VBAK' "I_STRUCTURE_NAME
        I_CLIENT_NEVER_DISPLAY       = 'X'
        I_INCLNAME                   = WA_REPID "I_INCLNAME
      I_BYPASSING_BUFFER           = I_BYPASSING_BUFFER
      I_BUFFER_ACTIVE              = I_BUFFER_ACTIVE
      CHANGING
        CT_FIELDCAT                  = IT_FIELDC
    EXCEPTIONS
      INCONSISTENT_INTERFACE       = 1
      PROGRAM_ERROR                = 2
    DELETE IT_FIELDC WHERE  FIELDNAME <>  'AUTLF' AND
                            FIELDNAME <> 'KUNNR' AND
                      FIELDNAME <>   'VSBED'    AND
                      FIELDNAME <>   'LIFSK'    AND
                      FIELDNAME <>   'AUGRU' AND
                      FIELDNAME <>   'VBELN' AND
                      FIELDNAME <>   'BSTKD' AND
                      FIELDNAME <>   'ZTERM' AND
                      FIELDNAME <>   'PRSDT' AND
                      FIELDNAME <>   'INCO1' AND
                      FIELDNAME <>   'INCO2' .
    CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
    EXPORTING
        I_PROGRAM_NAME               = WA_REPID
        I_INTERNAL_TABNAME           = 'IT_ITEM' "I_INTERNAL_TABNAME
        I_STRUCTURE_NAME             = 'VBAP' "I_STRUCTURE_NAME
       I_CLIENT_NEVER_DISPLAY       = 'X'
       I_INCLNAME                   = WA_REPID "I_INCLNAME
      I_BYPASSING_BUFFER           = I_BYPASSING_BUFFER
      I_BUFFER_ACTIVE              = I_BUFFER_ACTIVE
      CHANGING
        CT_FIELDCAT                  = IT_FIELDC1
    EXCEPTIONS
      INCONSISTENT_INTERFACE       = 1
      PROGRAM_ERROR                = 2
    DELETE IT_FIELDC1 WHERE FIELDNAME <>    'POSNR'   AND
                            FIELDNAME <>    'MATNR'   AND
                            FIELDNAME <>   ' WERKS'   AND
                            FIELDNAME <>    'LPRIO'   AND
                            FIELDNAME <>    'KWMENG'  AND
                            FIELDNAME <>    'ABGRU'   AND
                            FIELDNAME <>    'MAKTX'   AND
                            FIELDNAME <>    'VDATU'   AND
                            FIELDNAME <>    'PRSDT'   AND
                            FIELDNAME <>    'VBELN' .
    LOOP AT IT_FIELDC1 INTO WA_FIELDC.
    APPEND WA_FIELDC TO IT_FIELDC.   <----
    ENDLOOP.
    *want to pass IT_FIELDC to IT_FIELDCAT in  REUSE_ALV_HIERSEQ_LIST_DISPLAY ,but getting dump error finally.
    ganesh

    Hi siva,
       when u use APPEND both the workare structure and internal table structure should be same
    use this
    LOOP AT IT_FIELDC1 INTO WA_FIELDC.
    move-corresponding  WA_FIELDC TO IT_FIELDC.
    append it_fieldc.
    ENDLOOP.
    Message was edited by:
            chandrasekhar jagarlamudi

  • Add field to condtion table

    Hi Guys:
    Can any one tell me how to add the field to condition table, I am doing pricing determination setup.
    As I can see in Extend Field Catalog for Condition Tables there are lot of feild exist, but when I at "change condition table" in right column any few field exist in fieldCat, how can I add others.

    Hi,
    See Note 21040.
    Excerpt from Note :
    "The allowed fields for conditions and access sequences are defined in the tables KOMG,
    KOMK and KOMP. The fields in tables KOMK and KOMP can be used for the definition of access
    sequences, and the fields of table KOMG as key fields for condition tables.  A field which is taken
    up into the field catalog from tables KOMK or KOMP is ONLY valid as the definition of access
    sequences and NOT as a key field for condition tables, therefore it does not appear in the selection
    list of condition key field."
    You can however add the new field to the KOMG table by following the instructions on how to add a field to the condition
    technique for pricing in the IMG. You can find the documentation in the IMG at:
    MM -> Purchasing ->Conditions -> Define Price determination process.
    Here, go to 'System Enhancements'. There is also a detailed example to explain the procedure.
    Note 566002 describes the same thing for field PSTYV. Maybe Note 12905 will also help.
    Regards,
    Purnima
    Edited by: Purnima Prem Priyan on Feb 13, 2012 3:33 PM

  • How to move field symbol internal table to internal table with header line?

    Dear all,
    hi...hereby i would like to ask how i can move field symbol internal table to a internal table?
    as i know field symbol internal table is without header line..
    so, may i know how to do this....to move field symbol internal table to internal table which consist of header line and field and record will same as field symbol internal table...in additional, my field symbol internal table is dynamic table mean everytime will have flexible columns..?
    Please advise...
    Thanks
    Regard,
    ToToRo.
    Edited by: @ToToRo@ on Aug 20, 2009 6:16 AM

    Hello,
    Try this way:
    If both the type of internal tables are same then you can directly assign dynamic internal table to static internal table.
    itab = <itab>.
    Suppose you have field symbol internal table <itab> which is different in structure from ITAB.
    Now, you can create <wa> as follow:
    FIELD-SYMBOLS <wa>.
    DATA wa TYPE REF TO DATA.
    CREATE DATA wa TYPE LINE OF <itab>.
    ASSIGN wa->* to <wa>.
    This way your work area is read.
    Using [ASSIGN COMPONENT|http://help.sap.com/saphelp_nw04/helpdata/EN/fc/eb3923358411d1829f0000e829fbfe/content.htm] syntax you can read required component of <wa>.
    Finally you can use that value to load static internal table.
    You can also refer to my thread on [Dynamic table|Re: Creating Dynamic table].
    Hope this helps!
    Thanks,
    Augustin.
    Edited by: Augustarian on Aug 20, 2009 10:06 AM

  • Problem filling Arch infostructure for COPA2_S001 - field catalog?

    I'm not sure I'm posting this ti the correct forum, but I'll give it a try.
    Archivingobject COPA2_S001 is used to archive Copa data (account based CoPa). As the profitability analysis archiving objects depend on the operating concern (generated by the customer), and must also be generated, no appropriate information structures or field catalogs can be delivered as standard with the Archive Information System (SAP AS). You must create these yourself.
    This was set up by somenone in the pst, but the Infostructue (the table cretaed for it) stays empty.
    The Infostructure is activated, the archiving process shows no errors and even the status info from the AIS shows only green lights!
    My guess that the field catalog which was set up is not correct.
    Can anyone give my some info how to be sure what the cause, how to solve it and how to fill the AIS without starting a new archiving run.
    Thanks in advance!
    Ger

    Sorry misread the message.
    Kind regards,
    Robert Loeffen
    Message was edited by:
            M. van Lieshout

  • Search Help on Table Control - Fill more than one field in the table?

    Hey everyone,
    I have built a screen with a Table Control on it... the fields of the table control are linked to an internal table...  The internal table has the line type of a structure I've defined in the data dictionary.  Within that structure in the data dictionary, I've linked some fields to search helps (For example, a MATNR and CUSTOMER search help)...  I've defined in the structure definition which fields from the search help are to be returned to which fields in the structure.
    The problem is, even though I have the search help set to export both the customer number and location when using the search help on the customer field, it still does not fill the location field within the table.  Is this a limitation of using search helps within table controls?
    I'm also finding that by defining the search help through the structure, instead of directly within the screen, the search help round button does not show up on the field, yet I can still press F4 to bring up the search help.  Is there a reason why it's not showing the search help clickable button even though it works fine using F4?
    For doing search helps in Table Controls, is it better to just build the search help, attach it directly to the field in the table, and then after the user picks the single field, use the PAI to run a select and fill the rest of the fields required?
    Thanks,
    Dallas

    Hi Dallas,
    (1)
    What  i understood is that you added a search help by defining it in the internal table type for a field customer number..in the search help you have 2 fields customer number and location...user press the search help ..then you need to fill 2 different fields or 1 field?
    if you need to fill the customer location or location (only one) then you need to set the "import" in the search help for whichever is required.....
    if you need to fill 2 or more different fields..then you can use the technique you have mentioned last , to do a select in PAI and fill the fields....but this you can use if the combination for the fields is unique...eg: u have customer number and location..if customer X can be mapped to location X and location Y..when a select statement is done there are 2 options..so in such cases it is better to leave the option to the user otherwise if there is a clear mapping like customer X can be mapped only to location X then you can use the select..
    (2)
    usually when you define it as a type in the internal table the icon doesn't show up..but you can do alternative like mentioned..go to the table,find the search help for the required field if present or create a new one if required and place the search help mentioned in the screen itself..so as to see the icon...sometimes users are adamant that they need the search help icon to be seen..so it depends on if your user
    (3)
    as in the example of customer number and location mentioned we can provide them different search helps and do the needful processing in PAI to fill the fields
    Table controls may be used for different purposes and requirements....even a checkbox,push button can be placed as a field in table control and used,but yes most of the time requirements are like what is mentioned in your case...
    Regards
    Byju

  • Problem with Field catalog

    Hi,
    I am trying to create a condition table for inventory management. I require it at material group / movement type level. I added the fields ZZMATKL (type MATKL) and ZZBWART (type BWART) in the structure KOMPBZ2 (which is present in in the include of structure KOMPBME).
    I also added the two above custom fields in table V_T161F. But when I try to create a condition table I dont find the above two fields in the field catalog.
    Please help.
    Am I using an incorrect structure?
    Thanks!!
    Aroop

    Hi Friend,
      Looking at your code, I found that you have not the fieldcatalog at all.
    You need to fill the fieldcatalog with all the fields you want to display in the alv.
    Check the following links regarding field catalog:
    http://abap-gallery.blogspot.com/2007/07/field-catalog-in-alv.html
    Check this link for sample program:
    http://www.****************/Tutorials/ALV/SampleALVGridProgram.htm
    Hope this helps you.
    Any queries, get back to me.
    Regards,
    Chandra Sekhar

Maybe you are looking for

  • Does sun Cluster 3.0/3.1 HA Oracle agent support to use Oracle spfile?

    When defining the resource, the 'parameter_file' properties is usually sets to the Oracle pfile. Is it possible to use Oracle spfile? It is said if leaving 'parameter_file' NULL, it will be default to Oracle default. Suppose leaving it NULL and with

  • No firewire after turning of mains power - SMU reset needed to fix

    Everytime I turn the mains power off on my 20" G5 imac when I reboot I've lost all my firewire connections. If I do a SMU reset they both come back. It's a new logic board having been replaced on Apple Care for the overheating and fan problems. Unfor

  • Mac - PC connection out of the box gone?

    Hey guys. When I got my mac a year and a half ago, I turned it on and automatically my old gaming PC showed as a network place. Along the way my mac (or perhaps the dell pc) lost this connection and at a few lucky times all I get to see is my mac in

  • Finding the windows directory

    With the LabVIEW application builder, I can choose to put a file, such as an ..ini file, into the windows directory. Now, I need to read the file in my program, but I can't find a variable available that returns the windows directory, so I'm just usi

  • 8520 Black Screen then reboot

    Ive only recently started to get this problem, basically my blackberry will just reboot it self without no warnings or anything, it will go to a black screen with the LED flashing red twice before resenting itself, ive looked around and found no solu