cancel
Showing results for 
Search instead for 
Did you mean: 

How to use Mime Objects in Business Graphics at run

former_member187977
Participant
0 Kudos

Hi,

In a web dynpro abap application, I am using a business graphic. there is a attribute called 'customizing' present in the BG UI elem.

I want to set the value of customizing at runtime. I have uploaded few XML files in the Mimes folder of my web dynpro abap application. I want to change the property 'Customizing'(which takes a xml file as its value) at runtime. I want to take the xml file form the files uploaded in the mimes folder already. How do we do this programatically.

I have already done the following things.

data : lr_bg TYPE REF to cl_wd_Business_Graphics,

lr_bg_method_handler type ref to IF_WD_BUSIN_GRAPHICS_MTD_HNDL.

lr_bg ?= view->get_element( id = 'BGR_REMINQ' ).

lr_bg_method_handler ?= lr_bg->_method_handler.

CALL METHOD LR_BG_METHOD_HANDLER->CLEAR_DIRECT_CUSTOMIZING.

CALL METHOD LR_BG_METHOD_HANDLER->ADD_DIRECT_CUSTOMIZING

EXPORTING I_CUSTOMIZING = 'EUR.xml'.

In the above code, I am passing 'EUR.xml' to I_CUSTOMIZING property of the BG but the system is giving a error saying "The Literal 'EUR.xml' is not type compatible with formal parameter I_CUSTOMIZING". how to get rid of this error. how to reference a mime xml file in line 'EXPORTING I_CUSTOMIZING = 'EUR.xml'.

Regards

seventyros

Accepted Solutions (0)

Answers (1)

Answers (1)

former_member184578
Active Contributor
0 Kudos

Hi.,

Check these links.,

[Display MIME at run time|;

[MIME in UI in WDA|;

this will help u.,

Thanks & Regards,

Kiran

former_member187977
Participant
0 Kudos

hi,

These threads do not resolve my problem. They speak about creating a Mime Object at runtime. I have already uploaded mime object at design time. I want to use this Mime object(xml file) in a BG UI elem at runtime.

Regards

seventyros

Former Member
0 Kudos

Hi seventyros,

Expected parameter for method add_direct_customizing must be an object of type IF_IXML_DOCUMENT.

You must instantiate an object of this type using your 'EUR.xml'.

For doing so :

1/ Create an object from class CL_XML_DOCUMENT.

2/ Use method IMPORT_FROM_FILE to instantiate it from your 'EUR.xml' file if it is on your desktop or a similar one to load it from the bds (load could work).

3/ then access public attribute M_DOCUMENT which is type ref to IF_IXML_DOCUMENT.

4/ Pass this object to your method add_direct_customizing.

Job should be done.

Hope this helps,

Regards,

Mathieu.

Edited by: Mathieu Chenu on May 23, 2011 12:02 PM

former_member187977
Participant
0 Kudos

Hi,

I tried to do what you wrote.

I wrote following lines of code.

data : DOCUMENT TYPE REF TO CL_xml_document.

create OBJECT DOCUMENT.

DOCUMENT->IMPORT_FROM_FILE( filename = 'EUR.xml').

M_DOCUMENT = DOCUMENT->M_DOCUMENT.

CALL METHOD LR_BG_METHOD_HANDLER->CLEAR_DIRECT_CUSTOMIZING.

CALL METHOD LR_BG_METHOD_HANDLER->ADD_DIRECT_CUSTOMIZING

EXPORTING I_CUSTOMIZING = M_DOCUMENT.

at line where I am creating a object of class CL_xml_document ie at line create OBJECT DOCUMENT, program throws a dump saying "NOT_SUPPORTED_BY_GUI".

any suggestions on how to resolve this. I wrote the avove code in wddomodify() method.

regards

seventyros

former_member187977
Participant
0 Kudos

to add more to the above situation

Internally a call to following method is being made.

CALL METHOD cl_gui_frontend_services=>gui_upload

dump occurs exactly at CALL METHOD cl_gui_frontend_services=>gui_upload.

regards

seventyros

former_member187977
Participant
0 Kudos

hi,

and moreover, in your point no. 3, we are trying to upload the file from the desktop. I don't want to upload it from the desktop niether do I want to upload it using BDC etc. I have this XML file in the MIMEs objects of my web dynpro component. how do I get it from there?

regards

seventyros