cancel
Showing results for 
Search instead for 
Did you mean: 

User Exit for PGI

0 Kudos

Is there any standard user exit for stopping PGI to happen?

Accepted Solutions (0)

Answers (5)

Answers (5)

Former Member
0 Kudos

Had a similar sitution where the user wanted the PGI not to be done by user from a specific country on the last day of every month.

Made the changes in the user-exit 'USEREXIT_READ_DOCUMENT’ available in MV50AFZ1.

USEREXIT_READ_DOCUMENT

  • The document is not in Read mode

IF T180-TRTYP <> A then

|* Check for the Transaction codes

IF T180-TCODE = 'VL02N' or T180-TCODE = 'VL02' then.

|*Check for the User restriction

Check_User_Restriction

IF User_Restricted = True then

IF Program is being run via Batch job then

Record message in the output for the Batch job

EXIT

ELSE

IF the program is run directly then

Prompt the appropriate message

Exit

ENDIF

ENDIF

ENDIF

ENDIF

ENDIF

Function Check_User_Restriction

Check_DATE_TIME

IF Date is the last day of the current month and the time is between is 2300 to 2400 then

Get the user data: [Login Details]

IF the country for the user_id = 'XXX' then

User_Restricted = True

ELSE

User_Restricted = False

ENDIF

ENDIF

END

Reward Points on accomplishment

Regards,

Gaurav

Former Member
0 Kudos

Had a similar sitution where the user wanted the PGI not to be done by user from a specific country on the last day of every month.

Made the changes in the user-exit 'USEREXIT_READ_DOCUMENT’ available in MV50AFZ1.

USEREXIT_READ_DOCUMENT

  • The document is not in Read mode

IF T180-TRTYP <> A then

|* Check for the Transaction codes

IF T180-TCODE = 'VL02N' or T180-TCODE = 'VL02' then.

|*Check for the User restriction

Check_User_Restriction

IF User_Restricted = True then

IF Program is being run via Batch job then

Record message in the output for the Batch job

EXIT

ELSE

IF the program is run directly then

Prompt the appropriate message

Exit

ENDIF

ENDIF

ENDIF

ENDIF

ENDIF

Function Check_User_Restriction

Check_DATE_TIME

IF Date is the last day of the current month and the time is between is 2300 to 2400 then

Get the user data: [Login Details]

IF the country for the user_id = 'XXX' then

User_Restricted = True

ELSE

User_Restricted = False

ENDIF

ENDIF

END

Former Member
0 Kudos

Hi

Check the code.

***INCLUDE MV50AFZ1 .

************************************************************************

  • *

  • This include is reserved for user modifications *

  • *

  • Forms for delivery processing *

  • *

  • The name of modification modules should begin with 'ZZ'. *

  • *

************************************************************************

----


  • FORM ZZEXAMPLE *

----


  • text...................................... *

----


*FORM ZZEXAMPLE.

  • ...

*ENDFORM.

*eject

----


  • FORM USEREXIT_DELETE_DOCUMENT *

----


  • This userexit can be used to delete data in additional tables *

  • when a delivery is deleted. *

  • *

  • This form is called in dialog at the end of form BELEG_LOESCHEN*

  • just before form BELEG_SICHERN is performed to delete the *

  • datas on the database. *

  • *

----


FORM USEREXIT_DELETE_DOCUMENT.

ENDFORM.

*eject

----


  • FORM USEREXIT_MOVE_FIELD_TO_LIKP *

----


  • This userexit can be used to move some fields into the *

  • delivery header workaerea LIKP. *

  • This form is called, when a header is created *

  • This form is called at the end of form LIKP_FUELLEN. *

  • *

----


FORM USEREXIT_MOVE_FIELD_TO_LIKP.

  • LIKP-zzfield = xxxx-zzfield2.

ENDFORM.

*eject

----


  • FORM USEREXIT_MOVE_FIELD_TO_LIPS *

----


  • This userexit can be used to move some fields into the *

  • delivery item workaerea LIPS *

  • This form is called, when an item is created *

  • *

  • *

  • This form is called at the end of form LIPS_FUELLEN. *

  • *

----


FORM USEREXIT_MOVE_FIELD_TO_LIPS.

  • LIPS-zzfield = xxxx-zzfield2.

ENDFORM.

*eject

----


  • FORM USEREXIT_NUMBER_RANGE *

----


  • This userexit can be used to determine the numberranges for *

  • the internal document number. *

  • *

  • US_RANGE_INTERN - internal number range *

  • *

  • This form is called from form BELEG_SICHERN *

  • *

----


FORM USEREXIT_NUMBER_RANGE USING US_RANGE_INTERN.

  • Example: Numer range from TVLK like in standard

  • US_RANGE_INTERN = TVLK-NUMKI.

ENDFORM.

*eject

----


  • FORM USEREXIT_READ_DOCUMENT *

----


  • This userexit can be used to read data in additional tables *

  • when the program reads a delivery. *

  • *

  • This form is called at the end of form BELEG_LESEN. *

  • *

----


FORM USEREXIT_READ_DOCUMENT.

ENDFORM.

*eject

----


  • FORM USEREXIT_SAVE_DOCUMENT *

----


  • This userexit can be used to save data in additional tables *

  • when a document is saved. *

  • *

  • If field T180-TRTYP contents 'H', the document will be *

  • created, else it will be changed. *

  • *

  • This form is called at from form BELEG_SICHERN, before COMMIT *

  • *

----


FORM USEREXIT_SAVE_DOCUMENT.

  • Example:

  • CALL FUNCTION 'ZZ_EXAMPLE'

  • IN UPDATE TASK

  • EXPORTING

  • ZZTAB = ZZTAB.

ENDFORM.

*eject

----


  • FORM USEREXIT_SAVE_DOCUMENT_PREPARE *

----


  • This userexit can be used for changes or checks, before a *

  • document is saved. *

  • *

  • If field T180-TRTYP contents 'H', the document will be *

  • created, else it will be changed. *

  • *

  • This form is called at the beginning of form BELEG_SICHERN *

  • *

----


FORM USEREXIT_SAVE_DOCUMENT_PREPARE.

ENDFORM.

*eject

----


  • FORM USEREXIT_REFRESH_DOCUMENT *

----


  • It is always necessary to refresh user-specific data before *

  • the next document will be processed. *

  • This can be done in this userexit. *

  • This userexit can be used to refresh user-specific data *

  • when the processing of a delivery is finished *

  • - after the document is saved *

  • - when you leave the document processing with F3 or F15 *

  • It may be necessary to refresh user-specific data before *

  • the next document will be processed. *

  • *

  • This form is called in dialog at the end of form *

  • BELEG_INITIALISIEREN *

  • *

----


FORM USEREXIT_REFRESH_DOCUMENT.

  • clear: ZZ50A.

  • refresh: zzitemtab.

ENDFORM.

*eject

Reward points if it works.

Regards

Karan

rmazzali
Active Contributor
0 Kudos

into MV50AFZ1 FORM USEREXIT_SAVE_DOCUMENT_PREPARE

check the following:

IF FCODE(4) = 'WABU'. <--- this always is the fcode for posting good issue

your code

ENDIF.

Reward if it help you.

regards

Roberto Mazzali

Former Member
0 Kudos

Hi

Please go to the program SAPMV50A and look for the relavent include for PGI i.e.MV50AFZ1. Hope this help .

Regards

Satish Kullu