Function Module Call Via CMOD Logic for Master Data Enhancement

Hi Friends Please help me to resolve this, would really be very kind of all of you.
Requirement. I want to Enhance the field ZFACTREG from VIBDBE table in my datasource 0busentity_attr extract structure l_s_REIS_BUSENTITY_ATTR, I want to create the logic in CMOD exit_saplrsap_002 to call my function module for enhancement of master data. Please help me Step by Step
Thanks
Poonam Roy
<b>Step #1</b>
I put this code which gives me error in CMOD like this
ERROR : Das formale Argument 'OTHERS' muss am Schluss der Ausnahmeliste stehen.
ABAP Code#1 IN exit_saplrsap_002     
DATA: l_d_fmname(30) TYPE c.
CONCATENATE 'Z_DS_' i_datasource(25) INTO l_d_fmname.
TRY.
CALL FUNCTION l_d_fmname
EXPORTING
I_DATASOURCE = I_DATASOURCE
I_UPDMODE = I_UPDMODE
TABLES
I_T_SELECT = I_T_SELECT
I_T_FIELDS = I_T_FIELDS
I_T_DATA = I_T_DATA
C_T_MESSAGES = C_T_MESSAGES
EXCEPTIONS
RSAP_CUSTOMER_EXIT_ERROR = 1
OTHERS = 2
IF FOUND.
IF SY-SUBRC <> 0.
RASIE RSAP_CUSTOMER_EXIT_ERROR.
END IF
CATCH CX_SY_DYN_CALL_ILLEGAL_FUNC.
ENDTRY.
<b>Step#2</b>
I simple created the Function module Z_DS_BUSINESS
and put the code in source code  which gives me error . what should i put in other tabs like"Import", Export", Tables" i kept blank
ABAP CODE give me error : The Dictionary structure or table "FIELD-SYMBOLS" is either not active. i have to remove include in the FM. WHY SO??
FUNCTION Z_DS_BUSINENSS
""Lokale Schnittstelle:
*"       IMPORTING
*"             VALUE(I_DATASOURCE) TYPE  RSAOT_OLTPSOURCE
*"             VALUE(I_CHABASNM) TYPE  SBIWA_S_INTERFACE-CHABASNM
*"             VALUE(I_UPDMODE) TYPE  SBIWA_S_INTERFACE-UPDMODE
*"       TABLES
*"              I_T_SELECT TYPE  SBIWA_T_SELECT
*"              I_T_FIELDS TYPE  SBIWA_T_FIELDS
*"              I_T_DATA
*"              C_T_MESSAGES STRUCTURE  BALMI OPTIONAL
*"       EXCEPTIONS
*"              RSAP_CUSTOMER_EXIT_ERROR
INCLUDE ZXRSAU02.
  WRITE: / 'INSIDE THE Z_DS_MEASUREMENTS PROGRAM'.
TABLES: REIS_BUSENTITY_ATTR,
        VIBDBE,
field-symbols:.<fs_REIS_BUSENTITY_ATTR> like REIS_BUSENTITY_ATTR.
DATA: BEGIN OF i_c_t_data OCCURS 0.
          include structure REIS_BUSENTITY_ATTR.
DATA END OF i_c_t_data.
DATA: i_c_t_data_copy like i_c_t_data OCCURS 0 WITH HEADER LINE,
      begin of i_vibdbe occurs 0,
      INTRENO like vibdbe-INTRENO,
      ZFACTREG like vibdbe-ZFACTREG,
              end of i_vibdbe.
i_c_t_data_copy[] = i_c_t_data[] = c_t_data[].
sort i_c_t_data_copy by vibdbe.
Select  INTRENO
        into table i_VIBDBE from VIBDBE
        for all entries in i_c_t_data_copy
        where  INTRENO = i_c_t_data_copy- INTRENO.
if sy-subrc = 0.
  sort i_VIBDBE by INTRENO.
  loop at i_c_t_data assigning <fs_REIS_BUSENTITY_ATTR>.
    clear: i_VIBDBE.
    read table i_VIBDBE with key INTRENO = <fs_REIS_BUSENTITY_ATTR>-INTRENO
    BINARY SEARCH
    transporting ZFACTREG .
    if sy-subrc = 0.
      <fs_REIS_BUSENTITY_ATTR>-ZZFACTORY = i_vibebe-ZFACTREG
    endif.
