How to use the internal table of the submitted program

Hi,
In the main program i have submitted a program and that program is running  successfully and data is populated in to it_final, now i want to use this data populated internal table it_final in my main program.
Thanks,
Sudhakar.

Hi,Mathew,
*& Report  ZMB51                                                       *
REPORT  ZMB51                                   .
DATA LIST_TAB TYPE TABLE OF ABAPLIST.
DATA: BEGIN OF olist OCCURS 0,
        filler1(1500)   TYPE c,
      END OF olist.
submit <b>RM07DOCS</b> EXPORTING LIST TO MEMORY
                 AND RETURN.
CALL FUNCTION 'LIST_FROM_MEMORY'
  TABLES
    LISTOBJECT = LIST_TAB
  EXCEPTIONS
    NOT_FOUND  = 1
    OTHERS     = 2.
IF SY-SUBRC = 0.
  CALL FUNCTION 'LIST_TO_ASCI'
    EXPORTING
      LIST_INDEX         = -1
    TABLES
      LISTASCI           = oLIST
      LISTOBJECT         = LIST_TAB
    EXCEPTIONS
      EMPTY_LIST         = 1
      LIST_INDEX_INVALID = 2
      OTHERS             = 3.
BREAK-POINT.
write:/ sy-subrc.
ENDIF.
OLIST will contain the report output that you have executed but you need to tweak this internal table so that it can be used for further processing.The current example will get you MB51 output into OLIST,so change the program name to your program name at the SUBMIT statement and then try.
K.Kiran.

