Read attributes via Function Module

Hi Experts,
I need to read Directorate and Division which are  attributes of fundscenter, fundscenter is an attribute of 0Employee by using  Function  Module RSAU_READ_MASTER_DATA in a Transformation.
please advise how many times I would call the FM if so what would the Import and export parameters
Regards,
Koka

Thanks for the reply satish. I am using DB connect both Text and Attr.but how does that gonna effect.
I have actually passed the same what you have mentioned earlier I am able to get the funds ctr value.
Please find the same.
DATA:  l_employee  TYPE /bi0/memployee,
        lt_table    TYPE TABLE OF /bi0/memployee,
        l_funds_ctr TYPE /bi0/mfunds_ctr.
    DATA: l_iobjnm type RSDIOBJ-IOBJNM.
    DATA: l_chavl  type RSD_CHAVL.
    l_iobjnm = '0EMPLOYEE'.
    l_chavl = SOURCE_FIELDS-EMPLOYEE.
    CALL FUNCTION 'RSAU_READ_MASTER_DATA'
      EXPORTING
        i_iobjnm                      = l_iobjnm
        I_CHAVL                       = l_chavl
      I_T_CHAVL                     =
        I_DATE                        = SOURCE_FIELDS-tv_depdate
      I_FLG_WHOLE_TABLE             =
        I_ATTRNM                      = '0FUNDS_CTR'
      I_BYPASS_BUFFER               = RS_C_FALSE
      I_LOGSYS                      =
     IMPORTING
      E_STRUCTURE                   = l_employee
      E_TABLE                       = lt_table
       E_ATTRVAL                     = RESULT
     EXCEPTIONS
       READ_ERROR                    = 1
       NO_SUCH_ATTRIBUTE             = 2
       WRONG_IMPORT_PARAMETERS       = 3
       CHAVL_NOT_FOUND               = 4
       OTHERS                        = 5
    IF sy-subrc <> 0.
    CLEAR RESULT.
   ENDIF.
I Need to check the tv_depdate which is a deperture date has to be within to data and from date of employee so I have passed it.please provide me with the logic if possible.
Thanks in advance..
Koka.

