How to use internal table in Exporting Parameter of method.

Hi Friends,
I am new to abap oops and using the following code to read a select-option and pass the data in an internal table but on defining
internal table of a standard  type it is giving me following error :
ITAB is not an internal table - the OCCURS n specification is missing.
code
====
  class lcl_get_details DEFINITION.
    PUBLIC SECTION.
      types : r_carrid type RANGE OF sflight-carrid.
      data  : itab type STANDARD TABLE OF sflight.
      METHODS : get_data IMPORTING s_carrid type R_carrid
                         EXPORTING itab type sflight.
  ENDCLASS.   
class lcl_get_details IMPLEMENTATION.
  METHOD get_data.
    select *
    from sflight
    into table itab
    where carrid in s_carrid.
    if sy-subrc eq 0.
      sort itab by carrid.
    endif.
  endmethod.   
ERROR : ITAB is not an internal table - the OCCURS n specification is missing.
Kindly help.

Hi,
I think your problem is, because you use 2 variables named ITAB in method get_data.
Instance-variable ITAB is defined as STANDARD TABLE OF sflight.
Exporting-parameter ITAB is defined as sflight.
It seems like in implementation of get_data exporting-parameter ITAB is used.
Try this implementation:
METHOD get_data.
  select * from sflight into table me->itab
   where carrid in s_carrid.
  if sy-subrc eq 0.
  sort me->itab by carrid.
  endif.
ENDMETHOD.
This should solve your compiler error.
Nether the less, get_data will yield an empty structure as result.
Regards, Hubert
Edited by: Hubert Heitzer on Feb 24, 2010 10:22 AM

