Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Search help

Former Member
0 Kudos

Hi Experts,

How can we add a user defined search help in a standard SAP transaction? I have added a search help Exit wherein I added a function module. From this function module, I have called a program which has select options screen and in return it has to capture the selected material from the list to SAP search help screen. My select option screen is getting properly called but the value is not copied to the search help screen. How to achieve this?

Regards,

Sibin

1 ACCEPTED SOLUTION

raymond_giuseppi
Active Contributor
0 Kudos

What is exactly your question :

  • How to change a standard search help : better append search help to collective search help (or give us more information)
  • How to call a selection report ih a search help exit : export selected record(s) in the called report, import those in the exit FM, and append the selected records values to the parameter record_tab and set  callcontrol-step to 'RETURN'

Regards,

Raymond

15 REPLIES 15

FredericGirod
Active Contributor
0 Kudos

Hi Sibin,

for Material search-help, it's a multi-search-help, you could add your own single search help to this. It's not a standard modificaiton

regards

Fred

Former Member
0 Kudos

romit_raina
Active Participant
0 Kudos

Hello Sibin,

After  displaying search Help values, when CALLCONTROL-STEP ='RETURN', we need to call Function Module - "DYNP_UPDATE_FIELDS'.

I hope this will help you.

Thanks

Romit Raina

0 Kudos

Hi Romit,

I have called a program with ALV display of materials. If we double click a material it will call the function module provided in the search help. The problem here is that the value is not getting returned back to the function module.

I have done following steps:

in se11, search help MAT1_A included a search help.

Under included search help created a search help and defined a function module in search help exit.

In this function module I have called a program which displays select options list and based on this selection, an ALV list will be displayed in the report. If we double click this report the same function module will be called which was mentioned in the search help user exit. I have added a search help parameter in the above elementary search help for capturing material number.

The problem is that there is no link coming between the called zprogram and function module which calls it.

Regards,

Sibin

0 Kudos

Hello Sibin,

Did you try calling FM which i have mentioned ? I think it should work, mentioned FM will update the fields .

You can use it as shown below :-

IF  callcontrol-step = 'RETURN'.

     DATA : i_dynp TYPE STANDARD TABLE OF dynpread.

     DATA : w_dynp  TYPE dynpread.

     w_dynp-fieldname = 'S_MATNR-LOW'.

     w_dynp-fieldvalue = gv_posnr.

     APPEND w_dynp TO i_dynp.

     CLEAR : w_dynp.

     CALL FUNCTION 'DYNP_UPDATE_FIELDS'

       EXPORTING

         dyname               = 'SAPMZKLIM_HUREPORT'

         dynumb               = '0300'

         request              = 'A'

       TABLES

         dynpfields           = i_dynp

       EXCEPTIONS

         invalid_abapworkarea = 1

         invalid_dynprofield  = 2

         invalid_dynproname   = 3

         invalid_dynpronummer = 4

         invalid_request      = 5

         no_fielddescription  = 6

         undefind_error       = 7

         OTHERS               = 8.

     IF sy-subrc <> 0.

* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

*         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

     ENDIF.

     EXIT.

   ENDIF.

Please try this.

Thanks

Romit Raina

0 Kudos

Hi Romit,

Can you tell me how to define gv_posnr in the above code?

Regards,

Sibin

0 Kudos

Hi Sibin,

You can define as:

GV_POSNR TYPE DYNFIELDVALUE.

Thanks

Romit Raina

raymond_giuseppi
Active Contributor
0 Kudos

What is exactly your question :

  • How to change a standard search help : better append search help to collective search help (or give us more information)
  • How to call a selection report ih a search help exit : export selected record(s) in the called report, import those in the exit FM, and append the selected records values to the parameter record_tab and set  callcontrol-step to 'RETURN'

Regards,

Raymond

0 Kudos

Hi Raymond,

I have appended a search help to collective search help MAT1_A. Then under included search help I had added another appended search help. Here I included a search help with selection method and search help exit. I have passed some parameters which will be displayed in the search help screen and a function module which calls a program where user can select certain materials from the list. After selecting the material list user presses double click in the ALV report which inturn call back the function module to display the list in standard SAP screen.

In function module i have declared the variables as given below:

Changing:

SHLPTYPESHLP_DESCR
CALLCONTROLLIKEDDSHF4CTRL

Tables:

SHLP_TABTYPESHLP_DESCT
RECORD_TABLIKESEAHLPRES

In Import

MATNRTYPEMATNR                    

I have called the program using

SUBMIT <<Program Name>> AND RETURN

In return program I have used LEAVE to get back to the function

Regards,

Sibin

0 Kudos

Hi Experts,

Structure of my function module is as follws:

*"*"Local Interface:

*"  IMPORTING

*"     REFERENCE(MATNR) TYPE  MARA-MATNR

*"  TABLES

*"      SHLP_TAB TYPE  SHLP_DESCT

*"      RECORD_TAB STRUCTURE  SEAHLPRES

*"  CHANGING

*"     VALUE(SHLP) TYPE  SHLP_DESCR

*"     VALUE(CALLCONTROL) LIKE  DDSHF4CTRL STRUCTURE  DDSHF4CTRL

I am calling a report inside this FM using

SUBMIT 'ZREPORT' EXPORTING LIST TO MEMORY AND RETURN.

and in program 'ZREPRT', after executing the report I have called the FM using LEAVE.

But MATNR value is not getting returned to FM.

How to call a report program from a Function module without a parameter and return values from the called report into the Function Module.

Regards,

Sibin

0 Kudos

Hi Experts,

Please provide a solution.

Regards,

Sibin

0 Kudos

See this example.

1. use this from your fm  to call ur report .

SUBMIT zreport EXPORTING LIST TO MEMORY and return.


2. retrieve in report using.
CALL FUNCTION 'LIST_FROM_MEMORY'
  TABLES
    listobject = itab_list
  EXCEPTIONS
    not_found  = 4
    OTHERS     = 8.


3.pass your data to ABAP memory.

using export to memory id.

4. retrieve in fm using import from memory id.

Hope this helps.

0 Kudos

After your submit report you have to change some parameters of the exit FM : value(s) selected, next step of search help.

(Sample attached to message)

Regards,

Raymond

0 Kudos

Hi Raymond,

As per your attachment, import from memory is not fetching any value.

import p1 to e_exit p2 to et_lifnr from memory id 'ZPROG'.

I am not passing any value from my FM to the report. I am just calling a report which in fact returns a value to the FM.

Using FM, I am calling a report which has 3 parameters after selecting these parameters and executing the report, the program returns some values which should be returned back to this calling FM.

In the called program I have used LEAVE command for returning the values.

Regards,

Sibin

0 Kudos

Hi Experts,

Thanks a lot for your valuable suggestions.

I used below coding to resolve the issue:

export itab to MEMORY ID 'ZP' in Report program

IMPORT itab  FROM MEMORY ID 'ZP' in FM

Regards,

Sibin