BSP/MVC: Naming of Class Atributes

Hi there
developing BSP/MVC applications, I wonder which is a good naming standard for new class attributes of a controller or model class. saw in the examples that most attributes start with "M_" not only the inherited ones but also newly added.
as far as I remember, attributes starting with "M_" have a special meaning, can't fracking remember which one, though
So my questions:
1. what kind of attributes start or shout start with "M_"
2. what's a useful naming standard for attributes in classes
thanks in advance
Gerald

you just create a constructor method for this class and pass the column definition from your application to this class while instantiating the same .
sample.
  CALL FUNCTION 'TR_NAMETAB_GET'
    EXPORTING
      iv_tabname                 = 'SFLIGHT'
      iv_get_lengths_in_charmode = ' '
      iv_get_texts               = 'X'
    IMPORTING
      et_dfies                   = lt_dfies
    EXCEPTIONS
      not_found                  = 1
      OTHERS                     = 2.
  IF sy-subrc <> 0.
*--- Do nothing in this particular case
  ENDIF.
  LOOP AT lt_dfies INTO ls_dfies.
    wa_pers_tab-field_name = ls_dfies-fieldname.
    wa_pers_tab-text       = ls_dfies-reptext.
    wa_pers_tab-colpos     = sy-tabix.
    wa_pers_tab-invisible  = ' ' .
    APPEND wa_pers_tab TO pers_tab.
  ENDLOOP.
ENDIF .
SORT pers_tab BY colpos .
CREATE OBJECT iterator TYPE ycl_tv_iterator
  EXPORTING
    col_def = pers_tab .
and in the column definition method you can use this to build the columns
LOOP AT m_col_def INTO wa_col_def  .
    APPEND INITIAL LINE TO p_column_definitions ASSIGNING <def>.
    <def>-columnname = wa_col_def-field_name.
    <def>-title      = wa_col_def-text .
  ENDLOOP .

