2005 Dec 01 2:42 PM
Hi,
I need to display Material No , Material description & plant, ATP Value in the Search help(SD_MAT1) result screen. i am getting ATP value from BAPI_MATERIAL_AVAILABILITY funcation. I found out that i have to write custom function module & give that FM in Search help's Search help EXIT field. Now my question is How can i write that funcation Module. Please guys help me with Sample code for this FM?
Thanks,
Subashini
Hi,
I need to display Material No , Material description & plant, ATP Value in the Search help(SD_MAT1) result screen. i am getting ATP value from BAPI_MATERIAL_AVAILABILITY funcation. I found out that i have to write custom function module & give that FM in Search help's Search help EXIT field. Now my question is How can i write that funcation Module. Please guys help me with Sample code for this FM?
Thanks,
Subashini
2005 Dec 01 2:48 PM
Hi Subhashini,
pls look at the FM - F4IF_SHLP_EXIT. and the comments in that.
also look at other standard FMs havnig F4IFSHLPEXIT*(in its name) for coding..
Thanks & Regards,
Renjith
2005 Dec 01 2:50 PM
2005 Dec 01 2:56 PM
Check this FM F4IF_SHLP_PARTNER...for instance...
There are lots of standard sap search help exit FMs in the system, ie. why i suggested looking at different FMs for handling different kin of search help events...
2005 Dec 01 2:52 PM
I think there is no need for a Function Module. U can directly create a search help. While creating the search help, it will ask for the fields to be displayed. Here, U can specify the fields which are required and activate the search help. Use this search help in ur coding part.
If useful, pl. reward points.
2005 Dec 01 3:16 PM
Hi,
How can i do that. B'cos ATP not in Base table. If i create Search help in selection Method only i can give fields from base table. How can i import ATP value in SEarch help????? Could you plase explain with Sample code?
2005 Dec 01 3:34 PM
Hi I think Select all matnr,plant,meins data and send to the fm and then get atp
store them to a internal table then pass the table to search help in search help exit.
just create the fm with the same parameters,tables
if you see the sample search help exit you can get better idea.
regards
vijay
2005 Dec 01 3:38 PM
FUNCTION z_test_shlp_exit.
*"----------------------------------------------------------------------
*"*"Local interface:
*" TABLES
*" SHLP_TAB TYPE SHLP_DESCR_TAB_T
*" RECORD_TAB STRUCTURE SEAHLPRES
*" CHANGING
*" REFERENCE(SHLP) TYPE SHLP_DESCR_T
*" REFERENCE(CALLCONTROL) LIKE DDSHF4CTRL STRUCTURE DDSHF4CTRL
*" EXCEPTIONS
*" INTERNAL_ERROR
*"----------------------------------------------------------------------
DATA: l_aac LIKE seahlpres.
DATA: valid_aacs TYPE TABLE OF zaac_temp WITH HEADER LINE.
CHECK callcontrol-step = 'SELECT'.
IMPORT valid_aacs FROM MEMORY
ID 'VALID_AACS_SALES_ORDER_FROM_PF4'.
* l_aac(3) = sy-mandt.
* LOOP AT valid_aacs INTO l_aac+3.
* INSERT l_aac INTO TABLE record_tab.
* ENDLOOP.
LOOP AT valid_aacs INTO l_aac.
INSERT l_aac INTO TABLE record_tab.
ENDLOOP.
IF NOT record_tab[] IS INITIAL.
callcontrol-step = 'DISP'.
ENDIF.
ENDFUNCTION.this is the sample search help which i have used...
regards
vijay
2005 Dec 01 3:44 PM
hi,
FUNCTION YMAT.
*"----
""Local Interface:
*" TABLES
*" SHLB_TAB TYPE SHLP_DESCT
*" RECORD_TAB STRUCTURE SEAHLPRES
*" CHANGING
*" REFERENCE(SHLP) TYPE SHLP_DESCR
*" REFERENCE(CALLCONTROL) LIKE DDSHF4CTRL STRUCTURE DDSHF4CTRL
*"----
data : begin of itab occurs 1,
Plant(8) type c,
Materialdesc(20) type c,
Part(20) type c,
ATP(20) type c,
end of itab.
itab-plant = 'ALB1'.
itab-materialdesc = 'wire'.
itab-part = '100000223'.
itab-atp = '994'.
append itab.
IF callcontrol-step <> 'PRESEL'.
EXIT.
ENDIF.
CALL FUNCTION 'F4UT_OPTIMIZE_COLWIDTH'
TABLES
shlp_tab = shlp_tab
record_tab = record_tab
CHANGING
shlp = shlp
callcontrol = callcontrol.
if not tbl_zwcqualv[] is initial.
CALL FUNCTION 'F4UT_RESULTS_MAP'
EXPORTING
SOURCE_STRUCTURE =
APPLY_RESTRICTIONS = ' '
TABLES
shlp_tab = shlp_tab
record_tab = record_tab
source_tab = itab
CHANGING
shlp = shlp
callcontrol = callcontrol
EXCEPTIONS
illegal_structure = 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.
endif.
IF rc = 0.
callcontrol-step = 'DISP'.
ELSE.
callcontrol-step = 'EXIT'.
ENDIF.
ENDIF.
ENDFUNCTION.
I am trying this one. But giving me SHLB_TAB in un-known, But i declared SHLB_TAB in tables of FM.
Thanks,
Subashini
2005 Dec 01 4:00 PM
Hi Subashine,
I would not recommend to work as suggested by Vijay, as this is very unstable.
Your approach is reasonable, but I think what might help you most, is having a look at search help SFLIGHT and its search help exit. There it is demonstrated how the following problem is solved:
In the hit list I want to display a column which is not in the database but has to be derived from the values in the other columns.
In the SFLIGHT example this extra column can be derived by a simple computation (difference of two other columns). In your example it seems to be more complicated (call of a FM), but the principle should be the same.
Therefore I believe that you can adapt the technique demonstrated in the SFLIGHT search help for your problem.
Greetings
Stephan
2005 Dec 01 2:55 PM
Hi
You can refer to F4UT* SH Exits for sample .
Regards
Kalpana
2005 Dec 01 2:59 PM
Hi
Subashini
You can try with what ramesh Suggested, that is the simple way to do, and then you can assign this match code id in your program..
regards
vijay
2005 Dec 01 3:15 PM
She has to populate the ATP quantity in one of the fields of search help, so she would need a SH exit to code the ATP FM call.
- Kalpana
| User | Count |
|---|---|
| 3 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |