Dynamic creation of fields

Hello there,
I want to create an internal table, but some fields involved on this table must be fixed to a number. For example, while the execution of the report i get the number 9 on a certain variable, i must create 9 fields with the name "field1, field2, field3".
I've done it before creating 10 fields on my output table, and then, using that variable, saying on the field catalog that the report must show only 9 fields. But i have to put a max number of fields, so if i need more fields, 12 for example, i can't because i set a limit.
This method serves me as long as i need few fields, but if i need 100 for example?
My question is can i create fields dynamically on an output table?
Maybe doing something like creating fields with a while clause, and including this fields to the table?
I hope you can understand my question.
Sorry for my english

yes u can create fields in an internal table during runtime ..
check this sample code ..
This will solve ur purpose .. Reward if useful
*& Report  ZERUM_PROJECTION_REPORT
REPORT ZERUM_PROJECTION_REPORT ."  NO STANDARD PAGE HEADING.
TABLES: ZERNUM_TSHT_ID ,DTRESR.
TYPE-POOLS: SLIS.
FIELD-SYMBOLS: <FS1> , <EMP> , <ENAME> , <PNAME> , <WDAYS> ,<KBETR>.
DATA:W_SPMON TYPE SPMON .
*DATA: OK_CODE TYPE SY-UCOMM.
DATA: FIELDNAME(20) TYPE C.
DATA: FIELDVALUE(6) TYPE C.
DATA: W_ENAME TYPE ZEMAST-ENAM,
      W_PNAME TYPE ZPROJDTL-PJNAM ,
      W_RPERD TYPE ZERUM_TERMS_HD-RPERD.
DATA: IT_TSHT_ID TYPE STANDARD TABLE OF ZERNUM_TSHT_ID.
DATA: WA_TSHT_ID TYPE ZERNUM_TSHT_ID .
DATA: IT_TSHT_ID1 TYPE STANDARD TABLE OF ZERNUM_TSHT_ID.
DATA: WA_TSHT_ID1 TYPE ZERNUM_TSHT_ID .
DATA: W_D1(2) TYPE C,
      W_D2(2) TYPE C,
      W_D3(4) TYPE C ,
     W_V4(2) TYPE C,
      W_WDAYS TYPE I VALUE 0.
     W_V3(5) TYPE C .
DATA: W_WKOFF1 LIKE ZPROJDTL-WKOFF1,
      W_WKOFF2 LIKE ZPROJDTL-WKOFF2.
DATA: BEGIN OF IT_DAY OCCURS 0,
         DAY TYPE DTRESR-WEEKDAY,
      END OF IT_DAY .
DATA: BEGIN OF IT_DATE OCCURS 0,
       TDATE(10) TYPE C," LIKE ZERNUM_TSHT_ID-TDATE,
       DAY TYPE DTRESR-WEEKDAY,
      END OF IT_DATE.
DATA: IT_FCAT TYPE SLIS_T_FIELDCAT_ALV,
      IS_FCAT LIKE LINE OF IT_FCAT,
      LS_LAYOUT TYPE SLIS_LAYOUT_ALV.
DATA: IT_FIELDCAT TYPE LVC_T_FCAT,
      IS_FIELDCAT LIKE LINE OF IT_FIELDCAT.
DATA: NEW_TABLE TYPE REF TO DATA,
      NEW_LINE TYPE REF TO DATA,
      OB_CONT_ALV TYPE REF TO CL_GUI_CUSTOM_CONTAINER,
      OB_ALV TYPE REF TO CL_GUI_ALV_GRID.
     VG_CAMPOS(255) TYPE C,
     I_CAMPOS LIKE TABLE OF VG_CAMPOS,
     VG_CAMPO(30) TYPE C,
     VG_TABLES(60) TYPE C.
*DATA: e_params LIKE zutsvga_alv_01.
FIELD-SYMBOLS: <L_TABLE> TYPE TABLE,
               <L_LINE> TYPE ANY,
               <L_FIELD> TYPE ANY.
*<FS1> .
***alv declarations******
DATA: OK_CODE LIKE SY-UCOMM,
     IT_TSHT_ID TYPE TABLE OF IT_TYPES,"ZERNUM_TSHT_ID,
     IT_TSHT_ID TYPE IT_TYPES OCCURS 0 WITH HEADER LINE ,
      G_CONTAINER TYPE SCRFNAME VALUE 'SCR_100_CONTAINER',
      GRID  TYPE REF TO CL_GUI_ALV_GRID,
      G_CUSTOM_CONTAINER TYPE REF TO CL_GUI_CUSTOM_CONTAINER,
      GS_VARIANT   TYPE DISVARIANT,
      G_REPID LIKE SY-REPID,
      GS_PRINT    TYPE LVC_S_PRNT.
DATA : GS_LAYOUT   TYPE LVC_S_LAYO,
       IT_TOOLBAR TYPE UI_FUNCTIONS,
       GT_FIELDCAT TYPE LVC_T_FCAT WITH HEADER LINE,
       IT_SORT TYPE LVC_T_SORT.
      CLASS LCL_EVENT_HANDLER DEFINITION
CLASS LCL_EVENT_HANDLER DEFINITION.
  PUBLIC SECTION.
    METHODS:
      HANDLE_HOTSPOT_CLICK FOR EVENT HOTSPOT_CLICK OF CL_GUI_ALV_GRID
         IMPORTING E_ROW_ID E_COLUMN_ID ES_ROW_NO.
ENDCLASS.                    "LCL_EVENT_HANDLER DEFINITION
      CLASS LCL_EVENT_HANDLER IMPLEMENTATION
CLASS LCL_EVENT_HANDLER IMPLEMENTATION.
  METHOD HANDLE_HOTSPOT_CLICK.
    PERFORM HANDLE_HOTSPOT_CLICK USING E_ROW_ID E_COLUMN_ID ES_ROW_NO .
  ENDMETHOD.                    "HANDLE_HOTSPOT_CLICK
ENDCLASS.                    "LCL_EVENT_HANDLER IMPLEMENTATION
DATA: GR_EVENT_HANDLER TYPE REF TO LCL_EVENT_HANDLER .
*SO_MONTH FOR SPMON OBLIGATORY,
SELECTION-SCREEN BEGIN OF BLOCK BLOCK1 WITH FRAME TITLE TEXT-001.
SELECT-OPTIONS : SO_SPMON FOR W_SPMON OBLIGATORY,
                 SO_TDATE FOR ZERNUM_TSHT_ID-TDATE OBLIGATORY,
                 SO_EMPID FOR ZERNUM_TSHT_ID-EMPID MATCHCODE OBJECT ZSH_EID,
                 SO_PCODE FOR ZERNUM_TSHT_ID-PJCOD MATCHCODE OBJECT ZSH_PCODE.
                SO_WYOFF FOR DTRESR-WEEKDAY NO INTERVALS.