Similar Messages

  • BSP-MVC download to excel

    Hello experts,
    I know there are many threads on this topic in the forum. I tried using method cl_bsp_utility=>download
    but nothing happens. Here is the scenario -
    1. I have BSP
    2. From Do_handle_event in controller class I am calling model method which handles downloading to excel.
    Please help as this is real showstopper for the application, I am developing.
    Thanks, in advance.
    Trupti

    Hi Gopal,
    Thanks for your reply.
    Tried the code you sent me. As I am using BSP-MVC, I am building method in controller class and with event handling calling the method that handles download to excel. But it is not doing anything at all.
    Thank you.
    Trupti

  • Uploaded text file has a new line added at the top using BSP MVC applicatio

    I have a BSP MVC application that uploads data on to the application server. When I open the uploaded text file, the very first line on the file looks like the line below. ->
    htmlb:button:click:nullhtmlb_form_1UploadUpload0htmlbdfsdf
    But the rest of the file looks okay. This is causing other than .txt files to get corrupted.
    Here is the code from my DO_HANDLE_EVENT.
    data: entity   type ref to if_http_entity,
          name     type string,
          content  type xstring,
          content_type type string,
          idx      type i value 1,
          v_root(26) value '
    houappl131\SRM_Download\',
          v_unxfile(100),
          v_transfer type xstring,
          v_type(6),
          v_len type i,
          v_dirfile type zfileinfo,
          v_ofile(80),
          v_guid type guid_32.
      class cl_htmlb_manager definition load.
      data:        v_asn(10) type n.
      data: fu        type ref to cl_htmlb_fileupload,
                       file_id   type string value 'batchfile'.
      data: o_page_context type ref to if_bsp_page_context.
      data: parent type ref to cl_bsp_controller2,
            lo_model                       type ref to cl_sus_m_asn_detail.
      o_page_context = me->get_page_context( ).
      cl_htmlb_manager=>dispatch_event_ex( request = request
      page_context = o_page_context
      event_handler = me ).
      refresh z_batch->message.
      if htmlb_event->server_event = 'Upload'.
        fu ?= cl_htmlb_manager=>get_data( request = request id = file_id name
                                             = 'fileUpload' ).
        if fu->file_name gt space.
              z_batch->parameters-fpath = fu->file_name.
              v_len = strlen( z_batch->parameters-fpath ).
              if v_len gt 4.
                v_len = v_len - 3.
              endif.
              v_type = z_batch->parameters-fpath+v_len(3).
              search z_batch->parameters-fpath for '.'.
              if sy-fdpos gt 0 and v_len gt 0.
                v_len = v_len - sy-fdpos.
                v_type = z_batch->parameters-fpath+sy-fdpos(v_len).
              endif.
              clear v_asn.
              v_asn = z_batch->parameters-asnhdr.
              concatenate v_asn
                          z_batch->parameters-asnitem
                          z_batch->parameters-batch
                          v_type
                          into v_unxfile separated by '.'.
              concatenate v_root v_unxfile into v_unxfile.
              condense v_unxfile no-gaps.
              open dataset v_unxfile for output in binary mode.
                while idx <= request->num_multiparts( ).
                  entity = request->get_multipart( idx ).
                  name = fu->file_name .
                  if name is not initial.
                    content_type = entity->get_header_field( 'Content-Type' ).
                    clear content.
                    content      = entity->get_data( ).
                    v_transfer = content.
                    transfer content to v_unxfile.
                    append content to z_batch->filetab.
                  endif.
                  idx = idx + 1.
                endwhile.
                close dataset v_unxfile.
            endif.
      endif.
    Here is my fileupload button in the view
    <htmlb:page title="File Upload " >
        <htmlb:form method       = "post"
                    encodingType = "multipart/form-data" >
          <htmlb:label id     = "Batchnum"
                       design = "Label"
                       for    = "Batchnumber"
                       text   = "Batch" />
          <htmlb:inputField id    = "Batchinput"
                            value = "//zbatch/parameters.batch" />
          <htmlb:fileUpload id="batchfile" />
          <htmlb:button id      = "Upload"
                        text    = "Upload"
                        onClick = "Upload" />
          <htmlb:button id      = "Close"
                        text    = "Close window"
                        onClick = "Close" />
    Any of you gurus know why this is happening?

    I solved it myself

  • Call webdynpro from BSP (MVC)

    Hi, gurus!
    I have simple bsp created using MVC. I have my own component which includes MainWindow with controller class by default and a view with controller class and model class. Everything was created using Wizard.
    I need to call webdynpro app from this BSP in WEB UI. I have a code that get WD url, then I'm trying to use navigation in DO_REQUEST method whih I redefine for a view controller class:
      data: l_wd_url type string.
      call method cl_wd_utilities=>construct_wd_url
        exporting application_name = 'Z_XR_BP_COURCES'
        importing out_absolute_url = l_wd_url .
        navigation->goto_page( l_wd_url ).
    In test mode it's working fine, but when I call this BSP through WEB UI I recieve an error message:
    "Business Server Page (BSP) error
    What happened?
    Calling the BSP page was terminated due to an error."
    Sorry, if my question a little bit stupid =), but i'm new in BSP.
    Could anyone help me?

    Hi,
    Please check in SDN before posting the questions.
    Check with the following link [Webdynpro from BSP (MVC)|Call Webdynpro Application from BSP Application;
    Hope this helps you.
    Regards,
    Rajani

  • Problem with BSP MVC

    Hi all,
    I had a bsp application which is now running live in the organization. Recently, I got a problem report back from user, which is causing data loss.
    After the support team check the problem and found out the source of the problem. Let me briefly state the problem here. The application is using bsp mvc and it is stateful.
    First, when a user open the application in IE, it is a timesheet entry application, first page will display the time entry of that user for current month. let say the default selected month is September. then if the user wan to compare the entry with previous month, then he will open a new window (ctrl + N) or new tab (ctrl + T), then open the application again. Because of using SSO, the application will not prompt user to login again and will directly lead user to the time entry page. then the user change the month to August for the second new page.
    after the user change the month to august, it will refresh the model that hold the data of the month. means the model now carry August calendar. then the user go back to the first window or the first tab with september time entry, he try to add in new data into that time entry, and save. when it is saved, the september data will go into the August data not go into the September data. this causing data loss in September.
    If I tried this again with not using (ctrl + N) or (ctrl + T) but is open another new IE broswer instance, then it wont give this problem at all. because it create another new model to hold the calendar data. It work fine as long as the user not open two or more windows or tab in a same IE instances.
    Does anyone here meet this problem before or could provide any suggestion to solve this kind of problem? I cant simply changed the application to stateless because it already using worldwide and it will cause a lot of problem. Sorry if my question here was not clear enough.
    Thanks you. (reward point will be given for helpful answer.)

    Is there anyone can understand my problem?
    Thanks you.

  • Reg:bsp(mvc)

    hi to all,
    i had developed a stateful BSP application using MVC .
    in the first view iam entering a material number.
    in the second view iam displaying the records from a table based on material number.again when i make the application to stateless it is displaying the second
    view.with writing a code for a stateless application.i.e server side cookies.
    could any one help me out.
    with regards.
    gangadhar.

    Hi,
    To set data using cookies,
    call method cl_bsp_server_side_cookie=>set_server_cookie
              exporting
                name                  = 'ZF0707'
                application_namespace = str_app_ns
                application_name      = str_app_na
                username              = 'shtml'
                session_id            = str_ses_id
                data_name             = 'EMP_DATA'
                data_value            = itl_delview_tab
                expiry_time_rel       = 7200.
    To get the data using cookies,
    call method cl_bsp_server_side_cookie=>get_server_cookie
        exporting
          name                  = 'ZF0707'
          application_namespace = str_app_ns
          application_name      = str_app_na
          username              = 'shtml'
          session_id            = str_ses_id
          data_name             = 'EMP_DATA'
        changing
          data_value            = itl_delview_tab.
    here itl_delview_tab is an internal table.
    Also go through the below link,
    http://help.sap.com/saphelp_nw04s/helpdata/en/bd/4cd23a09313b37e10000000a11405a/content.htm
    Please close ur earlier thread and award points if u have got the solution,
    Re: REG:BSP(MVC)
    Regards,
    Sachidanand.B

  • How to clear the variables before closing a BSP MVC application

    I am calling a custom stateful BSP MVC application to display additional PO information as a popup window inside SAP BSP. When I close this popup window and open it later on a different PO, it still displays the old PO information. I am clearing the variables in the DO_HANDLE_EVENT. 
    I am using the javascript
    <htmlb:button id      = "Close"
                        text    = "Close window"
                        onClientClick="javascript:window.close()"  />
    to close the window.
    Could someone tell me what do I need to do before closing so that I can clear all the variables.

    Hi Krishana,
    Other neater way could be..
    instead of calling java script.. raise a server event.. in DO_HANDLE_EVENT set a flag <b>lv_close_window</b> to 'X'.
    on the page call the script to close the window if flag <b>lv_close_window</b> is set to 'X'.
    just before setting rhe flag to 'X' you can clear all unnecessary data.
    rememebr: javascript wont take you to DO_HANDLE_EVENT.
    <htmlb:button id = "Close"
    text = "Close window"
    onClick="close_window" />
    i would to this way if i am willing to go to DO_HANDLE_EVENT.
    A.

  • BSP MVC app -- debug issue

    Hello,
    I have an BSP MVC stateless app. It has 4 views: Initial, Start, REsult and Detail. Initial view encompasses the other 3 views. When a value is entered in the Start view and on hitting 'Get results' I want to debugger to stop. I assign an external breakpoint there -- but it still doesn't stop their on the DO_HANDLE_EVENT event. The debugger on other events like DO_INIT stops BUT not on handle event method.
    I do have other app similar to the one above but the type is of stateful and the debugger on the same event works fine.  Please advise on how to make it work in BSP MVC stateless apps on certain events.
    Thank you.
    Kshitij

    Hello,
    Yes I do have dispatch_input() in the DO_REQUEST method of view Initial. But still the debugger doesn't stop at the DO_HANDLE_EVENT method.
    method DO_REQUEST.
    *CALL METHOD SUPER->DO_REQUEST
      data start_view TYPE REF TO if_bsp_page.
      dispatch_input( ).
      start_view = create_view( view_name = 'start.htm' ).
      start_view->set_attribute( name = 'pernr_low' value = me->pernr_low ).
      start_view->set_attribute( name = 'pernr_high' value = me->pernr_high ).
      call_view( start_view ).
    endmethod.
    Thank you.
    Kshitij

  • Bsp application without application class

    Hi
        I want to know how is a stateful bsp application without application class will work, meaning where is it going to store all the values without application class
    regards
    Ashutosh

    Yes... It will work for example using server side cookies.
    Best regards
    Ariel

  • Regarding instantiation of Iterator Class BSP MVC

    Hi Friends,
    I am trying out the MVC based BSP application using tableview iterator. I read the blog by Brain and went through the forums and tried to implement in MVC pattern.  wrt to Iterator part I did the following things...
    1. I created a ZClass and implemented IF_HTMLB_TABLEVIEW_ITERATOR Interface
    2. I created a variable in Controller Attributes TV_ITERATOR type ref to Zclass (Interface implemented)
    3. In the layout I have used the iterator attribute of Tableview assiging to TV_ITERATOR.
    4. I have defined the method Column_definitions....
    and in Do Handle Event I created a object for iterator "Create object tv_iterator".( i created a separate class for interface and thought would instantiate in Controller Class)
    I am not getting the desired output. Hope I am clear with this....
    I am just a beginer in BSP so sorry if its a silly question...
    Thanks

    Hi Mark,
    Thanks for your reply. I tried that in DO_INIT and in DO_REQUEST as well. I started of this application well with the values selecting from Dropdown and then rendering the table columns. But now I have commented everything and just trying to render one column of the table....
    I have one concern.
    I have declared like this
    tv_iterator type ref to ZITERATOR.
    and in DO_INIT I have instantiated. Create Object tv_iterator.
    If you have any suggestions please let me know....
    Thanks

  • POP UP IN BSP MVC-NO java script code

    1.when ever I click on one Button in BSP application(MVC) ,One pop up should trigger with Yes or NO options.
    2.If user selects Yes I need to proceed further.
    I can do it through javascript code in page layout,AS I am doing changes in Standard application I do not want to change page layout .
    But I am looking to trigger pop up from abap code ,because I can enhance the class and implement post exit to event handler methods.
    BSP application name: HRRCF_ACT_PROC.
    View Name: List.do
    Event handler : Ondelete ( ).
    Domain: erecruiting
    I can create a new ZBSP apllication and view as yes or no options
    But how to call that new BSP application as POP UP and sned back data to original application

    1/In your BSP application YES /NO use this function identify computer name ***************************
      data: iRFCHOST type RFCHOST,
           oRFCHOST type RFCHOST.
      CALL FUNCTION 'TH_USER_INFO'
        IMPORTING
          TERMINAL = iRFCHOST.
      CALL FUNCTION 'RFC_IP_TO_HOST'
        EXPORTING
          RFCIP                       = IRFCHOST
        IMPORTING
          RFCHOST                     = ORFCHOST
        EXCEPTIONS
          IP_TO_HOST_CONVERSION_ERROR = 1
          OTHERS                      = 2.
      IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    2/Save computer name and decison Yes/No to custom table *************************************
    3/In you BSP aplication use function identify computer name(terminal name) and look to custom table for decision Yes/No
    Note: It will work if user will not work with multiple seesion

  • BSP MVC with multiple components approaches

    Hello,
    I have developed in BSP with follows MVC. The BSP application had multiple subcontroller and one main controller. I had one model for each controller,
    but the models were "stored" on the level of the main
    controller.
    Is this the right way? Are there are other approaches?
    Regards & Thanks,
    Guido

    Hi,
    Do you mean to say that u have instantiated the subcontroller models in the main controller using the model data and assigning them to the views in ur subcontroller do_request method?If so it will work however a better approach is to instantiate one main model class (make different method in the model class to access the records from database)in the main controller and use it to assign to the view in the do_request method of the subcontroller.
    Hope this helps.
    Reward useful answers.
    Regards,
    Shrita.

  • Class atributes

    Hello all!!
    Following the instructions in this Weblog for iterator implement /people/brian.mckellar/blog/2003/10/31/bsp-programming-htmlb-tableview-iterator (a lot of thanks)
    I create my own bsp that works correctly.
    Now I have a question with the class that implements the iterator interface.
    I want to use p_edit_mode in method IF_HTMLB_TABLEVIEW_ITERATOR~RENDER_CELL_START but i don't know how to set this parameter to x from the bsp (sorry but I'm newbie in this).
    I want, too, to establish a new atribute in this class to say to the method IF_HTMLB_TABLEVIEW_ITERATOR~GET_COLUMN_DEFINITIONS wich columns i want depending from a parameter of the bsp, and i don't know how to make this.
    Many thanks in advance and thank you too all persons of this forum beacuse it's a very good guidance to resolve problems (I read a lot of threads and with this I create my first bsp).
    Thanks again!!!

    you just create a constructor method for this class and pass the column definition from your application to this class while instantiating the same .
    sample.
      CALL FUNCTION 'TR_NAMETAB_GET'
        EXPORTING
          iv_tabname                 = 'SFLIGHT'
          iv_get_lengths_in_charmode = ' '
          iv_get_texts               = 'X'
        IMPORTING
          et_dfies                   = lt_dfies
        EXCEPTIONS
          not_found                  = 1
          OTHERS                     = 2.
      IF sy-subrc <> 0.
    *--- Do nothing in this particular case
      ENDIF.
      LOOP AT lt_dfies INTO ls_dfies.
        wa_pers_tab-field_name = ls_dfies-fieldname.
        wa_pers_tab-text       = ls_dfies-reptext.
        wa_pers_tab-colpos     = sy-tabix.
        wa_pers_tab-invisible  = ' ' .
        APPEND wa_pers_tab TO pers_tab.
      ENDLOOP.
    ENDIF .
    SORT pers_tab BY colpos .
    CREATE OBJECT iterator TYPE ycl_tv_iterator
      EXPORTING
        col_def = pers_tab .
    and in the column definition method you can use this to build the columns
    LOOP AT m_col_def INTO wa_col_def  .
        APPEND INITIAL LINE TO p_column_definitions ASSIGNING <def>.
        <def>-columnname = wa_col_def-field_name.
        <def>-title      = wa_col_def-text .
      ENDLOOP .

  • Beginner's question about naming helper classes

    Hello,
    I am building a pretty basic multi-tier application. I want to reduce a much as possible the dependencies between the web tier and the ejb tier. Ideally I would like for the web tier to construct a request object (of class MyRequest) and send it to the ejb tier that would then return a results object (of class MyResults).
    These would therefore be the only two classes that BOTH the ejb and web tier would be aware of. All other classes would either belong to the web tier OR the ejb tier.
    My question relates to the naming of these two classes. I would like to have different package names for the two classes as follows:
    -web-tier request object will be of type com.mycompany.web.MyRequest
    -ejb-tier request object will be of type com.mycompany.ejb.MyRequest
    -web-tier results object will be of type com.mycompany.web.MyResults
    -ejb-tier results object will be of type com.mycompany.ejb.MyResults
    I am getting errors with that. Is there a way around it?
    Thanks in advance,
    Julien Martin.

    Hello PinkyDead and thanks for your answer,
    I got the errors on another project and can't remember which. Class Cast Exceptions perhaps. I had to change the package names so that they matched in the web tier and the ejb tier. (which is what I don't like).
    As far as the new project is concerned I am trying to design the application as well as possible and your comments are therefore useful. Better getting the design right before starting coding.
    Can you or anyone tell me what architecture would be better that the one I proposed?? Don't you agree that at least some classes have to be shared by the web tier and the ejb tier? How can it be otherwise?
    Thanks in advance,
    Julien.

  • E-Recruitment extractor classes, BSP's, Smartforms, Workflows, classes

    Hi,
    Can anybody please provide any of the following to the email address [email protected]?
    List of Extractor classes available,
    List of BSP's,
    List of Smartforms for different activities,
    List of Workflows,
    All important classes,
    Any cookbooks,
    Any configuration documents,
    Any technical setting documents,
    Any list of reports,
    Any TREX config documents
    Thanks in advance.
    Naresh

    Thanks Mike, I am still septical about going for ABAP Classes - I know it is the direction that SAP wants to go, but with so little information about how to do it properly, I am afraid of doing more harm than good.
    You suggested that I should use a BO as an attribute of a class. So, are you suggesting that a should create a class called ZCL_EMPLOYEET, assign the BO EMPLOYEET as an attribute type SIBFLPORB and add any extra bits and pieces that I need in class ZCL_EMPLOYEET?
    Have you worked with classes CL_HRPA_INFOTYPE_*. I am assuming they represent the several Infotypes delivered in HR. Any hints about how to 'test' these classes - I didn't quite grasped yet how to 'test' these classes - I would like to see what they do, but I am not getting it.
    Thanks for any help you can provide,
    Regards,
    Cristiana

