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

Similar Messages

  • 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.

  • Accessing internal table of main program inside function module...

    I have function module say ZFUNC and main program say ZMAIN and internal table defined as IT_TAB inside ZMAIN but not passed as parameter to Function module ZFUNC.
    If I want to access the field value of IT_TAB of  main program ZMAIN inside ZFUNC during debugging then, I simply put <b>(ZMAIN)IT_TAB-amount</b> in ABAP debugger and then change it when the debugger is inside ZFUNC.
    How can I write code to change the value of internal table of main program in function module ZFUNC instead of doing in debugger ? I guess I have to use some field symbols, but not sure. Please suggest.
    Regards,
    Rajesh.

    Yes, you do need to use a field symbol.  Say for example, you had a internal table called IMARC in your program and you want to access it later in a funciton module, you would do something like this.
      data: xmarc type marc.
      field-symbols: <imarc> type marc_upl_tt.
    * Assign an internal table
      field = '(ZPROGRAM_NAME)IMARC[]'.
      assign (field) to <imarc>.
      loop at <imarc> into xmarc.
        write: / xmarc-matnr, xmarc-werks.
      endloop.
    Regards,
    Rich Heilman

  • Difference between Import and Export parameters in Function Module

    Hi All,
    I am unclear about the import and export parameters, when i create a function module. Can anyone explain abt this. However when i call the function module in any program the import parameters in Function module are displayed as exporting in program amd the export parameters as importing.
    Any help on this would be appericiated.
    Shejal.

    HI,
    Import parameter in FM is the value u provide to FM for processing.
    export is the value u get from FM after processing.
    when u call a FM in a progam the import parameter will appear as Export bcos u r giving value to the FM.
    and u r getting value from FM in import parameter(bcos u r importing).
    rgds,
    latheesh
    Message was edited by: Latheesh Kaduthara

  • (internal) Tables obsolete as parameter in function modules,

    Hi
    As you probably can see by the question, my ABAP Knowledge isn't exactly overwhelming !
    <i>anyway:</i>
    I'm trying to create a function module in NW2004s, This functionmodule should take an internal table, based on a structure as (import) parameter.
    In the earlier version, I've done this by defining it under the TAB 'Tables' in the function builder - But know its telling me that "<i>Tables Parameters are obsolete</i>", and that I should define it under "Changing" instead.
    I have tried that, but I'm only allowed to pass a single line, and if I try to do a Loop, in the function module, it tells me that ity isn't created as an internal table.
    So please - what is the "best practice" here ?
    Regards
    Morten Nielsen

    Hi All,
    I followed Steps 1 and 2 but when I use the following select statement I get a dump with the error enclosed.
    Step1. Created a structure ZDFKKCOHI which is a replica of DFKKCOHI.
    Step2. Created a table type ZDFKKCOHITABLE with line type as ZDFKKCOHI.
    Step3. In my function module I have a changing parameter ZDFKKCOHIPARAM of type ZDFKKCOHITABLE.
    Step 4. When I use the following select clause I am getting a dump.
    DATA: wa_zdfkkcohi LIKE LINE OF zdfkkcohiparam.
      SELECT *
      FROM dfkkcohi
      INTO  CORRESPONDING FIELDS OF TABLE zdfkkcohiparam
      WHERE cotyp EQ zcotyp
      AND gpart EQ zgpart
      AND corr_status EQ zcorr_status.
      LOOP AT zdfkkcohiparam INTO wa_zdfkkcohi.
    *Move IT_ZDFKKCOHI to ZDFKKCOHIOUT.
    *Append ZDFKKCOHIOUT.
    *Clear IT_ZDFKKCOHI.
      ENDLOOP.
    What could be wrong?
    Thanks for all your help in advance.
    Regards,
    Divya

  • (internal) Tables obsolete as parameter in function modules in ECC 6.0

    Hi All,
    I followed Steps 1 and 2 in the thread  but when I use the following select statement I get a dump with the error enclosed.
    Step1. Created a structure ZDFKKCOHI which is a replica of DFKKCOHI.
    Step2. Created a table type ZDFKKCOHITABLE with line type as ZDFKKCOHI.
    Step3. In my function module I have a changing parameter ZDFKKCOHIPARAM of type ZDFKKCOHITABLE.
    Step 4. When I use the following select clause I am getting a dump.
    DATA: wa_zdfkkcohi LIKE LINE OF zdfkkcohiparam.
    SELECT *
    FROM dfkkcohi
    INTO CORRESPONDING FIELDS OF TABLE zdfkkcohiparam
    WHERE cotyp EQ zcotyp
    AND gpart EQ zgpart
    AND corr_status EQ zcorr_status.
    LOOP AT zdfkkcohiparam INTO wa_zdfkkcohi.
    *Move IT_ZDFKKCOHI to ZDFKKCOHIOUT.
    *Append ZDFKKCOHIOUT.
    *Clear IT_ZDFKKCOHI.
    ENDLOOP.
    Error: Das laufende ABAP-Programm wollte eine Open SQL-Anweisung ausführen,
    bei der die Treffermenge mit 'INTO CORRESPONDING FIELDS' in
    namensgleiche Felder der Zielbereichs gestellt werden soll. Hierbei
    müssen die namensgleichen Felder des Zielbereichs einen flachen Typ
    haben, oder vom Typ STRING oder XSTRING sein.
    Im vorliegenden Fall enthält der Zielbereich " " aber ein
    namensgleiches Feld "MANDT " mit dem verbotenen internen Typ "l".
    What could be wrong?
    Thanks for all your help in advance.
    Regards,
    Divya

    Translating the error message -;)
    The running ABAP-program wanted to carry out an opus SQL-direction, with which the hit quantity with 'INTO
    CORRESPONDING FIELDS' is supposed to be placed into name same fields the goal area.  Herewith the name same
    fields of the goal area must have be a flat type, or of the type STRING or XSTRING. 
    In the existing case, the goal area "" contains however a name same field "MANDT" with the forbidden internal type "l".
    You should check you structures and assign the correct TYPE to the fields -:)
    Greetings,
    Blag.

  • PASSING INTERNAL TABLE IN SMARTFORM

    HI' I M NEW TO SMARTFORMS, MY PROBLEM IS =THAT
    I'VE CREATED A NEW TYPE(SAY TY_BKPF) IN THE DRIVER PROGRAM.
    THEN I'VE DECLARED AN INTERNAL TABLE OF THIS TYPE.
    TO PASS THIS INTERNAL TABLE INTO MY SMARTFORM I'VE PASSED THE INTERNAL TABLE'S NAME INTO THE FUNCTION MODULE UNDER THE TABLES PARAMETER.
    BUT I'M NOT ABLE TO UNDERSTAND AS TO WHAT TYPE SHOULD I GIVE IT IN THE FORM INTERFACE IN THE TABLES TAB.
    PLZ HELP.

    Define table in smartforms
    Global settings :
    Form interface
    Variable name    Type assignment   Reference type
    ITAB1               TYPE                  Table Structure
    Global definitions
    Variable name    Type assignment   Reference type
    ITAB2               TYPE                  Table Structure
    Also have a look at below sample code. It will give you idea abt the same.
    REPORT ZSMARTFORM.
    Calling SMARTFORMS from your ABAP program.
    Collecting all the table data in your program, and pass once to SMARTFORMS
    SMARTFORMS
    Declare your table type in :-
    Global Settings -> Form Interface
    Global Definintions -> Global Data
    Main Window -> Table -> DATA
    TABLES: MKPF.
    DATA: FM_NAME TYPE RS38L_FNAM.
    DATA: BEGIN OF INT_MKPF OCCURS 0.
            INCLUDE STRUCTURE MKPF.
    DATA: END OF INT_MKPF.
    SELECT-OPTIONS S_MBLNR FOR MKPF-MBLNR MEMORY ID 001.
    SELECT * FROM MKPF WHERE MBLNR IN S_MBLNR.
       MOVE-CORRESPONDING MKPF TO INT_MKPF.
       APPEND INT_MKPF.
    ENDSELECT.
    At the end of your program.
    Passing data to SMARTFORMS
    call function 'SSF_FUNCTION_MODULE_NAME'
      exporting
        formname                 = 'ZSMARTFORM'
      VARIANT                  = ' '
      DIRECT_CALL              = ' '
      IMPORTING
        FM_NAME                  = FM_NAME
      EXCEPTIONS
        NO_FORM                  = 1
        NO_FUNCTION_MODULE       = 2
        OTHERS                   = 3.
    if sy-subrc <> 0.
       WRITE: / 'ERROR 1'.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    endif.
    call function FM_NAME
    EXPORTING
      ARCHIVE_INDEX              =
      ARCHIVE_INDEX_TAB          =
      ARCHIVE_PARAMETERS         =
      CONTROL_PARAMETERS         =
      MAIL_APPL_OBJ              =
      MAIL_RECIPIENT             =
      MAIL_SENDER                =
      OUTPUT_OPTIONS             =
      USER_SETTINGS              = 'X'
    IMPORTING
      DOCUMENT_OUTPUT_INFO       =
      JOB_OUTPUT_INFO            =
      JOB_OUTPUT_OPTIONS         =
      TABLES
        GS_MKPF                    = INT_MKPF
      EXCEPTIONS
        FORMATTING_ERROR           = 1
        INTERNAL_ERROR             = 2
        SEND_ERROR                 = 3
        USER_CANCELED              = 4
        OTHERS                     = 5.
    if sy-subrc <> 0.
       MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
             WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    endif.
    Have a look at below link for more help on smart forms.
    http://sap.ionelburlacu.ro/sap0/sapsf001.htm
    http://help.sap.com/saphelp_erp2004/helpdata/en/a9/de6838abce021ae10000009b38f842/frameset.htm
    I hope it helps.
    Best Regards,
    Vibha
    *Please mark all the helpful answers

  • Need of Changing Parameters in Function Module

    Hi All,
    Why we need sepearte Import and Export parameters in Function Module if the Changing Parameters
    acts as both import and export parameters.
    What is the use of using Changing Parametrs in Function Module.
    Thanks in advance.
    Sundaresan

    Hi,
    EXPORT PARAMETERS: When u r passing some value to the function, and the parameter will not be changed in the function, we use export parameter. Example: u pass parameter (a : 10) to a function, even after the function has been executed, value of a will be 10 only.
    IMPORT PARAMETER: When u require some value back from the function. u do not provide any initial value to the function. Example : u pass a parameter (b: <blank>) to the function, function returns the same import parameter as (b : 20).
    CHANGING PARAMETER: When u pass some value to the function and that function may change that value inside function, then changing parameters are used. Example: u pass parameter ( c: 30) to the function as changing parameter and function modifies this variable and return ( c: 50).
    Reward points if helpful.
    Thanks & Regards
    - Rishika Bawa

  • Passing values to an InternalTable in a  Function Module from WebDynpro

    Hi,
       I have created a model from a function module that has a internal table.I have assigned the  value as a String to the datamodel context element of the internal table as a Line in the node that represents the input for the funtion module.The internal table accepts a value as an input.When i call the execute method on the input node i am not able to pass the value from the Webdynpro to the function module.I have also checked the assignment of the value as a String to the datamodel context element of the internal table as a Line in the node that represents the input for the funtion module and the value was assigned.
    If you can provide me any info on how to pass the internal table from Webdynpro to the function module will be very helpful ..???
    Thanks In Advance,
    Varma.

    Hi Rajendra,
               what u can pass to a function module is the parameter which are in import and tables  of RFC .so u have to declare a variable as a type of your internal table which may be type of   structure or table. then in your RFC u have to copy that into a variable of function module  and go for ur  logic ...

  • Passing internal tables as parameters to subroutines

    Hi,
    This was going to be a question but I just had it answered by someone. Hopefully, this piece of information is going to be useful to other people as well.
    I had a subroutine in my code which looks like this.
    form fr_sub_get_data USING uf_file
                                    TABLES ct_int_log STRUCTURE zinterface_log.
    endform.
    I was told by someone at work to change it as follows: -
    form fr_sub_get_data USING uf_file
                                    CHANGING ct_int_log type ty_tab_int_log.
    endform.
    The reason is that when using the tables' clause to pass internal tables as parameters, a header line is automatically created in the subroutine which lasts for as long as the subroutine is being excecuted. Its considered to be a bad practise to use header lines (Work-Areas are preferable).
    Another important point to remember is that the 'tables' clause can only be used to pass <b>standard</b> internal tables as parameters. It can not be used for internal tables of other types.
    Cheers!

    HI
    GOOD
    GO THROUGH THIS LINK
    http://www.abapforum.com/forum/viewtopic.php?t=1962&language=english
    THANKS
    MRUTYUN

  • Passing Internal tables to Workflow

    Hello all,
    I learning workflow and have a small doubt related to passing internal table as parameter to workflow when it is triggered by a report program explicitely.
    I wrote a prog to upload data from flat file into internal table and by passing this ITAB to the workflow for futher processing. <b>Actually i succeeded in this with only one field in my flat file (lfa1-lifnr).</b>
    <b>what if my flat file contains more than one field? (i.e., lifnr, name1, city, county) how should i declare the parameters for my EVENT (triggering event) and same with my container declaration?</b>
    Any inputs in this regards are welcome.
    Thank you in advance,
    Lakshmi Narayana

    Hi Lakshmi,
    Create Workflow container
      swc_container        lt_container.
      swc_create_container lt_container.
    Fill internal table with data
    The container type and the internal table type should be same, U can use a structure to define both.
    Declare a structure with all the fields.
    Define a conatiner of same type of structure in worklow and set it in <b>wait for event</b> setp.
    swc_set_table lt_container '<container_name>' lit_int_data.
    CALL FUNCTION 'SWE_EVENT_CREATE'
        EXPORTING
          objtype           = lc_objtyp
          objkey            = lv_objkey
          event             = lc_event
        IMPORTING
          event_id          = lv_eventid
        TABLES
          event_container   = lt_container
        EXCEPTIONS
          objtype_not_found = 1
          OTHERS            = 2.
    Rgds,
    Prakash
    Message was edited by: Prakashsingh Mehra

  • PASSING INTERNAL TABLE

    I CREATED INTERNAL TABLE ITAB WITH 2 FIELDS EBELN , BUKRS.
    I WANT TO USE FUNCTION MODULE .
    I CAN PASS EBELN , BUKRS AS EXPORT PARAMETERS .
    HOW CAN I PASS ITAB TO FUNCTION MODULE . SHOULD I DECLARE OF TYPE ITAB IN EXPORT PARAMETER LIST IN FUNCTION MODULE .....
    I DECLARED JTAB TYPE ITAB IN EXPORT PARAMETER . BUT WHEN I AM WRITING QUERY IN THE SOURCE CODE OF FUNCTION MODULE , IT IS NOT IDENTIFYING JTAB AS THE INTERNAL TABLE .
    I WANT TO PROCESS SOME DATA AND EXPORT JTAB BACK TO ABAP PROGRAM .
    AM I GOING RIGHT...?

    hi Rajesh,
    While creating a FM and passing Table to it. u can not use Internal table as type. Instead u need to create a structure in Database and then give the type of table as the Structure type.
    Hope this helps u.
    <REMOVED BY MODERATOR>
    Regards,
    Preeti
    Edited by: Alvaro Tejada Galindo on Feb 14, 2008 4:37 PM

  • How to pass internal table to form routine..?

    Gurus,
    I am creating a custom Function module in which i have declared few perform statements and passing internal table to it..but when i declare the form it gives me error that the internal table is unknown...Can u please suggest me what am i doing wrong...
      DATA: Begin of tb_set_values occurs 0.
            include structure rgsb4.
      DATA: End of tb_set_values.
    PERFORM read_sets_with_values USING wa_setheader CHANGING tb_set_values[].
    FORM read_sets_with_values USING value(rwa_setheader) LIKE setheader
                               CHANGING rtb_set_values LIKE tb_set_values[].
    DATA: v_setid TYPE setid.
    *DATA: Begin of rtb_set_values occurs 0.
         include structure rgsb4.
    *DATA: End of rtb_set_values.
      CALL FUNCTION 'G_SET_GET_ID_FROM_NAME'
        EXPORTING
          SHORTNAME = rwa_setheader-setname
        IMPORTING
          NEW_SETID = v_setid.
      CALL FUNCTION 'G_SET_GET_ALL_VALUES'
        EXPORTING
          SETNR      = v_setid
        TABLES
          SET_VALUES = rtb_set_values.
    ENDFORM.
    What can be the error..please help

    Well actually, I just tested it and it works fine as you have written it in my test program, so not sure what you are doing wrong. This was tested in NW 7.0
    REPORT rich_0001.
    DATA: setheader TYPE string.
    DATA: wa_setheader TYPE string.
    DATA: BEGIN OF tb_set_values OCCURS 0.
            INCLUDE STRUCTURE t000. "<<-- Test with T000 instead    "rgsb4.
    DATA: END OF tb_set_values.
    SELECT * INTO TABLE tb_set_values  FROM t000.
    PERFORM read_sets_with_values USING wa_setheader
                                  CHANGING tb_set_values[].
    *&      Form  read_sets_with_values
    *       text
    *      -->VALUE(RWA_SETHEADER)  text
    *      -->RTB_SET_VALUES        text
    FORM read_sets_with_values USING value(rwa_setheader) LIKE setheader
                               CHANGING rtb_set_values LIKE tb_set_values[].
      DATA: ls_set_values LIKE LINE OF rtb_set_values.
      LOOP AT rtb_set_values INTO ls_set_values.
        WRITE:/ ls_set_values.
      ENDLOOP.
    ENDFORM.                    "read_sets_with_values
    Regards,
    RIch Heilman

  • Fetch data from table(ET_) which is exporting parameter of function module

    Hi,
    I m new to ABAP programming.
    I have to develop a smartform that has to be filled in with fields from few tables.
    These tables have the naming convention ET_<XXX> (i.e. exporting parameter of function module).
    I m not able to directly view its contents in se11 or use select query for it.
    I have a report program which i can execute to view these parameter names.
    Now, how do i fetch data from these parameters/tables and pass it from my driver program to smartform??
    Someone pls guide me...
    Thank You.

    Hi,
    I have done that using Field-Symbols.
    Thanks,
    Preetha

  • To pass internal table data(including subtotal) to dynamic internal table

    here i am displaying the dynamic internal table in alv grid.
    i followed like this but i am unable to get the subtotal form the internal table.
    LOOP AT ITAB1. " assigning <fs_itab1>.
        ASSIGN COMPONENT 'RACCT' OF STRUCTURE <DYN_WA> TO <DYN_FIELD>.
        <DYN_FIELD> = ITAB1-RACCT.
        ASSIGN COMPONENT 'ERGSL' OF STRUCTURE <DYN_WA> TO <DYN_FIELD>.
        <DYN_FIELD> = ITAB1-ERGSL.
        ASSIGN COMPONENT 'TEXT' OF STRUCTURE <DYN_WA> TO <DYN_FIELD>.
        <DYN_FIELD> = ITAB1-TEXT.
        I = 4.
        CLEAR COMP_ITAB.
        LOOP AT COMP_ITAB.
          ASSIGN COMPONENT I OF STRUCTURE <DYN_WA> TO <DYN_FIELD>.
         LOOP AT ITAB WHERE RACCT = ITAB1-RACCT.
           IF ITAB-RBUKRS EQ COMP_ITAB-RBUKRS.
          IF ITAB1-RBUKRS EQ COMP_ITAB-RBUKRS.
            <DYN_FIELD> = ITAB1-REPVAL.
            SUB_TOT = ITAB1-REPVAL.
          ELSE.
            <DYN_FIELD> = 0.
            SUB_TOT = 0.
          ENDIF.
         ENDLOOP.
          I = I + 1.
          TOTAL = TOTAL + SUB_TOT.
        ENDLOOP.
        ASSIGN COMPONENT I OF STRUCTURE <DYN_WA> TO <DYN_FIELD>.
        <DYN_FIELD> = TOTAL.
        APPEND <DYN_WA> TO <DYN_TABLE>.
        CLEAR <DYN_WA>.
        TOTAL = 0.
      ENDLOOP.
    Thanks,
    sridhar.

    Hi Rakesh,
    We pass internal tables for the smartform are shown in bold in below code,
    CALL FUNCTION LF_FM_NAME
        EXPORTING
          ARCHIVE_INDEX      = TOA_DARA
          ARCHIVE_PARAMETERS = ARC_PARAMS
          CONTROL_PARAMETERS = LS_CONTROL_PARAM
          MAIL_RECIPIENT     = LS_RECIPIENT
          MAIL_SENDER        = LS_SENDER
          OUTPUT_OPTIONS     = LS_COMPOSER_PARAM
          USER_SETTINGS      = ' '               
          ZXEKKO             = L_DOC-XEKKO
          ZXPEKKO            = L_DOC-XPEKKO
          ZNAST              = NAST
        IMPORTING
          DOCUMENT_OUTPUT_INFO = IT_DOCUMENT
          JOB_OUTPUT_INFO      = IT_OUTPUT_INFO
          JOB_OUTPUT_OPTIONS   = IT_JOB_OUTPUT
        <b>TABLES
          L_XEKPO            = L_DOC-XEKPO[]
          L_XEKPA            = L_DOC-XEKPA[]
          L_XPEKPO           = L_DOC-XPEKPO[]
          L_XEKET            = L_DOC-XEKET[]
          L_XTKOMV           = L_DOC-XTKOMV[]
          L_XEKKN            = L_DOC-XEKKN[]
          L_XEKEK            = L_DOC-XEKEK[]
          L_XKOMK            = L_XKOMK</b>  
    EXCEPTIONS
          FORMATTING_ERROR   = 1
          INTERNAL_ERROR     = 2
          SEND_ERROR         = 3
          USER_CANCELED      = 4
          OTHERS             = 5.
    Regards,
    Azaz Ali.