SELECTION-SCREEN END OF BLOCK BLOCK1.
**AT SELECTION-SCREEN ON VALUE-REQUEST FOR SO_WYOFF-LOW .
  PERFORM F4_DAY .
AT SELECTION-SCREEN ON VALUE-REQUEST FOR SO_SPMON-LOW .
  PERFORM MONAT_F4 USING SO_SPMON-LOW.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR SO_SPMON-HIGH .
  PERFORM MONAT_F4 USING SO_SPMON-HIGH.
AT SELECTION-SCREEN OUTPUT.
  LOOP AT SCREEN.
    IF SCREEN-NAME = 'SO_TDATE-LOW' OR SCREEN-NAME = 'SO_TDATE-HIGH'.
      SCREEN-INPUT = 0.
      MODIFY SCREEN .
    ENDIF.
  ENDLOOP.
AT SELECTION-SCREEN .
  IF SO_SPMON-HIGH IS INITIAL .
    SO_SPMON-HIGH = SO_SPMON-LOW .
  ENDIF.
  REFRESH SO_TDATE.
  SO_TDATE-LOW = SO_SPMON-LOW .
  SO_TDATE-LOW+6(2) = 01 .
  SO_TDATE-HIGH = SO_SPMON-HIGH .
  SO_TDATE-HIGH+6(2) = 01 .
  DATA: W_DATE TYPE BEGDA ,
        W_LDATE LIKE SY-DATUM .
WRITE SO_TDATE-HIGH TO W_DATE USING EDIT MASK '..----'.
  W_DATE6(2) = SO_TDATE-HIGH6(2) .
  W_DATE4(2) = SO_TDATE-HIGH4(2) .
  W_DATE0(4) = SO_TDATE-HIGH0(4) .
CLEAR SO_TDATE-HIGH.
  CALL FUNCTION 'LAST_DAY_OF_MONTHS'
    EXPORTING
      DAY_IN            = W_DATE
    IMPORTING
      LAST_DAY_OF_MONTH = W_LDATE
    EXCEPTIONS
      DAY_IN_NO_DATE    = 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.
  SO_TDATE-HIGH = W_LDATE .
  APPEND SO_TDATE .
START-OF-SELECTION .
  PERFORM GET_DATA .
  PERFORM DISPLAY .
*&      Form  GET_DATA
      text
-->  p1        text
<--  p2        text
FORM GET_DATA .
  IF SO_TDATE-OPTION IS INITIAL .
   MESSAGE S000(ZERUM_MSG) WITH 'Enter required fields' .
    STOP.
  ENDIF.
  SELECT * INTO TABLE IT_TSHT_ID FROM ZERNUM_TSHT_ID WHERE TDATE IN SO_TDATE
                                            AND EMPID IN SO_EMPID
                                            AND PJCOD IN SO_PCODE .
  IF SY-SUBRC NE 0 .
    MESSAGE S000(ZERUM_MSG) WITH 'No records found' .
    STOP.
  ENDIF.
  SORT IT_TSHT_ID BY EMPID PJCOD TDATE .
  DATA: W_V1 TYPE I ,W_TDATE LIKE SY-DATUM .
  W_V1 = ( SO_TDATE-HIGH - SO_TDATE-LOW ) + 1.
  W_TDATE = SO_TDATE-LOW .
  DO W_V1 TIMES .
    CALL FUNCTION 'DATE_TO_DAY'
      EXPORTING
        DATE    = W_TDATE
      IMPORTING
        WEEKDAY = IT_DATE-DAY.
   CONCATENATE SO_TDATE-LOW6(2) SO_TDATE-LOW4(2)  SO_TDATE-LOW+2(2) INTO IT_DATE-TDATE SEPARATED BY '.' .
    IT_DATE-TDATE = W_TDATE .
    APPEND IT_DATE .
   IF SO_TDATE-LOW GT SO_TDATE-HIGH .
     EXIT.
   ENDIF.
    W_TDATE = W_TDATE + 1 .
  ENDDO.
EMPLOYEE ID
  IS_FCAT-FIELDNAME = 'EMPID'.
  IS_FCAT-REF_FIELDNAME = 'EMPID'.
  IS_FCAT-REF_TABNAME = 'ZERNUM_TSHT_ID'.
  APPEND IS_FCAT TO IT_FCAT.
EMPLOYEE NAME
  IS_FCAT-FIELDNAME = 'ENAME'.
  IS_FCAT-REF_FIELDNAME = 'ENAME'.
  IS_FCAT-REF_TABNAME = 'ZERNUM_TSHT_HD'.
  APPEND IS_FCAT TO IT_FCAT.
PROJECT NAME
  IS_FCAT-FIELDNAME = 'PJNAM'.
  IS_FCAT-REF_FIELDNAME = 'PJNAM'.
  IS_FCAT-REF_TABNAME = 'ZPROJDTL'.
  APPEND IS_FCAT TO IT_FCAT.
  DATA CELLCOLOR TYPE LVC_T_SCOL .
*NO OF DAYS
  IS_FCAT-FIELDNAME = 'WDAYS'.
  IS_FCAT-DATATYPE = 'INTEGER'.
  APPEND IS_FCAT TO IT_FCAT.
*RATE
IS_FCAT-FIELDNAME = 'W_RPERD'.
IS_FCAT-DATATYPE = 'KBETR'.
IS_FCAT-REF_TABNAME = 'KONV'.
APPEND IS_FCAT TO IT_FCAT.
*REVENUE YEARNED
  IS_FCAT-FIELDNAME = 'KBETR'.
  IS_FCAT-REF_FIELDNAME = 'KBETR'.
  IS_FCAT-REF_TABNAME = 'KONV'.
  APPEND IS_FCAT TO IT_FCAT.
DAYS FROM THE TIME SHEET
  LOOP AT IT_DATE .
    IS_FCAT-FIELDNAME = IT_DATE-TDATE.
    IS_FCAT-REF_FIELDNAME = 'DATLO'.
    IS_FCAT-REF_TABNAME = 'SYST'.
   TRANSLATE IT_DATE-DAY  TO UPPER CASE.
   IF IT_DATE-DAY EQ 'Sunday'.
     IS_FCAT-EMPHASIZE = 'X' .
   ENDIF.
   IF IT_DATE-DAY NE 'L' OR IT_DATE-DAY NE 'W'.
     IS_FCAT-EMPHASIZE = 'X' .
   ENDIF.
    APPEND IS_FCAT TO IT_FCAT.
    CLEAR IS_FCAT.
  ENDLOOP.