Similar Messages

  • How to use an internal table of a calling program in to a called program

    Hi Experts,
                I am calling a report in another report through SUBMIT .
              I want to use the internal table of calling prog into
             called   prog but problem is i have to do it without exporting to memory id and importing it.
    Plz provide me any soln..

    Check for more information on SUBMIT
    [http://www.sapdevelopment.co.uk/reporting/rep_submit.htm]

  • *How can we use the internal table in module pool programming? Clarify plz*

    If we creating a screen using the table having four fields(for e.g.). The screen has the functions of display, modify, delete, save, exit etc for the fields. The front-end of the screen having I/O fields of the table using internal table. How can we declare the internal table in the screen?

    HI,
    Create one WA for your Internal table and then map it to your fields.
    For Example,
    Data : begin of wa,
              name(10),
              age type i,
               end of wa.
    data : it like table of wa with header line.
    Then in screen create input fields with the name, age and ***.
    Then the user entered values are stored in name age and ***.
    then you can manipulate with that values using wa.
    Thanks.

  • How to Read the internal table for the data download from the spool

    HI all,
    I have one issue regarding the spool ,we are getting the correct output as per requirement of  user but when we send the same to the user in pdf format they did notget the same.
    they are telling that the due date is missing from the pdf.
    Please advice me how to track the internal  table for the spool data converted intopdf in a readable format.
    the FM used for the above task is : 
    call function 'CONVERT_OTFSPOOLJOB_2_PDF'
    Please reply if any one worked on the same.
    Thanks in advance.
    Gaurav,

    Hi Wang,
    Please let me know how you solved your question.
    Points will be rewarded.
    Thanks,
    Arun.

  • Moving  data in all the internal tables to the final table  t_data

    hi all,
    how to data in all the internal tables to the final table  t_data
    *selecting fields from bkpf table
      SELECT     bukrs
                 belnr
                 gjahr
                 bldat
                 xblnr
                 usnam
         FROM    bkpf
         INTO TABLE t_bkpf
        WHERE  bukrs  EQ po_bukrs AND
               belnr IN  so_belnr  AND
               budat IN  so_budat  AND
               blart IN  so_blart.
      IF t_bkpf[] IS INITIAL.
        MESSAGE a999(zfi_ap_gl) WITH text-011.
        STOP.
      ELSE.
    *selecting fields from  bseg table.
        SELECT  bukrs
                belnr
                gjahr
                koart
                shkzg
                dmbtr
                zuonr
                sgtxt
                kostl
                hkont
                lifnr
                prctr
                FROM bseg
                INTO  TABLE  t_bseg
                FOR ALL ENTRIES IN t_bkpf
              WHERE bukrs EQ  t_bkpf-bukrs AND
                    belnr EQ t_bkpf-belnr AND
                    gjahr EQ t_bkpf-gjahr AND
                    lifnr IN so_lifnr.
      ENDIF.
      IF t_bseg[] IS INITIAL.
        MESSAGE a999(zfi_ap_gl) WITH text-011.
        STOP.
      ELSE.
    *selecting the companies address from adrc table
        SELECT  SINGLE addrnumber street str_suppl2 city1
                       region post_code1
                       FROM adrc
                       INTO wa_adrc
                       WHERE addrnumber EQ w_adrnr.
    *selecting adrnr from the lfa1 table
        SELECT lifnr adrnr name1 ort01 regio pstlz
                     FROM lfa1
                     INTO TABLE t_adrnr
                     FOR ALL ENTRIES IN t_bseg
                     WHERE  lifnr EQ t_bseg-lifnr.
        IF NOT t_adrnr[] IS INITIAL.
    *populating the t_vaddress table.
          SELECT  addrnumber
                  street
                  str_suppl2
                  FROM adrc
                  INTO TABLE t_vaddress
                  FOR ALL ENTRIES IN t_adrnr
                  WHERE addrnumber  EQ t_adrnr-adrnr.
    *populating the t_vendor table with the vendor address
          SELECT lifnr
                 adrnp_2
                 namev
                 name1
                 INTO TABLE t_vendor
                 FROM knvk
                 FOR ALL ENTRIES IN t_adrnr
                 WHERE  lifnr EQ t_adrnr-lifnr AND
                        adrnp_2 EQ t_adrnr-adrnr.
        ENDIF.
      ENDIF.

    Loop the internal table which is having the maximum number of records,then use read table....for other internal tables....in that loop and then append them into final internal table.
    Ex-LOOP AT IT_VBRP INTO WA_VBRP.
        WA_FINAL-WERKS = WA_VBRP-WERKS_I.
        WA_FINAL-KUNAG = WA_VBRP-KUNAG.
        WA_FINAL-AEDAT = WA_VBRP-AEDAT.
        READ TABLE IT_KONV INTO WA_KONV WITH KEY KNUMV = WA_VBRP-KNUMV
                                                 KPOSN = WA_VBRP-POSNR_I.
        IF SY-SUBRC EQ 0.
          WA_FINAL-KSCHL = WA_KONV-KSCHL.
          CLEAR WA_KONV.
        ENDIF.
        READ TABLE IT_KNA1 INTO WA_KNA1  WITH KEY KUNNR = WA_VBRP-KUNAG.
        IF SY-SUBRC EQ 0.
          WA_FINAL-NAME1 = WA_KNA1-NAME1.
          CLEAR WA_KNA1.
        ENDIF.
        ENDIF.
        APPEND WA_FINAL TO IT_FINAL.
        CLEAR: WA_FINAL,WA_KONV,wa_kna1.
      ENDLOOP.

  • How to use dynamic internal table with FOR ALL ENTRIES

    Hello SDNers,
    I am having a dynamic internal table & want to use FOR ALL ENTRIES(FAE) using this dyn. table.
    This works fine for me:
    IF <lt_tmp> IS NOT INITIAL. "<lt_tmp> is my dyn. internal table
            SELECT field1 field2
              FROM TABLE ztable
              INTO TABLE itab "Itab is a static table
              FOR ALL ENTRIES IN <lt_tmp>
              WHERE (lv_dynwhere). "lv_dynwhere -> dynamic where clause
          ENDIF.
    SAP documentation says:
    "The logical expression sql_cond of the WHERE condition can be comprised of several logical expressions using AND and OR. However, if FOR ALL ENTRIES is specified, there must be at least one comparison with a column of the internal table itab that can be specified statically or dynamically. "
    How do we specify the column of the internal table dynamically ? Can we do something like this:
    IF <lt_tmp> IS NOT INITIAL. "<lt_tmp> is my dyn. internal table
            SELECT field1 field2
              FROM TABLE
              INTO TABLE itab "Itab is a static table
              FOR ALL ENTRIES IN <lt_tmp>
              WHERE key_field1 = (dynamic token for column1 of <lt_tmp>)
                           key_field2 = (dynamic token for column2 of <lt_tmp>)
          ENDIF.
          ENDIF.
    Let me know if i am not clear about my requirement.
    BR,
    Suhas

    Hello Thomas,
    What i meant was something like this:
    WHERE key_field1 = ('<LT_TMP-COL1>') AND
          key_field2 = ('<LT_TMP-COL2>')
    I am confused by what SAP means with "dynamic representation of internal table columns" in FAE ?
    @Rob: I was referring to SAPNW 7.0 documentation & the phrase (release 6.40 & higher) is missing. Anyways fyi i am on ECC5.0 ABAP release 6.40.
    @Subhankar: This is what Marcin had proposed in For all entries and dynamic table.
    Thanks,
    Suhas
    Edited by: Suhas Saha on Apr 6, 2010 11:53 AM

  • How to use dynamic internal table when using gui_upload?

    Hi Experts,
    my scenario is like i have header data, item data and serial numbers.
    so with respect to the  quantity in unit of measure ,there will be number of serial numbers..
    i have declared the dynamic internal table,but i am not getting the logic to change the structure accordingly with respect to the flat file entries..
    is it possible to do or its not possible....any suggestion!!!!i have declared like this....
    TYPES: BEGIN OF ty_final,
          bldat TYPE string,      "Document Date
          budat TYPE string,      "Psting Date
          bktxt TYPE string,      "Document Header Text
          werks TYPE string,      "Plant
          lgort TYPE string,      "Storage Location
          matnr TYPE string,      "Material Number
          erfmg TYPE string,      "Quantity in Unit Of Entry
          anln1 TYPE string,      "Asset Number
          anln2 TYPE string,      "Asset Subnumber
          sernr TYPE string,      "serial Number
    END OF ty_final.
    DATA : it_final TYPE TABLE OF ty_final,
           wa_final TYPE ty_final.
    FIELD-SYMBOLS : <fs_final> TYPE table.
    ASSIGN it_final TO <fs_final>.
    after this i called gui upload and passed internal table it_final..
    but i have to change the internal table structure dynamically before the upload function.so that it will match with the flat file...
    Regards
    Karthick

    There are at least two approaches you can use to change/generate new dynamic-structured table. Either with [RTTI + RTTS|https://wiki.sdn.sap.com/wiki/display/Snippets/CreatingFlatandComplexInternalTablesDynamicallyusingRTTI] or using [CL_ALV_TABLE_CREATE|http://www.sdn.sap.com/irj/scn/advancedsearch?query=cl_alv_table_create] . In this one just determine fieldcatalog of current table and change it accordingly, then regenarate table.
    There are plenty of examples in SCN for this. You should not face difficulties applying this.
    Regards
    Marcin

  • Validate the data in the internal table with the date in selection screen

    Hi all,
    I want to validate the data in the internal table and get only the records with the input date in the selection screen.
    The date is in the select options and please let me know how to get the records only if it satisfies the input date in the selection screen.
    Regards,
    Shalem

    For Ex.
    SELECT-OPTIONS: S_DATE FOR VBAK-VDATU
    If you want to read one INTERNAL TABLE record
    READ TABLE it_tab(internal table name) WHERE vdatu(date field name in the internal table) = s_date
    If you want to move more then one
    LOOP AT it_tab WHERE vdatu = s_date.
    Take the field values in another table and append it. then end loop.
    you will get the records which only have the date in select option..
    If you want detail code give me internal table name and select option name i will write you the code.
    regards
    Yuvaram

  • Problem with downloading the internal table onto the presentation server.

    Hey folks,
    I have a problem where in i am downloading one year of sales done by the company. I wrote a program to download the file onto the presentation server . The error occurs in the FM GUI_DOWNLOAD where if the file exceeds 105843504 bytes its giving me a dump saying that
    When the program was running , it was established that more memory was needed than the operating system is able to safely to provide.
    The current program has to be terminted because of the program already requested 105843504 bytes from the operating system with malloc when the operating system reported after further memory request that there was no more memory space available.
    Could somebody provide an alternative soltuion for this.
    Its really urgent as i can download the file with 70,000,000 bytes
    Regards
    Rock

    Hi Rock,
    Please download the files on to Application Server, else as suggested by Ashish download into 2 or 3 files and merge them manually.
    Declare same internal tables may be 5 times.
    When you fill the internal table check for a counter and when you hit a certain number stop appending to it and start appending to the next.
    After you are done so download all the internal tables.
    I guess this would be a good way. I am not sure if there are any ther alternative good methods.
    Hope this helps.
    Shreekant

  • How to use dynamic internal table in interactive report syntax

    pls let me know

    Hi Aarif,
    Go through the below code for better understanding:
    *& Report  ZDYN_INT_TABLE_02                                           *
    REPORT  ZDYN_INT_TABLE_02.
    TYPE-POOLS: slis.                      " ALV Global types
    SELECTION-SCREEN BEGIN OF BLOCK b1.
    PARAMETERS : p_max(3) TYPE n OBLIGATORY.
    SELECTION-SCREEN END OF BLOCK b1.
    TYPES: BEGIN OF wa_gt_data,
              matnr TYPE mara-matnr,
           END OF wa_gt_data.
    DATA gt_data TYPE STANDARD TABLE OF wa_gt_data WITH HEADER LINE.
    *INITIALIZATION.
    v_1 = 'Maximum of records to read'.
    START-OF-SELECTION.
      PERFORM f_read_data.
      PERFORM f_display_data.
         Form  f_read_data
    FORM f_read_data.
      SELECT matnr INTO TABLE gt_data
               FROM mara
                 UP TO p_max ROWS.
    ENDFORM.                               " F_READ_DATA
         Form  F_DISPLAY_DATA
    FORM f_display_data.
      DATA:
        l_column    TYPE sy-tabix,
        lp_struct   TYPE REF TO data,
        lp_table    TYPE REF TO data,      " Pointer to dynamic table
        ls_lvc_cat  TYPE lvc_s_fcat,
        lt_lvc_cat  TYPE lvc_t_fcat,       " Field catalog
        lt_fcat     TYPE slis_t_fieldcat_alv,  " Field catalog
        ls_fieldcat TYPE slis_fieldcat_alv,
        lt_fieldcat TYPE slis_t_fieldcat_alv,  " Field catalog
        ls_layout   TYPE slis_layout_alv.
      FIELD-SYMBOLS :
        <header>       TYPE ANY,
        <field_header> TYPE ANY,
        <field_mara>  TYPE ANY,
        <lt_data>      TYPE table.         " Data to display
      ls_lvc_cat-fieldname = 'COLUMNTEXT'.
      ls_lvc_cat-ref_table = 'LVC_S_DETA'.
      APPEND ls_lvc_cat TO lt_lvc_cat.
      ls_fieldcat-fieldname = 'COLUMNTEXT'.
      ls_fieldcat-ref_tabname = 'LVC_S_DETA'.
      ls_fieldcat-key  = 'X'.
      APPEND ls_fieldcat TO lt_fieldcat.
      DO p_max TIMES.
      For each line, a column 'VALUEx' is created in the fieldcatalog
      Build Fieldcatalog
       WRITE sy-index TO ls_lvc_cat-fieldname LEFT-JUSTIFIED.
        CONCATENATE 'VALUE' ls_lvc_cat-fieldname
               INTO ls_lvc_cat-fieldname.
        ls_lvc_cat-ref_field = 'VALUE'.
        ls_lvc_cat-ref_table = 'LVC_S_DETA'.
        APPEND ls_lvc_cat TO lt_lvc_cat.
      Build Fieldcatalog
        CLEAR ls_fieldcat.
        ls_fieldcat-fieldname = ls_lvc_cat-fieldname.
        ls_fieldcat-ref_fieldname = 'VALUE'.
        ls_fieldcat-ref_tabname = 'LVC_S_DETA'.
        APPEND ls_fieldcat TO lt_fieldcat.
      ENDDO.
    Create internal table
      CALL METHOD cl_alv_table_create=>create_dynamic_table
        EXPORTING
          it_fieldcatalog = lt_lvc_cat
        IMPORTING
          ep_table        = lp_table.
      ASSIGN lp_table->* TO <lt_data>.
    Create structure = structure of the internal table
      CREATE DATA lp_struct LIKE LINE OF <lt_data>.
      ASSIGN lp_struct->* TO <header>.
    Create field catalog from dictionary structure
      CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
        EXPORTING
          i_structure_name       = 'MARA'
        CHANGING
          ct_fieldcat            = lt_fcat
        EXCEPTIONS
          inconsistent_interface = 1
          program_error          = 2
          OTHERS                 = 3.
      IF sy-subrc <> 0.
        MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      ENDIF.
      LOOP AT lt_fcat INTO ls_fieldcat WHERE fieldname = 'MATNR'.
        ASSIGN COMPONENT 1 OF STRUCTURE <header> TO <field_header>.
        IF sy-subrc NE 0. EXIT .ENDIF.
        READ TABLE lt_fcat INTO ls_fieldcat INDEX sy-index.
        <field_header> = ls_fieldcat-seltext_m.
        IF <field_header> IS INITIAL.
          <field_header> = ls_fieldcat-fieldname.
        ENDIF.
        LOOP AT gt_data.
          l_column = sy-tabix + 1.
          ASSIGN COMPONENT 1 OF STRUCTURE gt_data TO <field_mara>.
          IF sy-subrc NE 0. EXIT .ENDIF.
          ASSIGN COMPONENT l_column OF STRUCTURE <header> TO <field_header>.
          IF sy-subrc NE 0. EXIT .ENDIF.
          WRITE <field_mara> TO <field_header> LEFT-JUSTIFIED.
        ENDLOOP.
        APPEND <header> TO <lt_data>.
      ENDLOOP.
      ls_layout-colwidth_optimize = 'X'.
      ls_layout-no_colhead = 'X'.
      ls_layout-zebra = 'X'.
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
        EXPORTING
          is_layout   = ls_layout
          it_fieldcat = lt_fieldcat
        TABLES
          t_outtab    = <lt_data>.
    ENDFORM.                               " F_DISPLAY_DATA
    END OF PROGRAM Z_ALV_LIST_TRANSPOSED *********************
    *Always reward point for helpful answers
    Regards,
    Amit

  • Checkbox as one of the field in the internal table in the list

    Hi,
    I have a requirement of processing the certain records of the internal table for which checkboxes are selected in the list.
    The selected records need to be updated in the custom table and the unselected records need to be ignored.
    I have created the PF status and the application tool bar and a button on the tool bar.
    Then when the report is executed the list is displayed with the records with one of the field as a checkbox.
    At user-command.
    Then in the at user-command handling the button click event.
    I want to know which records are been selected and which are not.
    If some one knows please let me know.
    Thanks
    S Patel

    This is exactly what you need to do:-
    PBO
    CREATE OBJECT g_custom_container
             EXPORTING container_name = g_container.
      CREATE OBJECT g_grid
             EXPORTING i_parent = g_custom_container.
    Select data from your table
      PERFORM select_data CHANGING pt_outtab[].
    Build fieldcat
      PERFORM build_fieldcat CHANGING pt_fieldcat.
    Exclude standard buttons from the Toolbar
      PERFORM exclude_tb_functions CHANGING lt_exclude.
    Display output in ALV grid
      CALL METHOD g_grid->set_table_for_first_display
        EXPORTING
          it_toolbar_excluding = lt_exclude
        CHANGING
          it_fieldcatalog      = pt_fieldcat
          it_outtab            = pt_outtab[].
    PAI
    Get modified data
      CALL METHOD gv_grid->check_changed_data.
      LOOP AT gt_output INTO wa_output WHERE zzchkbox EQ c_x.
        MOVE-CORRESPONDING wa_output TO wa_selblk.
        APPEND wa_selblk TO lt_selblk.
      ENDLOOP.
    This method will give you all the records which are selected in the list output. Collect them and modify your custom table.
    Edited by: Rudresh Chand on Feb 28, 2010 8:26 AM

  • How to use Dynamic Internal table

    Hello,
    I have a requirement where I need to pick a field from final internal table and display that field as ALV columns and I have to pick another field in the same INternal table to display it as a corresponding value for each header DYNAMICALLY.
    lw_fieldcat-col_pos = 1.
      lw_fieldcat-tabname = 'T_FINAL'.
      lw_fieldcat-fieldname = 'ATTR20A'.
      lw_fieldcat-seltext_m = 'SUBSTANCE ID'.
      lw_fieldcat-outputlen = '21'.
      lw_fieldcat-fix_column = 'X'.
      lw_fieldcat-key = 'X'.
      APPEND lw_fieldcat TO lt_fieldcat.
      CLEAR LW_FIELDCAT.
      lw_fieldcat-col_pos = 2.
      lw_fieldcat-tabname = 'T_FINAL'.
      lw_fieldcat-fieldname = 'PRVSY'.
      lw_fieldcat-seltext_m = 'R3 MAT NBR'.
      lw_fieldcat-outputlen = '14'.
      lw_fieldcat-FIX_COLUMN = 'X'.
      lw_fieldcat-key = 'X'.
      APPEND lw_fieldcat TO lt_fieldcat.
      CLEAR LW_FIELDCAT.
    These 2 fields are constant, now i need to display fields dynamically from the field STCTS (for dynamic header) CCNGN (for the value in each header)
    In the below code the logic is working to pick appropriate value for each header.
    DATA : Y_I_FCAT  TYPE LVC_T_FCAT,
          Y_WA_FCAT LIKE LINE OF Y_I_FCAT.
    DATA : T_NEWFINAL TYPE STANDARD TABLE OF TY_FINAL,
           WA_NEWFINAL TYPE TY_FINAL.
    LOOP AT T_FINAL INTO WA_FINAL
                  WHERE STCTS IS NOT INITIAL
    CONCATENATE 'SUBID CLASSIFICATION-' WA_FINAL-STCTS
                       INTO Y_WA_FCAT-FIELDNAME.
                       INTO Y_WA_FCAT-SCRTEXT_M.
      APPEND Y_WA_FCAT TO Y_I_FCAT. "Header of column appear as
                                    'SUBID SUBID CLASSIFICATION-AR-HTS'
      CLEAR Y_WA_FCAT.
    MOVE WA_FINAL-CCNGN TO WA_NEWFINAL-CCNGN.  "HERE IT WILL PICK THE VALUE FOR THE ABOVE                                             " HEADER EX : '2345'
    *&THIS STATEMENT WILL MOVE THE KEY FIELD TO
    *&WA_NEWFINAL.
    MOVE WA_FINAL-GUID_PR TO WA_NEWFINAL-GUID_PR.
      APPEND WA_NEWFINAL TO T_NEWFINAL.
      CLEAR : WA_FINAL,
              WA_NEWFINAL.
    ENDLOOP.
    How should i pass it to the dynamic interanl table and then to the ALV grid filed catlog.
    Below is my code for refernce :
    **DATA : Y_I_FCAT  TYPE LVC_T_FCAT,
          Y_WA_FCAT LIKE LINE OF Y_I_FCAT.
          Y_WA_FCAT TYPE LVC_S_FCAT.
    **DATA : T_NEWFINAL TYPE STANDARD TABLE OF TY_FINAL,
          WA_NEWFINAL TYPE TY_FINAL.
    *DATA : W_STRING TYPE STRING.
    DATA : WA_FLNAME(32) TYPE C.
    *LOOP AT T_FINAL INTO WA_FINAL
                 WHERE STCTS IS NOT INITIAL
                   AND CCNGN IS NOT INITIAL.
    *ADD 1 TO COUNTER.
    *ENDLOOP.
    *DO COUNTER TIMES.
    LOOP AT T_FINAL INTO WA_FINAL
                  WHERE STCTS IS NOT INITIAL
                    AND CCNGN IS NOT INITIAL.
    CONCATENATE 'SUBID CLASSIFICATION-' WA_FINAL-STCTS
                      INTO Y_WA_FCAT-FIELDNAME.
                       INTO Y_WA_FCAT-SCRTEXT_M.
                        INTO WA_FLNAME.
       Y_WA_FCAT-FIELDNAME = WA_FLNAME.
       Y_WA_FCAT-SELTEXT = WA_FLNAME.
      APPEND Y_WA_FCAT TO Y_I_FCAT.
      CLEAR Y_WA_FCAT.
    MOVE WA_FINAL-CCNGN TO W_STRING.
    MOVE WA_FINAL-CCNGN TO WA_NEWFINAL-CCNGN.
    *&THIS STATEMENT WILL MOVE THE KEY FIELD TO
    *&WA_NEWFINAL.
    MOVE WA_FINAL-GUID_PR TO WA_NEWFINAL-GUID_PR.
      APPEND WA_NEWFINAL TO T_NEWFINAL.
      CLEAR : WA_FINAL,
              WA_NEWFINAL.
    ENDIF.
    *ENDDO.
    ENDLOOP.
    PERFORM CREATE_DYNAMIC_ITAB.
    LOOP AT Y_I_FCAT INTO Y_WA_FCAT. "IT_FIELDCAT INTO LW_FIELDCAT.
    MOVE :  Y_WA_FCAT-SCRTEXT_M TO LW_FIELDCAT-SELTEXT_M,
            Y_WA_FCAT-FIELDNAME TO LW_FIELDCAT-FIELDNAME,
           Y_WA_FCAT-TABNAME   TO LW_FIELDCAT-TABNAME,
           Y_WA_FCAT-COL_POS   TO LW_FIELDCAT-COL_POS,
            Y_WA_FCAT-SCRTEXT_M TO LW_FIELDCAT-SELTEXT_M.
           Y_WA_FCAT-DATATYPE  TO LW_FIELDCAT-DATATYPE,
           Y_WA_FCAT-INTLEN    TO LW_FIELDCAT-INTLEN.
    APPEND LW_FIELDCAT TO LT_FIELDCAT.
    ENDLOOP.
    ENDFORM.                    " DYNAMIC
    *&      Form  CREATE_DYNAMIC_ITAB
          text
    -->  p1        text
    <--  p2        text
    FORM CREATE_DYNAMIC_ITAB .
    *DATA : DY_TABLE TYPE REF TO DATA,
          DY_LINE TYPE REF TO DATA.
    DATA : Y_LV_COMP TYPE STRING.
    *FIELD-SYMBOLS: <DYN_TABLE> TYPE STANDARD TABLE,
                  <DYN_WA>,
                  <DYN_FIELD>.
    *FIELD-SYMBOLS : <y_fld> TYPE ANY.
    CALL METHOD CL_ALV_TABLE_CREATE=>CREATE_DYNAMIC_TABLE
      EXPORTING
        IT_FIELDCATALOG           = Y_I_FCAT
      IMPORTING
        EP_TABLE                  = DY_TABLE.
    IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
               WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    ASSIGN DY_TABLE->* TO <DYN_TABLE>.
    *CREATE DYNAMIC WORK AREA AND ASSIGN TO FS.
    CREATE DATA DY_LINE LIKE LINE OF <DYN_TABLE>.
    ASSIGN DY_LINE->* TO <DYN_WA>.
    LOOP AT T_FINAL INTO WA_FINAL.
      Y_LV_COMP = 'ATTR20A'.
      ASSIGN COMPONENT Y_LV_COMP OF STRUCTURE <DYN_WA> TO <Y_FLD>.
       <Y_FLD> = WA_FINAL-ATTR20A.
       Y_LV_COMP = 'PRVSY'.
       ASSIGN COMPONENT Y_LV_COMP OF STRUCTURE <DYN_WA> TO <Y_FLD>.
       <Y_FLD> = WA_FINAL-PRVSY.
       Y_LV_COMP = 'PRTXT'.
       ASSIGN COMPONENT Y_LV_COMP OF STRUCTURE <DYN_WA> TO <Y_FLD>.
       <Y_FLD> = WA_FINAL-PRVSY.
       Y_LV_COMP = 'GRVSY'.
       ASSIGN COMPONENT Y_LV_COMP OF STRUCTURE <DYN_WA> TO <Y_FLD>.
       <Y_FLD> = WA_FINAL-GRVSY.
    LOOP AT T_NEWFINAL INTO WA_NEWFINAL
          WHERE GUID_PR = WA_FINAL-GUID_PR.
    CONCATENATE 'SUBID Classification-'
                  WA_FINAL-STCTS
                   INTO Y_LV_COMP.
      ASSIGN COMPONENT Y_LV_COMP OF STRUCTURE <DYN_WA> TO <Y_FLD>.
          <Y_FLD> = WA_NEWFINAL-CCNGN.
    ENDLOOP.
    APPEND <DYN_WA> TO <DYN_TABLE>.
    FREE : <DYN_WA>, <Y_FLD>.
    ENDLOOP.
    ENDFORM.                    " CREATE_DYNAMIC_ITA
    ANy suggestion would be apprecaited.
    Regards,
    Kittu

    I think I need to put it in more descriptive way...
    I am closing this thread

  • How to pass the internal table data to smartforms

    Hi Gurus,
    I have a problem in passing the internal table data to the smartforms. In the print program
    I get the data into one internal table "LT_PRDLBL1". I am passing this internal table to the other in print program by calling the FM_NAME.
    CALL FUNCTION fm_name
      EXPORTING
      ARCHIVE_INDEX              =
      ARCHIVE_INDEX_TAB          =
      ARCHIVE_PARAMETERS         =
        CONTROL_PARAMETERS         = T_SSFCTRLOP
      MAIL_APPL_OBJ              =
      MAIL_RECIPIENT             =
      MAIL_SENDER                =
        OUTPUT_OPTIONS             = T_SSFCOMPOP
        USER_SETTINGS              = ' '
    IMPORTING
      DOCUMENT_OUTPUT_INFO       =
      JOB_OUTPUT_INFO            =
      JOB_OUTPUT_OPTIONS         =
      TABLES
        LT_PRDLBL                 = LT_PRDLBL1
    EXCEPTIONS
       FORMATTING_ERROR           = 1
       INTERNAL_ERROR             = 2
       SEND_ERROR                 = 3
       USER_CANCELED              = 4
       OTHERS                     = 5
    In the print program I had defined the internal tables like
    Data: lt_prdlbl  type standard table of zprdlbl.
    Data: Begin of lt_prdlbl1 occurs 0.
            include structure zprdlbl.
    Data: End of lt_prdlbl1.
    How do I define the internal table in the smartform to get the values printed in the smartform?.
    <REMOVED BY MODERATOR>
    Thanks,
    Edited by: Alvaro Tejada Galindo on Apr 21, 2008 1:01 PM

    Nehal,
    Thanks for quick response.
    In the smartform under the Form Interface->Tables tab
    I had defined
    LT_PRDLBL LIKE ZPRDLBL. If I define TYPE instead of LIKE I get the error message saying "FLAT TYPES may only be referenced using LIKE for table parameters".
    In the main window I have created LOOP, in which I have ticked the internal table and
    LT_PRDLBL INTO LT_PRDLBL. In the text node I am passing the values of this internal table
    &LT_PRDLBL-XXXX&.
    I am able to get the print but the data is not printing.
    Please help me with this.
    Thanks,

  • How to pass the contents of an internal table to the IDoc FIDCC2?

    Hi,
    I have an internal table. Using its contents, I have to create an Idoc and do GL posting.
    I have to use FIDCC2 Idoc and the function module IDOC_INPUT_FIDCC2.
    Can u please let me know how to pass the contents of the internal table into the idoc FIDCC2 and do the GL posting?
    Regards,
    Balaji. R

    Hi balaji,
    use function IDOC_INBOUND_FROM_FILE. This will do half the process.
    Documentation is missing, but program RSEINB00 explains something,
    also some links
    [http://help.sap.com/saphelp_nw70/helpdata/EN/dc/6b7f1543d711d1893e0000e8323c4f/frameset.htm]
    [RSEINB00 does not work in background]
    [RSEINB00 flat file to idoc uploading in XI]
    [Loading flat idoc via report RSEINB00 into integration server fails]
    Hope it helps.
    Regards,
    Clemens

  • What are the advantages of using an internal table with workarea

    Hi,
    can anyone tell me
    What are the advantages of using an internal table with workarea
    over an internal table with header line?
    thnks in adv
    regards
    nagi

    HI,
    Internal tables are a standard data type object which exists only during the runtime of the program. They are used to perform table calculations on subsets of database tables and for re-organising the contents of database tables according to users need.
    http://help.sap.com/saphelp_nw04/helpdata/en/fc/eb35de358411d1829f0000e829fbfe/content.htm
    <b>Difference between Work Area and Header Line</b>
    While adding or retrieving records to / from internal table we have to keep the record temporarily.
    The area where this record is kept is called as work area for the internal table. The area must have the same structure as that of internal table. An internal table consists of a body and an optional header line.
    Header line is a implicit work area for the internal table. It depends on how the internal table is declared that the itab will have the header line or not.
    e.g.
    data: begin of itab occurs 10,
    ab type c,
    cd type i,
    end of itab. " this table will have the header line.
    data: wa_itab like itab. " explicit work area for itab
    data: itab1 like itab occurs 10. " table is without header line.
    The header line is a field string with the same structure as a row of the body, but it can only hold a single row.
    It is a buffer used to hold each record before it is added or each record as it is retrieved from the internal table. It is the default work area for the internal table
    1) The difference between
    whih header line and with out heater line of internal table.
    ex:-
    a) Data : itab like mara occurs 0 with header line.
    b) Data: itab like mara occurs 0.
    -While adding or retrieving records to / from internal table we have to keep the record temporarily.
    -The area where this record is kept is called as work area for the internal table.
    -The area must have the same structure as that of internal table. An internal table consists of a body and an optional header line.
    -Header line is a implicit work area for the internal table. It depends on how the internal table is declared that the itab will have the header line or not.
    a) Data : itab like mara occurs 0 with header line.
    table is with header line
    b) Data: itab like mara occurs 0.
    table is without header line
    2)work area / field string and internal table
    which one is prefarable for good performance any why ?
    -The header line is a field string with the same structure as a row of the body, but it can only hold a single row , whereas internal table can have more than one record.
    In short u can define a workarea of an internal table which means that area must have the same structure as that of internal table and can have one record only.
    Example code:
    data: begin of itab occurs 10,
    ab type c,
    cd type i,
    end of itab. " this table will have the header line.
    data: wa_itab like itab. " explicit work area for itab
    data: itab1 like itab occurs 10. " table is without header line.
    Regards,
    Padmam.