Maybe you are looking for

  • Absurdly slow internet speeds and often unable to ...

    I'm used to getting around 13 Mbps Internet speeds from BT. In the last few days, although the speed tests show similar results (assuming I can actually get online to test them), Internet browsing has become painfully slow, with many pages simply not

  • ITunes 10.5.3 update failes to install

    Window 7 64-bit currently running iTunes10.5.2.11 Every time i try and run the update for iTunes 10.5.3.3 x64 installer, it goes so far as to ask where to install (yes I ran the download manually after the automatic update failed a few times). Each t

  • A lot of JRE's installed...

    Good morning... here's something a bit wierd, but at least it doesn't involve pvc. i installed sun's jre1.2.2 and ibm's jre1.2.2. then i installed netscape 6.1 with it's jre1.3.0. now i have two plug-in control panels, 1 from sun and 1 from ibm and n

  • Date format in a parameter field (help)

    Post Author: binsk CA Forum: Formula Hi Guys, Newbie in CR world. I need help in changing the date format in parameter field. present setting is YYYY/MM/DD. I need it in DD/MM/YYYY. How is it to be done? My db is running in oracle. I'm using the CR X

  • Improvements for quality of screen sharing

    Hi, We have used the following values for screensharing from publisher side. We have already tried changing values specified in previous posts,however couldnt see big difference. These are the current values we have used, protected static const DEFAU