***NO OF DAYS
IS_FCAT-FIELDNAME = 'WDAYS'.
IS_FCAT-DATATYPE = 'INTEGER'.
APPEND IS_FCAT TO IT_FCAT.
***REVENUE YEARNED
IS_FCAT-FIELDNAME = 'KBETR'.
IS_FCAT-REF_FIELDNAME = 'KBETR'.
IS_FCAT-REF_TABNAME = 'KONV'.
APPEND IS_FCAT TO IT_FCAT.
  LOOP AT IT_FCAT INTO IS_FCAT.
    IS_FIELDCAT-FIELDNAME = IS_FCAT-FIELDNAME.
    IS_FIELDCAT-REF_FIELD = IS_FCAT-REF_FIELDNAME.
    IS_FIELDCAT-REF_TABLE = IS_FCAT-REF_TABNAME.
    APPEND IS_FIELDCAT TO IT_FIELDCAT.
   CONCATENATE IS_FIELDCAT-REF_TABLE IS_FIELDCAT-REF_FIELD
   INTO VG_CAMPOS SEPARATED BY '~'.
   APPEND VG_CAMPOS TO I_CAMPOS.
  ENDLOOP.
  CALL METHOD CL_ALV_TABLE_CREATE=>CREATE_DYNAMIC_TABLE
    EXPORTING
      IT_FIELDCATALOG = IT_FIELDCAT
    IMPORTING
      EP_TABLE        = NEW_TABLE.
*... Creating work area
  ASSIGN NEW_TABLE->* TO <L_TABLE>.
  CREATE DATA NEW_LINE LIKE LINE OF <L_TABLE>.
  ASSIGN NEW_LINE->* TO <L_LINE>.
  LOOP AT IT_TSHT_ID INTO WA_TSHT_ID.
   AT NEW EMPID.
   ON CHANGE OF IT_TSHT_ID-EMPID .
    ON CHANGE OF WA_TSHT_ID-EMPID OR WA_TSHT_ID-PJCOD.
      ASSIGN COMPONENT 'EMPID' OF STRUCTURE <L_LINE> TO <EMP>.
      <EMP> = WA_TSHT_ID-EMPID .
      SELECT SINGLE ENAM INTO W_ENAME FROM ZEMAST WHERE EID = WA_TSHT_ID-EMPID .
      ASSIGN COMPONENT 'ENAME' OF STRUCTURE <L_LINE> TO <ENAME>.
      <ENAME> = W_ENAME .
     ON CHANGE OF WA_TSHT_ID-PJCOD.
     AT NEW PJCOD.
      SELECT SINGLE PJNAM WKOFF1 WKOFF2 INTO (W_PNAME, W_WKOFF1, W_WKOFF2) FROM ZPROJDTL WHERE PJCOD = WA_TSHT_ID-PJCOD .
      ASSIGN COMPONENT 'PJNAM' OF STRUCTURE <L_LINE> TO <PNAME>.
      <PNAME> = W_PNAME .
      SELECT SINGLE RPERD INTO W_RPERD FROM ZERUM_TERMS_HD WHERE PJCOD = WA_TSHT_ID-PJCOD .
      ASSIGN COMPONENT 'KBETR' OF STRUCTURE <L_LINE> TO <KBETR>.
     <KBETR> = W_RPERD .
      LOOP AT IT_DATE .
  ON CHANGE OF EMPID .
        READ TABLE IT_TSHT_ID INTO WA_TSHT_ID WITH KEY TDATE = IT_DATE-TDATE EMPID = WA_TSHT_ID-EMPID PJCOD = WA_TSHT_ID-PJCOD.
        IF SY-SUBRC EQ 0 .
          FIELDNAME = IT_DATE-TDATE .
          FIELDVALUE = 'W'.
          W_WDAYS = W_WDAYS + 1 .
           W_V4 = WA_TSHT_ID-HURWK+0(2) .
           W_V2 = WA_TSHT_ID-HURWK+2(2).
           CONCATENATE W_V4 '.' W_V2 INTO W_V3 .
           FIELDVALUE = W_V3 .
          ASSIGN COMPONENT  FIELDNAME OF STRUCTURE <L_LINE> TO <FS1>.
          <FS1> = FIELDVALUE.
        ELSE.
          IF IT_DATE-DAY EQ W_WKOFF1 OR IT_DATE-DAY EQ W_WKOFF2.
            FIELDNAME = IT_DATE-TDATE .
            FIELDVALUE = 'L' .
            ASSIGN COMPONENT  FIELDNAME OF STRUCTURE <L_LINE> TO <FS1>.
            <FS1> = FIELDVALUE.
            CONTINUE.
          ENDIF.
          FIELDNAME = IT_DATE-TDATE .
          FIELDVALUE = 'O' .
          ASSIGN COMPONENT  FIELDNAME OF STRUCTURE <L_LINE> TO <FS1>.
          <FS1> = FIELDVALUE.
        ENDIF.
        AT LAST .
          ASSIGN COMPONENT 'WDAYS' OF STRUCTURE <L_LINE> TO <WDAYS>.
          <WDAYS> = W_WDAYS .
          <KBETR> = W_RPERD * W_WDAYS.
          W_WDAYS = 0.
          CLEAR W_RPERD.
          APPEND <L_LINE> TO <L_TABLE> .
        ENDAT.
      ENDLOOP.
       APPEND <L_LINE> TO <L_TABLE> .
     ENDON.
      APPEND <L_LINE> TO <L_TABLE> .
    ENDON .
  ENDLOOP .
ENDFORM.                    " GET_DATA
*&      Form  DISPLAY
      text
-->  p1        text
<--  p2        text
FORM DISPLAY .
  CALL SCREEN 100.
ENDFORM.                    " DISPLAY
*&      Module  INITIALIZE_ALV  OUTPUT
      text
MODULE INITIALIZE_ALV OUTPUT.
  DATA: ET_TOOLBAR_EXCLUDING  TYPE  UI_FUNCTIONS .
  IF G_CUSTOM_CONTAINER IS INITIAL.
    CREATE OBJECT G_CUSTOM_CONTAINER
    EXPORTING
    CONTAINER_NAME = 'SCR_100_CONTAINER'.
    CREATE OBJECT GRID
    EXPORTING
    I_PARENT = G_CUSTOM_CONTAINER.
  ENDIF.
  CREATE OBJECT GR_EVENT_HANDLER.
  SET HANDLER GR_EVENT_HANDLER->HANDLE_HOTSPOT_CLICK FOR GRID .
  GS_LAYOUT-GRID_TITLE = 'Actual  '(100).
GS_LAYOUT-CTAB_FNAME = 'CT'.
  GS_LAYOUT-CWIDTH_OPT = 'X'.
  GS_LAYOUT-ZEBRA = 'X'.
