Step1: Open T-code SPRO and follow below steps
Step2: Create the function group
Step3: Create the subscreen which to be enhanced.
Screen0001: subscreen to be enhanced in Basic data(MM)
Screen0002: subscreen to be enhanced in MRP1(MM)
Step4:
Now goto SPRO transaction and add screen sequence by
following below steps.
Go to screen sequence and click on data screens
Click on basic data and click sub screens
Add the screen 0001 for basic data enhancement as shown and
click save.
Proceed same steps for enhancing MRP screen (0002
subscreen).
Added sub screen in MM Basic data.
Added sub screen in MM MRP view.
Updating
custom screen fields into database:
Step5: Get the old structure values from Sap memory by
using the function modules MARA_GET_SUB and MARC_GET_SUB and MAKT_GET_SUB..
CALL FUNCTION 'MARA_GET_SUB'
IMPORTING
WMARA = <gfs_mara>
*XMARA =
*YMARA =
.
IMPORTING
WMARA = <gfs_mara>
*XMARA =
*YMARA =
.
CALL FUNCTION 'MARC_GET_SUB'
IMPORTING
WMARC = <gfs_marc>
*XMARC =
*YMARC =
.
IMPORTING
WMARC = <gfs_marc>
*XMARC =
*YMARC =
.
CALL FUNCTION 'MAKT_GET_SUB'
IMPORTING
WMAKT = <gfs_makt>
*XMAKT =
*YMAKT =
.
IMPORTING
WMAKT = <gfs_makt>
*XMAKT =
*YMAKT =
.
Step3: when save button clicked write the logic in PAI
module of custom screen to Update old structure with screen variable values to
corresponding structure of material
master.
Step4: Update the new structures to sap material master new
structure by using function modules MARA_SET_SUB(for updating mara table custom
fields) MARC_SET_SUB (updating marc table fields) and MAKT_SET_SUB(updating
makt table fields).
IF sy-tcode = 'BU'.
<gfs_mara>-zdtb_global = gv_global.
<gfs_mara>-zdtb_gdate = gv_gdate.
<gfs_marc>-zdtb_local = gv_local.
<gfs_marc>-zdtb_ldate = gv_ldate.
<gfs_mara>-zdtb_global = gv_global.
<gfs_mara>-zdtb_gdate = gv_gdate.
<gfs_marc>-zdtb_local = gv_local.
<gfs_marc>-zdtb_ldate = gv_ldate.
CALL FUNCTION 'MARA_SET_SUB'
EXPORTING
wmara = <gfs_mara>.
CALL FUNCTION 'MARC_SET_SUB'
EXPORTING
wmarc = <gfs_marc>.
CALL FUNCTION 'MAKT_SET_SUB'
EXPORTING
wmakt = <gfs_makt>.
ENDIF.
EXPORTING
wmakt = <gfs_makt>.
ENDIF.
And sap in standard program flow it will checks the old
structure with the new structure wmara,wmarc and wmakt which will responsible
in finding the change in the structures so if any change then it will update
the standard table field values.
Testcase:
Click save (ctrl +s)after
entering the values.
It will updates the
corresponding material master table custom field.
No comments:
Post a Comment