Similar Messages

  • How to pass  internal table values to parameter

    hi,
             how to pass  internal table values to parameter in selection screen.if is it possible means please sent codeings.
    thanks.
      stalin.

    hi,
    tables : mara.
    data :  begin of itab_mara occurs 0,
              matnr like mara-matnr,
              ernam like mara-ernam,
              end of itab_mara.
    selection-screen : begin of block blk1 with frame title text-001.
    parameters : p_matnr like mara-matnr.
    selection-screen : end of block blk1.
    select matnr ernam from mara into corresponding fields of itab_mara
                                                                    where matnr = p_matnr.
    loop at itab_mara.
    write :/ itab_mara-matnr,
               itab_mara-ernam.
    endloop.
    <b><REMOVED BY MODERATOR></b>
    Message was edited by:
            Alvaro Tejada Galindo

  • How to use internal table in F4 help?

    Hello Experts,
    I need to assign F4 help for Employee Responsible ID field in Search Criteria. I'm able to fetch the details of all employees into an internal table in get_v_xyz method of employee res. attribute. My doubt is,Can we display an internal table as F4 help. If yes, How can we do that?
    Regards
    DNR Varma

    Hi,
    here is the code to be written in GET_V to add itnernal table as search help.
    data:
    GR_DDLB_DIVISION TYPE REF TO CL_CRM_UIU_DDLB,
    data:
    ls_value      TYPE bsp_wd_dropdown_line,
    lt_ddlb       TYPE bsp_wd_dropdown_table.
      IF gr_ddlb_division IS NOT BOUND.
        CREATE OBJECT gr_ddlb_division
          EXPORTING
            iv_source_type = ''T'.
        LOOP AT internal table INTO work area.
          ls_value-key      = work area-key.
          ls_value-value = work area-value.
            INSERT ls_value INTO TABLE lt_ddlb.
          ENDLOOP.
    gr_ddlb_division->set_selection_table( it_selection_table = lt_ddlb ).
    endif.
    rv_valuehelp_descriptor = gr_ddlb_division.
    Thanks
    Sudhir Grover

  • Returning Internal Table as Returning Parameter of Method (by Value).

    When you return an internal table as the returning parameter of a method, it is passed by value.  I understand the concept of passing by value vs. passing by reference, but exactly what this means in this case is ambiguous.
    1)  It could mean that the entire table, including data, is copied from the local table in the method into the parameter provided by the calling code.
    2)  Alternatively, it could mean that only the pointer to the table is passed by value and the data is not literally copied from one place in memory to another.  This would <b>not</b> be the same as passing by reference.  For instance, I believe this is how object references are passed by value.
    I want to know how it works, so that I know if there is an efficiency problem with returning a huge table.  The returning parameter is wonderful for getter methods, and I prefer to use it over exporting parameters, but I have some concern about passing tables as returning parameters since I don't know how this works.
    Can anyone either explain this, or at least make it clear to me whether or not there is an efficiency issue?
    Thanks, in advance,
    -Chris

    Thanks to those who tried to help me with this question, but I finally had to just figure it out on my own.  I just realized today that there is a way to find the answer using the debugger's <i>Go To->Status Display->Memory Use</i> option.  This shows how variables are stored in memory.
    The answer:
    First of all, if you set one internal table equal to another like:
      i_tab1 = i_tab2.
    or like:
      i_tab1[] = i_tab2[].
    both will simply set <i>i_tab1</i> to point to the same memory that <i>i_tab2</i> is using.  It does <b>not</b> make a copy.  Now, if you attempt to change <i>i_tab1</i>, with an <i>append</i> statement for instance, a copy of <i>i_tab2</i>'s memory is made <b>then</b>!  The requested change to <i>i_tab1</i> is then applied to the copied data.  <b>AHA!!!</b>  This means that even if you think you are copying a table, you are not really doing it until it becomes necessary due to a divergence in values.
    I specifically tested a returning parameter to see how memory is handled, and it is basically just like an '<i>=</i>' statment.  No copy of the data is performed at first.  The memory that is allocated for the local variable in the method is simply pointed to by the variable used in the calling code to recieve that value.
    What if you then change the value in the calling code after the method has finished executing?  The answer depends on the situation.  If the value that you returned from the method is still being pointed to by another variable somewhere, then a copy is made when you attempt to change the returned table in the calling code, but if there is no longer another variable pointing to this memory, you can change the table in the calling program all you want without causing a copy in memory.
    For instance, if you have a getter method that returns the value of an attribute, at first no copy will be made, but when you try to change the table in your calling code, a copy will be made then.  However, if you just fill a local table in your getter method and return that table, there will never be a copy made, because the local variable that originally pointed to that memory expired when the method completed.  That means that after the method completes, the only variable pointing to the allocated memory is the one in the calling code that recieved the returning value.
    This is fantastic!!  This behaives in a way that seems to provide maximum efficiency in most cases.  Also, the table copies are <b>never</b> a waste, since they only happen upon changing of one of the table variables that point to the common memory, and in this case you would <b>want</b> to make a copy to avoid corrupting the other variable.
    Also, even if you did return your table as an exporting parameter by reference, you would not gain any significant efficiency.  There would still be no table copy if you don't change the returned table.  Also, if you did change the returned table, you <b>would</b> still produce a table copy if there was another variable, like an attribute, still pointing to the memory that you set your exporting paramter from before.
    The only situation that I can see resulting in a needless efficiency problem is if someone used a getter method to return the value of a table attribute, then changed the returned table in the calling program, and then used a setter method to set the whole table attribute equal to the changed table.  This would be a waste, so maybe this should be accomplished in another way.
    In conclusion, there is essentially no reason to hesitate returning a whole internal table as a returning parameter from a method call, even though it is pass by value.
    Kudos to the ABAP development team for their good design!

  • Pass internal tables in Export  Parameters of  Function Module

    Hi
    How to pass internal tables through export parametes of the calling function module. i
    think i can pass it by reference ....
    if so can anyone suggest how to do it?

    Hi,
    You can Export values of an Internal table in two ways, by :
    1) specifying in Tables tab
    (Not recommended since it's an obsolete in ECC 6.0)
    If used, will reduce the performance of the FM
    Tables are always passed by reference
    2) specifying in Exports tab.
    The parameter should be a Table type (created in se11)
    having a Line type that refers to the structure of the data.
    Pass by Value is not used for Normal Function modules.
    Used usually for RFC enabled FMs.
    Cheers,
    Remi

  • How to Send Internal table to SAP Spool using Function Modules or Methods?

    Hi Experts,
    How to Send Internal table to SAP Spool using Function Modules or Methods?
    Thanks ,
    Kiran

    This is my code.
    I still get the no ABAP list data for the spool, even tho I can see it sp01?
    REPORT  Z_MAIL_PAYSLIP.
    * Declaration Part *
    tables: PERNR, PV000, T549Q, V_T514D, HRPY_RGDIR.
    infotypes: 0000, 0001, 0105, 0655.
    data: begin of ITAB occurs 0,
      MTEXT(25) type C,
      PERNR like PA0001-PERNR,
      ABKRS like PA0001-ABKRS,
      ENAME like PA0001-ENAME,
      USRID_LONG like PA0105-USRID_LONG,
    end of ITAB.
    data: W_BEGDA like HRPY_RGDIR-FPBEG,
          W_ENDDA like HRPY_RGDIR-FPEND.
    data: RETURN like BAPIRETURN1 occurs 0 with header line.
    data: P_INFO like PC407,
          P_FORM like PC408 occurs 0 with header line.
    data: P_IDX type I,
          MY_MONTH type T549Q-PABRP,
          STR_MY_MONTH(2) type C,
          MY_YEAR type T549Q-PABRJ,
          STR_MY_YEAR(4) type C,
          CRLF(2) type x value '0D0A'.
    data: W_CMONTH(10) type C.
    data: TAB_LINES type I,
          ATT_TYPE like SOODK-OBJTP.
    data: begin of P_INDEX occurs 0,
            INDEX type I,
    end of P_INDEX.
    constants: begin of F__LTYPE, "type of line
       CMD like PC408-LTYPE value '/:',  "command
       TXT like PC408-LTYPE value 's',   "textline
    end of F__LTYPE.
    constants: begin of F__CMD, "commands
      NEWPAGE like PC408-LINDA value '',
    end of F__CMD.
    data: P_LIST like ABAPLIST occurs 1 with header line.
    *data: OBJBIN like SOLISTI1 occurs 10 with header line,
    data: OBJBIN like  LVC_S_1022 occurs 10 with header line,
          DOCDATA like SODOCCHGI1,
          OBJTXT like SOLISTI1 occurs 10 with header line,
          OBJPACK like SOPCKLSTI1 occurs 1 with header line,
          RECLIST like SOMLRECI1 occurs 1 with header line,
          OBJHEAD like SOLISTI1 occurs 1 with header line,
          it_mess_att LIKE solisti1 OCCURS 0 WITH HEADER LINE,
          gd_buffer type string,
          l_no_of_bytes TYPE i,
          l_pdf_spoolid LIKE tsp01-rqident,
          l_jobname     LIKE tbtcjob-jobname.
    data: file_length  type int4,
          spool_id     type rspoid,
          line_cnt     type i.
    *-------------------------------------------------------------------* * INITIALIZATION *
    OBJBIN = ' | '.
    append OBJBIN.
    OBJPACK-HEAD_START = 1.
    data: S_ABKRS like PV000-ABKRS.
    data: S_PABRP like T549Q-PABRP.
    data: S_PABRJ like T549Q-PABRJ.
    * SELECTION SCREEN                                                  *
    selection-screen begin of block BL1.
    parameters: PAY_VAR like BAPI7004-PAYSLIP_VARIANT default 'ESS_PAYSLIPS' obligatory.
    selection-screen end of block BL1.
    START-OF-SELECTION.
      s_ABKRS = PNPXABKR.
      S_PABRP = PNPPABRP.
      s_pabrj = PNPPABRJ.
      w_begda = PN-BEGDA.
      w_endda = PN-ENDDA.
    get pernr.
    *                                 "Check active employees
      rp-provide-from-last p0000 space pn-begda  pn-endda.
      CHECK P0000-STAT2 IN PNPSTAT2.
    *                                 "Check Payslip Mail flag
      rp-provide-from-last p0655 space pn-begda  pn-endda.
      CHECK P0655-ESSONLY = 'X'.
      rp-provide-from-last p0001 space pn-begda  pn-endda.
    *                                 "Find email address
      RP-PROVIDE-FROM-LAST P0105 '0030' PN-BEGDA PN-ENDDA.
      if p0105-usrid_LONG ne ''.
        ITAB-PERNR      = P0001-PERNR.
        ITAB-ABKRS      = P0001-ABKRS.
        ITAB-ENAME      = P0001-ENAME.
        ITAB-USRID_LONG = P0105-USRID_LONG.
        append itab.
        clear itab.
      endif.
      "SY-UCOMM ='ONLI'
    END-OF-SELECTION.
    *------------------------------------------------------------------* start-of-selection.
      write : / 'Payroll Area        : ', S_ABKRS.
      write : / 'Payroll Period/Year : ',STR_MY_MONTH,'-',STR_MY_YEAR. write : / 'System Date : ', SY-DATUM.
      write : / 'System Time         : ', SY-UZEIT.
      write : / 'User Name           : ', SY-UNAME.
      write : / SY-ULINE.
      sort ITAB by PERNR.
      loop at ITAB.
        clear : P_INFO, P_FORM, P_INDEX, P_LIST, OBJBIN, DOCDATA, OBJTXT, OBJPACK, RECLIST, TAB_LINES.
        refresh : P_FORM, P_INDEX, P_LIST, OBJBIN, OBJTXT, OBJPACK, RECLIST.
    *                                                  Retrieve Payroll results sequence number for this run
        select single * from HRPY_RGDIR where PERNR eq ITAB-PERNR
                                        and FPBEG ge W_BEGDA
                                        and FPEND le W_ENDDA
                                        and SRTZA eq 'A'.
    *                                                  Produce payslip for those payroll results
        if SY-SUBRC = 0.
          call function 'GET_PAYSLIP'
            EXPORTING
              EMPLOYEE_NUMBER = ITAB-PERNR
              SEQUENCE_NUMBER = HRPY_RGDIR-SEQNR
              PAYSLIP_VARIANT = PAY_VAR
            IMPORTING
              RETURN          = RETURN
              P_INFO          = P_INFO
            TABLES
              P_FORM          = P_FORM.
          check RETURN is initial.
    *                                                 remove linetype from generated payslip
          loop at p_form.
            objbin = p_form-linda.
            append objbin.
            line_cnt = line_cnt + 1.
          endloop.
          file_length = line_cnt * 1022.
    *                                                 create spool file of paylsip
          CALL FUNCTION 'SLVC_TABLE_PS_TO_SPOOL'
            EXPORTING
              i_file_length = file_length
            IMPORTING
              e_spoolid     = spool_id
            TABLES
              it_textdata   = objbin.
          IF sy-subrc EQ 0.
            WRITE spool_id.
          ENDIF.
          DESCRIBE table objbin.
          DATA PDF LIKE TLINE OCCURS 100 WITH HEADER LINE.
          CALL FUNCTION 'CONVERT_ABAPSPOOLJOB_2_PDF'
            EXPORTING
              SRC_SPOOLID                    = spool_id
              NO_DIALOG                      = ' '
              DST_DEVICE                     = 'MAIL'
    *      PDF_DESTINATION                =
    *    IMPORTING
    *      PDF_BYTECOUNT                  = l_no_of_bytes
    *      PDF_SPOOLID                    = l_pdf_spoolid
    *      LIST_PAGECOUNT                 =
    *      BTC_JOBNAME                    =
    *      BTC_JOBCOUNT                   =
            TABLES
              PDF                            = pdf
            EXCEPTIONS
              ERR_NO_ABAP_SPOOLJOB           = 1
              ERR_NO_SPOOLJOB                = 2
              ERR_NO_PERMISSION              = 3
              ERR_CONV_NOT_POSSIBLE          = 4
              ERR_BAD_DESTDEVICE             = 5
              USER_CANCELLED                 = 6
              ERR_SPOOLERROR                 = 7
              ERR_TEMSEERROR                 = 8
              ERR_BTCJOB_OPEN_FAILED         = 9
              ERR_BTCJOB_SUBMIT_FAILED       = 10
              ERR_BTCJOB_CLOSE_FAILED        = 11
              OTHERS                         = 12
          IF SY-SUBRC <> 0.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
          ENDIF.
    *Download PDF file C Drive
      CALL FUNCTION 'GUI_DOWNLOAD'
        EXPORTING
          filename = 'C:\itab_to_pdf.pdf'
          filetype = 'BIN'
        TABLES
          data_tab = pdf.
    * Transfer the 132-long strings to 255-long strings
    *  LOOP AT pdf.
    *    TRANSLATE pdf USING ' ~'.
    *    CONCATENATE gd_buffer pdf INTO gd_buffer.
    *  ENDLOOP.
    *  TRANSLATE gd_buffer USING '~ '.
    *  DO.
    *    it_mess_att = gd_buffer.
    *    APPEND it_mess_att.
    *    SHIFT gd_buffer LEFT BY 255 PLACES.
    *    IF gd_buffer IS INITIAL.
    *      EXIT.
    *    ENDIF.
    *  ENDDO.
          OBJHEAD = 'Objhead'.
          append OBJHEAD.
    * preparing email subject
          concatenate W_ENDDA(6)
                    ' Payslip-'
                    ITAB-ENAME+0(28)
                    ITAB-PERNR+4(4) ')'
                 into DOCDATA-OBJ_DESCR.
          DOCDATA-OBJ_NAME = 'Pay Slip'.
          DOCDATA-OBJ_LANGU = SY-LANGU.
          OBJTXT = 'Pay Slip.'.
          append OBJTXT.
    *prepare email lines
          OBJTXT = DOCDATA-OBJ_DESCR.
          append OBJTXT.
          OBJTXT = 'Please find enclosed your current payslip.'.
          append OBJTXT.
    * Write Attachment(Main)
    * 3 has been fixed because OBJTXT has fix three lines
          read table OBJTXT index 3.
    *    DOCDATA-DOC_SIZE = ( 3 - 1 ) * 255 + strlen( OBJTXT ).
          clear OBJPACK-TRANSF_BIN.
          OBJPACK-HEAD_START = 1.
          OBJPACK-HEAD_NUM = 0.
          OBJPACK-BODY_START = 1.
          OBJPACK-BODY_NUM = 3.
          OBJPACK-DOC_TYPE = 'RAW'.
          append OBJPACK.
    * Create Message Attachment
          ATT_TYPE = 'PDF'.
          describe table OBJBIN lines TAB_LINES.
          read table OBJBIN index TAB_LINES.
    *    OBJPACK-DOC_SIZE = ( TAB_LINES - 1 ) * 255 + strlen( OBJBIN ).
          OBJPACK-TRANSF_BIN = 'X'.
          OBJPACK-HEAD_START = 1.
          OBJPACK-HEAD_NUM = 0.
          OBJPACK-BODY_START = 1.
          OBJPACK-BODY_NUM = TAB_LINES.
          OBJPACK-DOC_TYPE = ATT_TYPE.
          OBJPACK-OBJ_NAME = 'ATTACHMENT'.
          OBJPACK-OBJ_DESCR = 'Payslip'.
          append OBJPACK.
    * Create receiver list refresh RECLIST.
          clear RECLIST.
          RECLIST-RECEIVER = itab-USRID_long.
          translate RECLIST-RECEIVER to lower case.
          RECLIST-REC_TYPE = 'U'.
          append RECLIST.
    * Send the document
    *SO_NEW_DOCUMENT_ATT_SEND_API1
          call function 'SO_DOCUMENT_SEND_API1'
            exporting
              DOCUMENT_DATA = DOCDATA
              PUT_IN_OUTBOX = 'X'
              COMMIT_WORK = 'X'
    * IMPORTING
    *   SENT_TO_ALL =
    *   NEW_OBJECT_ID =
            tables
              PACKING_LIST  = OBJPACK
              OBJECT_HEADER = OBJHEAD
              CONTENTS_BIN  = pdf
              CONTENTS_TXT  = OBJTXT
    *   CONTENTS_HEX =
    *   OBJECT_PARA =
    *   OBJECT_PARB =
              RECEIVERS = RECLIST
            exceptions
              TOO_MANY_RECEIVERS = 1
              DOCUMENT_NOT_SENT = 2
              DOCUMENT_TYPE_NOT_EXIST = 3
              OPERATION_NO_AUTHORIZATION = 4
              PARAMETER_ERROR = 5
              X_ERROR = 6
              ENQUEUE_ERROR = 7
              others = 8.
          if SY-SUBRC NE 0.
            ITAB-MTEXT = 'Message Not Sent to : '.
          else.
            ITAB-MTEXT = 'Message Sent to : '.
          endif.
    *    else.
    *      ITAB-MTEXT = 'Message Not Sent to : '.
    *    endif.
        else.
          "SY-SUBRC Not = 0
          ITAB-MTEXT = 'Payroll data not found : '.
        endif.
        "end of SY-SUBRC = 0.
        modify ITAB.
      endloop. "end loop at ITAB
      sort ITAB by MTEXT PERNR.
      loop at ITAB.
        at new MTEXT.
          uline.
          write : / ITAB-MTEXT color 4 intensified on.
          write : / 'Emp. Code' color 2 intensified on,
                 12 'Emp. Name' color 2 intensified on,
                 54 'Email ID' color 2 intensified on.
        endat.
        write : / ITAB-PERNR, 12 ITAB-ENAME, 54 ITAB-USRID_LONG.
      endloop.

  • Using Internal Table in ABAP OO.

    Hi,
         I am using a internal table, I am calling a FM, which require Internal table as its parameter. Since Internal table with header line is not supported in ABAP OO. How to attain this.
    Thanq For Ur time.
    Cheers,
    Sam

    Hi,
    Please look at my example below.
    TYPES: BEGIN OF t_vbak,
              vbeln TYPE vbak-vbeln,
              posnr TYPE vbap-posnr,
              erdat TYPE vbak-erdat,
              ernam TYPE vbak-ernam,
              auart TYPE vbak-auart,
              kunnr TYPE vbak-kunnr,
              vkgrp TYPE vbak-vkgrp,
             END OF t_vbak.
    DATA: gt_vbak     TYPE STANDARD TABLE OF t_vbak,
          gt_vbak_dum LIKE gt_vbak.
    *CLASS DEFINITIONS
    *       CLASS lcl_get_so DEFINITION
    CLASS lcl_get_so DEFINITION.
      PUBLIC SECTION.
        METHODS: get_sales_orders
                    EXPORTING
                       ex_vbak LIKE gt_vbak.
    ENDCLASS.                    "lcl_get_so DEFINITION
    *CLASS IMPLEMENTATIONS
    *       CLASS lcl_get_so IMPLEMENTATION
    CLASS lcl_get_so IMPLEMENTATION.
      METHOD get_sales_orders.
        SELECT vbak~vbeln vbap~posnr vbak~erdat
               vbak~ernam vbak~auart vbak~kunnr
               vbak~vkgrp
          FROM vbak
         INNER JOIN vbap
            ON vbak~vbeln = vbap~vbeln
          INTO TABLE gt_vbak
         WHERE vbak~erdat IN s_erdat
           AND vbak~ernam IN s_ernam
           AND vbak~auart IN s_auart
           AND vbak~vkgrp IN s_vkgrp
           AND vbak~kunnr = p_kunnr.
        IF NOT gt_vbak[] IS INITIAL.
          ex_vbak[] = gt_vbak[].
        ELSE.
          MESSAGE i000 WITH 'No data found for given criteria'.
          LEAVE TO SCREEN 0.
        ENDIF.
      ENDMETHOD.                    "get_sales_orders
    ENDCLASS.                    "lcl_get_so IMPLEMENTATION
    * START-OF-SELECTION                           *
    START-OF-SELECTION.
      DATA: o_get_so         TYPE REF TO lcl_get_so.
      CREATE OBJECT: o_get_so.
    *Get sales orders
        CALL METHOD o_get_so->get_sales_orders
          IMPORTING
            ex_vbak = gt_vbak_dum.
    Hope it helps...
    Please award points if it helps...

  • Error in passing internal table as returning parameter

    Hi
    Im new to ABAP OO.
    I declared a parameter ret_kna1 Returning Type KNA1.
    Inside the method, I am retrieving data from table KNA1 into internal table and then I want return the interal table value.
    But Im not able to assing the internal table for eg : code
    method READ_CUSTOMER_LIST.
    data: lt_kna1 type TABLE OF kna1,
          wa_kna1 LIKE LINE OF lt_kna1.
    data: lv_kunnr type kna1-kunnr,
          lv_land1 type kna1-LAND1.
    SELECT * FROM kna1
    INTO TABLE lt_kna1
    WHERE land1 eq lv_land1.
    insert LINES OF lt_kna1 INTO TABLE ret_kna1.
    endmethod.
    when I try to activate the error says 'ret_kna1 is not an internal table  "OCCURS n" specification is missing.
    but I can not declare the internal table 'ret_kna1' once again in the code, as it already defined in the parameter as type KNA1.
    please help me how to assign internal table values to the returing structur.

    Are you passing it as an EXPORT parameter?
    use and define it in the TABLES section of your function module as so:
    *"  IMPORTING
    *"     VALUE(INCLUDE_X_LEVELS) TYPE  CHAR1 OPTIONAL
    *"  TABLES
    *"      I_SELECTED_OU STRUCTURE  HRROOTOB
    *"      I_SELECTED_EE STRUCTURE  OBJEC
    *"      E_VIP_EPM_DISTR STRUCTURE  ZHR_VIP_EPM_DISTR
    *"      E_RETURN STRUCTURE  BAPIRET1
    That way you can pass value in the table (if needed) and then pass the table with your values based on your own logic

  • How to Use a table UI for input ?

    Hi All ,
    I just want to ask how to use a Table UI in webdynpro ABAP to insert , change and delete rows ?? and can we give a drop down facility in table columns ? . This is really urgent .
    Thanks in advance.
    Regards,
    LAS

    Hi LAS,
    Everything is possible. I am providing the logic here which will help you a lot.
    For insert, Change, Delete: 
       Just get the all the elements into temp internal table and get the lead slected index. Now instrt one row in the lead selected index position. then again bind the temporary internal table to your table node. Thats all it works like inserting the row.
    In the same way you can do the change and delete rows also.
    For Dropdown:
      Here i am providing the code for Dropdown. It will help you out.
      Just create the Dropdown view for the columns for which you want dropdown. And do the coding for that.
      Here in my scenario IT is the Table node which holds the information. And i am providing the dorpdown key for the column "BSCHL".
      If you have any dobts just reply to me . i will respond it.
    Code:
      data : ls_outtab               type /kyk/s_fb01_line,
             lt_outtab               type table of /kyk/s_fb01_line,
             lv_node_sd              type ref to if_wd_context_node,
             lv_node_it              type ref to if_wd_context_node,
             lv_node_info            type ref to if_wd_context_node_info,
             lv_node_sapmf05a_0106   type ref to if_wd_context_node,
             lv_node_waers           type ref to if_wd_context_node,
             lv_node_layout          type ref to if_wd_context_node,
             lv_rowcount             type i,
             lv_buzei                type i,
             lv_waers        type waers,
             lt_bschl_set    type wdy_key_value_table,
             bschl_key_item  type wdy_key_value.
    bind to context
      lv_node_sd      = wd_context->get_child_node( name = 'SD' ).
      lv_node_it      = lv_node_sd->get_child_node( name = 'IT' ).
      call method lv_node_it->bind_table
        EXPORTING
          new_items = lt_outtab.
    fill Dropdown Help for posting Key
      bschl_key_item-key    = '40'.
      bschl_key_item-value  = cl_wd_utilities=>get_otr_text_by_alias( '/KYK/FIN_FI/DEBIT_GL_ACCOUNT' ).
      insert bschl_key_item into table lt_bschl_set.
      bschl_key_item-key    = '50'.
      bschl_key_item-value  = cl_wd_utilities=>get_otr_text_by_alias( '/KYK/FIN_FI/CREDIT_GL_ACCOUNT' ).
      insert bschl_key_item into table lt_bschl_set.
      bschl_key_item-key    = '21'.
      bschl_key_item-value  = cl_wd_utilities=>get_otr_text_by_alias( '/KYK/FIN_FI/DEBITVENDOR' ).
      insert bschl_key_item into table lt_bschl_set.
      bschl_key_item-key    = '31'.
      bschl_key_item-value  = cl_wd_utilities=>get_otr_text_by_alias( '/KYK/FIN_FI/CREDITVENDOR' ).
      insert bschl_key_item into table lt_bschl_set.
      lv_node_info = lv_node_it->get_node_info( ).
      lv_node_info->set_attribute_value_set( name = 'BSCHL' value_set = lt_bschl_set ).
    Warm Regards,
    Vijay

  • How to get internal table from SAP Data Provider C#

    Hello.
    ABAP:
       DATA: lt_t001 TYPE TABLE OF t001.
       DATA: url(1000) TYPE c.
      SELECT * INTO TABLE lt_t001 FROM t001.
      CALL FUNCTION 'DP_CREATE_URL'
        EXPORTING
          type                 = 'APPLICATION'
          subtype           = 'X-R3TABLE'
        TABLES
          data                 = lt_t001
        CHANGING
          url                    = url
        EXCEPTIONS
          OTHERS           = 4.
    C#:
    using SAPDataProvider;
    using SAPTableFactoryCtrl;
    public void SetDataFromUrl(string url)
                SAPDataProviderClass p = new SAPDataProviderClass();
                p.SetDataFromURL("APPLICATION", "X-R3TABLE", url);
                ISapDPR3Table tbl = p.GetDataAsR3Table("APPLICATION", "X-R3TABLE");
                SAPTableFactoryClass tf = new SAPTableFactoryClass();
                Table tb = (Table)tf.NewTable();
                tb.ISAPrfcITab = tbl.DataTable; // Exception !!!!!!
    How to get internal table from SAP Data Provider ?

    Hi Sergey,
    I'm trying to do the same, have you found a solution to solved it?
    thanks for your help.
    Regards.
    Jonathan

  • How to pass internal table to method of class

    Hi all,
    I am new to abap objects, i want to pass one internal table to class.
    i am trying in this way.
    class c1 definition.
    method get_material importing t_stpo  type any table
                                   exporting t_mast type any table.
    endmethod.
    endclass.
    class c1 implementation.
    method get_material.
    select f1 f2 f3 from <tab> into table t_mast
            for all entries in t_stpo
            where stlnr = t_stpo-stlnr.
    endmethod.
    endclass.
    ERROR:
    "stlnr" is not available
    if i use this way. its not giing error.
    class c1 definition.
    method get_material exporting t_mast type any table.
    endmethod.
    endclass.
    class c1 implementation.
    method get_material.
    select f1 f2 f3 from <tab> into table t_mast
            for all entries in it_stpo
            where stlnr = it_stpo-stlnr.
    endmethod.
    endclass.
    how to pass internal table with some specific reference may be using like or type <it_xxxx>
    thanks

    Try this.
    TYPES : BEGIN OF ty_stpo,
             stlnr TYPE stpo-stlnr,
             idnrk TYPE stpo-idnrk,
             menge TYPE stpo-menge,
            END OF ty_stpo,
            BEGIN OF ty_mast,
             matnr TYPE mast-matnr,
             werks TYPE mast-werks,
             stlnr TYPE mast-stlnr,
            END OF ty_mast,
            tt_stpo TYPE TABLE OF ty_stpo,
            tt_mast TYPE TABLE OF ty_mast.
    DATA : it_stpo TYPE tt_stpo,
           it_mast TYPE tt_mast.
    *       CLASS c1 DEFINITION
    CLASS c1 DEFINITION.
      PUBLIC SECTION.
        METHODS : get_bom_numbers EXPORTING ex_stpo type tt_stpo,
                  get_parent_material IMPORTING im_stpo TYPE tt_stpo
                                      EXPORTING ex_mast TYPE tt_mast.
        endclass.
    *       CLASS c1 IMPLEMENTATION
    CLASS c1 IMPLEMENTATION.
      METHOD get_bom_numbers.
      ENDMETHOD.                    "get_bom_numbers
      METHOD get_parent_material.
      ENDMETHOD.                    "get_parent_material
    START-OF-SELECTION.
      DATA : obj TYPE REF TO c1.
      CREATE OBJECT obj.
      CALL METHOD obj->get_bom_numbers
        IMPORTING
          t_stpo = it_stpo.
      CALL METHOD obj->get_parent_material
        EXPORTING
          im_stpo = it_stpo
        IMPORTING
          ex_mast = it_mast.
    Regards,
    Rich Heilman

  • How to Convert internal table data into text output and send mail in ABAP

    Hi All,
    Good Morning.
    Taking a glance at a code that converts internal table data to an Excel file in ABAP. also checked how to send this excel to mailing list as attachment.
    But thought of doing it without excel.
    I mean, I have an internal table which contains fields of all types (character,integer,date,time). Since it is only around 4 to 5 rows in it (output),why to convert it to excel. not required!!.  Instead I  want to send this output to User's mails as Normal mail body with No attachments.
    Could anybody please suggest me a way as to how to send internal table data as a mail ( not as an excel or PDF etc).
    as of now my findings are, it is quite complex to convert internal table data to email (Text) format. but i believe if there is some way of doing it.
    Best Regards
    Dileep VT

    here's something I have used in the past where we send out information about failed precalculation settings (which are stored in internal table gt_fail)
    notice we use gt_text as "mail body"
    TRY.
    *     -------- create persistent send request ------------------------
           gv_send_request = cl_bcs=>create_persistent( ).
    *     -------- create and set document -------------------------------
    *     create text to be sent
           wa_line = text-001.
           APPEND wa_line TO gt_text.
           CLEAR wa_line.
           APPEND wa_line TO gt_text.
           LOOP AT gt_fail ASSIGNING <fs_fail>.
             MOVE <fs_fail>-retry_count TO gv_count.
             CONCATENATE text-002
                         <fs_fail>-setting_id
                         text-003
                         gv_count
                         INTO wa_line SEPARATED BY space.
             APPEND wa_line TO gt_text.
             CLEAR wa_line.
           ENDLOOP.
           APPEND wa_line TO gt_text.
           wa_line = text-007.
           APPEND wa_line TO gt_text.
    *     create actual document
           gv_document = cl_document_bcs=>create_document(
                           i_type    = 'RAW'
                           i_text    = gt_text
                           i_length  = '12'
                           i_subject = 'Failed Precalculation Settings!' ).
    *     add document to send request
           CALL METHOD gv_send_request->set_document( gv_document ).
    *     --------- set sender -------------------------------------------
           gv_sender = cl_sapuser_bcs=>create( sy-uname ).
           CALL METHOD gv_send_request->set_sender
             EXPORTING
               i_sender = gv_sender.
    *     --------- add recipient (e-mail address) -----------------------
           LOOP AT s_email INTO wa_email.
             MOVE wa_email-low TO gv_email.
             gv_recipient = cl_cam_address_bcs=>create_internet_address(
                                               gv_email ).
             CALL METHOD gv_send_request->add_recipient
               EXPORTING
                 i_recipient = gv_recipient
                 i_express   = 'X'.
           ENDLOOP.
    *     ---------- set to send immediately -----------------------------
           CALL METHOD gv_send_request->set_send_immediately( 'X' ).
    *     ---------- send document ---------------------------------------
           CALL METHOD gv_send_request->send(
             EXPORTING
               i_with_error_screen = 'X'
             RECEIVING
               result              = gv_sent_to_all ).
           IF gv_sent_to_all = 'X'.
             WRITE text-004.
           ENDIF.
           COMMIT WORK.
    *   exception handling
         CATCH cx_bcs INTO gv_bcs_exception.
           WRITE: text-005.
           WRITE: text-006, gv_bcs_exception->error_type.
           EXIT.
       ENDTRY.
    with the following declarations
    * TABLES                                                               *
    TABLES:
       adr6,
       rsr_prec_sett.
    * INTERNAL TABLES & WORK AREAS                                         *
    DATA:
       gt_fail          TYPE SORTED TABLE OF rsr_prec_sett
                             WITH UNIQUE KEY setting_id run_date,
       gt_text          TYPE bcsy_text,
       wa_fail          LIKE LINE OF gt_fail,
       wa_line(90)      TYPE c.
    FIELD-SYMBOLS:
       <fs_fail>        LIKE LINE OF gt_fail.
    * VARIABLES                                                            *
    DATA:
       gv_count(4)      TYPE n,
       gv_send_request  TYPE REF TO cl_bcs,
       gv_document      TYPE REF TO cl_document_bcs,
       gv_sender        TYPE REF TO cl_sapuser_bcs,
       gv_recipient     TYPE REF TO if_recipient_bcs,
       gv_email         TYPE adr6-smtp_addr,
       gv_bcs_exception TYPE REF TO cx_bcs,
       gv_sent_to_all   TYPE os_boolean.
    * SELECTION-SCREEN                                                     *
    SELECT-OPTIONS:
       s_email          FOR adr6-smtp_addr NO INTERVALS MODIF ID sel.
    DATA:
       wa_email         LIKE LINE OF s_email.

  • How to Populate Internal table data to Table Control in a Report Program

    Dear All,
           How to Populate Internal table data to Table Control in a Report Program? It is a pure report program with out any Module pool coding involved, which is just used to display data. Till now it is being displayed in a report. Now the user wants the data to be displayed in a table control. Could someone tell me how to go about with this.
    Thanks in Advance,
    Joseph Reddy

    If you want to use a table control, you will need to create a screen.
    In your report....
    start-of-selection.
    perform get_data.  " Get all your data here
    call screen 100. " Now present to the user.
    Double click on the "100" in your call screen statement.  This will forward navigate you to the screen.  If you have not created it yet, it will ask you if you want to create it, say yes.  Go into screen painter or layout of the screen.  Use the table control wizard to help you along the process.  It will write the code for you.  Since it is an output only table control, it will be really easy with not a lot of code. 
    A better way to present the data to the user would be to give it in a ALV grid.  If you want to go that way, it is a lot easier.  Here is a sample of the ALV function module.  You don't even have to create a screen.
    report zrich_0004
           no standard page heading.
    type-pools slis.
    data: fieldcat type slis_t_fieldcat_alv.
    data: begin of imara occurs 0,
          matnr type mara-matnr,
          maktx type makt-maktx,
          end of imara.
    * Selection Screen
    selection-screen begin of block b1 with frame title text-001 .
    select-options: s_matnr for imara-matnr .
    selection-screen end of block b1.
    start-of-selection.
      perform get_data.
      perform write_report.
    *  Get_Data
    form get_data.
      select  mara~matnr makt~maktx
                into corresponding fields of table imara
                  from mara
                   inner join makt
                     on mara~matnr = makt~matnr
                        where mara~matnr in s_matnr
                          and makt~spras = sy-langu.
    endform.
    *  WRITE_REPORT
    form write_report.
      perform build_field_catalog.
    * CALL ABAP LIST VIEWER (ALV)
      call function 'REUSE_ALV_GRID_DISPLAY'
           exporting
                it_fieldcat = fieldcat
           tables
                t_outtab    = imara.
    endform.
    * BUILD_FIELD_CATALOG
    form build_field_catalog.
      data: fc_tmp type slis_t_fieldcat_alv with header line.
      clear: fieldcat. refresh: fieldcat.
      clear: fc_tmp.
      fc_tmp-reptext_ddic    = 'Material Number'.
      fc_tmp-fieldname  = 'MATNR'.
      fc_tmp-tabname   = 'IMARA'.
      fc_tmp-outputlen  = '18'.
      fc_tmp-col_pos    = 2.
      append fc_tmp to fieldcat.
      clear: fc_tmp.
      fc_tmp-reptext_ddic    = 'Material'.
      fc_tmp-fieldname  = 'MAKTX'.
      fc_tmp-tabname   = 'IMARA'.
      fc_tmp-outputlen  = '40'.
      fc_tmp-col_pos    = 3.
      append fc_tmp to fieldcat.
    endform.
    Regards,
    Rich Heilman

  • Use Internal table in WebDynpro ABAP.

    Hi,
        I am using a internal table, for calling a FM, which require Internal table as its parameter. Since Internal table with header line is not supported in ABAP OO. How to attain this.
    Thanq For Ur time.
    Cheers,
    Sam

    Hi Sam,
    If we want to use an internal table for the FM as input then we can declare a table and use it.
    But when we want use it as a workarea we need to define a work area (another attribute) of a internal table saparatly and use it.
    Best regards,
    Suresh

  • Submititng the program to another program  using internal table values

    Hi All,
    How to Submit from one program to another program using internal table values minimum 7 int tables without using the seletion screen
    thanks
    raj

    Hi All,
    Thank you very much for your inputs.
    i am facing another issue:
    For each 10,000 records it should trigger a job  (we are trying to call a program)  were the validation will be done only through the other program.
    please find the code mentioned below :
    TABLES : but000.
    DATA:  int_bp LIKE but000 OCCURS 0 WITH HEADER LINE.
    data released like BTCH0000-CHAR1.
    DATA: jobnumber LIKE tbtcjob-jobcount, " Job ID and
          jobname LIKE tbtcjob-jobname, " job name.
          startdate LIKE tbtcjob-sdlstrtdt, " Start-time
          starttime LIKE tbtcjob-sdlstrttm, " window specs.
          laststartdate LIKE tbtcjob-laststrtdt,
          laststarttime LIKE tbtcjob-laststrttm,
          job_released LIKE btch0000-char1. " JOB_CLOSE: Was job released?
    DATA : l1 TYPE i,
           b_size TYPE i,
           b_cursor TYPE cursor.
    INITIALIZATION.
      b_size = 5000.
    START-OF-SELECTION.
      OPEN CURSOR WITH HOLD b_cursor
         FOR
         SELECT *
         FROM but000
         WHERE bpkind = 'AA'.
      IF sy-subrc = 0.
        DO.
          FETCH NEXT CURSOR b_cursor INTO TABLE int_bp
                                               PACKAGE SIZE b_size.
    Note : here in this point  we are getting a dump for the second job trigger.
          IF sy-subrc = 0.
            CLEAR jobname.
            CONCATENATE sy-repid sy-datum sy-uzeit INTO jobname.
    export int_bp to memory id 'ABC'.
            CALL FUNCTION 'JOB_OPEN'
                 EXPORTING
                      jobname          = jobname
                 IMPORTING
                      jobcount         = jobnumber.
                EXCEPTIONS
                     cant_create_job  = 1
                     invalid_job_data = 2
                     jobname_missing  = 3
                     OTHERS           = 4
    CALL FUNCTION 'JOB_SUBMIT'
          EXPORTING
               authcknam = sy-uname
               jobname   = jobname
               jobcount  = jobnumber
               report    = 'YTEST_RRR'.
               variant   = lv_variant.
       SUBMIT ytest_rrr
          VIA JOB jobname NUMBER jobnumber
          AND RETURN.
        CALL FUNCTION 'JOB_CLOSE'
          EXPORTING
           event_periodic                    = 'X'
            jobcount                          = jobnumber
            jobname                           = jobname
            strtimmed                         = 'X'
          IMPORTING
            job_was_released                  = released
            else.
            EXIT.
          ENDIF.
        ENDDO.
    calling program :
    REPORT YTEST_RRR .
    data itab1 like but000 occurs 0 with header line.
    data l type i.
    import itab1 from memory id 'ABC' .
    describe table itab1 lines l.
    free memory id 'ABC'.
    write:/ 'total records are:', l.
    Please give your suggestion why its going for  dump in the second iteration.
    thanks in advance.