GS_LAYOUT-EDIT = 'X'.
  PERFORM ALV_FIELDCAT .
  PERFORM SORT_BUILD USING 'EMPID' '' 'X' '' '' '' .
  PERFORM SORT_BUILD USING 'ENAME' '' 'X' '' 'X' '' .
  CALL METHOD GRID->SET_TABLE_FOR_FIRST_DISPLAY
    EXPORTING
     I_STRUCTURE_NAME     = 'IT_TYPES'
      I_SAVE               = 'A'
      IS_VARIANT           = GS_VARIANT
      IS_LAYOUT            = GS_LAYOUT
      IT_TOOLBAR_EXCLUDING = ET_TOOLBAR_EXCLUDING
    CHANGING
      IT_FIELDCATALOG      = GT_FIELDCAT[]
      IT_SORT              = IT_SORT[]
      IT_OUTTAB            = <L_TABLE>.
  CALL METHOD CL_GUI_CONTROL=>SET_FOCUS
    EXPORTING
      CONTROL = GRID.
ENDMODULE.                 " INITIALIZE_ALV  OUTPUT
*&      Form  alv_fieldcat
      text
-->  p1        text
<--  p2        text
FORM ALV_FIELDCAT .
LOOP AT <L_TABLE> INTO <L_LINE> .
ENDLOOP.
  LOOP AT IT_FCAT INTO IS_FCAT.
    IF IS_FCAT-EMPHASIZE = 'X'.
      PERFORM FIELDCATLOG USING SY-TABIX '' '' IS_FCAT-FIELDNAME 'X' 'C6' .
    ELSE.
      PERFORM FIELDCATLOG USING SY-TABIX '' '' IS_FCAT-FIELDNAME 'X' '' .
    ENDIF.
  ENDLOOP.
ENDFORM.                    " alv_fieldcat
*&      Form  FIELDCATLOG
      text
     -->P_SY_TABIX  text
     -->P_0483   text
     -->P_0484   text
     -->P_IS_FCAT_FIELDNAME  text
     -->P_0486   text
     -->P_0487   text
FORM FIELDCATLOG  USING    P_SY_TABIX
                           VALUE(P_0483)
                           VALUE(P_0484)
                           P_IS_FCAT_FIELDNAME
                           VALUE(P_0486)
                           VALUE(P_0487).
DATA W_SCRTXT(10) TYPE C.
  CLEAR GT_FIELDCAT.
  IF P_IS_FCAT_FIELDNAME EQ 'ENAME' .
    GT_FIELDCAT-SCRTEXT_L = 'Employee Name' .
   GT_FIELDCAT-TABNAME = 'ZEMAST' .
  ELSEIF P_IS_FCAT_FIELDNAME EQ 'PJNAM'.
    GT_FIELDCAT-SCRTEXT_L = 'Project Name' .
   GT_FIELDCAT-TABNAME = 'ZPROJDTL' .
  ELSEIF P_IS_FCAT_FIELDNAME EQ 'EMPID' .
    GT_FIELDCAT-SCRTEXT_L = 'EmpId' .
    GT_FIELDCAT-HOTSPOT = 'X' .
   GT_FIELDCAT-TABNAME = 'ZERNUM_TSHT_ID' .
  ELSEIF P_IS_FCAT_FIELDNAME EQ 'WDAYS' .
    GT_FIELDCAT-SCRTEXT_L = 'Total Worked Days' .
   GT_FIELDCAT-EDIT = 'X' .
  ELSEIF P_IS_FCAT_FIELDNAME EQ 'KBETR' .
    GT_FIELDCAT-SCRTEXT_L = 'Total Amount' .
  ELSE.
    CONCATENATE P_IS_FCAT_FIELDNAME6(2) P_IS_FCAT_FIELDNAME4(2)  P_IS_FCAT_FIELDNAME+2(2) INTO GT_FIELDCAT-SCRTEXT_L  SEPARATED BY '.' .
   CONDENSE W_SCRTXT NO-GAPS.
   GT_FIELDCAT-OUTPUTLEN = '10' .
   W_SCRTXT = P_IS_FCAT_FIELDNAME .
   GT_FIELDCAT-SCRTEXT_L      = P_IS_FCAT_FIELDNAME.
  ENDIF.
GT_FIELDCAT-SCRTEXT_L      = P_IS_FCAT_FIELDNAME.
  GT_FIELDCAT-COL_POS       =  P_SY_TABIX.
  GT_FIELDCAT-FIELDNAME     =  P_IS_FCAT_FIELDNAME.
  GT_FIELDCAT-TABNAME       =  P_0483.
  GT_FIELDCAT-OUTPUTLEN     =  P_0484.
  GT_FIELDCAT-DO_SUM        =  P_0486.
  GT_FIELDCAT-EMPHASIZE     =  P_0487.
  APPEND GT_FIELDCAT.
ENDFORM.                    " FIELDCATLOG
*&      Module  STATUS_0100  OUTPUT
      text
MODULE STATUS_0100 OUTPUT.
  SET PF-STATUS 'MENU' OF PROGRAM 'ZERUM_EMP_TIMS'.
  SET TITLEBAR '101'.
ENDMODULE.                 " STATUS_0100  OUTPUT
*&      Module  EXIT  INPUT
      text
MODULE EXIT INPUT.
  CALL METHOD G_CUSTOM_CONTAINER->FREE.
  IF OK_CODE EQ 'E_BAK'.
    LEAVE TO SCREEN 0.
  ELSE.
    LEAVE PROGRAM.
  ENDIF.
ENDMODULE.                 " EXIT  INPUT
*&      Form  F4_DAY
      text
-->  p1        text
<--  p2        text
FORM F4_DAY .
  REFRESH IT_DAY .
  APPEND 'Sunday' TO IT_DAY .
  APPEND 'Monday' TO IT_DAY .
  APPEND 'Tuesday' TO IT_DAY .
  APPEND 'Wed.' TO IT_DAY .
  APPEND 'Thursday' TO IT_DAY .
  APPEND 'Friday' TO IT_DAY .
  APPEND 'Sat.' TO IT_DAY .
  CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
  EXPORTING
  DDIC_STRUCTURE         = ' '
    RETFIELD               = 'SO_WYOFF-LOW'
  PVALKEY                = ' '
   DYNPPROG               = SY-REPID
   DYNPNR                 = SY-DYNNR
   DYNPROFIELD            = 'SO_WYOFF-LOW'
  STEPL                  = 0
  WINDOW_TITLE           =
  VALUE                  = ' '
   VALUE_ORG              = 'S'
  MULTIPLE_CHOICE        = ' '
  DISPLAY                = ' '
  CALLBACK_PROGRAM       = ' '
  CALLBACK_FORM          = ' '
  MARK_TAB               =
IMPORTING
  USER_RESET             =
  TABLES
    VALUE_TAB              = IT_DAY
  FIELD_TAB              = IT_FT
  RETURN_TAB             =
  DYNPFLD_MAPPING        = IT_DM
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.
ENDFORM.                                                    " F4_DAY
*&      Form  SORT_BUILD
      text
     -->P_0681   text
     -->P_0682   text
     -->P_0683   text
     -->P_0684   text
     -->P_0685   text
     -->P_0686   text
