Wednesday 22 May 2013

Mass Uploading of MIME Types to Transport

Brief : Package SMIME has lots of MIME interrogation objects in it.
By copying a BSP Application, you can attach all it's MIMEs to a transport.
You can't rename a BSP Application.

Our problem here is that we've developed a massive BSP with a bazillion MIMEs in it...

 We could quite easily hold down shift, select the first file in the folder, and then the last one, and rightclick. This only works for the folder though. 
So I was about to write a program that interrogates the MIME repository (Package SMIMES for the win there) and finds the MIME keys, and then uses those to attach to a transport. (Hadn't worked that bit out yet...)

THEN.... we were also asked to rename our BSP Application, because it'd been developed under some ZTEST_APP style name.
Now you can't rename a BSP application, so we cheekily copied it and deleted the original. Upon copying, we were obviously given a transport number, but also asked if the new BSP Application wanted the original's MIMEs. So I ticked that box, and the app then started chugging through, copying the 1400 MIMEs across, and .... attaching them to the new transport!
So flukily, saved myself the half a day it would have taken to write the program! 

Monday 20 May 2013

WD4A Popup Decision box

Just found totally excellent step-by-step for WD4A popup decision box. Not going to rehash it here, as it's soooo good to begin with, it doesn't need any further explanation!

http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/40bbbbf6-4fec-2e10-4fa1-b57866732ee0?QuickLink=index&overridelayout=true&52828097790413

Wednesday 15 May 2013

Paramaterising a Web Dynpro


So I wanted to Paramaterise my Web Dynpro. At the moment, we give out users a front screen that allows them to enter the Document #, and then view the Document.

What you’re looking at here is part of my WebDynpro application, the top view that you see when you first call the application…The requirement was that another Web Frontend Application (a really sexy BSP written by a company that does Websites) could call the WebDynpro by way of a paramaterised URL.

Chances are you see Paramaterised URLs all the time :Stuff like 

https://www.google.co.uk/search?q=dynamo 

Shows that you’re searching for dynamo on google. I started by adding I_QMNUM to the Paramaters list of the Application. 
You don’t really need to Type this, because it’ll just behave like a string regardless, and lots of browsers will do a bit of escape-charactering to it anyway.

I then put the following code into the HandleDefault Method of the main WINDOW (not view!) of the Application.



method HANDLEDEFAULT .

DATA it_parameter TYPE tihttpnvp,
         wa_parameter  
TYPE ihttpnvp.

  
DATA lo_nd_url_param TYPE REF TO if_wd_context_node.
*  DATA ls_url_param TYPE wd_this->element_url_param.

  
" Get all URL parameters
  
CALL METHOD wdevent->get_data
    
EXPORTING
      name  
if_wd_application=>all_url_parameters
    
IMPORTING
      
value it_parameter.

*  " Get parameter values
*  CLEAR wa_parameter.
  
READ TABLE it_parameter WITH KEY name 'I_QMNUM' INTO wa_parameter.
  
IF sy-subrc EQ 0.
     l_qmnum 
wa_parameter-value.
  
ENDIF.

Endmethod.

I then gave it a quick test.
I dropped an external breakpoint at the top of my code in the HANDLEDEFAULT method.
I went to my application in Internet Explorer, and opened my application as usual.
The Code was hit, but the it_paramater field wasn’t populated.

Now my usual url is
http://<servername>/sap/bc/webdynpro/sap/zhpewd_zecn_dash_chrome?sap-client=101&sap-language=EN

If I tag the I_QMNUM data on the end of it. (My QMNUM of choice is GB0002280), and plug in

http:// <servername /sap/bc/webdynpro/sap/zhpewd_zecn_dash_chrome?sap-client=101&sap-language=EN&I_QMNUM=GB0002280

to my browser bar…
when I hit the breakpoint, I’ve got it_parameter populated with the I_QMNUM!



Now all I’ve got to do is copy the code from the button press on the front screen which calls the document. But that’s the bit I already know how to do, so I’m not going to document that unless it throws up something interesting!