Maybe you are looking for

  • Mapping Issue: one IDoc to multiple IDocs concerning incoming segments

    Hi, i want to devide one incoming IDoc to two or more outgoing IDoc's of same type concerning the appearance of one segment. Incoming is:    <IDOC BEGIN="">                   1...1       <EDI_DC40 SEGMENT="">       </EDI_DC40>       <..>       <Z1MOV

  • FIELD-SYMBOLS and table ?

    Hi all, in my programm i must check in differents tables some values. Tables are parameters of my program. So i thought that i could use field-symbols for access to the table but it's not work for me. Just a example, i've 2 tables to check : HRP1002

  • Create schedule lines

    Hi, I know how Scheduling Agreement works with MRP with release or without release. But my requirement is very different to that of standard scheduling agreement functionalities. We have an external MRP system which generates the requirements which c

  • Restore not working for my iPhone 5 rare situation

    Out of the blue, my phone stopped working last night. Every time I go to recovery mode, I get a weird screen that pops up with an error code. I've tried everything that apple suggested online. I.E different cord, update my operating system, etc. I wa

  • G5 Dual won't boot past Apple logo

    PMG5 Dual 2.0gHz/2.5gb/23-inch ACD Been using this m/c since late 2005 without problems. It's usually left on 24/7 (auto sleep, power save etc) except for a restart once a week. This morning the machine was still showing the screen saver (had not sle