How to get structure from Idoc using function module?

Hi all,
I am looking for a function module in order to get the structure of a message type used for iDoc. The aim is to get the data element from the different fields in order to check authority if the data element is BUKRS.
Thanks for your help!
David

Hi David,
You can use the FM "IDOC_TYPE_COMPLETE_READ" which will get you the complete details of the IDOC type along with data elements referred for each fields in the segments.
The aim is to get the data element from the different fields in order to check authority if the data element is BUKRS.
Not sure if i understood the above requirement, if you could provide more info on the requirement, i guess you might get better a better solution from the forum. As there are other data elements with different names for company code (just look up *BUKRS* in SE11 under Data Elements to see what i mean), not sure if you can cover it all.
Regards,
Chen

Similar Messages

  • How to get structure of IDOC into xi in the scenario is IDOC - XI - File

    hi XI Guys,
          When i want to Integrate SAP sys(IDOC) with File how to get structure of IDOC into XI, As we will define Data types in File -> XI -> File. Please send Step by Step process as i am new to Netweaver(XI)
    ThankYou,
    B.Pushparaju.

    When i want to Integrate SAP sys(IDOC) with File how to get structure of IDOC into XI
    >>>>
    import the IDoc under the imported object in your SCV. Note that import should be allowed for the SCV.
    As we will define Data types in File -> XI -> File.
    >>>>
    Ref. these blogs to help you out ..
    /people/venkat.donela/blog/2005/03/02/introduction-to-simplefile-xi-filescenario-and-complete-walk-through-for-starterspart1
    /people/venkat.donela/blog/2005/03/03/introduction-to-simple-file-xi-filescenario-and-complete-walk-through-for-starterspart2

  • How  to get  response from such a  function

    How  to get  response from such a  function (in MODULE USER_COMMAND_0010 INPUT I get "ODGOVOR" 'X'
    FUNCTION Z_SEENKRAT.
    ""Local Interface:
    *"  EXPORTING
    *"     REFERENCE(ODGOVOR) TYPE  MSEG-KZEAR
    DATA ok_code LIKE sy-ucomm.
    DATA: test like mseg-kzear.
    BREAK-POINT.
    call screen 10.
    test = ODGOVOR.
    ENDFUNCTION.
    *&      Module  CLEAR_OK_CODE  OUTPUT
          text
    MODULE clear_ok_code OUTPUT.
      CLEAR ok_code.
    ENDMODULE.                 " CLEAR_OK_CODE  OUTPUT
    *&      Module  USER_COMMAND_0010  INPUT
          text
    MODULE USER_COMMAND_0010 INPUT.
    DATA odgovor LIKE mseg-KZEAR.
    CASE ok_code.
        WHEN 'DA'.
        ODGOVOR = 'X'.
      ENDCASE.
    ENDMODULE.                 " USER_COMMAND_0010  INPUT

    Hi,
    You need to declare the ODGOVOR variable in the TOP include, then you will get the value
    Regards
    Sudheer

  • How to get sysnr value in a Function Module

    Hi all,
    I need to get the sysnr(system number) value of the R/3 system. I execute a RFC function module and need to get the value of sysnr of the system it executes in as a return parameter. Can somebody tell me how to get this value in the function module and return it.
    Thanks and Regards,
    Pratik

    Hello Pratik
    The system number has to be defined in the RFC destination. Thus, select on your local system (where you call the RFC function module) the corresponding RFC destination from table <b>RFCDES</b>. In field RFCDES-RFCOPTIONS you will find a string like this:
    H=<ip address>,S=21,R=N, ...
    S=system number
    Regards
      Uwe

  • How to extract the data by using function module?

    hi experts,
    what are the steps i have to fallow to extract the data from R/3 by using FUNCTION MODULE.
    thanks & regards
    venkat

    Hi,
    Extracting data from R/3 extract structure thru function modules
    You can proceed with create function module using SE37, thereu2019s sample in system RSAX_BIW_GET_DATA_SIMPLE,
    You need to know the logic how to populate the structure,
    after that RSO2, create datasource specify extract structure and
    function module,
    activate and replicate to bw.
    Chheers
    Raj

  • Problem in getting public holiday class using function module

    Hi to all
    I am using function module
    HR_PERSON_READ_WORK_SCHEDULE.
    for getting the employee's actual work schedule and public holiday class FTKLA.
    But I am unable to get the correct public holiday class.
    Please guide me.
    How to do that.
    Regards
    Anubhav

    Hi,
    form build_work_schedule tables b_psp structure pdpsp
                                    b_day_psp structure pdsppsp
                                    b_employees structure pdpnr
                             using value(b_begda) like sy-datum
                                   value(b_endda) like sy-datum
                                   value(b_read_db) type c.
      data: counter type i. "Note 495298
      call function 'HR_PERSON_READ_WORK_SCHEDULE'
           exporting
                begin_date          = b_begda
                end_date            = b_endda
               grouping_dws        = motpr    "VEX Modif
               grouping_attendence = moabw
               grouping_substitute = mover
                read_from_database  = b_read_db
                im_read_no_locked_records = 'X'                 "803380
           tables
                pernr_tab           = b_employees
                psp                 = b_psp
                day_psp             = b_day_psp
           exceptions
                error_in_build_psp  = 1
                others              = 2.
      read table b_employees with key error = 'X'
                             transporting pernr.
      if sy-subrc eq 0.
        read table d3000_pers with key pernr = b_employees-pernr
                                               transporting name.
        if sy-subrc eq 0.
          message s582 with d3000_pers-name.
        else.
          message s582 with b_employees-pernr.
        endif.
      endif.
    Hope it helps you.

  • How to get data from Oracle using Native SQL in SAP.. Problem with date

    Hi Masters.
    I'm trying to get data from an Oracle DB. I was able to connect to Oracle using tcode DBCO. The connetion works fine
    I wrote this code and it works fine without the statement of where date > '01-09-2010'
    But i need that statement on the select. I read a lot about this issue, but no answer.
    My code is (this code is in SAP ECC 6.0)
    DATA: BEGIN OF datos OCCURS 0,
          id_numeric(10),
          component_name(40),
          comuna(10),
          record_id(10),
          status,
          sampled_date(10),
          END OF datos.
    DATA: c TYPE cursor.
    EXEC SQL.
      connect to 'LIM' as 'MYDB'
    ENDEXEC.
    EXEC SQL.
      SET CONNECTION 'MYDB'
    ENDEXEC.
    EXEC SQL PERFORMING loop_output.
      SELECT ID_NUMERIC, COMPONENT_NAME, COMUNA, RECORD_ID, STATUS, SAMPLED_DATE
      into :datos from lims.SAMP_TEST_RESULT
      where     date > '01-09-2010'
    ENDEXEC.
    EXEC SQL.
      disconnect 'MYDB'
    ENDEXEC.
    How can i get the data from that date?? If i delete the where statemet, the program works well, it takes 30 mins and show all the data, I just need the data from that date.
    Any help
    Regards

    Please refer the example in this link which deals with Oracle date format.
    You can finnd a command DECODE which is used for date formats. If you have a look at whole theory then you will get an idea.
    Link:[Bulk insert SQL command to transfer data from SAP to Oracle|http://sap.ittoolbox.com/groups/technical-functional/sap-dev/bulk-insert-sql-command-to-transfer-data-from-sap-to-oracle-cl_sql_connection-3780804]

  • Help , How to get data from database using recordset with UI API

    I want to get a data from database
    when I want to create recordset i notice that UI API didn't has record set
    so I created recordset using DI API (SAPbobscom.recordset and SAPbobscom.company)
    ======================================================
    Dim oCompanyUI As SAPbouiCOM.Company <<UI API
    Dim oRecSet As New SAPbobsCOM.Recordset << DI API
    Dim oCompanyDI As New SAPbobsCOM.Company << DI API
    '=====================================================
    oCompanyDI.Connect
    Set oRecSet = oCompanyDI.GetBusinessObject(BoRecordset)
    oRecSet.DoQuery ("SELECT T0.CardCode, T0.CardName FROM OCRD T0")
    SBO_Application.MessageBox oRecSet.Fields.Item(1).Value
    ======================================================
    but I got an error it said "you are not connected to company"
    I'm really don't have an idea about how to get a data from using UI API (exp I want to get a date or costumer code)
    can someone help me please, I really need it
    Thanks

    you need a single sign on
            Dim oDICompany As SAPbobsCOM.Company
            Dim sCookie As String
            Dim sConnStr As String
            Dim ret As Integer
            oDICompany = New SAPbobsCOM.Company
            sCookie = oDICompany.GetContextCookie
            sConnStr = SBO_Application.Company.GetConnectionContext(sCookie)
            If oDICompany.Connected Then
                oDICompany.Disconnect()
            End If
            ret = oDICompany.SetSboLoginContext(sConnStr)
            If Not ret = 0 Then
                SBO_Application.MessageBox("set Login Context failed!")
                Exit Sub
            End If
            ret = oDICompany.Connect()
            If Not ret = 0 Then
                SBO_Application.MessageBox("Company Connect failed!")
            End If

  • How to get substring from string using index?

    hi,
    here i am having string ,
    i want the pullareddy from below line ,
    i know how to get from substring.
    but i want to get the above using "index",
    can any help how to do it?
    String str1="janapana,pullareddy, in malaysia";
    jpullareddy

    get the start index with indexAt("pullareddy")
    get the end index with adding the length of the word to the start
    get the char[] of str1 with toCharArray()
    make a new string with the chars from start to end index.

  • How to get data from bean using selectmanycheckbox

    Am not able to understand how to get selectmanycheckbox data of datatable from backing bean
    help me on this
    thanks

    hi balu,
    Am getting the error in running the jsp. the error is like
    org.apache.jasper.JasperException: "{2}" Conversion Error setting value ''{0}'' for ''{1}''.
         org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:370)
         org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:291)
         org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
         com.sun.faces.context.ExternalContextImpl.dispatch(ExternalContextImpl.java:322)
         com.sun.faces.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:147)
         com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:87)
         com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:200)
         com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:117)
         javax.faces.webapp.FacesServlet.service(FacesServlet.java:198)
    root cause
    java.lang.IllegalArgumentException: "{2}" Conversion Error setting value ''{0}'' for ''{1}''.
         com.sun.faces.util.Util.getSelectItems(Util.java:642)
         com.sun.faces.renderkit.html_basic.SelectManyCheckboxListRenderer.encodeEnd(SelectManyCheckboxListRenderer.java:115)
         javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:712)
    can u seggest me on this
    can u give the example code for setters And getters of selecteditems, selectitems
    thanks

  • How to get type any table in function module... or something

    Moderator message: Please use a more informative subject in future, and NOT IN ALL CAPITALS.
    Hi experts,
    how to get type any table option.
    in source code.
    *"  CHANGING
    *"     REFERENCE(S_EKORG) TYPE  ANY TABLE OPTIONAL
    Thank you.
    Edited by: Matt on Feb 17, 2009 2:27 PM - subject edited

    In Function module...... Under changing tab, give the parameter name and type enter associated type any.... You would get that same in the source code and also choose Optional check box.....
    You will see exact code in the FM source code

  • How to execute the process chain using function module

    Hi,
    How can we execute the process chain when there is any process failed. For ex. when we are running many processes. when loading fails in local process chain, after fixing this error, how can we execute the rest of processes. Can we execute the rest of processes using any function module. Kindly guide me.

    Hi,
    Chk the weblog.
    https://www.sdn.sap.com/irj/sdn/weblogs?blog=/pub/wlg/3149. [original link is broken] [original link is broken] [original link is broken]
    Regards,
    Balaji

  • How to get LAST_VALUE from an Analytic Function within a report?

    My analytical report has following sql:
    SELECT....
    DENSE_RANK() OVER (PARTITION BY pco.appropriation ORDER BY pco.appropriation,
    pco.fiscal_year ASC NULLS LAST) "Duration Years",
    SUM(pco.quantity) OVER (PARTITION BY sms.data_source ORDER BY
    sms.data_source, cst.display_nm RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT
    ROW) "Quantity Cum",
    FROM ........
    I have a request to calculate the percentage value by dividing MAX or LASTVALUE of these two functions at current row level:_
    %DENSE_RANK = LAST_VALUE of ? DENSE_RANK() OVER (PARTITION BY pco.appropriation ORDER BY pco.appropriation,
    pco.fiscal_year ASC NULLS LAST) "Duration Years"
    / (divide by)
    DENSE_RANK() OVER (PARTITION BY pco.appropriation ORDER BY pco.appropriation,
    pco.fiscal_year ASC NULLS LAST) "Duration Years"
    %SUM = LAST_VALUE of ? SUM(pco.quantity) OVER (PARTITION BY sms.data_source ORDER BY
    sms.data_source, cst.display_nm RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT
    ROW) "Quantity Cum",
    / (divide by)
    SUM(pco.quantity) OVER (PARTITION BY sms.data_source ORDER BY
    sms.data_source, cst.display_nm RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT
    ROW) "Quantity Cum"
    Example of report output:
    DENSE RANK DENSE RANK % SUM SUM %
    1 10% 10 10%
    2 20% 20 20%
    3 100% 30 100%
    1 10% 10 10%
    2 20% 20 20%
    I appreciate your help to implement LAST_VALUE function for this case. Many thanks in advance.
    Rob.
    Edited by: user10455955 on Dec 17, 2008 9:25 AM

    Hi Rod,
    Thank you for replying. My intentions are:
    1. to get last value of DENSE_RANK(), and divide by fisrt until last DENSE_RANK() value within defined partition.
    Example: I have DENSE_RANK() from 1 to 7, and want to divide last value (7) by 1, 2,... so on until 7, so last value 7 always renders 100%
    2. to get last value of cumulative total, and divide fisrt until and last cumulative total value within defined partition
    Example: I have 3 values 1, 2, 3. Fisrt cumulative total is 1 , second cumulative is 3 (1+2) , third cumulative is 6 (1+2+3). I want to divide last cumulative total 6 by 1, then 2, then 3.
    Thanks again.
    Rob.
    Edited by: user10455955 on Dec 22, 2008 9:16 AM
    Edited by: user10455955 on Dec 22, 2008 9:18 AM

  • How to create a f4 help using function module.

    Hi,
        I want to create an f4 help with out using match code objects.How can i do it ? . Is there  any function code for it ?.

    Hi,
    Please search on SCN before posting...
    Refer FM F4IF_INT_TABLE_VALUE_REQUEST
    Refer this demo code to get a S.help for BELNR based on user input for BUKRS:-
    PARAMETERS : p_belnr TYPE belnr,
                 p_bukrs TYPE bukrs.
    DATA : BEGIN OF itab OCCURS 0,
             belnr TYPE belnr,
           END OF itab.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_belnr.
      PERFORM f4_belnr_help USING p_belnr.
    *&      Form  f4_belnr_help
    *       text
    *      -->P_BELNR text
    FORM f4_belnr_help USING p_belnr.
      DATA : itab TYPE STANDARD TABLE OF it WITH HEADER LINE,
             tb_dynpfields LIKE dynpread OCCURS 0 WITH HEADER LINE,
             v_bukrs TYPE bukrs.
      CLEAR:   tb_dynpfields.
      REFRESH: tb_dynpfields.
      MOVE 'P_BUKRS' TO tb_dynpfields-fieldname.
      APPEND tb_dynpfields.
      CALL FUNCTION 'DYNP_VALUES_READ'
        EXPORTING
          dyname                               = 'Z_F4' "program name
          dynumb                               = '1000' "screen number
        TABLES
          dynpfields                           = tb_dynpfields
        EXCEPTIONS
          INVALID_ABAPWORKAREA                 = 1
          INVALID_DYNPROFIELD                  = 2
          INVALID_DYNPRONAME                   = 3
          INVALID_DYNPRONUMMER                 = 4
          INVALID_REQUEST                      = 5
          NO_FIELDDESCRIPTION                  = 6
          INVALID_PARAMETER                    = 7
          UNDEFIND_ERROR                       = 8
          DOUBLE_CONVERSION                    = 9
          STEPL_NOT_FOUND                      = 10
          OTHERS                               = 11.
      IF sy-subrc  0.
        MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
               WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
      READ TABLE tb_dynpfields INDEX 1.
      IF sy-subrc EQ 0.
        v_bukrs = tb_dynpfields-fieldvalue.
      ENDIF.
      SELECT belnr from <db_table> INTO TABLE itab WHERE bukrs = v_bukrs.
      CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
        EXPORTING
          retfield               = 'BELNR' "internal table field
          dynpprog               = 'Z_F4' "program name
          dynpnr                 = '1000' "screen number
          dynprofield            = 'P_BELNR' "screen field name
          value_org              = 'S'
        TABLES
          value_tab              = itab "internal table
        EXCEPTIONS
          PARAMETER_ERROR        = 1
          NO_VALUES_FOUND        = 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.
    ENDFORM.                    " f4_belnr_help
    Hope this helps you.
    Regards,
    Tarun
    Edited by: Tarun Gambhir on Mar 26, 2009 11:29 AM

  • How to read data from idoc to internal table?

    Hi
    How to get data from idoc segments to internal table?

    Hi
    Check this ex
    The following coding sample, shows how you may read a MATMAS IDoc and extract the data for the MARA and MARC segments to some internal variables and tables.
    DATA: xmara LIKE mara.
    DATA: tmarc LIKE marc
                OCCURS 0
                WITH HEADER LINE.
    LOOP AT edidd.
       CASE edidd-segnam.
         WHEN 'E1MARAM'.
              MOVE edidd-sdata TO xmara.
         WHEN 'E1MARCM'.
           MOVE edidd-sdata TO tmarc.
              APPEND tmarc.
       ENDCASE.
    ENDLOOP.
    now do something with xmara and tmarc.
    hope this helps you...
    Reward points if useful..
    Regards
    Sreenivas

Maybe you are looking for