Maybe you are looking for

  • Restrict Automatic creation of Notification from an Order

    Hi, In one of my client, During creation of order a notification is created automatically in the background. Now they dont want to create notification in the background. How to stop this ? Thanks

  • Nested query in BPEL JDeveloper

    Hi, Can anyone help me with nested query writing in BPEL (JDeveloper) the query is : SELECT LENGTH, WIDTH, HEIGHT, WEIGHT, LENGTH*WIDTH* HEIGHT AS ITEM_CUBE FROM ITEM_SUPP_COUNTRY_DIM WHERE ITEM= <Level1 item> AND DIM_OBJECT= (SELECT CASE_NAME FROM I

  • Size of macbook air case?

    I am designing a decal for a friend and i wanted to know if there was any good templates for photoshop to use to design the decal. i need a tmplate with the apple logo on it. if not can someone tell me the exact size of the back of the macbook air 13

  • Unable to connect to system thru gui...

    hi, please help me in this error which frequently  occuring connection to host xxx,service sapdp02  timed out, how to solve this and where do i look into to. thanks in advance.. shash.......

  • Credit Memo for Tax

    Hi, In an scenarion like 4% CSt was charged and billed to customer but if C from not being received then we need to rasie credit memo for differential tax i.e 12.5% so 4% already charged now how to rasie credit memo for balance 8.5% now ...via credit