Maybe you are looking for

  • How can I modify column width in a spreadsheet report without using an Excel template

    I currently use the LabVIEW Report Generation toolkit in LabVIEW 2011SP1 to create simple spreadsheet reports that I can build/print without having Microsoft Office products installed.  I really like being able to do this, and it allows me to generat

  • Outlook 2013 will not connect to specific networks outside the office

    Outlook 2013.  I can connect to any Wi-Fi network I have attempted...but Outlook 2013 will not connect to my home network.  I have tried clearing the dns cache as well as re-creating the account.  Outlook works fine at the office, fine at hotels, fin

  • Transferring recordings from sky plus to macbook pro

    Does anyone know how I can transfer recorded programmes from my sky+ box to my mac? I've been hit a few times when the sky box crashes and needs replacing resulting in me losing some treasured recordings. I did have a DVD recorder but that has recent

  • E72 won't play long video file

    Although I have 138MB free in phone memory and 6+GB on my 16GB MicroSD card the phone locks up solid after playing 2 minutes of a 22 minute movie filmed through its own lens  the same day, and which plays without even a flicker on my PC in Windows Me

  • Referring as optional library

    We have an ear(webapp) file has dependency on external libraries. So the weblogic-applications.xml file has them as <library-ref> <library-name>oracle.somepath.someclass</library-name> </library-ref> We used to deploy the jar file containing someclas