Skip to Content
Author's profile photo Former Member

SAP NetWeaver 7.0 BI: How to send XML data to BI – enhancement

SAP NetWeaver 7.0 BI: How to send XML data to BI – enhancement

Hello, this blog refers to the How to Guide “How to send XML data to BI”.

http://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/f027dde5-e16e-2910-97a4-f231046429f2
You will learn how to send data from SAP NetWeaver 2004s XI/PI to SAP NetWeaver 2004s BI with full quality of service.

The proxy coding mentioned in Step 27 is fixed to a certain PSA structure of the WebService DataSource.

Please find below an example of an enhanced proxy implementation. The coding determines the PSA structure on the fly and therefore it can be reused for any other WebService DataSource using the XI-BI integration. The name of the function module and the exception class are still necessary to add. These constants are maked bold in the example.

I hope the enhancement helps. Comments are very welcome!

 

Enhanced Coding:

 

method ZII_DATA_TO_BW~EXECUTE_ASYNCHRONOUS.
* ==== To be adapted ==========================================================

* Note: only /BI/CF functions keep the name in target system
  DATA: l_function     TYPE funcname VALUE ‘/BIC/CQSENDXML00001000‘,
            l_exception    TYPE seoclsname VALUE ‘ZCX___BIC__CQSENDXML00001000_E’.* –


Get FM

  CALL FUNCTION ‘RPY_FUNCTIONMODULE_READ’
    EXPORTING
      functionname       = l_function
    TABLES
      import_parameter   = l_t_import_parameter
      changing_parameter = l_t_changing_parameter
      export_parameter   = l_t_export_parameter
      tables_parameter   = l_t_tables_parameter
      exception_list     = l_t_exception_list
      documentation      = l_t_documentation
      SOURCE             = l_t_source
    EXCEPTIONS
      error_message      = 1
      function_not_found = 2
      invalid_name       = 3
      OTHERS             = 4.

  IF sy-subrc <> 0.
    CALL FUNCTION ‘RS_MESSAGE_TO_EXCEPTION’
      EXPORTING
        i_exception   = l_exception
        i_msgid       = sy-msgid
        i_msgno       = sy-msgno
        i_msgty       = ‘E’
        i_msgv1       = sy-msgv1
        i_msgv2       = sy-msgv2
        i_msgv3       = sy-msgv3
        i_msgv4       = sy-msgv4
      IMPORTING
        e_r_exception = l_rx_exception.
    RAISE EXCEPTION l_rx_exception.
  ELSE.

* –


Get structure* –


Map data* –


Primary segment* –


Secondary segments: not yet supported* –


Submit to receiver

Assigned Tags

      12 Comments
      You must be Logged on to comment or reply to a post.
      Author's profile photo Former Member
      Former Member
      Mic, excellent job.

      I am in a situation and hope you can provide some inputs.

      I have data coming in from a XML file.

      Data in this file is at 3 levels.
      1st level contains the header info. Next two levels contain the transaction data info.
      Ex: Level 2 has the product name and level 3 has amount and corresponding time period. To be more specific Level 2 has all the products and Level 3 has the corresponding transaction amount and calday for that transaction....

      Any tips on how to design a datasource in this case?
      If just add all the fields at both levels to the data source then the generated WSDL file/web service considers all the fields coming at the same level.

      Thanks,
      sam

      Author's profile photo Former Member
      Former Member
      Hi sam, Thanks.
      I know, the problem is that we do not support deep DataSource structures yet. We always expect a flat (normalized) structure. Some customer do use XI as an interface (wrapper) in between.
      I hope this help, Michael
      Author's profile photo Former Member
      Former Member
      Hey Mic,
      Thanks for the reply. So summarizing possible options for my case (correct me if I am wrong or add if I missed any):
      1. Modify the XML file externally to a flat structure.
      2. Use XI as an intermediate stage.

      Thanks,
      SAM

      Author's profile photo Former Member
      Former Member
      yes. These are the options. Thanks Michael
      Author's profile photo Former Member
      Former Member
      Hello,

      another option will be build a webservice which can handle deep structure. This web service will there
      update the corresponding BW objects.

      Regards & Thanks,

      Guido

      Author's profile photo Former Member
      Former Member
      Hi Guido, interesting. Do you have a chance to put a example (blog) together.
      Thanks Michael
      Author's profile photo Former Member
      Former Member
      If you guys want we can work togthr, I have a good sample file for this case... let me know your thoughts..
      Author's profile photo Former Member
      Former Member
      Let me check... I will come back to you... Thanks Michael
      Author's profile photo Former Member
      Former Member
      Hi, created a blog how you could use a WebService with a deep input structure.
      I hope this helps,
      Michael
      SAP NetWeaver BI 7.0: How to create a WebService with deep input structure
      Author's profile photo Former Member
      Former Member
      Hey that is a really good one...
      Author's profile photo Former Member
      Former Member
      Thanks!
      Michael
      Author's profile photo Former Member
      Former Member
      Guido, that will great if you can put an example as blog.

      Mic and Guido if you guys are interested we can work togthr. I have a file with data for this type of scenario. I have developed XML tree from this file.

      Let me know your thoughts...

      Thanks,
      sam