2007 Aug 27 11:04 PM
Hi Experts,
I am working on one BADI (MB_MIGO_BADI) with MIGO, I am not able to excess PO number that is entered on the main screen.
I need this value in my defined field of BADI.
while debugging I can see the PO value into variable
(SAPLMIGO) GODYNPRO-PO_NUMBER, but if I give only GODYNPRO-PO_NUMBER then I am not able to get value into debugger.
So my question is how to define a variable that will be same as (SAPLMIGO) GODYNPRO-PO_NUMBER type.
I tried somthing like this:
data: LV_PO type EBELN
LV_PO = (SAPLMIGO) GODYNPRO-PO_NUMBER but this gives syntax error.
Points will be rewarded for helpful answer.
neo
2007 Aug 28 2:35 AM
Hi
You need to declare a Field symbol of type any and assaign PO number value to the Field symbol.
eg:
FIELD-SYMBOLS <fs_xjkap> TYPE any.
l_name = '(SAPMJ45A)XJKAP'.
ASSIGN (l_name) TO <fs_xjkap>.
IF <fs_xjkap> IS ASSIGNED.
MOVE <fs_xjkap>-vbeln TO l_vbeln.
MOVE <fs_xjkap>-posnr TO l_posnr.
ENDIF.
regards,
raghu
Hi Experts,
I am working on one BADI (MB_MIGO_BADI) with MIGO, I am not able to excess PO number that is entered on the main screen.
I need this value in my defined field of BADI.
while debugging I can see the PO value into variable
(SAPLMIGO) GODYNPRO-PO_NUMBER, but if I give only GODYNPRO-PO_NUMBER then I am not able to get value into debugger.
So my question is how to define a variable that will be same as (SAPLMIGO) GODYNPRO-PO_NUMBER type.
I tried somthing like this:
data: LV_PO type EBELN
LV_PO = (SAPLMIGO) GODYNPRO-PO_NUMBER but this gives syntax error.
Points will be rewarded for helpful answer.
neo
2007 Aug 27 11:09 PM
Try using the function module
'DYNP_VALUES_READ'. by passing the program name, screen number for the PO number in badi
Example code
REPORT Z_SRI_HELP_VALUE_FOR_TABLES .
tables tcurt.
DATA DYFIELDS LIKE DYNPREAD OCCURS 1 WITH HEADER LINE.
PARAMETERS: P_WAERS LIKE TCURT-WAERS, "Currency
P_LTEXT LIKE TCURT-LTEXT, "Long Text
P_KTEXT LIKE TCURT-KTEXT. "Short Text
*----
*--- Example of updating value of another field on the screen -
AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_WAERS.
CLEAR: DYFIELDS[], DYFIELDS.
*--- select currency
CALL FUNCTION 'HELP_VALUES_GET'
EXPORTING
fieldname = 'WAERS'
tabname = 'TCURT'
IMPORTING
SELECT_VALUE = P_WAERS.
*--- get long text for the selected currency
SELECT SINGLE LTEXT FROM TCURT
INTO DYFIELDS-FIELDVALUE
WHERE SPRAS = SY-LANGU
AND WAERS = P_WAERS.
IF SY-SUBRC <> 0.
CLEAR DYFIELDS-FIELDVALUE.
ENDIF.
*--- update another field
DYFIELDS-FIELDNAME = 'P_LTEXT'.
APPEND DYFIELDS.
CALL FUNCTION 'DYNP_VALUES_UPDATE'
EXPORTING
DYNAME = SY-CPROG
DYNUMB = SY-DYNNR
tables
dynpfields = DYFIELDS .
*----
*--- Example of reading value of another field -
AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_KTEXT.
*--- read another field
CLEAR: DYFIELDS[], DYFIELDS.
DYFIELDS-FIELDNAME = 'P_WAERS'.
APPEND DYFIELDS.
CALL FUNCTION 'DYNP_VALUES_READ'
EXPORTING
DYNAME = SY-CPROG
DYNUMB = SY-DYNNR
TABLES
DYNPFIELDS = DYFIELDS .
READ TABLE DYFIELDS INDEX 1.
*--- get short text and update current field
SELECT SINGLE KTEXT FROM TCURT
INTO P_KTEXT
WHERE SPRAS EQ SY-LANGU
AND WAERS EQ DYFIELDS-FIELDVALUE.
Thanks
Mahesh
2007 Aug 28 2:35 AM
Hi
You need to declare a Field symbol of type any and assaign PO number value to the Field symbol.
eg:
FIELD-SYMBOLS <fs_xjkap> TYPE any.
l_name = '(SAPMJ45A)XJKAP'.
ASSIGN (l_name) TO <fs_xjkap>.
IF <fs_xjkap> IS ASSIGNED.
MOVE <fs_xjkap>-vbeln TO l_vbeln.
MOVE <fs_xjkap>-posnr TO l_posnr.
ENDIF.
regards,
raghu
| User | Count |
|---|---|
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |