Customer exit MEREQ001(EQ001 Customers' Own Data in Purchase Requisi) include(ZXM02U12)
*&---------------------------------------------------------------------*
*& Include ZXM02U12
*&---------------------------------------------------------------------*
DATA :gs_im_t_eban TYPE eban,
messages TYPE bapiret2.
READ TABLE im_t_eban INTO gs_im_t_eban INDEX 1.
IF gs_im_t_eban-frgdt < sy-datum.
CLEAR : messages.
CALL FUNCTION 'BALW_BAPIRETURN_GET2'
EXPORTING
type = 'E'
cl = 'ZRKMSG'
number = '008'
par1 = ' '
par2 = ' '
par3 = ' '
par4 = ' '
IMPORTING
return = messages.
APPEND messages TO ex_messages.
RAISE error_messages.
EXIT.
MESSAGE 'PR Release Date should not be less than the System Date' TYPE 'E'.
ENDIF.
**BREAK mihirp.
*10
*break krutis.
*BREAK NAVEENC.
* DATA : gt_eban TYPE STANDARD TABLE OF eban,
* gs_eban TYPE eban.
*
******* Added By Bijal Chauhan
* break bijalc.
*
* CLEAR gs_eban.
* IMPORT gt_eban TO gt_eban FROM MEMORY ID 'EBAN'.
*
*LOOP AT .
*
*ENDLOOP.
* MOVE-CORRESPONDING gs_eban TO im_t_eban.
******* End of Edit
*DATA: lv_frgdt TYPE sy-datum,
* it_eban TYPE STANDARD TABLE OF eban WITH HEADER LINE,
* ls_eban TYPE eban.
*DATA:fcode TYPE sy-ucomm.
*DATA: gt_return TYPE bapiret2.
*
*lv_frgdt = sy-datum.
*it_eban[] = im_t_eban[].
*
*READ TABLE it_eban INTO ls_eban INDEX 1.
*IF sy-subrc = 0.
*
* IF ls_eban-frgdt < lv_frgdt .
** FCODE = 'ENT1'.
** SET CURSOR FIELD 'FRGDT'.
** MESSAGE 'Date should not be less than system date' TYPE 'E'." DISPLAY LIKE 'E'.
** MESSAGE e007(zsapmsg_k)." DISPLAY LIKE 'E'.
** LEAVE LIST-PROCESSING AND RETURN TO SCREEN sy-dynnr.
* CALL FUNCTION 'BALW_BAPIRETURN_GET2'
* EXPORTING
* type = 'E'
* cl = 'ZSAPMSG_K'
* number = '007'
** PAR1 = ' '
** PAR2 = ' '
** PAR3 = ' '
** PAR4 = ' '
** LOG_NO = ' '
** LOG_MSG_NO = ' '
** PARAMETER = ' '
** ROW = 0
** FIELD = ' '
* IMPORTING
* return = gt_return.
* APPEND gt_return TO ex_messages.
* RAISE error_messages.
** set SCREEN 0014.
** LEAVE TO SCREEN sy-dynnr.
* ENDIF.
*ENDIF.
*********** Logic Implemented By Bijal Chauhan - 20.12.2016
*BREAK bijalc.
*DATA : lt_eban TYPE STANDARD TABLE OF eban WITH HEADER LINE,
* lv_date TYPE datum,
* messages TYPE bapiret2.
*
*lv_date = sy-datum.
*lt_eban[] = im_t_eban[].
*
************ Logic For Date in ME54N
*IF sy-tcode EQ 'ME54N'.
* IF sy-ucomm EQ 'MERELEASE'.
** READ TABLE lt_eban INDEX 1.
* LOOP AT lt_eban.
* IF sy-subrc EQ 0.
* IF lt_eban-frgdt > lv_date.
* CLEAR messages.
* CALL FUNCTION 'BALW_BAPIRETURN_GET2'
* EXPORTING
* type = 'E'
* cl = 'Z_BIJ_PRACTICE'
* number = '025'
* par1 = ' '
* par2 = ' '
* par3 = ' '
* par4 = ' '
* IMPORTING
* return = messages.
* APPEND messages TO ex_messages.
* RAISE error_messages.
* EXIT.
* ENDIF.
* ENDIF.
* ENDLOOP.
* ENDIF.
*ENDIF.
************
*
************ Logic For Date in ME51N
*IF sy-tcode EQ 'ME51N' OR sy-tcode EQ 'ME52N'.
* IF sy-ucomm EQ 'MESAVE' OR
* sy-ucomm EQ 'MECHECKDOC'.
* READ TABLE lt_eban INDEX 1.
* IF sy-subrc EQ 0.
* IF lt_eban-lfdat > lv_date.
* CLEAR messages.
* CALL FUNCTION 'BALW_BAPIRETURN_GET2'
* EXPORTING
* type = 'E'
* cl = 'Z_BIJ_PRACTICE'
* number = '025'
* par1 = ' '
* par2 = ' '
* par3 = ' '
* par4 = ' '
* IMPORTING
* return = messages.
* APPEND messages TO ex_messages.
* RAISE error_messages.
* EXIT.
* ENDIF.
* IF lt_eban-frgdt > lv_date.
* CLEAR messages.
* CALL FUNCTION 'BALW_BAPIRETURN_GET2'
* EXPORTING
* type = 'E'
* cl = 'Z_BIJ_PRACTICE'
* number = '026'
* par1 = ' '
* par2 = ' '
* par3 = ' '
* par4 = ' '
* IMPORTING
* return = messages.
* APPEND messages TO ex_messages.
* RAISE error_messages.
* EXIT.
* ENDIF.
* ENDIF.
* ENDIF.
*ENDIF.
***********
************************* End of Logic *************************
*break anju_d.
*
*DATA : lt_eban TYPE STANDARD TABLE OF eban WITH HEADER LINE.
*DATA : lv_frgdt TYPE sy-datum.
*
*lv_frgdt = sy-datum + 2.
*lt_eban[] = im_t_eban[].
*
*READ TABLE lt_eban INDEX 1.
*IF lt_eban-frgdt > lv_frgdt.
* PERFORM folge_gleichsetzen(saplv00f).
* sy-ucomm = 'ENT1'.
* MESSAGE 'PR Release Date should not be in past of system date or more three days of system date' TYPE 'E'.
* SET SCREEN syst-dynnr.
* LEAVE SCREEN.
*ENDIF.
************Release Date Validation Uname:PAYALD.
*BREAK payald.
**DATA : it_eban TYPE STANDARD TABLE OF eban WITH HEADER LINE.
**DATA: gt_return TYPE bapiret2.
**DATA : fcode TYPE sy-ucomm.
**it_eban[] = im_t_eban[].
**READ TABLE it_eban INDEX 1.
**IF it_eban-frgdt < sy-datum.
** CALL FUNCTION 'BALW_BAPIRETURN_GET2'
** EXPORTING
** type = 'E'
** cl = 'ZSAPMSG_K'
** NUMBER = '007'
** PAR1 = ' '
** PAR2 = ' '
** PAR3 = ' '
** PAR4 = ' '
** LOG_NO = ' '
** LOG_MSG_NO = ' '
** PARAMETER = ' '
** ROW = 0
** FIELD = ' '
** IMPORTING
** RETURN = gt_return.
** APPEND gt_return TO ex_messages.
** RAISE error_messages..
**ENDIF.
***********Release Date Validation by Freddie*************
* break freddie.
** DATA : it_eban TYPE TABLE OF eban WITH HEADER LINE,
** messages TYPE bapiret2.
** it_eban[] = im_t_eban[].
** READ TABLE it_eban INDEX 1.
**
** IF it_eban-frgdt < sy-datum.
** CLEAR : messages.
** CALL FUNCTION 'BALW_BAPIRETURN_GET2'
** EXPORTING
** type = 'E'
** cl = 'ZFM_MSG'
** number = '043'
** par1 = ' '
** par2 = ' '
** par3 = ' '
** par4 = ' '
** IMPORTING
** return = messages.
** APPEND messages TO ex_messages.
** RAISE error_messages.
** EXIT.
**
** MESSAGE 'Release Date cannot be before system date.' TYPE 'E'.
** ENDIF.
***********Release Date Validation by chetan sharma *************
*break chetans.
*DATA : it_eban TYPE TABLE OF eban WITH HEADER LINE,
* messages TYPE bapiret2.
*it_eban[] = im_t_eban[].
*READ TABLE it_eban INDEX 1.
*
*IF it_eban-frgdt < sy-datum.
* CLEAR : messages.
*
* CALL FUNCTION 'BALW_BAPIRETURN_GET2'
* EXPORTING
* type = 'E'
* cl = 'ZCS_MSG'
* number = '042'
* par1 = ' '
* par2 = ' '
* par3 = ' '
* par4 = ' '
* IMPORTING
* return = messages.
* APPEND messages TO ex_messages.
* RAISE error_messages.
* EXIT.
*
* MESSAGE 'Release Date cannot be before system date.' TYPE 'E'.
*
*ENDIF.
*& Include ZXM02U12
*&---------------------------------------------------------------------*
DATA :gs_im_t_eban TYPE eban,
messages TYPE bapiret2.
READ TABLE im_t_eban INTO gs_im_t_eban INDEX 1.
IF gs_im_t_eban-frgdt < sy-datum.
CLEAR : messages.
CALL FUNCTION 'BALW_BAPIRETURN_GET2'
EXPORTING
type = 'E'
cl = 'ZRKMSG'
number = '008'
par1 = ' '
par2 = ' '
par3 = ' '
par4 = ' '
IMPORTING
return = messages.
APPEND messages TO ex_messages.
RAISE error_messages.
EXIT.
MESSAGE 'PR Release Date should not be less than the System Date' TYPE 'E'.
ENDIF.
**BREAK mihirp.
*10
*break krutis.
*BREAK NAVEENC.
* DATA : gt_eban TYPE STANDARD TABLE OF eban,
* gs_eban TYPE eban.
*
******* Added By Bijal Chauhan
* break bijalc.
*
* CLEAR gs_eban.
* IMPORT gt_eban TO gt_eban FROM MEMORY ID 'EBAN'.
*
*LOOP AT .
*
*ENDLOOP.
* MOVE-CORRESPONDING gs_eban TO im_t_eban.
******* End of Edit
*DATA: lv_frgdt TYPE sy-datum,
* it_eban TYPE STANDARD TABLE OF eban WITH HEADER LINE,
* ls_eban TYPE eban.
*DATA:fcode TYPE sy-ucomm.
*DATA: gt_return TYPE bapiret2.
*
*lv_frgdt = sy-datum.
*it_eban[] = im_t_eban[].
*
*READ TABLE it_eban INTO ls_eban INDEX 1.
*IF sy-subrc = 0.
*
* IF ls_eban-frgdt < lv_frgdt .
** FCODE = 'ENT1'.
** SET CURSOR FIELD 'FRGDT'.
** MESSAGE 'Date should not be less than system date' TYPE 'E'." DISPLAY LIKE 'E'.
** MESSAGE e007(zsapmsg_k)." DISPLAY LIKE 'E'.
** LEAVE LIST-PROCESSING AND RETURN TO SCREEN sy-dynnr.
* CALL FUNCTION 'BALW_BAPIRETURN_GET2'
* EXPORTING
* type = 'E'
* cl = 'ZSAPMSG_K'
* number = '007'
** PAR1 = ' '
** PAR2 = ' '
** PAR3 = ' '
** PAR4 = ' '
** LOG_NO = ' '
** LOG_MSG_NO = ' '
** PARAMETER = ' '
** ROW = 0
** FIELD = ' '
* IMPORTING
* return = gt_return.
* APPEND gt_return TO ex_messages.
* RAISE error_messages.
** set SCREEN 0014.
** LEAVE TO SCREEN sy-dynnr.
* ENDIF.
*ENDIF.
*********** Logic Implemented By Bijal Chauhan - 20.12.2016
*BREAK bijalc.
*DATA : lt_eban TYPE STANDARD TABLE OF eban WITH HEADER LINE,
* lv_date TYPE datum,
* messages TYPE bapiret2.
*
*lv_date = sy-datum.
*lt_eban[] = im_t_eban[].
*
************ Logic For Date in ME54N
*IF sy-tcode EQ 'ME54N'.
* IF sy-ucomm EQ 'MERELEASE'.
** READ TABLE lt_eban INDEX 1.
* LOOP AT lt_eban.
* IF sy-subrc EQ 0.
* IF lt_eban-frgdt > lv_date.
* CLEAR messages.
* CALL FUNCTION 'BALW_BAPIRETURN_GET2'
* EXPORTING
* type = 'E'
* cl = 'Z_BIJ_PRACTICE'
* number = '025'
* par1 = ' '
* par2 = ' '
* par3 = ' '
* par4 = ' '
* IMPORTING
* return = messages.
* APPEND messages TO ex_messages.
* RAISE error_messages.
* EXIT.
* ENDIF.
* ENDIF.
* ENDLOOP.
* ENDIF.
*ENDIF.
************
*
************ Logic For Date in ME51N
*IF sy-tcode EQ 'ME51N' OR sy-tcode EQ 'ME52N'.
* IF sy-ucomm EQ 'MESAVE' OR
* sy-ucomm EQ 'MECHECKDOC'.
* READ TABLE lt_eban INDEX 1.
* IF sy-subrc EQ 0.
* IF lt_eban-lfdat > lv_date.
* CLEAR messages.
* CALL FUNCTION 'BALW_BAPIRETURN_GET2'
* EXPORTING
* type = 'E'
* cl = 'Z_BIJ_PRACTICE'
* number = '025'
* par1 = ' '
* par2 = ' '
* par3 = ' '
* par4 = ' '
* IMPORTING
* return = messages.
* APPEND messages TO ex_messages.
* RAISE error_messages.
* EXIT.
* ENDIF.
* IF lt_eban-frgdt > lv_date.
* CLEAR messages.
* CALL FUNCTION 'BALW_BAPIRETURN_GET2'
* EXPORTING
* type = 'E'
* cl = 'Z_BIJ_PRACTICE'
* number = '026'
* par1 = ' '
* par2 = ' '
* par3 = ' '
* par4 = ' '
* IMPORTING
* return = messages.
* APPEND messages TO ex_messages.
* RAISE error_messages.
* EXIT.
* ENDIF.
* ENDIF.
* ENDIF.
*ENDIF.
***********
************************* End of Logic *************************
*break anju_d.
*
*DATA : lt_eban TYPE STANDARD TABLE OF eban WITH HEADER LINE.
*DATA : lv_frgdt TYPE sy-datum.
*
*lv_frgdt = sy-datum + 2.
*lt_eban[] = im_t_eban[].
*
*READ TABLE lt_eban INDEX 1.
*IF lt_eban-frgdt > lv_frgdt.
* PERFORM folge_gleichsetzen(saplv00f).
* sy-ucomm = 'ENT1'.
* MESSAGE 'PR Release Date should not be in past of system date or more three days of system date' TYPE 'E'.
* SET SCREEN syst-dynnr.
* LEAVE SCREEN.
*ENDIF.
************Release Date Validation Uname:PAYALD.
*BREAK payald.
**DATA : it_eban TYPE STANDARD TABLE OF eban WITH HEADER LINE.
**DATA: gt_return TYPE bapiret2.
**DATA : fcode TYPE sy-ucomm.
**it_eban[] = im_t_eban[].
**READ TABLE it_eban INDEX 1.
**IF it_eban-frgdt < sy-datum.
** CALL FUNCTION 'BALW_BAPIRETURN_GET2'
** EXPORTING
** type = 'E'
** cl = 'ZSAPMSG_K'
** NUMBER = '007'
** PAR1 = ' '
** PAR2 = ' '
** PAR3 = ' '
** PAR4 = ' '
** LOG_NO = ' '
** LOG_MSG_NO = ' '
** PARAMETER = ' '
** ROW = 0
** FIELD = ' '
** IMPORTING
** RETURN = gt_return.
** APPEND gt_return TO ex_messages.
** RAISE error_messages..
**ENDIF.
***********Release Date Validation by Freddie*************
* break freddie.
** DATA : it_eban TYPE TABLE OF eban WITH HEADER LINE,
** messages TYPE bapiret2.
** it_eban[] = im_t_eban[].
** READ TABLE it_eban INDEX 1.
**
** IF it_eban-frgdt < sy-datum.
** CLEAR : messages.
** CALL FUNCTION 'BALW_BAPIRETURN_GET2'
** EXPORTING
** type = 'E'
** cl = 'ZFM_MSG'
** number = '043'
** par1 = ' '
** par2 = ' '
** par3 = ' '
** par4 = ' '
** IMPORTING
** return = messages.
** APPEND messages TO ex_messages.
** RAISE error_messages.
** EXIT.
**
** MESSAGE 'Release Date cannot be before system date.' TYPE 'E'.
** ENDIF.
***********Release Date Validation by chetan sharma *************
*break chetans.
*DATA : it_eban TYPE TABLE OF eban WITH HEADER LINE,
* messages TYPE bapiret2.
*it_eban[] = im_t_eban[].
*READ TABLE it_eban INDEX 1.
*
*IF it_eban-frgdt < sy-datum.
* CLEAR : messages.
*
* CALL FUNCTION 'BALW_BAPIRETURN_GET2'
* EXPORTING
* type = 'E'
* cl = 'ZCS_MSG'
* number = '042'
* par1 = ' '
* par2 = ' '
* par3 = ' '
* par4 = ' '
* IMPORTING
* return = messages.
* APPEND messages TO ex_messages.
* RAISE error_messages.
* EXIT.
*
* MESSAGE 'Release Date cannot be before system date.' TYPE 'E'.
*
*ENDIF.
Comments
Post a Comment