Multimapping with ABAP Class

Hi all,
in a scenario I have to do some complex summarizations and mappings and so on. Therefore I implemented an ABAP Mapping within a class.
For the conversion I use a simple Transformation to have the data after it in an internal table. Then I'm doing some things. For the conversion back to XML I also use a ST.
The result of this mapping is are 2 messages (splitted by a key value within each row of the internal table).
I got it working that the mapping is returning me these 2 messages in such a structure:
<?xml version="1.0" encoding="utf-8"?>
<ns0:Messages xmlns:ns0="http://sap.com/xi/XI/SplitAndMerge">
  <ns0:Message1>
    <ns1:Messagetype xmlns:ns1="htto://ns.com">
      <item>
         <entity>data1</entity>
      </item>
    </ns1:MessageType>
    <ns1:MessageType xmlns:ns1="http://ns.com">
      <item>
        <entity>data2</entity>
      </item>
    </ns1:MessageType>
  </ns0:Message1>
</ns0:Messages>
But in the Adapter this message comes as one not as 2 messages.
So the question is, how the structure should look like for having 2 messages after the ABAP mapping.
Thanx
Olli

Oliver,
I am assuming here that you have just one Message type in the target and this message type is going to occur 0 to unbounded times.
If you have a requirement where you have multiople message types in the target then the strcuture will look like,
<?xml version="1.0" encoding="utf-8"?>
<ns0:Messages xmlns:ns0="http://sap.com/xi/XI/SplitAndMerge">
<b><ns0:Message1>
<ns1:Messagetype1 xmlns:ns1="htto://ns.com"></b>
<item>
<entity>data1</entity>
</item>
<b></ns1:MessageType1>
</ns0:Message1></b>
<b><ns0:Message2>
<ns1:MessageType2 xmlns:ns1="http://ns.com"></b>
<item>
<entity>data2</entity>
</item>
<b></ns1:MessageType2>
</ns0:Message2></b>
</ns0:Messages>
Also, have you used a Extended Interface Determination for this in the Interface determination?
Regards
Bhavesh

