cancel
Showing results for 
Search instead for 
Did you mean: 

Matchcodes in HTMLB

Former Member
0 Kudos

Hi,

i'm developing an application in BSP and i've to simulate a Module Pool made with many matchcodes, is there any tag in htmlb or other standard which help me to do that in an automatically or semi-automatically way?

Regards.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

F4 functionality has already been discussed here. Iwan seems to have made a breakthrough here.

<b>Brian McKellar's path for proceeding to have an F4</b>

<b>Iwan Santoso's implementation of F4</b>

Subramanian V.

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

If you want something more generic, I have an example as well:

/people/thomas.jung3/blog/2004/09/17/bsp-150-a-developer146s-journal-part-xii-150-value-input-help-popups

Probably after TechEd I will post the updated version that includes dynamic calls to the Value Help BAPI. This greatly expands the functionality.

Former Member
0 Kudos

Thomas' example is very well documented. Very sorry to miss that out.

Just going through that blog and made me realise, if F4 help is going to be that difficult to implement... Should be a little simpler. It seems to me as a project on its own in an application.

Regards,

Subramanian V.

P.S. Completely agree with Thomas on that weblog, F4 help is taken for granted

Former Member
0 Kudos

Thomas,

After all, thank you for your response.

I'm trying to implement this solution for the f4 functionality but i have found some problems to do that.

My questions are:

In the model ZCL_BSP_M_INPUT_HELP:

-The table SHSVALTAB2 doesn't exist in my system, although SHSVALTAB exists

-In the method BUILD_ACCEPT_SELECTION_SCRIPT i don't have the code for the get_table_structure method. could you send it to me?

-In the method GET_HELPVALUES_SIMPLE the method get_simple_helpvalues2 doesn't exist. although get_simple_helpvalues exists.

I've another problems but i'm trying to solve it by myself. Could you help me to solve the above?

Thank you.

Regards.

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

No Problem. The first and third problem are related, I'm sure. From looking at the dates in version management on the Interface, IF_BSP_SERVICES, it looks like SAP added GET_SIMPLE_HELPVALUES2 in one of the Support Packages (Not sure exactly which one). I would imagine at the same time that also created the type, SHSVALTAB2, for its exporting parameter. If you don't have this method or table type just use the original method, GET_SIMPLE_HELPVALUES from IF_BSP_SERVICES. This new module just returns the upper bounds for ranges. I'm not actually using this additional functionality, so using the older method shouldn't make any difference.

GET_TABLE_STRUCTURE: Shoot I did miss that one. I actually just borrowed this code from within SAP's tableView BSP extension. I found it so useful that I put it into a reusable little class. I detailed it in another WebLog:

/people/thomas.jung3/blog/2004/09/02/creating-a-bsp-extension-for-downloading-a-table

However I will include the code here (and include it in the original WebLog in just a little bit):

Interface:

@78\QImporting@ ITAB TYPE REF TO DATA

@7B\QReturning@ VALUE( STRUCT ) TYPE EXTDFIEST DD Internal: Information on Table Fields


method get_table_structure .
  data: descrref   type ref to cl_abap_typedescr,
         no_header  type c,
         structref  type ref to cl_abap_structdescr,
         tableref   type ref to cl_abap_tabledescr,
         l_helpid   type string,
         l_typename type dfies-tabname,
         l_compname type dfies-fieldname,
         exttab     type extdfiest,
         extwa      type extdfies.

  field-symbols: <t>           type any,
                 <f>           type any,
                 <tab>         type index table,
                 <component>   type abap_compdescr.

  data: ddiccomptab type ddfields,
             isddic type abap_bool,
        extdfies_wa like line of struct,
         b_no_table type c.          " flags table is not available

  field-symbols <ddiccomp> type dfies.

****Get a pointer to the data table
  assign itab->* to <tab>.
***Read the first record initializing a work area and making sure it has some data
  read table <tab> index 1 assigning <t>.
  if sy-subrc ne 0.
    b_no_table = 'X'.
  else.
    b_no_table = ' '.
  endif.


****Get Type Description by Data Reference
  tableref ?= cl_abap_typedescr=>describe_by_data_ref( itab ).

  try.
****Is the type definition a pointer to a structure?
      structref ?= tableref->get_table_line_type( ).
****Is the structure a Data Diction Type?
      isddic = structref->is_ddic_type( ).
      if isddic eq abap_true.
****Kernel and Dynamic data defintions can't come from the Data Dictionary
        if structref->absolute_name+6(2) eq '%_'.
          isddic = abap_false.
        endif.
      endif.
      if isddic eq abap_true.
****Definition is in the data Dictionary- We can read details from the returned
****DDic Structure
        ddiccomptab = structref->get_ddic_field_list( ).
        loop at ddiccomptab assigning <ddiccomp>.
          extdfies_wa-fieldname = <ddiccomp>-fieldname.
          extdfies_wa-coltitle  = <ddiccomp>-reptext.
          extdfies_wa-inttype   = <ddiccomp>-inttype.
          extdfies_wa-convexit  = <ddiccomp>-convexit.
          append extdfies_wa to struct.
        endloop.
      else.
        if b_no_table is initial.
****Not in DDic - Get a Type description of the Workarea so we can analyse each field
          descrref = cl_abap_typedescr=>describe_by_data( <t> ).
          try.
****Get the structure of our type description for the workarea
              structref ?= descrref.
****Loop through the list of components(fields) in our work area
              loop at structref->components assigning <component>.
                extdfies_wa-fieldname = <component>-name.
                extdfies_wa-coltitle  = <component>-name.
****Get a pointer to the individual component(field) that we are currently processing
                assign component sy-tabix of structure <t> to <f>.
