‎2005 Sep 14 7:11 PM
Hi All
Could any one let me know the user exit name used to modify the line items values of a P.O. in the transaction ME22N. I am using the exit EXIT_SAPMM06E_012. Its not changing the values of EKPO. Please suggest.
Thank You,
Suresh
‎2005 Sep 14 8:28 PM
‎2005 Sep 14 7:38 PM
Use
DATA CHAR(50) VALUE '(SAPLMEPO)POT[]'.
data itab like BEKPO OCCURS 0 with header line.
FIELD-SYMBOLS <F1> TYPE ANY.
ASSIGN (CHAR) TO <F1>.
ITAB = <F1> .
LOOP AT ITAB.
ITAB-NETPR = 100.
ENDLOOP.
<F1> = ITAB.
Now you can change any value in <F1> , NETPR is an example.
‎2005 Sep 14 7:41 PM
‎2005 Sep 14 7:52 PM
DATA: WA_ERNAM LIKE EBAN-ERNAM.
IF ( SY-TCODE = 'ME21' OR
SY-TCODE = 'ME21N' ) AND I_EKKO-BSART = 'NB'.
LOOP AT TEKPO.
IF NOT TEKPO-BANFN IS INITIAL.
SELECT SINGLE ERNAM
FROM EBAN
INTO WA_ERNAM
WHERE BANFN = TEKPO-BANFN AND
BNFPO = TEKPO-BNFPO.
IF SY-SUBRC = 0.
TEKPO-AFNAM = WA_ERNAM.
TEKPO-ZREQUIS = WA_ERNAM.
MODIFY TEKPO TRANSPORTING AFNAM ZREQUIS
WHERE BANFN = TEKPO-BANFN AND
BNFPO = TEKPO-BNFPO.
MODIFY TEKPO INDEX SY-TABIX.
ENDIF.
ELSE.
TEKPO-AFNAM = SY-UNAME.
TEKPO-ZREQUIS = SY-UNAME.
MODIFY TEKPO TRANSPORTING AFNAM ZREQUIS
WHERE BANFN = TEKPO-BANFN AND
BNFPO = TEKPO-BNFPO.
ENDIF.
ENDLOOP.
ENDIF.
The above is the code i have written in EXIT_SAPMM06E_012 its not showing the changed values of AFNAM and ZREQUIS in EKPO. That is in ME21N while creating the P.O.
Please suggest.
Thank You
Suresh
‎2005 Sep 14 7:41 PM
‎2005 Sep 14 7:54 PM
Changes to TEKPO will not work.
You will have to modify POT[] ( structure BEKPO) to have your changes posted to database.
Modify your code as per my previous post and add your necessary code there . It should work.
‎2005 Sep 14 7:58 PM
DATA: WA_ERNAM LIKE EBAN-ERNAM.
DATA CHAR(50) VALUE '(SAPLMEPO)POT[]'.
data itab like BEKPO OCCURS 0 with header line.
FIELD-SYMBOLS <F1> TYPE ANY.
ASSIGN (CHAR) TO <F1>.
ITAB = <F1> .
LOOP AT ITAB.
IF NOT itab-BANFN IS INITIAL.
SELECT SINGLE ERNAM
FROM EBAN
INTO WA_ERNAM
WHERE BANFN = itab-BANFN AND
BNFPO = itab-BNFPO.
IF SY-SUBRC = 0.
itab-AFNAM = WA_ERNAM.
itab-ZREQUIS = WA_ERNAM.
ELSE.
TEKPO-AFNAM = SY-UNAME.
TEKPO-ZREQUIS = SY-UNAME.
ENDIF.
MODIFY ITAB.
ENDLOOP.
<F1> = ITAB.
‎2005 Sep 14 8:10 PM
ASSIGN (CHAR) TO <F1>.
ITAB = <F1> .
LOOP AT ITAB.
IF NOT ITAB-BANFN IS INITIAL.
SELECT SINGLE ERNAM
FROM EBAN
INTO WA_ERNAM
WHERE BANFN = ITAB-BANFN AND
BNFPO = ITAB-BNFPO.
IF SY-SUBRC = 0.
ITAB-AFNAM = WA_ERNAM.
ITAB-ZREQUIS = WA_ERNAM.
ENDIF.
ELSE.
TEKPO-AFNAM = SY-UNAME.
TEKPO-ZREQUIS = SY-UNAME.
ENDIF.
MODIFY ITAB.
ENDLOOP.
<F1> = ITAB.
when i use the above code its giving a dump at 'ITAB = <F1>' saying as below
You attempted to move one data object to another.
This is not possible here because the conversion of a data object of type "h" to type "BEKPO" is not supported.
when i us
Please suggest
‎2005 Sep 14 8:28 PM
‎2005 Sep 14 8:33 PM
Hi Sanjay,
Thank You Very Much.
It solved my problem. Could you please let me know how it works actually, i didnt get the logic behind the assigning of CHAR(50) VALUE '(SAPLMEPO)POT[]'. It would be helpful for me if you can explain me.
Thanks Again
Suresh
‎2005 Sep 14 8:42 PM
With ASSIGN you can read or change any data object in CALL STACK even if it is not available in the interface of user exit . You can access global data of main program.
POT is an internal table of SAPLMEPO.