FORM SORT_BUILD  USING    VALUE(P_0681)
                          VALUE(P_0682)
                          VALUE(P_0683)
                          VALUE(P_0684)
                          VALUE(P_0685)
                          VALUE(P_0686).
  DATA: LS_SORT TYPE LVC_S_SORT.
  LS_SORT-FIELDNAME = P_0681.
  LS_SORT-SPOS      = P_0682.
  LS_SORT-UP        = P_0683.
  LS_SORT-DOWN    = P_0684.
  LS_SORT-SUBTOT     =  P_0685.
  LS_SORT-OBLIGATORY =  P_0686.
  APPEND LS_SORT TO IT_SORT.
  CLEAR LS_SORT.
ENDFORM.                    " SORT_BUILD
*&      Form  HANDLE_HOTSPOT_CLICK
      text
     -->P_E_ROW_ID  text
     -->P_E_COLUMN_ID  text
     -->P_ES_ROW_NO  text
FORM HANDLE_HOTSPOT_CLICK  USING    P_E_ROW_ID TYPE LVC_S_ROW
                                    P_E_COLUMN_ID TYPE LVC_S_COL
                                    P_ES_ROW_NO TYPE LVC_S_ROID.
  DATA: W_PJCOD LIKE ZPROJDTL-PJCOD,
        W_LDATE LIKE SY-DATUM,
        W_HDATE LIKE SY-DATUM .
  READ TABLE <L_TABLE> INTO <L_LINE> INDEX P_E_ROW_ID .
  ASSIGN COMPONENT 'EMPID' OF STRUCTURE <L_LINE> TO <EMP>.
  ASSIGN COMPONENT 'PJNAM' OF STRUCTURE <L_LINE> TO <PNAME>.
  SELECT SINGLE PJCOD INTO W_PJCOD FROM ZPROJDTL WHERE PJNAM = <PNAME> .
  W_LDATE = SO_TDATE-LOW .
  W_HDATE = SO_TDATE-HIGH .
EXPORT W_LDATE TO MEMORY ID 'W_LDATE' .
EXPORT W_HDATE TO MEMORY ID 'W_HDATE' .
  SUBMIT ZERUM_EMP_TIMS WITH PA_EMPID = <EMP> WITH SO_PCODE-LOW = W_PJCOD
    WITH SO_TDATE BETWEEN W_LDATE AND W_HDATE
    AND RETURN.
*SUBMIT ZERUM_EMP_TIMS VIA SELECTION-SCREEN WITH PA_EMPID = <L_LINE>-EMPID AND RETURN.
BREAK-POINT.
ENDFORM.                    " HANDLE_HOTSPOT_CLICK
*&      Form  MONAT_F4
      text
     -->P_SO_SPMON_HIGH  text
FORM MONAT_F4  USING    W_MONTH TYPE SPMON.
  IF W_MONTH IS INITIAL.
    W_MONTH = SY-DATUM+0(6).
  ENDIF.
  CALL FUNCTION 'POPUP_TO_SELECT_MONTH'
    EXPORTING
      ACTUAL_MONTH               = W_MONTH
    IMPORTING
      SELECTED_MONTH             = W_MONTH
    EXCEPTIONS
      FACTORY_CALENDAR_NOT_FOUND = 01
      HOLIDAY_CALENDAR_NOT_FOUND = 02
      MONTH_NOT_FOUND            = 03.
ENDFORM.                                                    " MONAT_F4
Regards.,
S.Sivakumar

