Application Development 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: 

Assigning '(SAPMM07M)MSEG-PRCTR'

Former Member
0 Kudos

Hi Experts.

I am working in 'EXIT_SAPMM07M_001'.

I want to assign a value into '(SAPMM07M)MSEG-PRCTR'.

My code:

Header 1
DATA: BP TYPE I"Break Point
FIELD-SYMBOLS: <PRCTR> TYPE MSEG-PRCTR.

BP = 0.

ASSIGN '(SAPMM07M)MSEG-PRCTR' TO <PRCTR>.
<PRCTR> = 'TEST_DUMMY'.

BP = 1.

Error returns:

"'(SAPMM07M)MSEG-PRCTR'" and "<PRCTR>" are type-incompatible  

If I change the TYPE of <PRCTR>  to ANY, error returns:

"Error at assignment : Overwritten protected field."


May I ask for some hints?

BR,

King

6 REPLIES 6

nabheetscn
Active Contributor
0 Kudos

Hi

Can you please explain us your requirement..? If you look at parameters of this exit it is for updating text and we should better do that only.

Nabheet

0 Kudos

Hi

I want to change the profit center during material movement MIGO.

I am trying the methods from follow link.

King

0 Kudos

Hi,

Try using as below

    CONSTANTS: lc_addr_oth_city   TYPE char40 VALUE '(SAPLSZA1)ADDR1_DATA-PO_BOX_LOBBY'.

       FIELD-SYMBOLS: <fs_po_box> TYPE ANY.

      ASSIGN (lc_addr_oth_city) TO <fs_po_box>.

   
IF <fs_po_box> IS ASSIGNED.
             gv_flag_chg =
'X'.

    ENDIF.

  

    UNASSIGN <fs_po_box>.

Regards

Sajid

arivazhagan_sivasamy
Active Contributor
0 Kudos

Hi King Kong,

You can't assign or change the value for profit center in EXIT_SAPMM07M_001.

you can only change the value for

E_SGTXT    LIKE    MSEG-SGTXT    Segment Text Determined

Arivazhagan S

UweFetzer_se38
Active Contributor
0 Kudos

Please do yourself (and your successor) a favor and don't use such eval constructs.

Maybe using exit MB_CF001 may be the better option.

thanga_prakash
Active Contributor
0 Kudos

Hello King,

You can try with the below BADI.

EXIT_SAPMM07M_001 only changes

MSEG-SGTXTSegment Text Determined

Regards,

Thanga