****Ask for the help ID (F1 help) belonging to field  - this will give the Data dictionary
****LIKE reference that this field was created from - See DESCRIBE FIELD - HELP-ID in on-line
****Help for a useful example
                describe field <f> help-id l_helpid.
                if l_helpid is not initial.
****Split the help-id into structure - element
                  split l_helpid at '-'
                          into l_typename l_compname.
                  extdfies_wa-tabname = l_typename.
*****Get details about the structure or table part of the helpid
                  call function 'DD_INT_TABLINFO_GET'
                    exporting
                      typename       = l_typename
                    tables
                      extdfies_tab   = exttab
                    exceptions
                      not_found      = 1
                      internal_error = 2
                      others         = 3.
                  if sy-subrc eq 0.
****Read the details about the element portion of the help-id from the information
****we just received using the field name from the original component
                    read table exttab into extwa with key fieldname = extdfies_wa-fieldname.
                    if sy-subrc eq 0.
                      extdfies_wa-coltitle = extwa-coltitle.
                      extdfies_wa-convexit = extwa-convexit.
                    else.
****No entry for the original component name, try the one from the help-id
                      read table exttab into extwa with key fieldname = l_compname.
                      if sy-subrc eq 0.
                        extdfies_wa-coltitle = extwa-coltitle.
                        extdfies_wa-convexit = extwa-convexit.
                      else.
****No Luck so far -> Lets ask the ABAP Descriptor class to try and describe the elment
****using a reference to the component we are processing
                        data: elemref type ref to cl_abap_elemdescr,
                              ddicobj type dd_x031l_table.
                        field-symbols <ddic> type x031l.
****Descriptor for tte Element
                        descrref = cl_abap_typedescr=>describe_by_data( <f> ).
                        try.
****Can we cast this to an DDic element descriptor?
                            elemref ?= descrref.
****Read the DDic defintion for this element
                            ddicobj = elemref->get_ddic_object( ).
****Get the Conversion Exit recorded in the DDic for this element
                            read table ddicobj index 1 assigning <ddic>.
                            if sy-subrc eq 0.
                              extdfies_wa-convexit = <ddic>-convexit.
                            endif.
****Catch all Global Execptions - like bad casts
                          catch cx_root.                 "#EC CATCH_ALL
                                                        "#EC NO_HANDLER
                        endtry.
                      endif.
                    endif.
                  endif.
                endif.
****Use Describe Field on the Element to get its basic data type
                describe field <f> type extdfies_wa-inttype.

                append extdfies_wa to struct.
              endloop.
****Catch all Global Execptions - like bad casts
            catch cx_root.                               "#EC CATCH_ALL
              no_header = 'X'.
          endtry.
        else.
          no_header = 'X'.
        endif.
      endif.

****Catch all Global Execptions - like bad casts
    catch cx_root.                                       "#EC CATCH_ALL
      no_header = 'X'.
  endtry.

endmethod.

I am glad to see so many people are interested in this example. I have an updated version with a few minor fixes as well as lots of new functionality that I will post very soon (most likely after I return from TechEd San Diego).

former_member181879
Active Contributor
0 Kudos

GET_SIMPLE_HELPVALUES2 added 620SP32.

Former Member
0 Kudos

Hi again,

I think i'm near of getting it. I've a few compilation errors. Here are my questions:

In the controller: What are the values of these constants?

Method: COMPILE_TIME_IS_VALID

c_inputfield_designs

c_cellhaligns

c_invalid_types

Method: RUNTIME_IS_VALID

mc_content

c_cellhaligns

c_invalid_type_auto

In the view i suppose that i need an Model attribute: MODEL TYPE ZCL_BSP_M_INPUT_HELP

What is the complete path of dragiframe.js in the server?

are there any way to debug the element alone?

Regards.

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

I'm sorry but I will have limited ability to help with problems this week because I am at TechEd in San Diego. I will give it a shot from memory. There are few Class constants that I forgot to mention that I had copied over from the HTMLB InputField. The following thread documents these:

Some of the other constants I see here should already be in your class. They should have been inherited.

Yes you do need the model attribute.

I just have the dragiframe.js uploaded in the mime repository under the same BSP application as my popup page (zes_keg_shared).

I will go back through these threads and make sure all these questions are answered in the next version of this example. I have already submitted the content for upload to SDN.

Former Member
0 Kudos

Thank you for your response.

I've implemented your solution and it works fantastic.

I'll wait for your new version of the matchcode element.

Best Regards.

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

Glad to hear that you got it working. Hopefully you will enjoy some of the new features in the new version!

Former Member
0 Kudos

Thomas,

I've a little problem with the matchcode tag, i've implemented a matchcode function which recover a lot of records (20300 more or less), and when i try to move the pop-up, sometimes, an internet explorer error occurs.

("The memory could not be read)

do you know why it happens?

Best regards.

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

I have seen this error as well. It seems to be related to the overflow containers that I used. There are two solutions that I have seen. One - Since I upgrade my PC to WindowsXP SP2 I have not been able to recreate this problem. That makes it really seem like a bug in IE. The other thing that seems to have fixed the problem is simplifying the rendering of the overflow containers. In my newer version I have made several changes around this rendering and my users have not been experiencing this error any more. I uploaded the newer version to SDN several weeks ago, but I never heard back from anyone. Now that I am back from vacation I will follow up. If I don't hear anything soon, I will go ahead and post the code in a weblog like I did before.

The only other question I might have is are you trying to display all the values at once? If you limit the number of values that the table displays and make you user scroll through them, that should send less data to the frontend. That's the only reason that I could think that the number of records would effect anything.

Answers (0)