Similar Messages

  • Dynamic creation of fields in a UI Map

    Is there a possibility of dynamically creating fields in a UI Map with orafield values populated ?

    In case if you want to create a dynamic field(text field, etc) when you do some action(onclick)...
    var newField = document.createElement('input'); ----> Creating a new field(element)
    newField.setAttribute('type','text'); ----> Adding the attributes
    document.getElementById('parentId').appendChild(newField); -----> Append the new field into a place where you want

  • How to get the co-ordinates of a dynamically created input field

    Hello Frn's
    i have created a dynamic text view . but this text view is not appearing at proper position . I want palce it infront of a dynamically created input field . how can i do this ?
    as i am thinking ...i should first of all  get info about the co-ordinates of   dynamaclly creatd input field . and with respect to these co-ordinates ...set the position of  text View .
    Please suggest  your thoughts .
    Thanks and Regards
    Priyank Dixit

    Hi,
    There is no provision in WD for getting screen coordinates and then placing the UI element.
    You to add the UI element to layout editor and based on the layout type it will add the UI element to respective position.
    I would advice not to create dynamic UI elements( instead you can create them statically and then play with visibility status through context binding ). This will be more effective way and less error prone. This is also recommended practice.
    still,For dynamic creation you can refer to following wiki:
    http://wiki.sdn.sap.com/wiki/display/WDABAP/CreatingUIElementsDynamicallyinAbapWebdynpro+Application
    regards
    Manas Dua

  • Dynamic creation of TabStrip

    Hi,
    I want to create a tabstrip dynamically.The tabstrip should have 3 tabs, and in each of the tabs i want to put some UI elements like a label, input field, dropdown, tables.........etc.
    Im able to create the tabstrip and add tabs to it dynamically.
    I've even created the UI elements which i wanted to put in the tabs.............But im not able to proceed as i dont know how to add the UI elements to the tabs.......
    Can anyone tell me how to add UI elements to a tab in a tabstrip?
    Regards,
    Padmalatha.K
    Points will be rewarded.

    Hi,
    Following code will help you to understand the dynamic creation and adding them
    //Tabstrip
           IWDTabStrip tabStrip = view.createElement(IWDTabStrip.class);
           //Tab
           IWDTab tab = view.createElement(IWDTab.class);
           //Input Field
           IWDInputField inputField = view.createElement(IWDInputField.class);
           //Adding inputfield to tab
           tab.setContent(inputField);
           //Adding tab to tabstrip
           tabStrip.addTab(tab);
    //Finally add this tabstip to either your root container or some other container.
    Regards
    Ayyapparaj

  • Dynamic Creation of UI in adobe forms??

    Hi Experts,
    I need to create a dynamic interactive form and dynamic UI elements in the interactive form.
    As per my requirement I need to display a pdf and I will be getting values from the RFC's. I need to show the form segments and the UI elements only when there's a data from the RFC else not. I am unable to understand whether this requirement needs generation of the UI elements dynamically or I can do it statically as well.
    The form thus generated will be having data from the RFC which based on the data quantity may exceed to n number of pages.
    In case it needs dynamic creation can you suggest me please how to achive it in interactive forms?
    Helpful answers will be appreciated.
    Warm Regards,
    Gaurav

    Hi,
    subForm1:-
    Flow content
    Allow page breaks
    Place: following previous-----> This means when you are repeating the subform the previous one should be followed.
    Say you have a table and have 3 columns in it.
    After 1st column is completed, the next column should come with 1st comun
    After: Continue filling parent--->Continously fill the data with the parent element
    Repeat sub form min count is 1 : Minimum of 1 line item will be printed
    Height: Expand to fit is true.: If the field height is increased it automatically expands.
    For help in Adobe Press F1 or Goto Help--> Adobe Designer Help in Adobe Designer
    After installing Adobe Designer, goto the specific folder
    C:\Program Files\Adobe\Designer 8.0\EN you can get sample documents.
    For help press F1 after opening designer.
    Sub Form1: Content--> Flowed, Flow direction --> Top to bottom
                       Binding --> Check the checkbox Repeat Subform for each data item
    Subform 2: Content --> Positioned, No pagination No binding settings changes needed.
    Hey i forgot to mention the Header Subform where you create all these subforms should be flowed.
    Try it once like this and lte us know
    Edited by: Sankar Narayana on Oct 3, 2008 5:06 PM

  • Dynamic creation of date in selection variant

    Hi All,
    I have a Z program for updating a field in BOM item. One of the input field in the report is "Valid From Date". Actually the current date is automatically fetched through a function module and it is defaulted in that field. 
    Our client is using selection variant for ease of use. The problem here is old date in the selection variant  is replacing the current date. I want current date to be created automatically during insertion of variant also. How can i solve this problem. Is there any selection variable inside the variant for dynamic creation of Date?
    Thanks
    Sankar

    As I know there is no setting for this. For any std or Z report variant function with L should act same way...anyway you discuss with your ADABer.
    See the help for variables
    Selection Variables                                                                               
    The following three types of selection variables are currently          
        supported:                                                                               
    o   Table variables from TVARV                                          
            You should use these variables if you want to store static          
            information. TVARV variables are proposed by default.                                                                               
    o   Dynamic date calculations:                                          
            To use these variables, the corresponding selection field must have 
            type 'D' (date). If the system has to convert from type T to type D 
            when you select the selection variables, the VARIABLE NAME field is 
            no longer ready for input. Instead, you can only set values using   
            the input help.                                                     
            The system currently supports the following dynamic date            
            calculations:                                                       
            Today's date                                                        
           From beginning of the month to today                               
           Today's date +/- x days                                            
           First quarter ????                                                 
           Second quarter ????                                                
           Third quarter ????                                                 
           Fourth quarter ????                                                
           Today's date - xxx, today's date + yyy                             
           Previous month                                                                               
    o   User-specific variables                                            
           Prerequisite: The selection field must have been defined in the    
           program using the MEMORY ID pid addition. User-specific values,    
           which can be created either from the selection screen or from the  
           user maintenance transaction, are placed in the corresponding      
           selection fields when the user runs the program.                                                                               
    The SELECTION OPTIONS button is only supported for date variables that 
       fill select-options fields with single values.                         
    i.e means we can do that with D also.

  • Dynamic creation of internal table based on alv layout

    Hi experts!!
    I have the following request from my client:
    I am displaying an alv report and i need to download it in txt format based on the columns showed in the current layout (i.e. if the user chooses to hide some columns, then they should not appear in the txt file ). In the alv i am using the Function Modules of the alv and not ABAP Objects.
    I thought of dynamically creating the internal table, but i am not sure how to do it.
    I also thaught of creating an internal table with only one field with the maximum length, but how can i check which fields are diplayed, and how can i get their values??
    Please Help!!
    Thank u in advance!!!
    Please - no duplicate posts
    Edited by: Rob Burbank on Feb 24, 2009 2:16 PM

    After call the above said function module you will get the exporting table for field catalog ie
              call function 'REUSE_ALV_GRID_LAYOUT_INFO_GET'
                importing
                  es_layout     = ls_slis_layo
                  et_fieldcat   = lt_slis_fcat
    if you check the lt_slis_fcat internal table if the field are hide in the layout by the user then in this internal table check for field NO_OUT will X.
    Take the fields where NO_OUT ne X 
    then for creating dynamic internal table
      field-symbols :  <ptab>  type standard table.
      call method cl_alv_table_create=>create_dynamic_table
        exporting
          it_fieldcatalog =  lt_slis_fcat
        importing
          ep_table        = i_content.
      if sy-subrc = 0.
        assign i_content->* to <ptab>.
      else.
        write: 'Error creating internal table'.
        stop.
      endif.
    Here  is the dynamic internal table

  • Dynamic creation of ComponentUsage

    Hi people,
    I want to reuse a view (ViewA) in different views (ViewB, ViewC, ViewD).ViewA has a quite complex logic, so it is necessary to outsource this view.  Not only the logic, but also the count of UIElements and contextelements is quite large, for this I don't want to implement this part redundant in the views A, C and D.
    I have to use ViewA in a table in  the TablePopin UIElement. Every line of the table should have its own instance of ViewA. Is that possible?
    My idea is it, to put the view in an own component. For every tableline I need an instance of the componentUsage. My problem is now, that I'm not able to create at runtime a ComponentUsage and at designtime I don't know how many instances I need. Is it possible in webdynpro to create dynamic instances of ComponentUsage?
    If you know an other way, that prevents me from implementing the view and its logic more times, please tell me!
    Thanks in  advance,
    Thomas Morandell

    Hi Thomas,
    just for clarification. Principally it is possible in Web Dynpro to dynamically create new component usages of the same type like an existing, statically declared one. This means after having defined a component usage of type ISomeComp (component interface definition) you can dynamically create new component usages which all point to the same component interface definition ISomeComp:
    wdThis.wdGetISomeCompUsage().createComponentUsageOfSameType();
    But this dynamic creation approach implies, that you must also embed the component interface view of this component usage to the view composition dynamically; and this is (unfortunately) quite cumbersome and complicated based on the existing Web Dynpro Java API (it is not yet optimized for a simple dynamic view composition modification.
    Additionally, like Valery pointed out, the dynamic creation of new component usages is not compatible with table popins.
    Regards, Bertram

  • Accessing Dynamic Internal table fields

    Hello All,
    I have one internal table ep_tabx having 138 columns whose data is getting displayed
    by using function module reuse_alv_grid_display.
    Now my query is, i have created one custom button on the appl toolbar to download ep_tabx data.
    IF the user changes the the layout of the output at runtime and then presses that custom button
    then i have created one dynamic internal table using call method cl_alv_table_create=>create_dynamic_table suppose <dyn_table> whose struc will be that of
    dynamic fieldcatalog returned by using FM REUSE_ALV_GRID_LAYOUT_INFO_GET.
    And then I have put a loop on the int table ep_tabx and move corresponding to the int table
    <dyn_table>. But when i download the <dyn_table> data through GUI_DOWNLOAD the
    date fields data is not getting downloaded correctly. I have 4 date fields in my ep_tabx.
    In the alv grid output the date is getting displayed like 08/30/2004(ie mon/date/yr) but in download
    file it comes like 20040830(ie yr/mon/date and that too without /).How to access the dynamic
    internal tables fields separately so asto convert them in the pgm before the download.
    Kindly Help.
    Thanks in advance.
    Mansi

    Hi,
    Search in SDN you would get loads of info on accessing dynamic itab's .
    in order to convert your date format use WRITE stmt to convert the value in your itab before passing it to download FM.
    Regards,
    Raghavendra

  • Need Help in Field Symbol for Dynamically passing  table field value

    Hi All,
    In my internal table I am having data.
    I am dynamically forming table field name and substitute for the another table field name to pass DATA.
    but I am getting the Variable name insted of Value ie Data.
    I am using Field Symbol for this.
    data:
    Field-symbols <TS> type any.
    field1 type string.
    LOOP AT TABLEFIELDS INTO WA_TABLEFIELDS.
                READ TABLE  TEST  WITH KEY NAME = WA_TABLEFIELDS-FIELDNAME.
                IF SY-SUBRC = 0.
                  CONCATENATE 'WA_' WA_TABLEFIELDS-TABNAME '-' WA_TABLEFIELDS-FIELDNAME INTO  Field1.
                  Assign Field1 to <TS>.
                    ALL_VAL-VALUE = <TS>
    "After substituting the <TS>  into ALL_VAL-VALUE  field I need a DATA to be passed but the variable name is appending"*    
             APPEND ALL_VAL.
                ENDIF.
              ENDLOOP.
    kindly how to pass the value into the table.
    Thanks in advance.
    San

    Hi,
    pls assign a break point in
    CONCATENATE 'WA_' WA_TABLEFIELDS-TABNAME '-' WA_TABLEFIELDS-FIELDNAME INTO Field1.
    Assign Field1 to <TS>.
    ALL_VAL-VALUE = <TS>
       " Put a break point here and check for the value in <TS>.
    if <TS> contains value then create a work area for ALL_VAL AND PASS the Field-Symbol to that and then  append thw wa into the table...
    Hope this works out!!
    thanks

  • PO Collaboration : Invoice Creation Type field

    Hello,
    The Invoice Creation Type field in the SNC Web UI is always "Invoice Creation not allowed" irrespective of the settings to the Master Data / Transaction Data.
    Given below are the settings I ve maintained
    ECC System:
    PO -> Item Details -> Invoice Tab:
    Inv. Receipt Indicator - Checked
    GR-Bsd IV - Checked / Unchecked
    SNC System:
    Vaildation Checks - Tried both these settings:
    1. PO_INVOICE_CREATION - Active
        PO_INVOICE_DATA_ASSIGN - Active
        PO_INVOICE_RELATED_TO_PO_OR_ASN - Inactive
    2. PO_INVOICE_CREATION - Inactive
        PO_INVOICE_DATA_ASSIGN - Active
        PO_INVOICE_RELATED_TO_PO_OR_ASN - Active
    Infact, I am not able to see the Invoice tab itself in the PO details screen in SNC Web UI.
    Note : I am using the Orders.Orders05 Idoc for sending the PO from ECC to SNC system.

    Hi Bharath
    Your settings are fine
    Please do the following checks
    If you use IDocs of type ORDERS.ORDER05, SAP SNC can instead read the data for these fields from a reference document, such as a contract, that has previously been transferred via the Core Interface (CIF).
    In your PO you would have referenced a contract/agreement, Please check whether it is CIFed or not
    Also before CIFING do implement these notes
    1053121 & 828912
    Now when you send the ORDERS idoc, The RON xml reads this data and puts in structure
    <FollowUpInvoice>
      <RequirementCode>01</RequirementCode>
      <GoodsReceiptBasedInvoiceIndicator>TRUE</GoodsReceiptBasedInvoiceIndicator>
      <CustomerSelfBillingIndicator>FALSE</CustomerSelfBillingIndicator>
      <ProductTaxationCharacteristicsCode>V1</ProductTaxationCharacteristicsCode>
      </FollowUpInvoice>
    Irrespective, whether you create invoice for ASN or PO, the tab should be visible as Nikhil rightly mentioned
    In SAP SNC , Controlling Invoice Creation for POs is done by FollowUpRequirementCode as mentioned above
    Now since you are using ORDERS, you need to check you SA or Contract in Item Details Tab
    the following fields need to be checked "IR" in both cases and In Header Details Field "Invoicing Party"
    Also during creation of PO, make sure you dont check Unlimited Overdelivery in item delivery tab and even in your reference document.
    Now after implementing above two notes reCIF and try creating PO, It will work
    Please do mention whether you are able to see the above structure in your RON xml in SCM side and what details???
    Best Regards
    Vinod

  • Coloring of Particular Cells in a dynamic internal table(field symbols)

    Hi,
         I have a requirement to introduce color into some particular cells in a dynamic internal table(Field symbol) based on some conditions.I know that color can be introduced at cell level in the case of static internal table.But, can anybody tell me whether it is possible to introduce color to particular cells in the dynamic internal table(Field Symbol) .Please suggest me on this issue.
    Thanks in advance,
    Rajesh

    Hi,
    This is the sample coding for the colour cell report.
    Kindly go through it. It will helps u.
    REPORT YMS_COLOURTEST .
    DATA: BEGIN OF TP OCCURS 10, ID, NR(8), TEXT(255), END OF TP.
    DATA: LENGTH TYPE I VALUE 8, " Length of list
    TESTSTRING(15) TYPE C VALUE '012345678901234',
    WIDTH TYPE I. " Width of list
    DATA: TXT_REPORT LIKE DOKHL-OBJECT.
    START-OF-SELECTION.
    PERFORM HEADING.
    PERFORM OUTPUT_BODY.
    FORM HEADING.
    FORMAT INTENSIFIED OFF. " Remove any INTENSIFIED
    ULINE AT (WIDTH). " Upper frame border
    FORMAT COLOR COL_HEADING INTENSIFIED." Title color
    WRITE: / SY-VLINE. " Left border
    WRITE: 'No |Colour |intensified |intensified off|',
    'inverse' NO-GAP.
    WRITE: AT WIDTH SY-VLINE. " Right border
    ULINE AT (WIDTH). " Line below titles
    FORMAT COLOR OFF.
    ENDFORM.
    FORM OUTPUT_BODY.
    DO LENGTH TIMES.
    PERFORM WRITE_LINE USING SY-INDEX.
    ENDDO.
    ENDFORM.
    FORM WRITE_LINE USING COUNT TYPE I.
    DATA: HELP(14) TYPE C,
    COUNT1 TYPE I.
    COUNT1 = SY-INDEX - 1.
    WRITE: / SY-VLINE NO-GAP.
    WRITE: (4) COUNT1 COLOR COL_KEY INTENSIFIED NO-GAP.
    WRITE: SY-VLINE NO-GAP.
    CASE COUNT1.
    WHEN '0'.
    HELP = 'COL_BACKGROUND'.
    WHEN '1'.
    HELP = 'COL_HEADING'.
    WHEN '2'.
    HELP = 'COL_NORMAL'.
    WHEN '3'.
    HELP = 'COL_TOTAL'.
    WHEN '4'.
    HELP = 'COL_KEY'.
    WHEN '5'.
    HELP = 'COL_POSITIVE'.
    WHEN '6'.
    HELP = 'COL_NEGATIVE'.
    WHEN '7'.
    HELP = 'COL_GROUP'.
    ENDCASE.
    WRITE: HELP COLOR COL_KEY INTENSIFIED NO-GAP.
    WRITE: SY-VLINE NO-GAP.
    WRITE: TESTSTRING COLOR = COUNT1 INTENSIFIED NO-GAP.
    WRITE: SY-VLINE NO-GAP.
    WRITE: TESTSTRING COLOR = COUNT1 INTENSIFIED OFF NO-GAP.
    WRITE: SY-VLINE NO-GAP.
    WRITE: TESTSTRING COLOR = COUNT1 INVERSE NO-GAP.
    WRITE AT WIDTH SY-VLINE NO-GAP.
    ENDFORM.
    Thanks,
    Shankar

  • Dynamic assign in field symbols

    dynamic assign in field symbols

    Hi,
    DYNAMIC ASSIGN:
    If you do not know the name of the field that you want to assign to the field symbol when you write a program, you can use a dynamic ASSIGN statement:
    ASSIGN (<f>) TO <FS>.
    This statement assigns the field whose name is contained in the field <f> to the field symbol <FS>. You cannot use offset and length in a dynamic ASSIGN.
    At runtime, the system searches for the corresponding data object in the following order:
    If the ASSIGN statement is in a procedure, the system searches first in its local data.
    If it cannot find the object in the local data (or if the ASSIGN statement is not in a procedure), it then looks in the local data of the program.
    If the field does not exist in the global data of the program, the system looks in the table work areas declared with the TABLES statement in the main program of the current program group. A program group consists of a main program and all of the programs that are loaded into the same internal session as a result of other program calls.
    If the search is successful and a field can be assigned to the field symbol, SY-SUBRC is set to 0. Otherwise, it is set to 4, and the field symbol remains unchanged. For security reasons, you should always check the value of SY-SUBRC after a dynamic ASSIGN to prevent the field symbol pointing to the wrong area.
    Searching for the field in this way slows down the program. You should therefore only use the dynamic ASSIGN statement when absolutely necessary. If you know when you create the program that you want to assign a table work area to the field symbol, you can also use the following variant of the dynamic ASSIGN statement:
    ASSIGN TABLE FIELD (<f>) TO <FS>.
    The system then only searches within the table work areas in the main program of the current program group for the data object that is to be assigned to the field symbol. This addition is forbidden in ABAP Objects, since the latter does not support table work areas.
    Suppose we have three programs. The main program:
    REPORT demo_field_symbols_dynami_as_1.
    TABLES sbook.
    sbook-fldate = sy-datum.
    PERFORM form1 IN PROGRAM demo_form1.
    The other two programs are:
    REPORT demo_form1.
    FORM form1.
      PERFORM form2 IN PROGRAM demo_form2.
    ENDFORM.
    and
    REPORT demo_form2.
    FORM form2.
      DATA name(20) TYPE c VALUE 'SBOOK-FLDATE'.
    FIELD-SYMBOLS <fs> TYPE ANY.
      ASSIGN (name) TO <fs>.
      IF sy-subrc EQ 0.
        WRITE / <fs>.
    ENDIF.
    ENDFORM.
    The output looks something like this:
    02.06.1998
    The program group in the internal session now consists of the programs DEMO, MYFORMS1 and MYFORMS2. The field symbol <FS> is defined in MYFORMS2. After the dynamic ASSIGN statement, it points to the component FLDATE of the table work area SBOOK declared in the main program DEMO.
    REPORT demo_field_symbols_dynami_as_2 .
    TABLES sbook.
    DATA: name1(20) TYPE c VALUE 'SBOOK-FLDATE',
          name2(20) TYPE c VALUE 'NAME1'.
    FIELD-SYMBOLS <fs> TYPE ANY.
    ASSIGN TABLE FIELD (name1) TO <fs>.
    WRITE: / 'SY-SUBRC:', sy-subrc.
    ASSIGN TABLE FIELD (name2) TO <fs>.
    WRITE: / 'SY-SUBRC:', sy-subrc.
    The output is:
    SY-SUBRC:      0
    SY-SUBRC:      4
    In the first ASSIGN statement, the system finds the component FLDATE of the table work area SBOOK and SY-SUBRC is set to 0. In the second ASSIGN statement, the system does not find the field NAME1 because it is declared by the DATA statement and not by the TABLES statement. In this case, SY-SUBRC is set to 4.
    Reference: http://help.sap.com/saphelp_nw04/helpdata/en/fc/eb38d5358411d1829f0000e829fbfe/content.htm
    reward points if helpful.
    Regards,
    Ramya

  • How to delete Dynamically created input field UI Element

    Hi all,
              I want to delete dynamically created input field and label.
    Is there any method please tell.
    Thanks in advance
    Hemalatha

    Hi,
    In the WDEVENT parameter of the action handler you can find the event id.
    ***Variables
      DATA:
        lv_selected  type string.          "Selected tab value
    ***Structure and internal table for the Events and messages
      DATA:
        lt_events type WDR_EVENT_PARAMETER_LIST,
        ls_events type WDR_EVENT_PARAMETER.
    ***Field symbols
      field-symbols: <fs_value> type any.   "Attribute value in events table
    ***Move the event table to lt_events
      lt_events = wdevent->parameters.
      read table  lt_events into ls_events with key name = 'SAVE'.  "Button Id
      if sy-subrc eq 0.
        assign ls_events-value->* to <fs_value>.
        if sy-subrc eq 0.
          lv_selected  = <fs_value>.
        endif.                 "IF sy-subrc eq 0.
      endif.                 "IF sy-subrc eq 0.
    Regards,
    Lekha.

  • Validate Dynamically Generated Form Fields

    Hello, I am having difficulty in validating some text boxes I dynamically generated using javascript.
    I have done the below which is not working..... giving errors of undefined or is null
    var i=rowNum;//value of the integer giving the form field a unique name
    var thefield =(eval(document.getElementById('xxxx_'+i).value));
    if (thefield =="")
    alert("xxxxxxxxxxxxx");
    This is not working. Any one has example of validating dynamically generated form fields?

    Check out jquery and the validation plug-in by Jörn Zaefferer: http://plugins.jquery.com/project/validate
    It'll simplify your life!

Maybe you are looking for