Reg: code problem in Function module

Hi Friends,
I am facing problem while developing Function module.
i declared following things in Import.
""Local Interface:
*"  IMPORTING
*"     VALUE(SOURCETABLETXT) TYPE  STRING
*"     VALUE(SELECTTXT) TYPE  STRING
*"     VALUE(SOURCEINFOOBJECT) TYPE  STRING
*"     REFERENCE(ITAB_OUTTAB)
*"     REFERENCE(ITAB_SOURCEPAK)
In source code writen as,
DATA DREF1 TYPE REF TO DATA.
FIELD-SYMBOLS: <ITAB_SPACK> TYPE ANY TABLE,
                    <WA1> TYPE ANY,
TYPES: BEGIN OF SOURCEIOJ,
        SOURCEINFOOBJECT(72) TYPE C ,
       END OF SOURCEIOJ.
DATA: ITAB_SOURCEIOJ TYPE TABLE OF SOURCEIOJ.
DATA: WA_SOURCEIOJ LIKE LINE OF ITAB_SOURCEIOJ.
ASSIGN ITAB_SOURCEPAK->* TO <ITAB_SPACK>.
CREATE DATA DREF1 LIKE LINE OF <ITAB_SPACK>.
ASSIGN DREF1->* TO <WA1>.
LOOP AT <ITAB_SPACK> assigning <WA1>.
READ TABLE ITAB_SOURCEIOJ INTO WA_SOURCEIOJ WITH KEY SOURCEINFOOBJECT = <WA1>-SOURCEINFOOBJECT.
IF SY-SUBRC <> 0.
WA_SOURCEIOJ-SOURCEINFOOBJECT = <WA1>-SOURCEINFOOBJECT.
INSERT WA_SOURCEIOJ INTO TABLE ITAB_SOURCEIOJ.
ENDIF.
ENDLOOP.
While checking i am getting error as The data object "<WA1>" has no structure and therefore no componentcalled "SOURCEINFOOBJECT". called "SOURCEINFOOBJECT".
SOURCEINFOOBJECT is not field in internal table which passing as reference and hence not in WA1.
But the input field which i give to SOURCEINFOOBJECT while calling the FM, that input field is the part of the intenal table
<ITAB_SPACK>, which ref of ITAB_SOURCEPAK passing to FM.
Please give some idea how to handle this.
Regards
MRK

Hey,
you declared <wa> as field symbol, so it won't contain the field that you are trying to read. Go through the following; it may help you.
Loop at <ITAB_SPACK> assigning <WA1>.
        do.
          assign component sy-index of structure <wa1> to <dyn_field>.
          if sy-subrc <> 0.
            exit.
          endif.
          if sy-index = 1.
            WA_SOURCEIOJ-SOURCEINFOOBJECT = <dyn_field>.
          else.
            WA_SOURCEIOJ-SOURCEINFOOBJECT = <dyn_field>.
          endif.
        enddo.
       endloop.
with regards
Mahesh