Similar Messages

  • WebDynpro with ABAP or JAVA?

    Hi all,
    I am a veteran in ABAP. I wish to learn web dynpro. I never worked on JAVA. Can anybody advice me which programming language i should use to learn WebDynpro development. Also let me know which companies have webdynpro projects in India?
    Thanks in advance..

    Hi Buddy,
             Welcome to intresting world of Web Dynpro.
             As veteran ABAPer you should go for WebDynproABAP .
             Now why ?
    Point 1:
    In my view WebDynpro ABAP and Wd Java are not same.
    Basically WebDynpro ABAP and Java are two different webDynpro provided by NetWeaver Stack.
    Basic conceptual base of WD ABAP and WD Java is same.I mean to say concepts like Context binding , node , elements , Layout both support are same.
    But when you provide background functionality to your Web Screen then Java or ABAP come in to picture.Just take case , you want do some thing on click of some button then
    1) in case of java may you will call some ejb or you will may write some java code on click.
    2) but in case of WD ABAP you have to do same thing with ABAP classes . You will call some call or some method of some system defined class.
    Ulimately point I want make
    1) WD ABAP and WD java 's Base is same but you code in completely different way.
    2) Purpose for which SAP came with two different WDynpro is different. Java can be used for developing quite sophistcated Web services.
    Point 2:
    another help for you .Just go thr' following thread
    How much of oops ABAP is required for ABAP Webdynpro .
    Point 3:
    You can start with tutorials and all
    Web Dynpro for ABAP
    http://help.sap.com/saphelp_erp2005/helpdata/en/a5/1a1e3e7181b60ae10000000a114084/frameset.htm
    best tutorials in wbdynpro for ABAP to start with :
    https://www.sdn.sap.com/irj/sdn/developerareas/webdynpro?rid=/webcontent/uuid/fed073e5-0901-0010-4eb4-c9882aac7b11 [original link is broken]

  • ABAP Objects with Workflows / Classes and Instances

    Hello,
    I am currently designing a workflow using an ABAP-Objects. So far I have been been able to get my Workflow to run with my class, but I have a couple of problems:
    - I am using the Function 'SAP_WAPI_START_WORKFLOW' to start other subflows, which enables me to decide which subflow to start at runtime. All of the subflows have standart importing-parameters in their containers, such as the key of my class. In each workflow I instantiate my class using a self-written method, which checks the table T_INSTANCES in my object, and then either returns the object reference to an existing instance or creates a new one. Obviously all of the subflows that I call from my main workflow should be able to find the instance. As far as I can see in their protocolls, this happens without any problems. The problem starts when I make changes to the instance. For example the changing of attributes (with setter methods) seems not to work. After the subflows are finished, in my main workflow, I do not see (with getter methods) any changes that has been made to the object. Is local persistence really limited to one workflow ?
    - My second problem is basically about the workflow container in workflow protocoll. In the same workflow, I can change the attributes of my object. Nevertheless, the protocoll always show the initial attribute, even though, my task with the getter-method returns the new value of the attribute.
    I appreciate any help and thanks a lot in advance.

    Hello Pauls,
    Thank you for your answer. I think we are misunderstanding each other. The problem occurs (I think) because my class is not a singleton class. Or am I mistaken ?
    When I directly start a subflow from my main workflow, then the instance that I have created in my main workflow is also visible to the subflow. As well as the static table which actually keeps track of the instances. So, in this case the subflows finds the instance and then can use the object as is.
    When I start a subflow from my main workflow using the function I mentioned above, then even though the same object key is used, there is a new instance. And the static table (I assume that you mean a static variable from type table, when you say "class table") is completely empty. In this case, my "new" instance is created which overwrites every attribute that I have set in the main workflow, before I started the subflow. More interestingly, my main workflow instantiates another new object, as soon as the subflow has finished. (I am using an event to wait for the subflow to finish.)
    On the other hand, I am not quite sure that I understood your approach with refresh and how it could help me. This method is not well documented anywhere, and all of the examples that I have found are about "leave it empty"
    As far as I understood, this method is called by the workflow between the steps, when an object is used. I slowly start to think that I need advanced information about Workflows and Memory Management.
    Thanks a lot again. Apparently, I am the only person who came across such a problem
    Greetz
    G.Fendoglu

  • Calling ABAP Class with Javascript (Example?)

    Can anyone provide an example of calling an ABAP class with Javascript?  I'm looking to retrieve a variable value from a Web Application
    Thanks

    I need this too.
    I have a Selection Screen in JAVA. And I want to fill the f4-help with a abap-function.
    with kind regards
    Maria Kiltz

  • ABAP class method with dialogue

    Hi all,
    I want to use a ABAP class method within a Workflow definition with user interaction. The SAP help says, that is possible, but I couldn't find a way, to mark the method as "with dialogue".
    For BOR-objects there is a checkbox in the details for the method definition. Can anybody tell me, how it can be done?
    Thanks in advance
    Nick

    Hi Nicolas,
      When you create the Task with the ABAP OO Method, you can select it as "Background Processing" else it will be a "Dialog Process".
    If you notice here, "Background Processing" checkbox will be editable if ABAP OO Method is used, whereas in case of Business Objects it directly comes from method definition.
    Reward points if useful.

  • Binding ABAP Class Attribute with BUS2038 in a Standard WF task

    Hi,
    I need help as mentioned in the subject line.
    In my standard task I am capturing event for BUS2038. In the General tab I have a ABAP class which has implemented IF_WORKFLOW. From BUS2038 I just need notification number.
    Since my source is a BO and my target is a class. How do I make this conversion and pass the data to my class?
    I know there are several solution but none have solved my concern.
    Thanks,
    Sridhar Karra.

    Hi,
    If you want to access teh attributes of the BOR inside a class emthod then you have to make use of teh MACROS.
    1. include INCLUDE CNTN01_SWC  in the class local macros section. and in the type groupsof the class include SWC0.
    2. Now if you know the key of the BOR instance then create a BOR object inside the class method as below
    DATA lo_object   TYPE SWC0_OBJECT.
    SWC0_CREATE_OBJECT lo_object '<BUSXXXX>' '<Key of the BOR>.
    the above line will create the instance of the bor inside the class method
    now inorder to access the attributes of the BOR  use the below code
    DATA lv_notif_no   TYPE  <type of the notification>.
    SWC0_GET_PROPERTY lo_object '<ATTRIBUTE NAME> lv_notif
    In this way you can access the BOR attributes inside a class method.
    Regards
    Pavan
    Edited by: Pavan Bhamidipati on Dec 15, 2011 11:01 PM

  • Shooping cart creation in SRM 7.0 using web dynpro ABAP classes.

    Hi,
    We have recently upgraded to SRM 7.0 from SRM 4.0. We are using customized portal application for the creation of the shopping cart.I am planning to create custom FM which will use the standard Web dynpro ABAP classes to create the shopping cart.
    Could you please guide with the classes that are need to be implemented and the sequence of the classes used in the shopping cart creation.
    I think these are the classes that are used in the standard web dynpro ABAP component.
    CL_FPM_EVENT ->                  Creates an instance of this class based on an event ID.
    CL_BADI_FLT_DATA_TRANS_AND_DB -> Data Handling: Transport and Database.
    CL_EXITHANDLER ->               Class for Ext. Services Within Framework of Exit Technique.
    CL_EX_BBP_DOC_CHANGE_BADI ->     BAdI Class CL_EX_BBP_DOC_CHANGE_BADI.
    CL_BBP_OBJECTS_ACCESS ->         Access Functions for Object Types.
    /SAPSRM/CL_PDO_BO_SC ->          Shopping Cart BO.
    Your expert comments will be appreciated...
    Regards,
    Naresh

    Dear Poster,
    As no response has been provided to the thread in some time I must assume the issue is resolved, if the question is still valid please create a new thread rephrasing the query and providing as much data as possible to promote response from the community.
    Best Regards,
    SDN SRM Moderation Team

  • Calling Portal event from ABAP class

    Hi Experts,
    I need a following clarificatrion, Please help,
    1. Is it possible to call a webdynpro method from a normal ABAP class?
    2. If no, we need a functionality of a class 'CL_WDR_HTTP_EXT_MIME_HANDLER' having method 'DO_DOMAIN_RELAX_HTML'.
    Is there any alternative method which can be used in ABAP having the same functionality.
    3. Is there any ways with which we can call portal event from ABAP class?
    Thanks,
    Shabir

    >1. Is it possible to call a webdynpro method from a normal ABAP class?
    I wouldn't necessarily recommend this approach. You shouldn't try to trigger events or any of the standard WDDO* methods from outside the WD Component itself.  That said, you can pass the object reference (like the WD_COMP_CONTROLLER object reference or the View Object Reference) into methods of normal classes.  Be careful if you are finding yourself calling a lot of your added methods from outside WD.  This is probably a sign that these methods should be in the Assistance Class or some other Class functioning as a Model Object.
    >2. If no, we need a functionality of a class 'CL_WDR_HTTP_EXT_MIME_HANDLER' having method 'DO_DOMAIN_RELAX_HTML'.
    Is there any alternative method which can be used in ABAP having the same functionality.
    What exactly do you want to do here?  Do you just want to get the relaxation script?  For what purpose?  You should never need to inject the relaxation script into WDA. 
    >3. Is there any ways with which we can call portal event from ABAP class?
    To what purpose.  Do you just want to delegate the triggering of the event that is inside WD Component to be called from a class?  If so you can pass the portal API object reference into a class from the WD Component.  However this only works while running within WD.
    How is this class used?  Are you running in WD?  Are you trying to generate some HTML code that runs in the portal independent of WD?

  • TYPES statement in abap class to include structure

    hi ,
    i have declared following in a abap class...
    TYPES:
          zts_alv_line TYPE zmat_pr_costest_alv.
         TYPES:BEGIN OF ts_alv_line,
                include type zts_alv_line,
                matkl type mara-matkl,
                t023t type t023t-wgbez,
                lvorm type mara-lvorm,
                end of ts_alv_line.
         TYPES: tt_alv_data TYPE STANDARD TABLE OF ts_alv_line WITH DEFAULT KEY.
         DATA:
          alv_data TYPE tt_alv_data.
    now while refering to alv_data-matnr the sap is giving error that this component does not have matnr.
    please help.
    Edited by: Suhas Saha on Feb 3, 2012 1:11 PM

    TYPES: zts_alv_line TYPE zmat_pr_costest_alv.
    TYPES:BEGIN OF ts_alv_line,
                include type zts_alv_line,
                matkl type mara-matkl,
                t023t type t023t-wgbez,
                lvorm type mara-lvorm,
                end of ts_alv_line.
    Actually by defining this you've defined include as field of ts_alv_line. Actually ts_alv_line is a nested structure.
    I think you need to re-define the structure definition as:
    TYPES:BEGIN OF ts_alv_line.
          INCLUDE TYPE zts_alv_line.
    TYPES: matkl TYPE mara-matkl,
           t023t TYPE t023t-wgbez,
           lvorm TYPE mara-lvorm.
    TYPES: END OF ts_alv_line.
    BR,
    Suhas

  • ABAP CLASSES - XI don't create the Target File..

    Hallo,
    I have a problema in XI when I use an ABAP Class.
    This is My FLOW:
    1) R/3 SEND an IDOC DEBMAS to XI un idoc DEBMAS(Customer data)
    2) XI have this Interface Mapping: Interface_Mapping_Anagrafica_Cliente.
    It si composed on:
    - Input: IDOC (DEBMAS)
    - 1° Mapping      ==> named: Message_Mapping_Anagrafica_Cliente
       This mapping, from IDOC DEBMAS, create the message type Message_Type_Anagrafica_Cliente.
    - 2° Mapping      ==> Classe ABAP
       This mapping, from Message_Type_Anagrafica_Cliente create the message type Message_Type_Click.
    - Output: Message_Type_Click
    3) I want that this Message_Type_Click will be in the file.
    But, if I execute the transaction SXMB_MONI in XI, I can see the IDOC OK .. but if I make double click on it, I don't see the Payload for the target file. Infact the target file is not be created by XI...
    I have made debug after my class and I found a Problem in the Trace with type E with message: CL_MAPPING_XMS_PLSRV3-ENTER_PLSRV.
    What is this?
    Can you help me?
    Thanks.
    Monia

    Hi Monia,
    first put your trace to 3: SXMB_ADM, Integration Engine Configuaration, Specific Configuration, Runtime/Trace Level
    Second delete your abap mapping from your interface mapping and look in the monitoring for the output. Is it what you expect? Is it the datatype the abap mapping can work with?
    Copy the result as source for the next test. Now you put the ABAP mapping inside and delete the message mapping from your interface mapping. Test with transaction SXI_MAPPING_TEST. Look to the weblog <a href="/people/sameer.shadab/blog/2005/09/29/testing-abap-mapping ABAP Mapping</a> how to test an ABAP mapping.
    The problem with more than one mapping program in one interface mapping is that you see only the result of both!
    Regards,
    Udo

  • How to use web service with ABAP Web Dynpro

    Hi.
         do you know, how to web service with ABAP Web Dynpro?

    Hi,
    If you have a webservice ready with you then you can generate a proxy from SE80 and you can use that. You just have to create a port and assign to that generated proxy(CLASS) and you are good to go.
    Let me know if you need more information.
    Thank You,
    Gajendra.

  • Problem with ABAP mapping

    Hi...
    I have  the following issue: I create an ABAP mapping class and activate it, but when I test the mapping via TC SXI_MAPPING_TEST it doing nothing, that is, in the result page, in the option TRACE its throw the following message: No mapping configured.
    Previously:
    1.- Create DT, MT and MI for each interfaces.
    2.- Create IM in wich put the name of the ABAP class of the mapping (and activate too).
    3.- Check in the IM the namespaces of both MT.
    Do I miss something?
    Hector

    Hi,
    Where did you created your ABAP mapping . is it in R3 instance of XI or in external R3?.
    If you are in R3 of XI then you can test it with SXI_MAPPING_TEST
    see the below links for more details
    /people/sameer.shadab/blog/2005/09/29/testing-abap-mapping
    ABAP mapping
    Testing ABAP mapping
    http://help.sap.com/saphelp_nw04/helpdata/en/de/705c3c3806af06e10000000a11402f/frameset.htm
    /people/r.eijpe/blog/2005/11/21/xml-dom-processing-in-abap-part-ii--convert-an-xml-file-into-an-abap-table-using-sap-dom-approach
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/15ecdf90-0201-0010-d792-941a3c3c30a4
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/media/uuid/06114a70-0701-0010-5db6-93dbadaed321?prtmode=navigate
    /people/r.eijpe/blog/2006/02/19/xml-dom-processing-in-abap-part-iiia150-xml-dom-within-sap-xi-abap-mapping
    /people/r.eijpe/blog/2006/02/20/xml-dom-processing-in-abap-part-iiib150-xml-dom-within-sap-xi-abap-mapping
    Regards
    Chilla..

  • ABAP Class in WAD 7.0 - what's missing?

    Guys,
    I need some help in calling an ABAP Class from the Web Application Designer 7.0. I've read all documentation about inserting my class and it looks like I'm still missing something.
    First I checked the class in a Test Query in 3.5. Put it in the WAD 3.5 and it works fine, I am replacing a field (characteristic in my query) with a longtext field which is being fetched from a table. I see the results in my 3.5 report.
    Now I'm building this in 7.0 WAD. So the following steps:
    1. My class is ok, it works in 3.5. Interface IF_BICS_CONS_WEBITEM_CUST_EXIT has been added according to the How To.
    2. I've inserted a Customer Exit Item in my WAD
    3. I've assigned the query as a source for my Customer Exit Item
    4. Navigational State Access is on, Result Set Access is on.
    5. The parameters of the Customer Exit item are set with the ABAP Class name. The Properties list there shows the Name 'Default'. The Value is 'Default' as well. Don't know what I have to fill in there.
    Have any of you any idea of what I'm missing here?
    Thanks!
    Cheers,
    Joost

    Just to Clarify I am passing value as l_s_values-value = '<a href=u201Dhttp://www.yahoo.comu201D>yahoo</a>'
    and the IE is interpreting it as l_s_values-value = '&lt;a href=u201Dhttp://www.yahoo.comu201D>yahoo</a>'.

  • BOR Object and ABAP Class

    Hi,
        Can anybody say when to use BOR object and Abap class in the task with an example.
    Thanks,
    Mugundhan

    There is no any specific condition or rule that for this purpose you need to use BOR and Class , it depends on your requirement. not only the requirement but also the new techniques to make classes not just as simple way to create objects but when you use classes in the Workflows they are not simple classes but they are BUSINESS CLASSES which makes a lot of difference.
    Check the blogs of [Jocelyn Dart|https://www.sdn.sap.com/irj/scn/wiki?path=/pages/viewpage.action%3fpageid=55566]

  • BOR Object or ABAP Class

    Hi Experts,
    We are implementing the Leave Request WF using WS12300111. The user raises a leave request from the portal.
    As per the functional point of contact, they have said that this WF can be set up in the configuration in SPRO to be triggered when a leave request is raised.
    When we saw the standard SAP provided WF, the steps in it are based on ABAP class. I just want to know if the approach has to be only using ABAP classes or can BOR objects be used.
    We require some customizations in the sense, we need to add some custom logic to retrieve some data from some custom tables and also display the same.
    Kindly let me know if we need to use ABAP classes or we can use a BOR Object.
    Cheers,
    Belinda Clarke

    Hi Karri,
    Thanks a lot for your response.
    I was actually evaluating the possibilities of the same as our WF consultant is currently on leave. I was just seeing a scenario where they have used BOR Object for Travel and Expenses module. When i saw the standard WF for Leave Request WS12300111, I was seeing mainly ABAP Objects and there was no BOR objects used.
    I just wanted to confirm whether we could create a BOR Object or go on with the ABAP Classes. Does the ABAP Classes involve a lot of effort? We need to actually send email notifications and add some new steps etc...so was just thinking as to which would involve more effort.
    We need to actually retrieve data from table PTREQ_ATTABS and send the email notification to the concerned user whenever the leave request is approved/rejected/cancelled as shown below :
    Your leave request has been approved/rejected
    Name : abcde
    Emp No : 123456
    Type of Leave : Annual Leave
    Date : 7th July to 11th July
    No. of Days : 3 days
    So do u imply that all of this can be done with an ABAP Class
    Could you kindly guide us.

Maybe you are looking for