Similar Messages

  • How to read attachment via function module??

    Hi All,
    I have to Read the content of attachment of standard task TS00407864.
    For that i have used a function module SAP_WAPI_GET_ATTACHMENTS.
    and i got this.
    OBJECT_ID                                SOFM      FOL32000000000004RAW340
    DESCRIPT                       Office Document
    SHORTTEXT                      Office Document
    DEF_ATTRIB                     Document Not as per Accounting Stantard
    OBJECT_TYP                     AT
    Now i have to read it in internal table which function i should use and how can i pass the value to it.
    Please Help!
    Regards,
    Purvesh Patel.

    Hi,
    use method cl_swf_utl_convert_por=>convert_bor_to_ibf( ). Also properly defined structures will parse data without need of offset reading/parsing.
    Example:
         data:
             lt_attachment         type  swrtobject,
             lt_wapi_message       type  swr_msgtab,
             ls_docid              type  soentryi1,
             lv_subrc              type  sy-subrc,
             lv_doc_id             type  sofolenti1-doc_id
         field-symbols:
             <ls_attachment>       type  swr_object
         call function 'SAP_WAPI_GET_ATTACHMENTS'
             exporting
                 workitem_id     = me->mv_workitem_id
                 user            = me->mv_username
                 language        = me->mv_language
             importing
                 return_code     = lv_subrc
             tables
                 attachments     = lt_attachment
                 message_struct  = lt_wapi_message
         if ( lv_subrc <> 0 ).
             "! Handle error / messages
         endif.
         loop at       lt_attachment
             assigning <ls_attachment>
             lv_doc_id = cl_swf_utl_convert_por=>convert_bor_to_ibf( i_bor_por = <ls_attachment>-object_id ).
             ls_docid  = lv_doc_id.
         endloop.

  • Generic Delta Extraction via Function Module

    Hello,
    i need a help for a generic delta extraction based on a Function Module. As an example i take the function module RSVD_BW_GET_DELTA_DATA.
    My generic delta extractor based on the field AEDAT - Change Date and i will extract purchase service orders and entry sheets.
    In the sample function module the select for the extraction worked with the table ROBWQTSTAT, but this table ist empty after the initialization.
    OPEN CURSOR WITH HOLD G_CURSOR FOR
          SELECT * FROM ROVERCUBE1
                   WHERE COUNTRY IN L_R_COUNTRY AND
                         REGION  IN L_R_REGION AND
                         KUNNR   IN L_R_KUNNR AND
                         TYPE    IN L_R_TYPE AND
                         GJAHR   IN L_R_GJAHR AND
    Here the timerange calculated in form GET_TIME_INTERVAL is evaluated.
                         TSTMP   IN S_R_TSTMP AND
                         OBJVERS = 'A'.
    I found the table ROOSGENDLM. In this table i found the field DELTAID with the last date of the extraction and the field REPEATID with the date for the repead-Update.
    My Questions:
    Is this the right way to build an generic delta extraction with an function module or must i install a coding in my function module for an update of the table ROBWQTSTAT?
    Which settings are needed in the table ROOSOURCE for a generic delta extraction via function module?
    Best regards
    Uwe

    Hi Uwe,
    please have a look at https://weblogs.sdn.sap.com/pub/wlg/2415. [original link is broken] [original link is broken] [original link is broken] It might help
    kind regards
    Siggi
    PS: We already had almost the same question here today.

  • Error in Extraction with Generic Datasource via Function Module

    Dear Gurus,
    Iam working for BI-HR module.We are extracting data with generic data source via function module. The client some more extra fields in already existing DS. So we made a copy of that Function module and tried to create new generic DS, we got error while extraction like "Error occured during the extraction process". Can you please help in resolving this issue, your valuable suggestion would be highly appreciated.
    Thanks and regards
    Arun S

    Hi,
    Which structure are you using??
    Are you using the same old structure for this function module as well.
    Have you enhanced the structure with new required fields.
    New extrac fields needs to be added to existing structure if you are using the same or create a new one and make sure that you have all the fields in the structure which you are going to use in the data source.
    You need to take care for the append as well and the issue could be in the code as well.
    Make sure you have written the proper code and just for the new fields done an append
    Thanks
    Ajeet

  • WBS copy via function module "K_PLAN_TO_PLAN_COPY"

    Hi Experts
    anybody please advise whether WBS copy to other via function module "K_PLAN_TO_PLAN_COPY"
    is possible or not in below situation.
    Currently we faced some issue when WBS satus is "TECO", we can not
    copy WBS to another WBS (we want to copy whole wbs into others) by
    function module "K_PLAN_TO_PLAN_COPY".
    So we just change system status from TECO to REL then copy wbs to other,
    however, we could face another issue with this way of copying. (since we
    have to change wbs status, it could cause conflict against other project)
    We want to copy wbs without changing wbs status via function module "K_PLAN_TO_PLAN_COPY".
    Can it be possible? if yes, please advise how to, (settings/conditions/something like that)
    Thank you.
    Satoru

    Hi Satoru,
    The Function Module K_PLAN_TO_PLAN_COPY is not released for customers and therefore it is not intended to be used in customer specific programs or enhancements. For further details, please have a look SAP Note 109533.
    Sorry for not having better news.
    BR,
    Enrique

  • Adding a new conditon on head via function modul?

    Hi,
    is there a way to add a condition to an order via function module? I mean in customizing we have maintained the calc scheme (and everything else) and assign it to the order. What we want is to add the new condition type to the head of the order via function module. The scenario is as follows:
    We create an order and have on the header a field for a value. If you type a value in the field and press enter the condition should be created and calculatetd. The result is given in the condition tab of the order on header level.
    We try to not do a modifictaion. therefore i am looking for a function module. Is there someone who could help?
      thanks and regards,
           Ming

    Why can't this be done by the pricing configuration?
    There are also pricing user exits available, which are not modifications and exist for this purpose exactly (i.e. when for some reason configuration alone is not enough). See the list here:
    https://www.sdn.sap.com/irj/sdn/wiki?path=/display/erplo/sdUserexits

  • Error during XML inbound via Function Module 'EDI_DATA_INCOMING'

    Hi Team,
    I am facing below error while trying to upload a inbound XML file via Function Module  'EDI_DATA_INCOMING'.
    The control record must begin with <EDI_DC40 segment="1"> instead of
    Message no. EA719
    Diagnosis
    The tag '<EDI_DC40 segment="1">' must be at the start of a control record in XML format, otherwise string '' would be found.
    System Response
    The file cannot be processed.
    Procedure
    Correct file DEV_H\SGIDOCI\MSUTEST\00082_ATT..
    Please suggest a proper solution for the same. If it is because of wrong structure of XML file then please send me correct XML format for file upload.
    Regards,
    Amit Sharma

    Hello,
    It's the error is SAP code.
    Look notes 1616333 and 1535033. Those should fix the error.
    BR, Janne

  • Datasource via function module

    Hi,
    I am building a function that is due to be used by a Datasource (via Function Module).
    This function uses table WDRD. It applies to this table a code that needs the use of an internal table for the calculation (for intermediary calculation storage). After which, I want to get the result of this internal table (say T1_DATA), and return it to E_T_DATA, which will be used to fill my datasource. This is where I am stuck.
    -> When I try to get the content of my internal table in my cursor (code: OPEN CURSOR WITH HOLD S_CURSOR FOR
          select * from T1_DATA
        endif.),
    I get an error message stating the table is not defined in the ABAP dictionary.
    -> When I try to avoid the cursor and put directly the content of my table T1_DATA in table E_T_DATA, I don't get anything in my Datasource.
    Any help would be greatly appreciated.
    Thanks,
    Pierre

    Hi,
    Which structure are you using??
    Are you using the same old structure for this function module as well.
    Have you enhanced the structure with new required fields.
    New extrac fields needs to be added to existing structure if you are using the same or create a new one and make sure that you have all the fields in the structure which you are going to use in the data source.
    You need to take care for the append as well and the issue could be in the code as well.
    Make sure you have written the proper code and just for the new fields done an append
    Thanks
    Ajeet

  • Call WDA from ABAP via function module

    Hi WDA experts,
    is there any possibility to call a WDA within a ABAP report AND include it in the process.
    The best would be to call a WDA via a function module - make some inputs on the WDA side - press submit and the function module gives me the data from the webdynpro back to my application.
    I know that I can call a WDA via the function CALL_BROWSER, but in this case the WDA application is fully independent from the report and I am not able to post any data back to the report.
    I also know FM WDY_EXECUTE_IN_PLACE, but in this case I need a HTML container to display the WDA and there it seems that I also never get back any data back to the report.
    Any hints are appreciated.

    Not too hard:
    CALL WDA passing in a KEY on start plug.
    write the data to a shared memory object using the key passed as the
    key to a shared memort object on the submit.
    (see blogs on writing Shared maemory objects in ABAP)
    Then simply exit APP.
    On return read the data from the Shared memory Object.
    The shared memory object lives across the 2 sessions.
    cheers
    Phil.

  • Equipment record address creation via function module

    How can I  populate an Equipment record's address via a function module?  I'm referrring to the Address area of the Location tab in tcode IE02. BAPI_EQUI_CREATE works fine for the base data but has no address capabilities.

    Alejiandro
    Yes it was ITOB410. I tried the lock_old parm without luck but was able to get around that problem with an explicit calll to FM EQUIPMENT_LOCK. However, I have a new problem with the FM.
    The LOCK FM got rid of the BLOCKED issue. However, now an internal call from EQUIPMENT_MODIFY to EQUI_GET_SAVE_DATA is causing a short dump in include LITOBBUFEQF70 on:
    120           IF NOT SY-SUBRC IS INITIAL.
    121 *         try to read lock table by matnr/sernr
    122             READ TABLE I_WA-LOCK ASSIGNING <L_WA_LOCK_REC>
    123                  WITH TABLE KEY EQUNR = SPACE
    124                                 MATNR = <L_WA_EQUI_REC_WBUF>-EQUI
    125                                 SERNR = <L_WA_EQUI_REC_WBUF>-EQUI
    126             IF NOT SY-SUBRC IS INITIAL.
    >>>>               MESSAGE X003.
    128             ENDIF.
    129           ENDIF.
    Have you seen this?

  • Execute BEX Query via Function Module

    Hi Mates,
    I want to execute BEX query via a Function Module.
    Also i want to explore whether the input parameters of the query can be retrieved from a Database Table.
    Please let me know how this can be achieved.
    Thanks in advance.
    Regards,
    Hrishikesh

    Hi Hrishikesh,
    Assuming you have the necessary ABAP knowledge, you will have to code the exit in the include ZXRSRU01 under I_STEP = 1 (this is because you want to prepopulate your parameters from the values in your DB table).
    Your DB table has Key1, Key2 and Your field as the three fields and you want to read the value of 'Your Field' based on your keys Key1 and Key2.
    So, the code will be something like -
    when 'Your variable'.
    if i_step = 1.
    select single 'Your field' from 'Your DB table' into lv_your_field where Key 1 = 'X' and
                                                                                                                   key 2 = 'Y'.
    clear l_s_range.
    l_s_range - low = lv_your_field.
    l_s_range-sign = 'I'.
    l_s_range-opt = 'EQ'.
    append l_s_range to e_t_range.
    endif.

  • Packing a Delivery via function modules or BAPI's

    Does anyone know the correct function modules to call in order to pack an outbound delivery.  The HU is already been entered into the delivery.  I just need to pack all the items into this HU and PGI the delivery.  I've tried the following function modules:
    SD_DELIVERY_UPDATE_PACKING
    V51P_FIND_HEADER
    V51P_NEUE_HU_PRO
    I'm not sure what I'm doing wrong but the delivery doesn't get packed.  Anyone have a clue?
    Thank you,

    The problem resides in external unique number assignement for handling units:
    in SPRO:
    > Logistics - General
      > Handling Unit Management
        > External Identification
          > Set Unique Number Assignment for HU Identification
    Simply flag the checkbox and Save!
    Without this flag BAPI's raise this info message (HUDIALOG 038). Even if it is an info message and the number is returned at the end the handling unit won't be created!
    Just flag it!

  • Problem with Creation of CRM Order via Function Module Test

    I am trying to check the order creation process from external systems by using the test function in Tcode SE37 with Function Module BAPI_BUSPROCESSND_CREATEMULTI.
    I have created a Test Sequence of the following FMs:
    BAPI_BUSPROCESSND_PROCSETTINGS
    BAPI_BUSPROCESSND_CREATEMULTI
    BAPI_PROCESS_SAVE
    BAPI_TRANSACTION_COMMIT
    All that I have been able to create so far is an order header without a Sold-to or Ship-to and no items. I am able to populate the Organization data, Header text and Appointments. The only partner function that is being populated is the one that is being automatically picked up from my user master.
    For the BAPI_BUSPROCESSND_CREATEMULTI I am populating the following tables:
    HEADER          1 entry
    ITEM               2 entries
    PARTNER          2 entries
    ORGANISATION     1 entry
    APPOINTMENT          2 entries
    INPUT_FIELDS          41 entries     
    SCHEDULELINE     2 entries
    I have created the entries based upon information gained through debugging function module CRM_ORDER_MAINTAIN during the creation of a service order.
    It would be interesting to know if anybody has successfully created an order via the SE37 test function and if so, it would be useful to see the data in the relevant tables.

    HEllo ,
    Write a wrapper to the function module CRM_ORDER_MAINTAIN.
    To populate the Text use below code
      ls_input_field_names-fieldname  = 'REF_GUID'.
      INSERT ls_input_field_names INTO TABLE lt_input_field_names.
      ls_input_field_names-fieldname  = 'REF_KIND'.
      INSERT ls_input_field_names INTO TABLE lt_input_field_names.
      ls_input_field_names-fieldname  = 'TDID'.
      INSERT ls_input_field_names INTO TABLE lt_input_field_names.
      ls_input_field_names-fieldname  = 'TDSPRAS'.
      INSERT ls_input_field_names INTO TABLE lt_input_field_names.
      ls_input_field_names-fieldname  = 'TDSTYLE'.
      INSERT ls_input_field_names INTO TABLE lt_input_field_names.
      ls_input_field_names-fieldname  = 'TDFORM'.
      INSERT ls_input_field_names INTO TABLE lt_input_field_names.
      ls_input_field_names-fieldname  = 'LINES'.
      INSERT ls_input_field_names INTO TABLE lt_input_field_names.
      ls_input_field_names-fieldname  = 'MODE'.
      INSERT ls_input_field_names INTO TABLE lt_input_field_names.
      CLEAR ls_input_fields.
      ls_input_fields-ref_guid    = attr_guid.
      ls_input_fields-ref_kind    = 'A'.
      ls_input_fields-objectname  = 'TEXTS'.
      CONCATENATE 'CRM_ORDERH' order_guid INTO ls_input_fields-logical_key.
      ls_input_fields-field_names = lt_input_field_names.
      INSERT ls_input_fields INTO TABLE attr_t_inputfields.
    Call Order maintain FM to create any order
      CALL FUNCTION 'CRM_ORDER_MAINTAIN'
        EXPORTING
          it_text               = lp_order->attr_t_text
          it_partner          = lp_order->attr_t_partner
        IMPORTING
          et_exception     = et_exception
        CHANGING
          ct_orderadm_h     = lp_order->attr_t_orderadm_h
          ct_input_fields      = lp_order->attr_t_inputfields
        EXCEPTIONS
          error_occurred    = 1
          document_locked   = 2
          no_change_allowed = 3
          no_authority      = 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.
    Regards
    Satish

  • Call lsmw functions via function module

    Hi experts,
    I have heard about the possibility to call LSMW functions
    (e.g. Read Data, Convert Data, Create Idoc,...) from "outside" with
    a SAP function module.
    I searched help databases and this forum for answers but I didn't find anything
    helpful.
    Has anybody experience with this issue?

    Not too hard:
    CALL WDA passing in a KEY on start plug.
    write the data to a shared memory object using the key passed as the
    key to a shared memort object on the submit.
    (see blogs on writing Shared maemory objects in ABAP)
    Then simply exit APP.
    On return read the data from the Shared memory Object.
    The shared memory object lives across the 2 sessions.
    cheers
    Phil.

  • Clarification on some reading: Datasource and Function Module extraction

    Hi,
    I found a link on Help.sap which explains how to create a function module and I have some questions after my review:
    It basically uses function module to read some filght data from the table SPFLI
    1.
    I got into this research since one of the methods for data extraction from R3/ECC to BW is through Function Modules.
    Why couldn't that extraction be based on a view of the table SPFLI.
    i.e. why is this complication of writing an ABAP code to achieve something which could be done with a DB view or table?
    2.
    Any example or scenario where you think a datasource could NOT be created based on a table, Database View or Sap Query and that it must be done with a Function Module?
    3.
    So, once the function module is successfully created; how to do create a Datasource based on this function modeule to take care of the delta's on the source data?
    4.
    There was a discussion about "remote function call" which I did not get completely. Will extracting data from R3/ECC to BI be regarded as "remote call"
    Thanks

    1. Why couldn't that extraction be based on a view of the table SPFLI. i.e. why is this complication of writing an ABAP code to achieve something which could be done with a DB view or table?
    A DataSource could have been created directly from table SPFLI. It was used as an example in the case of the document is my guess. There are some table types, however, that you cannot create a DataSource directly off of.
    2. Any example or scenario where you think a datasource could NOT be created based on a table, Database View or Sap Query and that it must be done with a Function Module?
    Pool/Cluster tables cannot be directly read and therefore must use a Function Module for extraction. Another reason for using a Function Module, even against a single table, is in the case that you have more than one field that you want to create a generic delta against. SAP delivers the capability in the application to set a generic delta on only one field within the DataSource. If there is more than one, say created on and changed on dates, a Function Module is require in order to enable that.
    3. So, once the function module is successfully created; how to do create a Datasource based on this function modeule to take care of the delta's on the source data?
    Go to tocde RSO2, enter the DataSource name, click on the Create button. In the next screen, there are three buttons toward the top to tell what is the source of the DataSource: 1) Extraction from View (default); 2) Extraction from Query; and 3) Extraction from Function Module. When you click on the Extraction from Function Module button, the View/Table field will gray out and the Function Module and Extraction Structure fields will un-gray.
    4. There was a discussion about "remote function call" which I did not get completely. Will extracting data from R3/ECC to BI be regarded as "remote call"
    I think that this is referring to a process whereby you create a remote-enabled Function Module on the source R3/ECC system and then create an ABAP program in BW that calls that remote-enabled Function Module. Basically, the ABAP program on BW would send some parameters through to the remote-enabled Function Module on R3/ECC. The Function Module would extract data into an internal table and then pass that internal table back through to the ABAP program in BW for further processing.
    Edited by: Dennis Scoville on Aug 20, 2009 8:18 AM

Maybe you are looking for

  • HOW TO FIND THE REQUIRED DELIVERY DATE IN VA02

    hi HOW TO FIND THE REQUIRED DELIVERY DATE IN VA02. i want to display this field in my report. what is the fieldname and in which table it is ?

  • How can i update my iTunes account while away from my computer?

    I received a new debit card in the mail the other day, making my old one invalid.  I am away from my computer and wanted to update my account information so it reflects the new debit card. Is there any way to do this or do i have to wait until i get

  • Is it possible to change 16 GB to 32 GB iPad?

    I want to know if is it possible to upgrade my ipad2 with more storage capacity

  • Record Management Examples?

    Hello, I want to write a webservice which checks a folder in my content database if there are any files older then xx days. If so the webservice should move these files into some kind of archive.... But i dont know how to start because i found no doc

  • Getting error message when selecting item form dropdown

    Hi Folks, I am creating a screen exit which we configure in QA11 transaction. I am inserting few fields in User Data subscreen including QMEL-PRIOK field. when selecting an option from drop down list, It is giving an error message' Error: entry not a