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: 

User Exit for Delivery to add Profit Centre

NAeda
Contributor
0 Kudos

Hello All,

I need the User Exit to Add the Profit Centre at Delivery level..!

I tried in this MV50AFZ1 Form FORM userexit_move_field_to_lips.

but its not working...

So please let me know the userexit and the code..!

Thanks in Advance

Regards

Aeda

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Try using subroutine USEREXIT_SAVE_DOCUMENT_PREPARE of Include: MV50AFZ1.

Change XLIPS-PRCTR with the desired value and update indicator XLIPS-UPDKZ = 'U' for changing and 'I' for Inserting new line item.

Regards

Eswar

9 REPLIES 9

former_member181995
Active Contributor
0 Kudos
Enhancement:V50S0001
Exit:EXIT_SAPLV50S_001 
EXIT_SAPLV50S_002 
Either BADI:DELIVERY_PUBLISH
Method:PUBLISH_BEFORE_COMMIT

Former Member
0 Kudos

Try using subroutine USEREXIT_SAVE_DOCUMENT_PREPARE of Include: MV50AFZ1.

Change XLIPS-PRCTR with the desired value and update indicator XLIPS-UPDKZ = 'U' for changing and 'I' for Inserting new line item.

Regards

Eswar

0 Kudos

Hello All,

I did this but its not working, it not updating the record...!

Include : MV50AFZ1

Form :USEREXIT_SAVE_DOCUMENT_PREPARE

loop at xlips.

Xlips-charg+0(1) eq 'R'.

Xlips-prctr = '0000001300'.

elseif Xlips-charg+0(1) eq 'M'

or Xlips-charg+0(1) eq 'P'

or Xlips-charg+0(1) eq 'N'

or Xlips-charg+0(1) eq 'U'

or Xlips-charg+0(1) eq 'H'

or Xlips-charg+0(1) eq 'L'

or Xlips-charg+0(1) eq 'S'

or Xlips-charg+0(1) eq 'O'

or Xlips-charg+0(1) eq 'Y'

or Xlips-charg+0(1) eq 'B'

or Xlips-charg+0(1) eq 'A'

or Xlips-charg+0(1) eq 'I'.

Xlips-prctr = '0000009001'.

endif.

  • XLIPS-UPDKZ = 'U' .

endloop.

please kidlly help me...

i dont know which code i need to write in BADI..or User exit...!

thanks

Babu

Former Member
0 Kudos

try this BADI LE_SHP_DELIVERY_PROC.

Former Member
0 Kudos

Hi,

Did you modify the internal table XLIPS with the profit center...

as in your code...there is no MODIFY statement within the LOOP AT xlips..ENDLOOP.

Thanks

Naren

0 Kudos

Hello

Its working when i write Modify Statement..!

but its working only in Delivery.., Its not Carrying the same Profit centre to Billing..

please help me out..

thanks

Babu

0 Kudos

Hi,

Are you trying to change the profit center in delivery after the billing document is posted???

Oh btw i am a bit confused on how to address you Aeda or Babu cause your signature got transformed from Aeda to Babu...

Regards

Eswar

0 Kudos

Hello Eswar,

We need to maintain the profit center derivation rule in the delivery or billing document, i.e. if batch no starts as A- Profit center-1000, B -Profit center-2000. We have used some user exit in order and working fine. where as our client is interested to have same in delivery or billing document. The profit center should be determined as per batch no starts and not as maintained in the material master.

now I did it in Delivery its working fine only in Delivery but its not carrying to Billing

so please help me out which carries for entire cycle

my code is like this

Include MV50AFZ1

FORM userexit_save_document_prepare.

LOOP AT xlips.

IF xlips-charg+0(1) EQ 'D'.

xlips-prctr = '0000001000'.

ELSEIF xlips-charg+0(1) EQ 'E'.

xlips-prctr = '0000001200'.

ELSEIF xlips-charg+0(1) EQ 'R'.

xlips-prctr = '0000001300'.

ELSEIF xlips-charg+0(1) EQ 'M'

OR xlips-charg+0(1) EQ 'P'

OR xlips-charg+0(1) EQ 'N'

OR xlips-charg+0(1) EQ 'U'

OR xlips-charg+0(1) EQ 'H'

OR xlips-charg+0(1) EQ 'L'

OR xlips-charg+0(1) EQ 'S'

OR xlips-charg+0(1) EQ 'O'

OR xlips-charg+0(1) EQ 'Y'

OR xlips-charg+0(1) EQ 'B'

OR xlips-charg+0(1) EQ 'A'

OR xlips-charg+0(1) EQ 'I'.

xlips-prctr = '0000009001'.

ENDIF.

  • XLIPS-UPDKZ = 'U' .

MODIFY xlips.

  • CLEAR xlips.

ENDLOOP.

ENDFORM. "USEREXIT_SAVE_DOCUMENT_PREPARE

Thanks

Regards

Babu Aeda

0 Kudos

Hi

Can you please let me know if this worked. If yes, how.

I have a similar requirement.

Thanks