Académique Documents
Professionnel Documents
Culture Documents
[http://4.bp.blogspot.com/-Tj5JftmShx4/U6LjYZybJ8I/AAAAAAAAJZk/3JiGKj0Ba8U/s1600/1.JPG]
[http://1.bp.blogspot.com/-OFcoVxQDNh4/U6LjaXcvomI/AAAAAAAAJag/uumw2NTDnSQ/s1600/2.JPG]
Step3. Provide the cost center and Material number, quantity, plant and storage location. It signifies that this plant needs
material for the Maintenance activity.
[http://1.bp.blogspot.com/-_OB02E6un6M/U6Ljaj8mz4I/AAAAAAAAJaQ/HJpg3SRrjzM/s1600/3.JPG]
[http://2.bp.blogspot.com/-5s2mosQHoCg/U6Ljb1FKy2I/AAAAAAAAJaY/7TCPgkOPGYA/s1600/4.JPG]
[http://1.bp.blogspot.com/-tFcvvhoFsC8/U6Ljc_WXDZI/AAAAAAAAJao/SSG-GO2pevI/s1600/5.JPG]
[http://1.bp.blogspot.com/-fYjMV2XQcfo/U6LjdLSPiSI/AAAAAAAAJa0/yU77cdjkduo/s1600/6.JPG]
Step7. Then the User Run the Tx: ME51N to cretae a purchase requisition for the required material quantity .
[http://4.bp.blogspot.com/-zEeiJci7LZE/U6LjdgYzybI/AAAAAAAAJbY/1ij7E0pZoPM/s1600/7.JPG]
Step8. Pur Req- Doc type is NB. Provides the material number and quantity and creates a purchase requisition.
[http://1.bp.blogspot.com/-qfla2Em1FRw/U6Ljd1fXapI/AAAAAAAAJbQ/QXUyfBkldzI/s1600/8.JPG]
Step9. The below Pur Requisition is generated which can be displayed in ME53N.
[http://4.bp.blogspot.com/-wJoYtoVIBVI/U6LjedkBMoI/AAAAAAAAJbM/5wAkRqep8vc/s1600/9.JPG]
Step10. Lets Automate the process by Using BAPI fm. The Bapi: BAPI_PR_CRETAE can be used to create the bapi in
background.
[http://3.bp.blogspot.com/--YyY7zVTTZ4/U6LjYh0FQYI/AAAAAAAAJbI/q6lFA3eseuc/s1600/11.JPG]
[http://4.bp.blogspot.com/-spIGor3hy9w/U6LjYsH_uWI/AAAAAAAAJaA/xnsorkdce4w/s1600/10.JPG]
_________________________________________________________________________________
Step12. Below report creates the Purchase requisition for the selected Reservation.
REPORT zres_pr_create MESSAGE-ID ZPR_CRT.
TYPE-POOLS : slis.
DATA :
lt_resb TYPE TABLE OF resb.
START-OF-SELECTION.
SELECT * FROM resb INTO TABLE lt_resb WHERE bdter = sy-datum. " Get all reservation
" created on the current date
SORT lt_resb BY rsnum rspos.
END-OF-SELECTION.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program
= sy-cprog
i_callback_pf_status_set = 'FM_STATUS'
i_callback_user_command = 'CRT_PR'
i_structure_name
= 'RESB'
i_grid_title
= 'Showing Todays Material Reservation'
TABLES
t_outtab
= lt_resb.
*&---------------------------------------------------------------------*
*&
Form FM_status
*&---------------------------------------------------------------------*
*
text
*----------------------------------------------------------------------*
FORM fm_status USING rt_extab TYPE slis_t_extab.
SET PF-STATUS 'STATUS_PR' EXCLUDING rt_extab. " Create Pf status for appl toolbar Button
ENDFORM.
"fm_status
*&---------------------------------------------------------------------*
*&
Form crt_pr
*&---------------------------------------------------------------------*
*
text
*----------------------------------------------------------------------*
*
-->R_UCOMM
text
*
-->RS_SELFIELD text
*----------------------------------------------------------------------*
FORM crt_pr USING r_ucomm LIKE sy-ucomm
rs_selfield TYPE slis_selfield.
DATA : it_resb TYPE TABLE OF resb,
ls_resb TYPE resb,
pos
TYPE rspos .
DATA : ls_hdr
TYPE bapimereqheader,
ls_hdr_x
TYPE bapimereqheaderx,
pr_num
TYPE bapimereqheader-preq_no,
t_ret
TYPE TABLE OF bapiret2,
s_ret
TYPE bapiret2,
t_pritm
TYPE TABLE OF bapimereqitemimp,
s_pritm
TYPE bapimereqitemimp,
t_pritmx
TYPE TABLE OF bapimereqitemx,
s_pritmx
TYPE bapimereqitemx.
IF rs_selfield-sel_tab_field = '1-RSNUM'. " CHeck if the User Single-click on the Reservation No.
LOOP AT lt_resb INTO ls_resb WHERE rsnum = rs_selfield-value . " Read the Reservation Value
APPEND ls_resb TO it_resb.
CLEAR ls_resb.
ENDLOOP.
** The Reservation Records are Ready in the Internal Table it_resb**
** FILL Header ****
ls_hdr-pr_type = 'NB'. " Pur Requisition Document type
ls_hdr_x-pr_type = 'X'.
****fill item***
LOOP AT it_resb INTO ls_resb .
pos
= 10 + ls_resb-rspos - 1.
s_pritm-preq_item
= pos.
s_pritm-pur_group
= '011'.
" pur group
_________________________________________________________________________________
Step13. Create the PF status with below application tool bar Button.
[http://1.bp.blogspot.com/-XvOPCHEhYwA/U6LjZJf0PGI/AAAAAAAAJbE/sZlOUTylvY8/s1600/12.JPG]
Step14. Run the report and we can see all the Reservations created for the current date.
[http://2.bp.blogspot.com/-YT3pNTCdSVQ/U6LjZZtd7aI/AAAAAAAAJaw/A2IGbbZ8k-Q/s1600/13.JPG]
Step15. Select any one and click on the Button Cretae Pur Requisition.
[http://4.bp.blogspot.com/-TU6fUZb7WRU/U6LjZhToi2I/AAAAAAAAJaI/s0U7w4P42TA/s1600/14.JPG]
Step16. The BAPI is executed and the Pur Req. is generated which can be viewed in Tx- ME53N.
[http://2.bp.blogspot.com/-yW4R5zdwyVY/U6LjaDwD2aI/AAAAAAAAJbU/KwJlJP0KycA/s1600/15.JPG]
_________________________________________________________________________________
Posted 19th June 2014 by S Prasad
0
View comments
No comments yet
Add a comment