09-09-2013 7:18 AM
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
09-09-2013 9:53 AM
What is exactly your question :
Regards,
Raymond
09-09-2013 8:06 AM
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
09-09-2013 8:09 AM
many threads available for your query,
09-09-2013 8:11 AM
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
09-09-2013 8:54 AM
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
09-09-2013 2:21 PM
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
09-09-2013 3:35 PM
Hi Romit,
Can you tell me how to define gv_posnr in the above code?
Regards,
Sibin
09-10-2013 5:41 AM
Hi Sibin,
You can define as:
GV_POSNR TYPE DYNFIELDVALUE.
Thanks
Romit Raina
09-09-2013 9:53 AM
What is exactly your question :
Regards,
Raymond
09-09-2013 1:02 PM
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:
SHLP | TYPE | SHLP_DESCR |
CALLCONTROL | LIKE | DDSHF4CTRL |
Tables:
SHLP_TAB | TYPE | SHLP_DESCT |
RECORD_TAB | LIKE | SEAHLPRES |
In Import
MATNR | TYPE | MATNR |
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
09-26-2013 9:38 AM
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
09-27-2013 12:22 PM
09-27-2013 12:49 PM
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.
09-27-2013 1:04 PM
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
09-28-2013 6:45 AM
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
09-28-2013 12:59 PM
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