null

(I leave office until Monday morning, Europe time)
in include from customer-exit ZXRSAU01, etc.
CASE I_DATASOURCE.
WHEN '0CUSTOMER_ATTR'.
   PERFORM 0customer_attr changing i_t_data...
ENDCASE.
In each perform, doing what you wrote ; select (needed fields) from complementary-database-table into an internal table with a for all entries. sort the table. LOOP and MODIFY on i_t_data.
In some case i had to insert lines of i_t_data to an internal table of DS_structure when entering subroutine and back at exit. (on 4.6C PI 2003 if i remember)
Some optimization done when reading small tables (T001 society and the same, these are filled once and not for each packet of data.
Your idea of creating different FM is of interest, but the cost of passing i_t_data between two programs (two function groups) may overcome the gain of performance. In a job only one DataSource is processed so only one routine is actually called.
Regards.

Similar Messages

  • How to Debug Functional Module called via RFC?

    Hi Experts,
         Please, can someone explain to me how to debug functional module that is called via RFC? Thanks in advance.
      Best Regards,
    Aleksandar

    Hi Laxman,
       First of all thank you very much for giving attention to my post. Ok, I am trying to debug function module in RM-CA (FICA), function module is called by CRM system (via RFC) and in addition all this chain is triggered by WebClient.
         I have user that can login on the CRM as well as on RM-CA (ECC 6.0) system, but those users are different (unfortunately I do not have administration permission so I can’t change profiles of my users but I can ask for it). I can without any problem debug calls that come from WebClient, so setting an external break point in CRM system I can catch whatever I want but when process comes to point where actually call to back-end (RM-CA) takes place I simply can’t get into functional module, that resides on RM-CA side. Actually what happens is that processing continues as was chosen ‘NEXT STEP’ (F6).
         To resume, two systems and two different users. Where XCM user should be created? (on RM-CA system or CRM). Should I change something in Menu option Utilities -> Settings -> ABAP Editor tab -> Debugging tab, in field users?  If you need any additional info please tell me.
      Thanks again for your support.
    Aleksandar

  • Function module to get month lists for entered date

    Hi Experts,
    Is there any function module which gives me output as mentioned below.
    Eg Input : 01.10.2010 - 01.02.2011
         OUTPUT :  OCT 2010
                          NOV 2010
                          DEC 2010
                          JAN 2011
                          FEB 2011
    Please suggest.
    Regards,
    Kaustubh.

    Moderator message - Please see How to post code in SCN, and some things NOT to do... before posting - post locked
    Please do not ask basic date questions
    Rob

  • Urgent-Need help with code for Master data enhancement

    hi Experts,
    I have appended YMFRGR field(Table MARC) to 0MAT_PLANT_ATTR datasource.
    The key fields in the MARC table are MATNR and WERKS.Can anybody help with the user exit to populate this field,as am pretty new to ABAP.
    Thanks in advance

    Hi,
    go through this link which has the similar problem:
    https://forums.sdn.sap.com/click.jspa?searchID=1331543&messageID=2794783
    hope it helps.
    Thanks,
    Amith

  • Function module Vs BDC for master data upload

    Hi ,
    Please advice we should use the following function modules for master data upload or we should go for BDC.
    MP_RFC_SINGLE_CREATE
    MP_RFC_INACT_CHANGE
    MPLAN_CREATE
    MPLAN_CHANGE
    MPLAN_SET_DELETION_INDICATOR
    ASSET_MASTERRECORD_MAINTENANCE
    MPLAN_ITEM_CREATE
    MPLAN_ITEM_CHANGE
    GL_ACCT_MASTER_SAVE
    GL_ACCT_MASTER_SAVE
    GL_ACCT_MASTER_SAVE
    Actually, we have already used these function modules in our upload program, but we are not sure if these function modules will create any data inconsistency.
    Please let me know, if we should continue using the FMs, or there is any risk using the FMs and we should replace them by BDC.
    Thanks in advance.

    HI Vikram,
    Better to serch for the BAPI for uploading the master data.Becuase we have problems with BDC and FM's.
    If you use FM's it does n't contain all the fields which you want.IF you go for BDC this is not maintainable for future releaseas.IF you upgrade then screen may change.
    IF don' have any BAPI then better go for BDC.
    Thanks

  • Function module like ENQUEUE and DEQUEUE for function location.

    Hi All,
    I should be highly appreciate if any one help me for locking function module like ENQUEUE and DEQUEUE
    for function location.
    Thanks
    Shaw

    Hi,
    You can either use the standard way of locking by using :
    data:lv_varkey          TYPE rstable-varkey.
    concatenate functional_location sy-mandt into lv_varkey .
    *   Lock table
        CALL FUNCTION 'ENQUEUE_E_TABLEE'
          EXPORTING
            mode_rstable   = 'E'
            tabname        = 'IFLOS'
            varkey         = lv_varkey
          EXCEPTIONS
            foreign_lock   = 1
            system_failure = 2
            OTHERS         = 3.
    *     Unlock table
          CALL FUNCTION 'DEQUEUE_E_TABLEE'
            EXPORTING
              mode_rstable = 'E'
              tabname      = 'IFLOS'
              varkey       = lv_varkey.
    Or,
    As mentioned above create a lock object via transaction SE11.
    Go to transaction se11:
    --> Enter lock object name e.g EZ_IFLOS
    --> Click on create
    --> Enter description
    --> Click on tables tab
    --> Enter 'IFLOS' as table name
    --> select lock mode
    --. click on save and activate.
    2 function modules will be created as DEQUEUE_EZ_IFLOS and ENQUEUE_EZ_IFLOS .
    Regards.

  • Rfc function module call error

    Hi Abaper,
    I'm doing upgrade from 4.7 to ecc 6.0 currently and encounter problem in one of the rfc function module that we used. I've tested the connection to destination using sm59 and the connection is successful.
    As an information, in the rfc setting, the target system is not Unicode system.
    When I test using se37 and put the rfc destination in my function module call, I always encountered system_error exception. There's no issue with this rfc call before in 4.7 system.
    Please help me on this. Thank you.
    Edited by: Abraham Bukit on Sep 3, 2008 2:36 AM

    Hi,
    I had the same issue in the past and solved it in the following way.
    If the destination system is not Unicode please try to set the password for the communication user set in SM59 using only upper-case characters and taking into account that the password shouldn't be longer than 8 characters.
    Hope this will help.

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

  • Regarding the RFC Function Module call from PI

    Hi All,
    I am working on one File to RFC interface, in which File adapter picks the file, this file data has to goto  2 function modules in SAP system. For this i added 2 Inbound interfaces in INTERFACE DETERMINATION and I developed 2 RECEIVER AGREEMENTS. In 2 RECEIVER AGREEMENTS i added single receiver RFC Communication Channel.
    Now i want assurance that once 1 st function module will execute completely, then only my second function module should be called. Is there any setting that i can do to make this sync?????.
    what is the use of  Send 'Confirm Transaction' in receiver RFC Communication Channel under Adavanced Mode.
    Thanks,
    Balu

    Hi,
    As per you requirement I would suggest to change your scenario as File To Proxy. It will much more easier and 100% sure to process second BAPI only after first gets successful inside the proxy.
    Pass the data from file adapter to inbound proxy and then inside proxy code you first call the first BAPI and use commit wrok. Once commit work is successful then you call the second BAPI otherwise rollback the changes.
    Example:
    Call First_BAPI
    <pass the data to it's import export parameters>
    Commit work.
    if sy-subrc =0.
    Call Second_BAPI.
    <pass the data to it's import export parameters>
    Commit work.
    endif.
    Note: If you are not very much comfortable with ABAP the discuss this with your ABAP team mate.
    Regards,
    Sarvesh

  • Need to track Function modules called when executing a transaction

    Hi All,
              Is there a way through which i can track function modules called, while executing a Transaction. Kindly provide pointers to it.
    Thanks in advance.
    Regards,
    Navin.

    Goto SE80 Transaction and use Program name for corresponding Transaction Use Find operation like Call Function .. then you will get list of FM ..
    There is no other option .
    reward Points if it is helpful
    Thanks
    Seshu

  • Function module WWW_ALV_CALL is not released for the Internet

    Hi
    I am facing this error Function module WWW_ALV_CALL is not released for the Internet and Only user SAP can release the function module.
    Best Regards
    GAGAN

    hi,
    This Web based calls are not available anymore in Netweaver 2004s/7.0. 
    More information in SAP-Note: 910202
    Hope this helps
    regards
    Tobias

  • Can a function module call another function module

    Can a function module call another function module:-
      within the same function group
    (ii)  within different function  groups

    Hi,
    We can call function from another function. If there is a function which is like a calculator and all the operations are from different functions then we have to call the functions from the calculator function for different functions.
    If all the function are from same function group, Then the data is globally available to all the functions with in the group.
    Otherwise we have to declare the data definitions for each of the functions if they are in different function groups.  
    Yes it is possible to call a function module from another function module:-
    within the same function group
    (ii) within different function groups
    Reward.

  • Idoc - Error Status 51: Incorrect function module called up

    Hi,
    In the receiver system for the custom message type, I got this error.
    Incorrect function module called up
    Can any one pls help me to solve this one.
    Regards,
    Bala Raja

    Hi Bala,
         Check the inbound function module attached to process code in receiving system. Generally in every inbound function module first check is coded for checking message type or for checking funciton module like below.In the receiving system go to WE20 and then select the partner and select inbound message type. in that double click on assigned process code.then you have to double click on displayed FM. In that fm check first few lines. You will find this error message.
    LOOP AT IDOC_CONTRL.
        IF IDOC_CONTRL-IDOCTP(6) <> 'DESADV'.
          MESSAGE ID 'E0' TYPE 'E' NUMBER '029'
          WITH IDOC_CONTRL-IDOCTP ' ' 'IDOC_INPUT_DESADV'
          RAISING WF_ERROR_PROCESS.
        ENDIF.
      ENDLOOP.
    Thanks & Regards,
    Kalyan.

  • Function module to choose the file for download and upload

    what is the function module to choose the file for download and upload  for presentation server.
    give me with example

    Please search in SCN.
    This has been discussed so many times.

  • Function module call with destination

    Hi,
    how can check if a function module call with destination works or not ?
    How can I debug.
    What can be the reason if it is not calles
    regards
    ertas

    * to chcek the rfc Destination By pass RFC destination name and Connection Type..
    RFC_CHECK_DESTINATION
    or
    RFC_CHECK_DESTINATION_ID
    or
    You can use this FM RFC_VERIFY_DESTINATION if your release is greater than 4.6C.
    Check this sample code from Craig Cmehil's weblog.
    CALL FUNCTION 'RFC_VERIFY_DESTINATION'
      EXPORTING
        DESTINATION = TMP
            TIMEOUT = 10
      EXCEPTIONS
        INTERNAL_FAILURE           = 1
        TIMEOUT                    = 2
        DEST_COMMUNICATION_FAILURE = 3
        DEST_SYSTEM_FAILURE        = 4
        UPDATE_FAILURE             = 5
        NO_UPDATE_AUTHORITY        = 6
        OTHERS                     = 7.
      IF SY-SUBRC EQ '0'.
        "* Do code here
      ENDIF.
    Prabhu

Maybe you are looking for

  • How to debug a program which is running in background (Job)

    Hi, I have a program which can be run only in background. I have to debug that program. Could you please let me know, how can I do that? Thanks, Sandeep

  • How to move an icon from one Pic into another Pic?

    Hello, I haven't seen this question addressed so forgive me if this was already discussed. I like to know how I can place a small smiley icon (pic) into another existing photo. In Photoshop Elements (be it 4.0 or 6.0) if I drag the the picture into E

  • Can't access NAS through Windows 8.1 file explorer anymore

    This used to word perfectly, but since I reinstalled my Windows 8.1 setup I can't access my NAS through Windows Explorer anymore. The weird thing is: I can still access it by logging in into the admin console via "http://ix4-300d/manage/manage.html"

  • Date Selection in BW Query

    Hello - I am trying to create a query that will show me the most recent cost estimate in BW infocubes 0COPC_C08 or 0COPC_C09, without making any changes to the standard functionality or available characteristics in these cubes.  One of the cubes has

  • Printing on paper

    i want print text on a normal paper how can i make this ??