Similar Messages

  • Unable to write, type anything in source code of a function module.

    Hi all,
    We have a registered name space for our client called /ABCD/EFG.
    I need to create a function module in the name space.
    So first I created a Function Group called /ABCD/EFG_FG in /ABCD/EFG. I activated it in se80.
    Then I created a Function Module called /ABCD/EFG_FM in /ABCD/EFG. I declared the import and export paramters and now I am trying to add the code in source code and the editor does not let me change the source code donu2019t know why.. and every thing is in grey color.
    Can some one tell me what is going wrong? Cant we write any logic in the function module that we create in registered name spaces? When I created the same function module as a local object in $TMP package I dint have any problem. Similarly I created the function module in a Z package and I dint have any problem but if I try to create the same function module in a registered name space it is getting created but it doesnu2019t not let me type anything in the source code of the function module.
    Did any body encounter this problem earlier? Kindly please help.
    Regards,
    Jessica Sam

    Rich,
    Thanks a lot, that worked. Now it lets me type and change the source code of the editor.
    But while i was turing off the assistant it showed me 2-3 messages saying that "i cannot track the changes" and that "during upgrade i cant track the changes " etc.
    So now i can type in source code and i am able to change in source code..but will the trurning of this assistant cause any problmes in future or during upgrade?
    Regards,
    Jessica Sam

  • Hi  problems in function module

    Hi friends I have the following problems.........
    When I am using this  following code  in a function module
    its not giving me output until i comment those two fields kwmeng and netwr..i have use VRKME and WAERS  for those two..........which are the components of a structure i have created....unless i comment them its giving dump
    but when i am using the same thing in report...i am getting
    values..off course there is no use of structures......i am creating internal tables and using them ...
    i need to use this functio module...how can i get the data from those two fields..tell me the
    SELECT vbak~vbeln
           vbak~erdat
           vbak~vkorg
           vbak~ABRVW
           vbak~augru
           vbak~kunnr
           vbap~posnr
           vbap~matnr
           vbap~vkaus
           vbap~spart
         vbap~netwr
           vbap~waerk
         vbap~kwmeng
           vbap~kondm
           vbap~mvgr1
           vbap~mvgr2
           vbap~mvgr3
           vbap~mvgr4
           vbap~mvgr5
      FROM vbak AS vbak INNER JOIN vbap AS vbap
      ON vbakvbeln EQ vbapvbeln
      INTO corresponding fields of TABLE tvbak
    WHERE vbak~vbeln = vbeln1.

    there is aproblem witht he last line of your code:
    WHERE vbak~vbeln = vbeln1.
    it should be
    WHERE vbakvbeln = vbapvbeln.
    There is no problem with selection of netwr or Kwmeng .
    Edited by: Rachana Singh on Jan 21, 2008 9:09 AM

  • How to code a predifined function module in sap ,in se37.

    can any one tell me how to code a predifined function module in sap ,in se37.it's an immediate requirement.if u give a brief description it'll do.

    Hi Henry,
    There are two possible ways in which I can interpret your question.
    1. You want to create a new Function Module in SE37. you will have to refer to the <a href="http://help.sap.com/saphelp_47x200/helpdata/en/d1/801e9a454211d189710000e8322d00/frameset.htm">Function Builder</a> tutorial for that.
    2. You want to use an existing function module in your program. In the code of your program in SE38, click the button <i>Pattern</i>. On the pop-up, give the name of the function module that you wish to use in your program.
    Regards,
    Anand Mandalika.

  • How to insert a code for a function module into a Customer Exit Variable?

    I have two Key Figures viz., Net Prchs Rtl, and Net Prchs Unt. Both these Key figures have This Week (TW) and Last Week (LW). There is a variable for This week but there is no variable defined for Last week.
    I need to get data in the column LW (Last Week) for both the key figures.
    In function module EXIT_SAPLRRS0_001 one of the functions I have is:
    Get the previous Fiscal Week
              CALL FUNCTION 'DATE_TO_PERIOD_CONVERT'
    I need to create a new variable to get values in the Last week column for different key figures and use function “'DATE_TO_PERIOD_CONVERT'” in that variable.
    Can anyone please explain me the steps as to how to use a function module in a variable so that when the variable is used in a key figure it shows the output.
    In other words what I want to know is after creating a Customer exit variable of type Characteristic value how do I refer the above mentioned function moduel and insert the code for the function module into the Customer exit variable that I created.
    Thank you.
    TR.

    Hi Wond,
    Thanks a lot for your reply. I understand what you mean but I have never done this before so can you please explain it in a detailed manner. I have the following code:
    Get the previous Fiscal Week
              CALL FUNCTION 'DATE_TO_PERIOD_CONVERT'
                EXPORTING
                  i_date         = ld_date
                  i_periv        = lc_periv
                IMPORTING
                  e_buper        = ln_poper
                  e_gjahr        = ln_bdatj
                EXCEPTIONS
                  input_false    = 1
                  t009_notfound  = 2
                  t009b_notfound = 3
                  OTHERS         = 4.
              IF sy-subrc <> 0.
                MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
              ELSE.
                lc_poper = ln_poper.
                CONCATENATE ln_bdatj lc_poper+1(2) INTO wa_e_t_range-low.
                wa_e_t_range-sign = 'I'.
                wa_e_t_range-opt = 'EQ'.
                APPEND wa_e_t_range TO e_t_range.
              ENDIF.
            ENDIF.
          ENDIF.
        ENDIF.
    I believe I should now use the above code in my customer exit variable. If that's right can you please explain me the steps as to how should I do this so that the variable gets populated.
    Thank you.
    Regards,
    TR.

  • Problem using Function Module IDOC_INBOUND_ASYNCHRONOUS

    Hi friends,
    I have a critical problem load idoc ARTMAS05. I development a program for load the data with idoc but my program call the function module IDOC_INBOUND_ASYNCHRONOUS close my session of the SAP GUI and lose the load. This problem begining today because yesterday was work well. This morning when I'm load the idoc gave to me a short dump with this message "SNAP_NO_NEW_ENTRY" I have find some notes and obtained this note 17537.
    Note Solution
    Solution
    When the SNAP Table is full: Reorganize the table e.g. via Transaction ST22->Go to->Reorganize. Please also refer to Note 16083. This may lead to other errors of this kind since not all dumps e.g. from SM21 can be displayed.
    In case of database problems, the errors should no longer occur with new short dumps after correcting the database error. Here, other errors of this kind may occur in SM21 as well.
    After apply the correction begin the error that I close me the Session of SapGui and lose all my data proccessing. Please need your help.
    Thank and regards..

    Hi Sir,
    I am also facing the same issue...i need to update dependents Information  Date Of Birth n Perid(Which is stored in IT0106)...in IT 0021..
    Kindly correct my code....
    I am using the following code for this...
    data: w_return type  bapireturn1.
    data: p0021_struc TYPE p0021,
          p0106_struc TYPE p0106,
          p_pskey   TYPE pskey.
    start-of-selection.
    get pernr.
    p0021_struc = p0021.
    p0021_struc-favor = 'Gaurav'.
    p0021_struc-fgbdt = '05/10/1955'.
    Move p0021_struc-favor to p0021-favor.
      p0106_struc = p0106.
      p0106_struc-stras = '2235 BOmbay Road'.
      p0106_struc-perid = '123456789'.
      MOVE p0106_struc-stras to p0106-stras.
    Enqueue personnel number
      call function 'BAPI_EMPLOYEE_ENQUEUE'
        exporting
          number = pernr-pernr
        importing
          return = w_return.
      CALL FUNCTION 'HR_INFOTYPE_OPERATION'
        EXPORTING
          infty            = p_pskey-infty
          number           = p_pskey-pernr
          subtype          = p_pskey-subty
          objectid         = p_pskey-objps
          lockindicator    = p_pskey-sprps
          validityend      = p0021-endda         " '99991231'
          validitybegin    = p0021-begda
          record           = p0021_struc
          operation        = 'mod'
          tclas            = 'A'
          dialog_mode      = '2'
         nocommit         = p_test
          VIEW_IDENTIFIER  = '07'              "p0003-viekn
          secondary_record = p0106_struc
        IMPORTING
          return           = w_return
         key              = familykey
        EXCEPTIONS
          OTHERS           = 0.
    Enqueue personnel number
      call function 'BAPI_EMPLOYEE_DEQUEUE'
        exporting
          number = pernr-pernr
        importing
          return = w_return.

  • Problems in Function Module of a Custom Virtual Cube

    Hi all,
    I have copied a Function Module-- RS_BCT_FIGL_DATA_GET_VC10 into a custom one ZRS_BCT_FIGL_DATA_GET_VC10. A custom Virtual Cube(ZFIGL_V10) was also created using this FM. The Function Module and Function Group are activated and there are no syntax errors in the custom FM.
    When I try to check data of this virtual cube using the T-CODE "listcube" it gives me the following errors.
    1. "An exception with the type CX_SY_DYN_CALL_ILLEGAL_FUNC occurred, but was neither handled locally, nor declared in a RAISING"
    2. "The function call failed; the function ZRS_BCT_FIGL_DATA_GET_V10 is either not activated or contains no code"
    Also some queries are not executing in this Virtual Cube.
    Could not figure out what the problem was.Can someone help me on this?
    Thanks
    Maddy

    HI,
    Can you check whether the FM is activated. Also check the function module group is activated or not. You can check the status of the same via SE80.
    Goto SE80 -> Select function grp -> give your function grp and press enter
    Double click on the below funtion grp to check status.
    Also expand FM and check whether it is activated.
    Also check the import and export parameters of the FM. Try to see whether there is any discrepancy.
    If any default values are specified, check whether they are correct.
    Also try to debug, put a breakpoint in your code and check whether it gets into the code or not.
    Regds,
    Shashank

  • PROBLEM in function module extractor

    Hi ,
    i m facing a problem in creating a function module as extractor in srm but its not working plz letme know the way i can create the zfunction module as extrator.
    i created a datasource ZSRM_CS in which i m using BBP_PDS_CND as extraction structure and Z_BIW_GET_DATA_SIMPLE as zfunction module
    but even wen i use rsa3 in debug mode its not stoping and gives error
    ERROR6 plz letmme know the problem.
    i copied the standard module RSAX_BIW_GET_DATA_SIMPLE .
    n hide the irrelvant things. tell me y its not stoping in debug mode in rsa3
    Thnx
    Regards

    Thnx for ur concern ...but i have already mentioned. my code goes llike this.plz have a luk
    FUNCTION Z_BIW_GET_DATA_SIMPLE.
    ""Local Interface:
    *"  IMPORTING
    *"     VALUE(I_REQUNR) TYPE  SRSC_S_IF_SIMPLE-REQUNR OPTIONAL
    *"     VALUE(I_DSOURCE) TYPE  SRSC_S_IF_SIMPLE-DSOURCE OPTIONAL
    *"     VALUE(I_MAXSIZE) TYPE  SRSC_S_IF_SIMPLE-MAXSIZE OPTIONAL
    *"     VALUE(I_INITFLAG) TYPE  SRSC_S_IF_SIMPLE-INITFLAG OPTIONAL
    *"     VALUE(I_READ_ONLY) TYPE  SRSC_S_IF_SIMPLE-READONLY OPTIONAL
    *"  TABLES
    *"      I_T_SELECT TYPE  SRSC_S_IF_SIMPLE-T_SELECT OPTIONAL
    *"      I_T_FIELDS TYPE  SRSC_S_IF_SIMPLE-T_FIELDS OPTIONAL
    *"      E_T_DATA TYPE  ZT_BBP_PDS_CND OPTIONAL
    *"  EXCEPTIONS
    *"      NO_MORE_DATA
    *"      ERROR_PASSED_TO_MESS_HANDLER
    Example: DataSource for table SFLIGHT
      TABLES: ZQUOTATION.
    Auxiliary Selection criteria structure
      DATA : L_S_SELECT TYPE SRSC_S_SELECT.
      DATA : GIT_QTN type table of ZQUOTATION with header line .
      DATA : GIT_TAB type table of BBP_PDS_CND with header line .
    Maximum number of lines for DB table
      STATICS: S_S_IF TYPE SRSC_S_IF_SIMPLE,
    counter
              S_COUNTER_DATAPAKID LIKE SY-TABIX,
    cursor
              S_CURSOR TYPE CURSOR.
    Select ranges
    RANGES: L_R_CARRID  FOR SFLIGHT-CARRID,
             L_R_CONNID  FOR SFLIGHT-CONNID.
    Initialization mode (first call by SAPI) or data transfer mode
    (following calls) ?
    IF I_INITFLAG = SBIWA_C_FLAG_ON.
    Initialization: check input parameters
                    buffer input parameters
                    prepare data selection
    Check DataSource validity
      CASE I_DSOURCE.
       WHEN '0SAPI_SFLIGHT_SIMPLE'.
         WHEN OTHERS.
          IF 1 = 2. MESSAGE E009(R3). ENDIF.
    this is a typical log call. Please write every error message like this
           LOG_WRITE 'E'                  "message type
                     'R3'                 "message class
                      '009'                "message number
                     I_DSOURCE   "message variable 1
                    ' '.                 "message variable 2
            RAISE ERROR_PASSED_TO_MESS_HANDLER.
       ENDCASE.
        APPEND LINES OF I_T_SELECT TO S_S_IF-T_SELECT.
    Fill parameter buffer for data extraction calls
        S_S_IF-REQUNR    = I_REQUNR.
        S_S_IF-DSOURCE = I_DSOURCE.
       S_S_IF-MAXSIZE   = I_MAXSIZE.
    Fill field list table for an optimized select statement
    (in case that there is no 1:1 relation between InfoSource fields
    and database table fields this may be far from beeing trivial)
       APPEND LINES OF I_T_FIELDS TO S_S_IF-T_FIELDS.
    ELSE.                 "Initialization mode or data extraction ?
    Data transfer: First Call      OPEN CURSOR + FETCH
                   Following Calls FETCH only
    First data package -> OPEN CURSOR
       IF S_COUNTER_DATAPAKID = 0.
    Fill range tables BW will only pass down simple selection criteria
    of the type SIGN = 'I' and OPTION = 'EQ' or OPTION = 'BT'.
       select * from ZQUOTATION
                into table GIT_QTN .
       LOOP AT GIT_QTN .
        CALL FUNCTION 'BBP_PDCND_GETDETAIL'
          EXPORTING
            i_p_guid                      = GIT_QTN-GUID1
           I_P_KIND                      = 'B'
           I_OBJECT_TYPE                 = GIT_QTN-OBJECT_TYPEH
         IV_VERSION_TYPE               = ' '
            iv_header_guid                = GIT_QTN-HEADER
          IV_WITH_DELETED_RECORDS       = ' '
         IMPORTING
           ET_CONDITIONS                 = GIT_TAB
          E_COM                         =
        TABLES
          E_T_DATA                      =
          MOVE-CORRESPONDING GIT_TAB TO E_T_DATA.
        ENDLOOP.
         LOOP AT S_S_IF-T_SELECT INTO L_S_SELECT WHERE FIELDNM = 'CARRID'.
           MOVE-CORRESPONDING L_S_SELECT TO L_R_CARRID.
           APPEND L_R_CARRID.
         ENDLOOP.
         LOOP AT S_S_IF-T_SELECT INTO L_S_SELECT WHERE FIELDNM = 'CONNID'.
           MOVE-CORRESPONDING L_S_SELECT TO L_R_CONNID.
           APPEND L_R_CONNID.
         ENDLOOP.
    Determine number of database records to be read per FETCH statement
    from input parameter I_MAXSIZE. If there is a one to one relation
    between DataSource table lines and database entries, this is trivial.
    In other cases, it may be impossible and some estimated value has to
    be determined.
         OPEN CURSOR WITH HOLD S_CURSOR FOR
         SELECT (S_S_IF-T_FIELDS) FROM SFLIGHT
                                  WHERE CARRID  IN L_R_CARRID AND
                                        CONNID  IN L_R_CONNID.
       ENDIF.                             "First data package ?
    Fetch records into interface table.
      named E_T_'Name of extract structure'.
       FETCH NEXT CURSOR S_CURSOR
                  APPENDING CORRESPONDING FIELDS
                  OF TABLE E_T_DATA
                  PACKAGE SIZE S_S_IF-MAXSIZE.
       IF SY-SUBRC <> 0.
         CLOSE CURSOR S_CURSOR.
         RAISE NO_MORE_DATA.
       ENDIF.
       S_COUNTER_DATAPAKID = S_COUNTER_DATAPAKID + 1.
      ENDIF.              "Initialization mode or data extraction ?
    ENDFUNCTION.
    plz letme know where i m wrong in code,
    wt my code is doing its picking the GUID! and header from view zquation and through fm 'BBP_PDCND_GETDETAIL' its returning et conditions whichi have to pass to data source .
    Thnx

  • Problem in Functional Module on BW Query

    Hi,
    We are working on below requirement in BW.
    We have to fetch the data of BW Query via a functional module to web services. We have created a query and a functional module based on that query. To create the function module on query, we have followed the standard method suggested in SAP blog. (ie. Input parameters for Functional Module is Filters use in Query and output parameters will be Keyfigures and Char. Of the Query).
    We have 0PLANT in the raw section in query. We want to fetch plant text in the Function module output. But, our problem is we are getting Plant KEY value only in the output of functional module.
    0PLANT properties in query designer is set to TEXT only.
    So, in short, we want to have 0PLANT Text in the function module output.
    Please suggest.
    Regards,
    Macwan James.

    Hi,
    In your Function module, I hope the code is perfect. Please check your Infoobject maintenance whether text was maintained.
    Regards,
    Suman

  • Need code for a function module- Urgent

    Hi friends,
    I have a requirement where I am giving material description as an import parameter in the function module. ( Material description could be a wild search -- say - Mat* ) I want a sub routine in the function module which should get all the materials from the database ( mara or makt..not sure ) for the user entered Material description.
    I want this particular code to be written using a sub-routine using formal parameters inside this fm . Could any one send me the code for this.
    Thanks in advance,
    Vishnu.

    Hi Vishvanath,,
    Please find the below code.
    DATA : BEGIN OF itab OCCURS 0,
           matnr LIKE makt-MATNR,
           MAKTX LIKE makt-MAKTX,
           END OF itab.
    DATA : BEGIN OF itab1 OCCURS 0,
           matnr LIKE makt-MATNR,
           MAKTX LIKE makt-MAKTX,
           END OF itab1.
    data : a(5) type c value 'TEST'.
    perform mat_no using a.
    form mat_no  using    p_a.
    data : lv_temp(4) type c.
    select matnr maktx from makt into table itab.
    loop at itab.
    lv_temp = itab-maktx+0(4).
    if lv_temp = p_a.
      move itab to itab1.
      APPEND ITAB1.
    endif.
    endloop.
    loop at itab1.
    write :/ itab1.
    endloop.
    endform.                    " mat_no
    Thanks.
    Amjad.

  • Problem in Function Module "ALSM_EXCEL_TO_INTERNAL_TABLE"

    Dear All,
    In this function module we give the number of end rows to be picked from the excel sheet. So, please tell me what can be the maximum number, currently I have put 4000 end rows.
    Thanx&Reg,
    Nishu

    Hai Nishu
    *& Report ZK_REPORT *
    REPORT ZK_REPORT.
    internal table declarations
    DATA: BEGIN OF ITAB OCCURS 0,
    NAME(20) TYPE C,
    ADDR(20) TYPE C,
    END OF ITAB.
    DATA: ITAB1 LIKE ALSMEX_TABLINE OCCURS 0 WITH HEADER LINE.
    DATA: K1 TYPE I VALUE 1,
    M1 TYPE I VALUE 1,
    K2 TYPE I VALUE 100,
    M2 TYPE I VALUE 9999.
    use FM for uploading data from EXCEL to internal table
    CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE'
    EXPORTING
    FILENAME = 'C:\book1.xls'
    I_BEGIN_COL = K1
    I_BEGIN_ROW = M1
    I_END_COL = K2
    I_END_ROW = M2
    TABLES
    INTERN = ITAB1
    EXCEPTIONS
    INCONSISTENT_PARAMETERS = 1
    UPLOAD_OLE = 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 ITAB1.
    WRITE:/ ITAB1.
    ENDLOOP.
    Thanks & regards
    Sreeni

  • Problem with function module calling

    Hi,
    I have two questions here
    i have a function moduel 'Z_GET_MATL_BALANCE'
    in my code it called in the below said way
    CALL FUNCTION 'Z_GET_MATL_BALANCE'
        DESTINATION 'NONE'
        STARTING NEW TASK 'A'
        PERFORMING f_back ON END OF TASK
        EXPORTING
          ref_dte    = s_datum-low
          str_dte    = s_datum-high
          end_dte    = s_datum-high
          i_werks    = p_werks
          i_past     = 'X'
          i_future   = 'X'
          verselem   = p_mrpver
          plscn      = p_scenar
          r_outrec   = r_outrec
          supstk     = p_supstk
          days_ahead = w_days_ahead
          shipnt     = p_shipnt
        TABLES
          mat_bals   = w_zmat_bals_a
          i_zdatum   = i_datum
          mat_movmts = w_mat_movmts_a
          mat_ship   = i_mat_ship_a.
      IF sy-subrc NE 0.
        MESSAGE e005(ZMIM) WITH
       text-009 text-166 text-054 sy-subrc.
      ENDIF.
    FORM f_back USING task.
      CASE task.
        WHEN 'A' .
          RECEIVE RESULTS FROM FUNCTION 'Z_GET_MATL_BALANCE'
         TABLES
              mat_bals                     = w_zmat_bals_a
              mat_movmts                   = w_mat_movmts_a
              mat_ship                     = i_mat_ship_a
           EXCEPTIONS
                call_material_lesen_fail     = 1
                call_t450n_fail              = 2
                call_t399d_fail              = 3
                call_aufbauen_mdpsx_fail     = 4
                call_mdezx_aufbauen_fail     = 5
                call_t001w_fail              = 6
                call_zmrpelem_failed         = 7
                call_aufbauen_mdpsx_sim_fail = 8
                OTHERS                       = 9.
          IF SY-SUBRC NE 0.
           RET_CODE1 = SY-SUBRC.
          ENDIF.
    now my first question is what is the difference between function modules calling normally and in the above said way
    and the second question is
    under tables parameter i have four internal tables defined where as while calling the same function module using recive results i have three internal tables. is this correct?
    i am asking this because i am getting an error message while using this funciton module
    please do not give generic answers, all the helpful answers will get a def reward

    Call function starting new task is used to make Asynchronus RFC Call. In this case your function module will be called in a NEW SESSION and it will exceute independently from the Main program which is calling the FM. Also, the main program will continue its own processing and it will not wait for the RFC FM to complete.
    Its not mandatory to have all the TABLES parameters in the RETURN Perform (..Receive results from ...)

  • Problem using Function Module

    Hi,
    I am using RH_STRUC_GET with evalPath O-O-S-P and get the or g structure. I then loop through the table obtained from RH_STRUC_GET and re-use RH_STRUC_GET with a evaluation path 'bossonly' to find out who the managers are. But it does not work. I get No ROOTS FOUND error.
    When I try the function module RH_STRUC_GET separately with the same input fields then it works!!!
    Please let me know if I am doing anything wrong. My code is shown below....
    FUNCTION Z_ORGBUILDER_CONN.
    ""Local interface:
    *"  IMPORTING
    *"     VALUE(OTYPE) LIKE  OBJEC-OTYPE
    *"     VALUE(OBJID) LIKE  OBJEC-OBJID
    *"     VALUE(PATHID) LIKE  GDSTR-WEGID
    *"     VALUE(PLVAR) LIKE  OBJEC-PLVAR
    *"  EXPORTING
    *"     VALUE(RETURN) LIKE  BAPIRET2 STRUCTURE  BAPIRET2
    *"  TABLES
    *"      L_ZCONN_TAB TYPE  ZCONN_TAB
    *"      RESULT_TAB STRUCTURE  SWHACTOR OPTIONAL
    *"      RESULT_OBJEC STRUCTURE  OBJEC OPTIONAL
    *"      RESULT_STRUC STRUCTURE  STRUC OPTIONAL
    *"      L_ZCONN_ORG TYPE  ZCONN_TAB
    *"      L_ZCONN_POS_HOLDER TYPE  ZCONN_POS_TAB
    *"      L_MANAGERS STRUCTURE  OBJEC
    DATA: z_struc type zconn_struc.
    DATA: xresult_struc like result_struc.
    DATA: yresult_struc like result_struc.
    DATA: z_struc1 type zconn_struc.
    DATA: z_struc_pos type zconn_position.
    DATA: temp_tab LIKE SWHACTOR occurs 0 with HEADER LINE.
    DATA: temp like struc-objid.
            CALL FUNCTION 'RH_STRUC_GET'
              EXPORTING
                          act_otype = otype
                          act_objid = objid
                          act_plvar = plvar
                          act_wegid = pathid
              TABLES
                          result_tab = result_tab
                          result_struc = result_struc
                          result_objec = result_objec
              EXCEPTIONS
                          no_plvar_found = 1
                          no_entry_found = 2
                          OTHERS = 3.
              IF sy-subrc <> 0.
                          RAISE no_roots_found.
              ENDIF.
    LOOP AT result_struc into xresult_struc.
          read table result_struc into yresult_struc with key seqnr =
    xresult_struc-pup.
            if sy-subrc = 0.
            z_struc-objectID = xresult_struc-OBJID.
            z_struc-objectType = xresult_struc-otype.
            z_struc-parentID = yresult_struc-objid.
            z_struc-parentType = yresult_struc-otype.
    endif.
    Append z_struc to l_zconn_tab.
    ENDLOOP.
    LOOP AT l_zconn_tab.
      if l_zconn_tab-objectType = 'O' or l_zconn_tab-objectType = 'S'.
            z_struc1-objectID = l_zconn_tab-objectID.
            z_struc1-objectType = l_zconn_tab-objectType.
            z_struc1-parentID = l_zconn_tab-parentID.
            z_struc1-parentType = l_zconn_tab-parentType.
    Append z_struc1 to l_zconn_org.
        endif.
    ENDLOOP.
    LOOP AT l_zconn_tab.
      if l_zconn_tab-objectType = 'P'.
            z_struc_pos-position = l_zconn_tab-parentID.
            z_struc_pos-pos_holder = l_zconn_tab-objectID.
    Append z_struc_pos to l_zconn_pos_holder.
        endif.
    ENDLOOP.
    loop at result_struc.
      if result_struc-otype = 'O'.
            CALL FUNCTION 'RH_STRUC_GET'
              EXPORTING
                          act_otype = 'O'
                          act_objid = result_struc-objid
                          act_plvar = '01'
                          act_wegid = 'bossonly'
              TABLES
                          result_tab = temp_tab
              EXCEPTIONS
                          no_plvar_found = 1
                          no_entry_found = 2
                          OTHERS = 3.
              IF sy-subrc <> 0.
                          RAISE no_roots_found.
              ENDIF.
              APPEND LINES OF temp_tab to L_managers.
          endif.
    endloop.
    ENDFUNCTION.

    data: begin of itab occurs 0,
          orgunit(10) type c,
          mananger(30) type c,
          end of itab.
    * This will add a record to your itab
    loop at result.
      itab-orgunit = result-orgunit.   " I don't know what fields they are
      itab-manager = result-manager.
      append itab.
    endloop.
    Please remember to award points for helpful answers and mark this post as solved if you question has been answered.  Thanks.
    Regards,
    Rich Heilman

  • Problem using function module for infotype 21

    hi
    im uploading the infotype 21 (family details) through function module hr_infotype_operations. i found that infotype 0106 (family/related person)
    is a secondary infotype and that a record is created for 0106 ,everytime you create a record in 21. so i upload the family data of an employee using the function module for infotype 21 initially. and then fetch the same record from the table pa0106 and modify the same record with other information.
    for example : u have the address details of a dependent(father subtype 11) in infotype 21. this address data is stored in the table pa0106 .  im not able to modify the record for infotype 0106 using the function module 0106.
    i would like to know the reason for the same. Is it because that infotype 0106 is a secondary infotype and u cannot modify the record using the fn module..?/
    thanks
    sridharan

    Hi Sir,
    I am also facing the same issue...i need to update dependents Information  Date Of Birth n Perid(Which is stored in IT0106)...in IT 0021..
    Kindly correct my code....
    I am using the following code for this...
    data: w_return type  bapireturn1.
    data: p0021_struc TYPE p0021,
          p0106_struc TYPE p0106,
          p_pskey   TYPE pskey.
    start-of-selection.
    get pernr.
    p0021_struc = p0021.
    p0021_struc-favor = 'Gaurav'.
    p0021_struc-fgbdt = '05/10/1955'.
    Move p0021_struc-favor to p0021-favor.
      p0106_struc = p0106.
      p0106_struc-stras = '2235 BOmbay Road'.
      p0106_struc-perid = '123456789'.
      MOVE p0106_struc-stras to p0106-stras.
    Enqueue personnel number
      call function 'BAPI_EMPLOYEE_ENQUEUE'
        exporting
          number = pernr-pernr
        importing
          return = w_return.
      CALL FUNCTION 'HR_INFOTYPE_OPERATION'
        EXPORTING
          infty            = p_pskey-infty
          number           = p_pskey-pernr
          subtype          = p_pskey-subty
          objectid         = p_pskey-objps
          lockindicator    = p_pskey-sprps
          validityend      = p0021-endda         " '99991231'
          validitybegin    = p0021-begda
          record           = p0021_struc
          operation        = 'mod'
          tclas            = 'A'
          dialog_mode      = '2'
         nocommit         = p_test
          VIEW_IDENTIFIER  = '07'              "p0003-viekn
          secondary_record = p0106_struc
        IMPORTING
          return           = w_return
         key              = familykey
        EXCEPTIONS
          OTHERS           = 0.
    Enqueue personnel number
      call function 'BAPI_EMPLOYEE_DEQUEUE'
        exporting
          number = pernr-pernr
        importing
          return = w_return.

  • Urgent: problems in function module extraction

    Hi Gurus,
    I am new to BW and My requirement is to extract the notes from CRM as it is not stored in database tables i used functional module to extract it i have used standard FM RSAX_BIW_GET_DATA_SIMPLE but in that when i map E_T_DATA with my own structure with like or type keyword in tables tab(e.g. E_T_DATA LIKE/TYPE ZCRM_OREDR_STR) i am getting a warning msg "tables parameters are obsolete". Would anyone please suggest me what i need to do. I appreciate it in advance. I def. award points.
    Thanks a lot
    With Regards
    Venkat

    Hi PSG,
    Thanks a lot for quick response. when i use tables it is once again giving an error "The typing method can be 'Like', 'Type', or 'Type Ref To'" I even used all the three than also same problem. Actually it is coming in Function Builder in Tables tabstrip when i use E_T_DATA Like/tables/type/type ref to ZCRM_ORDER_STR I donot know why it is happening. Please would you suggest me what to do.
    Thanks a lot
    With Regards
    Venkat.

