‎2006 Feb 07 8:38 PM
Hi,
I wrote Custom FM to get value for Dynamic popup to display Materialnumber , Old material number ,Manufac. Part number etc.
I am displaying the value using
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
RETFIELD = 'MATNR'
VALUE_ORG = 'S'
TABLES
VALUE_TAB = L_PARTS
RETURN_TAB = T_RETVAL
EXCEPTIONS
PARAMETER_ERROR = 1
NO_VALUES_FOUND = 2
OTHERS = 3.
My Qustion is I need this popup should display in VA01, If i enter material number or old material number on item level. which UserEXIT i should use for this ? Whether USEREXIT_MOVE_FIELD_VBAP or CHECK_VBAP ?
Guide me please.
Urgent----
‎2006 Feb 07 8:42 PM
I don't know if there is such an exit to handle this. I believe that you would have to hack the standard SAP screen to put a module in the <b>PROCESS ON VALUE-REQUEST</b> event in the flow logic. You would also have to put these module somewhere, you might be able to put it in the "Z" PBO include(s).
Regards,
Rich Heilman
‎2006 Feb 07 8:42 PM
I don't know if there is such an exit to handle this. I believe that you would have to hack the standard SAP screen to put a module in the <b>PROCESS ON VALUE-REQUEST</b> event in the flow logic. You would also have to put these module somewhere, you might be able to put it in the "Z" PBO include(s).
Regards,
Rich Heilman
‎2006 Feb 07 8:47 PM
‎2006 Feb 07 8:49 PM
From what I can see in my system(46c) The item tab of VA01 is screen 4900 SAPMV45A. Way at the bottom, in the PROCESS ON VALUE-REQUEST event of the flow logic, you will see all of the modules for value help. There currently already is a module tied to VBAP-MATNR.
* SD specific F4 for material number
FIELD vbap-matnr MODULE vbap_matnr_values.This module calls a perform.
*----------------------------------------------------------------------*
* INCLUDE MV45AI0V_VBAP_MATNR_VALUES *
*----------------------------------------------------------------------*
MODULE VBAP_MATNR_VALUES INPUT.
PERFORM VBAP_MATNR_VALUES USING 'VBAP-MATNR'.
ENDMODULE. " VBAP_MATNR_VALUES INPUT
Here is the code of the form.
*----------------------------------------------------------------------*
* INCLUDE MV45AF0V_VBAP_MATNR_VALUES *
*----------------------------------------------------------------------*
*&---------------------------------------------------------------------*
*& Form VBAP_MATNR_VALUES
*&---------------------------------------------------------------------*
* F4 für Materialnummer
*----------------------------------------------------------------------*
FORM VBAP_MATNR_VALUES USING FIELDNAME_VBAP_MATNR.
DATA: BEGIN OF DYNPFIELDS OCCURS 1.
INCLUDE STRUCTURE DYNPREAD.
DATA: END OF DYNPFIELDS.
DATA: DYNPRO_PROGRAM LIKE SY-REPID. "Programmpool und Nummer in dem
DATA: DYNPRO_NUMBER LIKE SY-DYNNR. "das aktuelle Dynpro liegt.
DYNPRO_PROGRAM = SY-REPID. "believe it or not -
DYNPRO_NUMBER = SY-DYNNR. "these assignments are necessary!
* zu lesende Feld vormerken.
MOVE FIELDNAME_VBAP_MATNR TO DYNPFIELDS-FIELDNAME.
APPEND DYNPFIELDS.
* Feldinhalte vor dem automatischen Feldtransport beim PAI
* explizit auslesen
CALL FUNCTION 'DYNP_VALUES_READ'
EXPORTING
DYNAME = DYNPRO_PROGRAM
DYNUMB = DYNPRO_NUMBER
* TRANSLATE_TO_UPPER = ' '
* REQUEST = ' '
PERFORM_INPUT_CONVERSION = 'X'
TABLES
DYNPFIELDS = DYNPFIELDS
EXCEPTIONS
INVALID_ABAPWORKAREA = 1
INVALID_DYNPROFIELD = 2
INVALID_DYNPRONAME = 3
INVALID_DYNPRONUMMER = 4
INVALID_REQUEST = 5
NO_FIELDDESCRIPTION = 6
INVALID_PARAMETER = 7
UNDEFIND_ERROR = 8
ERROR_MESSAGE = 9
OTHERS = 10.
READ TABLE DYNPFIELDS WITH KEY FIELDNAME = FIELDNAME_VBAP_MATNR.
IF SY-SUBRC EQ 0 AND DYNPFIELDS-FIELDINP = 'X'.
* Parameter für F4IF_FIELD_VALUE_REQUEST
DATA: MC_OBJ LIKE HELP_INFO-MCOBJ.
* Matchcodeobjekt aufrufen
MC_OBJ = 'SD_MAT1'.
CALL FUNCTION 'F4IF_FIELD_VALUE_REQUEST'
EXPORTING
TABNAME = SPACE
FIELDNAME = SPACE
SEARCHHELP = MC_OBJ
* SHLPPARAM = ' '
DYNPPROG = DYNPRO_PROGRAM
DYNPNR = DYNPRO_NUMBER
DYNPROFIELD = DYNPFIELDS-FIELDNAME
STEPL = DYNPFIELDS-STEPL
* VALUE = ' '
* MULTIPLE_CHOICE = ' '
* DISPLAY = ' '
* CALLBACK_PROGRAM = ' '
* CALLBACK_FORM = ' '
EXCEPTIONS
FIELD_NOT_FOUND = 1
NO_HELP_FOR_FIELD = 2
INCONSISTENT_HELP = 3
NO_VALUES_FOUND = 4
OTHERS = 5.
ENDIF.
ENDFORM. " VBAP_MATNR_VALUES
Now, if you are going to hack anything, this FORM would be it. I believe that if you change this form, you will get the results that you want when doing F4 on the Material Number field in item overview tab. You will need to register this INCLUDE program with SAP to get a registration key.
Please remember to award points for helpful answers. Thanks.
Regards,
RIch Heilman
‎2006 Feb 07 9:04 PM
I need to get popup by putting value for materialnumber in itemlevel & press enter not by F4 key...??????
‎2006 Feb 07 9:07 PM
‎2006 Feb 07 11:35 PM
I put code in CHECK_VBAP DATA L_LINES TYPE I.
*
*DATA: T_RETVAL LIKE DDSHRETVAL OCCURS 0 WITH HEADER LINE.
*
*DATA: BEGIN OF L_PARTS OCCURS 0,
MATNR LIKE MARA-MATNR,
MAKTX LIKE MAKT-MAKTX,
MFRPN LIKE MARA-MFRPN,
NAME1 LIKE LFA1-NAME1,
STOCK(10) TYPE C,
END OF L_PARTS.
*
*
*DATA: BEGIN OF L_MATNRS OCCURS 0.
INCLUDE STRUCTURE ZWCSM_MARATAB.
DATA: END OF L_MATNRS.
*
*
*
*
*CALL FUNCTION 'ZWCSM_DYNAMIC_PART_LOOKUP'
EXPORTING
I_MATERIAL = VBAP-MATNR
I_PLANT = 'ALB1'
I_SALES_ORG = 'S001'
I_DIST_CHANNEL = '01'
I_KUNNR = ' '
TABLES
MATNRS_OUT = L_MATNRS
EXCEPTIONS
NOTHING_FOUND = 1
NO_KEYS = 2
INVALID_PLANT = 3
OTHERS = 4.
*LOOP AT L_MATNRS.
L_PARTS-MATNR = L_MATNRS-MATNR.
L_PARTS-MAKTX = L_MATNRS-MAKTX.
L_PARTS-MFRPN = L_MATNRS-MFRPN.
L_PARTS-NAME1 = L_MATNRS-NAME1.
*
IF L_MATNRS-MTART = G_NS_2
OR L_MATNRS-DISPR = G_NS_1.
L_PARTS-STOCK = TEXT-055.
ELSE.
L_PARTS-STOCK = TEXT-054.
ENDIF.
*
APPEND L_PARTS.
CLEAR L_PARTS.
ENDLOOP.
*
*DESCRIBE TABLE L_PARTS LINES L_LINES.
*IF L_LINES = 1 .
MESSAGE I002(ZEXAMPLE).
*ELSEIF L_LINES = 0.
MESSAGE I003(ZEXAMPLE3).
*ENDIF.
*
*
*
*IF L_LINES > 1.
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
RETFIELD = 'VBAP-MATNR'
VALUE_ORG = 'S'
TABLES
VALUE_TAB = L_PARTS
RETURN_TAB = T_RETVAL
EXCEPTIONS
PARAMETER_ERROR = 1
NO_VALUES_FOUND = 2
OTHERS = 3.
IF NOT T_RETVAL[] IS INITIAL.
READ TABLE T_RETVAL INDEX 1.
P_ITEM = T_RETVAL-FIELDVAL.
ENDIF.
ENDIF.
It's giving ERROR as <b>"MAterial OZC500 not defined for sales org. s001, distr. channel 01 launage EN"</b>
OZC500 is an oldmaterial number value. Also After putting value in Material number popup is not coming It's asking for to " enter Quantity field"
I need to display POPup immediately after material number or old material number entered in itemlevel & press enter.??????????
Guide me please...... Will appreciate any reply
‎2006 Feb 08 2:24 PM
‎2006 Feb 08 4:27 PM
The problem you are seeing is that the standard field checks are being performed <u>before</u> the user exit code is hit. For example, the "V1 382" message is being sent from SAPFV45P, form maapv_select via this call stack:
1 SAPFV45P FORM MAAPV_SELECT
2 SAPFV45P FORM VBAP_MATNR_PRUE_TEIL2
3 SAPFV45P FORM VBAP-MATNR_PRUEFEN
4 SAPMV45A MODULE (PAI) VBAP-MATNR_PRUEFENTry setting a break-point on the E382 message in form maapv_select. Also, set several break-points in the various user-exit subroutines and customer-function calls. You will see that none of the break-points will be hit when you enter an old (i.e. invalid) material number. The first break-point you encounter will be the error message.
So where does this leave you? Unless you are able to find a customer modifiable "hook" in the logic that occurs <u>before</u> the standard screen checks, your popup will not be possible when these types of errors (including messages such as "Enter a quantity") occur. This would be a case where some of the newer enhancement techniques (there is more info on these in SDN, etc.) would be very useful.
Unfortunately, I cannot see a solution that will give you exactly what you need unless you modify the standard code (do not do this!!!). Having said this, however, you may have better luck at finding an appropriate customer modifiable "hook". I only had limited time to try the break-point technique, so maybe you can try it out for all the user exits. You never know...
I wish I had a more positive answer for you. Sometimes we just have to live with the limitations that exist with not being able to modify the standard code.
Best Regards,
James Gaddis
‎2006 Feb 07 8:56 PM
Hi,
I would prefer USEREXIT_CHECK_VBAP over USEREXIT_MOVE_FIELD_VBAP because it does not appear that internal table XVBAP contains the new item when USEREXIT_MOVE_FIELD_VBAP is called. When USEREXIT_CHECK_VBAP is called, however, itab XVBAP does contain your new item.
If you are looking to enhance the F4 capability of the material number field then you might want to consider appending the search help MAT1. You can do this from the dictionary (in the search help screens) via Goto -> Append search help. I believe there is information on doing this in SDN (and certainly help.sap.com).
Best of luck,
James Gaddis
Message was edited by: James Gaddis