Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

P.O line items change exit

Former Member
0 Likes
3,038

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

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,715

use

ITAB[] = <F1>.

And

<f1> = ITAB[].

10 REPLIES 10
Read only

Former Member
0 Likes
1,715

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.

Read only

Former Member
0 Likes
1,715

Also you can try EXIT_SAPMM06E_012

Read only

0 Likes
1,715

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

Read only

Former Member
0 Likes
1,715

EXIT_SAPMM06E_013

Read only

Former Member
0 Likes
1,715

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.

Read only

Former Member
0 Likes
1,715

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.

Read only

0 Likes
1,715

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

Read only

Former Member
0 Likes
1,716

use

ITAB[] = <F1>.

And

<f1> = ITAB[].

Read only

0 Likes
1,715

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

Read only

Former Member
0 Likes
1,715

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.