Maybe you are looking for

  • Converting aac files to aiff format in iTunes 8.0

    I've always been able to convert files by using the preferences, advanced, import tab on iTunes. With 8.0, I can convert to mp3 format without having to go through preferences, but there is no place to convert an aac (mp4) to an aiff, which is what I

  • Data load from R/3....(problem)

    Hello all, I have a query regarding data load. Business scenario  is : 1) I had taken "init delta"  2 months ago....had started deltas at that time... 2) somehow...i need to delete whole data.... 3) present RSA7  in R/3 :  Delta queue : 0 records    

  • Cover flow order

    for some reason some of the albums that I have end up at the end of my cover flow list. all of the album information is correct and everything it just for whatever reason ends up at the end of the list, is there anything to do, or is it just stuck li

  • Nothing seems to solve my MacBook Pro problem 'Could not sign in.Please Check your network connection and try again'

    On old MacBook Pro Version 10.6.8 downloaded Facetime from the Mac Store as instructed but error loging in says 'Could not sign in.Please Check your network connection and try again'. I have follwed all these discussion fixes with DNS settings 8.8.8.

  • Please help re auto-curve line altering feature

    to all Illustrator artists and experts: Can you please tell me the name of the Illustrator auto-curve line altering feature and how to adjust it or turn it off?  When I draw a line, and want that line not to be a perfect curve, when I complete the li