04-27-2006 12:04 AM
Hi:
I want to catch the values of some other fields of the same dynpro besides de field im doing a Field Exit. Does anyone knows if this is possible or i have to think in another way to fill the field?
I've try to put some parameters in the function module but i obtain a short dump when i run the transacction cause de función in the standart program doesn't recognize the extra parameters besides INPUT or OUTPUT
Any clue will be great.
Thanks
04-27-2006 1:40 AM
Hi Rafael,
Yes you can get the value of the other field in the same screen by using the FM DYNP_VALUES_READ.
and here is how its supposed to be used.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR S_VERID-LOW.
IT_DYNPREAD-FIELDNAME = 'S_MATNR-LOW'.
APPEND IT_DYNPREAD.
IT_DYNPREAD-FIELDNAME = 'S_WERKS-LOW'.
APPEND IT_DYNPREAD.
CALL FUNCTION 'DYNP_VALUES_READ'
EXPORTING
DYNAME = sy-cprog
DYNUMB = sy-dynnr
TABLES
DYNPFIELDS = IT_DYNPREAD
.
IF SY-SUBRC <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
READ TABLE IT_DYNPREAD INDEX 1.
IF SY-SUBRC = 0.
L_MATNR = IT_DYNPREAD-FIELDVALUE.
ENDIF.
READ TABLE IT_DYNPREAD INDEX 2.
IF SY-SUBRC = 0.
L_WERKS = IT_DYNPREAD-FIELDVALUE.
ENDIF.
TRANSLATE L_MATNR TO UPPER CASE.
TRANSLATE L_WERKS TO UPPER CASE.
SELECT VERID WERKS MATNR INTO TABLE IT_VERID FROM MKAL WHERE MATNR = L_MATNR AND WERKS = L_WERKS.
Hope this helps
Cheers
VJ
04-27-2006 1:40 AM
Hi Rafael,
Yes you can get the value of the other field in the same screen by using the FM DYNP_VALUES_READ.
and here is how its supposed to be used.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR S_VERID-LOW.
IT_DYNPREAD-FIELDNAME = 'S_MATNR-LOW'.
APPEND IT_DYNPREAD.
IT_DYNPREAD-FIELDNAME = 'S_WERKS-LOW'.
APPEND IT_DYNPREAD.
CALL FUNCTION 'DYNP_VALUES_READ'
EXPORTING
DYNAME = sy-cprog
DYNUMB = sy-dynnr
TABLES
DYNPFIELDS = IT_DYNPREAD
.
IF SY-SUBRC <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
READ TABLE IT_DYNPREAD INDEX 1.
IF SY-SUBRC = 0.
L_MATNR = IT_DYNPREAD-FIELDVALUE.
ENDIF.
READ TABLE IT_DYNPREAD INDEX 2.
IF SY-SUBRC = 0.
L_WERKS = IT_DYNPREAD-FIELDVALUE.
ENDIF.
TRANSLATE L_MATNR TO UPPER CASE.
TRANSLATE L_WERKS TO UPPER CASE.
SELECT VERID WERKS MATNR INTO TABLE IT_VERID FROM MKAL WHERE MATNR = L_MATNR AND WERKS = L_WERKS.
Hope this helps
Cheers
VJ
04-27-2006 5:35 PM