cancel
Showing results for 
Search instead for 
Did you mean: 

bapi_helpvalues_get

Former Member
0 Kudos

When implementing Thomas Jung's blog for F4 search help, has anyone ran into trouble with an equipment/functional location search help?

I've tried about every object, with no luck. Any advice? Thanks in advance.

Accepted Solutions (1)

Accepted Solutions (1)

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

What kind of problem are you having? Have you not been able to find a BOR defintion that has the search help you need? I run into this from time to time (or when I need to call a custom search help). That is why in my R/3 system I created a custom BOR object just to hold these search helps. I can then any key field I want to this BOR object (and set its Search Help).

Depending upon the BOR object being access, there might also be a function module call to determine authority to use this search help via the BAPI. The mapping of these calls is done in configuration table BAPIF4T. For the new elements that I added to my custom BOR object I had to add an entry to this table and call a custom Auth Check Function module. Here is an example of the structure that these Auth Check Function modules must have:

function z_e_sd_helpvalues_auth.
*"----------------------------------------------------------------------
*"*"Local interface:
*"  IMPORTING
*"     VALUE(OBJTYPE) LIKE  BAPIF4F-OBJTYPE
*"     VALUE(METHOD) LIKE  BAPIF4F-METHOD
*"     VALUE(DTEL) LIKE  BAPIF4F-DTEL
*"     VALUE(SHLPNAME) LIKE  BAPIF4F-SHLPNAME
*"     VALUE(TABNAME) LIKE  BAPIF4F-TABNAME
*"  EXPORTING
*"     VALUE(RETURN) LIKE  BAPIF4F-RETURN
*"----------------------------------------------------------------------


clear return.


endfunction.

Former Member
0 Kudos

I had the authorization issue already, but my problem is not being able to find a BOR definition. I'll create an object, and I'm assuming in the method, have import parameters with a field type that has a search help.

Thanks again! I haven't created a BOR object before... it will be interesting.

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

Actually you don't even have to create a method for the BOR object. In my custom BOR object, I never did. I just created Key Fields (since these can be used as well in the HELP Bapi). Inside the BOR when you define a Key Field, you must give a Data Dictionary reference (including a search help if you wish).

Goto transaction SWO1 and look at one of the SAP delivered BOR objects (Perhaps BUS1001 - Material). Then look at its key field - Material or perhaps one of its attributes. This way you can avoid also having to create a dummy function module for the method itself.

Former Member
0 Kudos

OK cool. In your bapi_helpvalues_get, isn't method a required parameter?

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

Nope Method is optional. I have some calls where I determine the search help from objtype, objname, and param only. The BAPI works in such a way that if you don't sepecify a method, it looks for a key field that matches your param value instead.

      <zkeg:inputHelp id        = "chg_id"
                      value     = "//model/CHG_ID"
                      multiple  = "false"
                      size      = "10"
                      disabled  = "<%= model->MY_RETRIEVE_REQ_FLAG %>"
                      rfcDest   = "<%= application->rfcdest %>"
                      objtype   = "ZBSP_HELP"
                      objname   = "BSPHelp"
                      keyField  = "ID"
                      alignment = "CHAR"
                      param     = "EngChangeID" />

Former Member
0 Kudos

Is it possible that the bapi might not work when in test mode? I'm not getting any results for my new business object... I'll try it from the BSP.

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

Test mode as always work fine for me. In fact I usually use the Function Tester on the BAPI when I am trying out a new object.

Former Member
0 Kudos

I'm getting the values in the debugger from the BSP when the explicit search help field is filled, but I get an "RFC error: Invalid partial field access: Offset + length too large."

Have you ever come across this? I get the error in:

CALL FUNCTION 'BALW_SHLP_BAPI_FILL'

EXPORTING

LV_TABNAME = LV_TABNAME

LV_HELPFIELDNAME = LV_FIELDNAME

SHLP_METHOD = SHLP_METHOD

TABLES

NEW_HV = LT_NEW_HV

LT_DESCRIP = LT_FIELDDESCR

HELPVALUES = HELPVALUES

VALUES_FOR_FIELD = VALUES_FOR_FIELD

DESCRIPTION_FOR_HELPVALUES = DESCRIPTION_FOR_HELPVALUES.

While it loops through this, it just quits, and ends up back to the BSP with the error message above.

  • modify helpvalues ***************************************************

  • get internal name of helpfield

CLEAR LV_HELPVIEW_FLDNAME.

LOOP AT SHLP_METHOD-INTERFACE INTO INTERFACE

WHERE VALTABNAME = LV_TABNAME AND VALFIELD = LV_HELPFIELDNAME.

LV_HELPVIEW_FLDNAME = INTERFACE-SHLPFIELD.

ENDLOOP.

LOOP AT NEW_HV.

CLEAR SHLP_OFFSET.

LOOP AT LT_DESCRIP.

HELPVALUES+SHLP_OFFSET(LT_DESCRIP-LENG) =

NEW_HV+LT_DESCRIP-OFFSET(LT_DESCRIP-LENG).

SHLP_OFFSET = SHLP_OFFSET + LT_DESCRIP-LENG + LC_INSPACE.

IF LT_DESCRIP-FIELDNAME = LV_HELPVIEW_FLDNAME.

VALUES_FOR_FIELD = NEW_HV+LT_DESCRIP-OFFSET(LT_DESCRIP-LENG).

APPEND VALUES_FOR_FIELD.

ENDIF.

ENDLOOP. "lt_descrip

APPEND HELPVALUES.

ENDLOOP. "new_hv

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

I can't say that I have ever gotten that error. What I can do (tomorrow when I get back into work) is set a breakpoint there and then debug through with one of my custom BOR search objects. I will see what I have in this area (assuming I hit it at all).

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

I did some debugging this morning and I do hit this same section, however it pass through it without error. As you loop through NEW_HV it is processing the return values from the Help. Your backend system isn't Unicode by any chance? Although I can't recreate this exact problem in my Unicode system, I have had other problems with the Help BAPIs and their offsets. Some of the APIs return the offset in byte length and others in character length. Of course this would internal to SAP's processing and would have to be fixed by them.

Former Member
0 Kudos

So far, I only get the error for the field equi-equnr. I'm pretty sure our system is in Unicode.

Sounds like I might be out of luck. Well, thanks anyway- you've been a great help.

Answers (0)