Yeah we can use the same notes, but you need to have some code written in user exit include.
follow this. - you can send me your email i will send you the document.
Implementing the characteristics descriptions in MC94.
- Use the user exit: MCP20004 – activate the exit by crating the project.
- Create a z* module pool program
- Copy the corresponding screens from program: SAPMMCP6 – modify the screen by adding the input fields just beside the regular field where we are expecting descriptions with output type only.
- The write the appropriate logic to call the z* program and screen in user exit like
****&---------------------------------------------------------------------*
****& Include ZXSOPU04
****&---------------------------------------------------------------------*
***
e_strat = i_strat.
CLEAR sy-subrc.
***
TABLES: s774,
s774e,
mcdynum.
DATA: short_text(40),
long_text(40),
hlp_index TYPE i,
hlp_screenfield(13),
con_sum_plobj(10) VALUE 'SUMMEN',
con_keyfigure_screen(4) VALUE '1000',
*con_mat_txt_screen(4) VALUE '0100',
con_prodcat_screen(4) VALUE '7039',
con_prodline_screen(4) VALUE '7040',
con_prodhier1_screen(4) VALUE '7041',
con_matnr_screen(4) VALUE '7042',
con_version_screen(4) VALUE '1020',
*Maheshg
con_initial_screen(4) VALUE '1002',
lv_char TYPE prodh_d,
lv_matdesc TYPE maktx,
lv_prodcat_desc TYPE bezei40,
lv_prodline_desc TYPE bezei40,
lv_prodhier_desc TYPE bezei40,
BEGIN OF screens_for_display OCCURS 0,
fieldname(10),
screenfield(10),
END OF screens_for_display.
*field-symbols: .
* in every case:
e_strat = i_strat.
CASE i_sav_t445a-gstru.
* which info structure ?
WHEN 'S774'.
* check the planning types
CHECK i_sav_t445p-sctyp = '~1S774' OR
i_sav_t445p-sctyp = 'ZS774-FCRS1'.
* collect the screens for display
* (the user settings were read by the standard)
SELECT * FROM mcdynum WHERE
progname = 'SAPMMCP6' AND
tabname = 'S774'.
screens_for_display-fieldname = mcdynum-fieldname.
CASE mcdynum-dynnr.
WHEN i_strat-dynp1.
screens_for_display-screenfield = '1'.
APPEND screens_for_display.
WHEN i_strat-dynp2.
screens_for_display-screenfield = '2'.
APPEND screens_for_display.
WHEN i_strat-dynp3.
screens_for_display-screenfield = '3'.
APPEND screens_for_display.
WHEN i_strat-dynp4.
screens_for_display-screenfield = '4'.
APPEND screens_for_display.
WHEN i_strat-dynp5.
screens_for_display-screenfield = '5'.
APPEND screens_for_display.
WHEN i_strat-dynp6.
screens_for_display-screenfield = '6'.
APPEND screens_for_display.
ENDCASE.
ENDSELECT.
* initialize the include dynpros
PERFORM initialize_dynpros_s774 IN PROGRAM zstfhead.
* get the characteristic values
CLEAR: s774, s774e.
IF i_strat-akt_plobj = con_sum_plobj OR i_strat-kennz = 'X'.
* get the characteristic values of the aggregated information
PERFORM get_sxyz_value IN PROGRAM mmcp6774
CHANGING s774.
MOVE-CORRESPONDING s774 TO s774e.
ELSE.
* get the characteristic values of the detailed information
SELECT SINGLE * FROM s774e WHERE plobj = i_strat-akt_plobj.
CHECK sy-subrc = 0.
ENDIF.
* set the information of the description fields
*product category
IF s774e-prod_cat <> space.
MOVE s774e-prod_cat TO lv_char.
PERFORM char_desc IN PROGRAM zstfhead
USING lv_char
CHANGING lv_prodcat_desc.
CLEAR lv_char.
ENDIF.
*product line
IF s774e-prod_line IS NOT INITIAL."<> space.
MOVE s774e-prod_line TO lv_char.
PERFORM char_desc IN PROGRAM zstfhead
USING lv_char
CHANGING lv_prodline_desc.
CLEAR lv_char.
ENDIF.
*product hierarchy
IF s774e-prod_hier1 IS NOT INITIAL. "<> space.
MOVE s774e-prod_hier1 TO lv_char.
PERFORM char_desc IN PROGRAM zstfhead
USING lv_char
CHANGING lv_prodhier_desc.
CLEAR lv_char.
ENDIF.
**
* here: material short text:
IF s774e-matnr IS NOT INITIAL. "<> space.
* get the material short text
PERFORM mat_desc IN PROGRAM zstfhead
USING s774e-matnr
CHANGING lv_matdesc.
ELSE.
* no material short text is to be filled
ENDIF.
* set the characteristic values into the screens
LOOP AT screens_for_display.
hlp_screenfield = 'E_STRAT-DYNP'.
hlp_screenfield+12 = screens_for_display-screenfield.
*assign (hlp_screenfield) to .
CASE screens_for_display-fieldname.
WHEN 'PROD_CAT' . "product category
PERFORM fill_dynpro IN PROGRAM zstfhead
USING con_prodcat_screen
s774e-prod_cat
lv_prodcat_desc.
WHEN 'PROD_LINE' . "product line
PERFORM fill_dynpro IN PROGRAM zstfhead
USING con_prodline_screen
s774e-prod_line
lv_prodline_desc.
WHEN 'PROD_HIER1' . "product hierarchy
PERFORM fill_dynpro IN PROGRAM zstfhead
USING con_prodhier1_screen
s774e-prod_hier1
lv_prodhier_desc.
WHEN 'MATNR' . "material number
* con_matnr_screen.
PERFORM fill_dynpro IN PROGRAM zstfhead
USING con_matnr_screen
s774e-matnr
lv_matdesc.
ENDCASE.
ENDLOOP.
IF i_strat-kennz = 'X'.
* the key figure format is active
* ==> fill the dynpro with the key figure text
e_strat-dynp7 = con_keyfigure_screen.
PERFORM fill_dynpro IN PROGRAM zstfhead
USING '1020'
i_rmcp2-krit3
lv_matdesc.
ENDIF.
* set the dynpro prog
*maheshg
* e_strat-dynp_prog = 'SAPMMCP6'. "ZSTFHEAD'.
e_strat-dynp_prog = 'ZSTFHEAD'.
* fill in every case the version and its texts
e_strat-dynp8 = con_version_screen.
PERFORM fill_version_and_vtext IN PROGRAM zstfhead
USING i_rmcp2-vrsio
i_rmcp2-vetxt
i_rmcp2-avtxt.
WHEN OTHERS.
ENDCASE.
- Write subroutines to populate the characteristics as well descriptions like MATNR, PROD_LINE,PROD_CAT and PROD_HIER for S774
Program: ZFHEADF00
*&---------------------------------------------------------------------*
*& Include ZFHEADF00
*&---------------------------------------------------------------------*
*----------------------------------------------------------------------*
*&---------------------------------------------------------------------*
*& Module PROCESS_BEFORE OUTPUT
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
FORM fill_dynpro
USING fd_dynnr
fd_value
lv_desc.
CASE fd_dynnr.
*when '0100'.
*hlp_matnr_txt = fd_value.
WHEN '7042'.
*s774-matnr = fd_value.
makt-maktx = lv_desc.
WHEN '7039'.
*s774-prod_cat = fd_value.
hlp_prodcat_txt = lv_desc.
WHEN '7040'.
*s774-prod_line = fd_value.
hlp_prodline_txt = lv_desc.
WHEN '7041'.
*s774-prod_hier1 = fd_value.
hlp_prodhier_txt = lv_desc.
WHEN '1020'.
rmcp2-krit3 = fd_value.
ENDCASE.
ENDFORM. " FILL_DYNPRO
*&---------------------------------------------------------------------
*& Form INITIALIZE_DYNPROS_S712
*&---------------------------------------------------------------------
* initialize all fields of all dynpros *
*----------------------------------------------------------------------
*----------------------------------------------------------------------
FORM initialize_dynpros_s774.
CLEAR: s774,
rmcp2,
hlp_matnr_txt.
ENDFORM. " INITIALIZE_DYNPROS_S774
*&---------------------------------------------------------------------
*& Form FILL_VERSION_AND_VTEXT
*&---------------------------------------------------------------------
* text
*----------------------------------------------------------------------
* --> vrsio version number
* --> vetxt text of the version
* --> avtxt active version / inactive version
*----------------------------------------------------------------------
FORM fill_version_and_vtext
USING vrsio
vetxt
avtxt.
rmcp2-vrsia = vrsio.
rmcp2-vetxt = vetxt.
rmcp2-avtxt = avtxt.
ENDFORM. " FILL_VERSION_AND_VTEXT
form mat_desc
using i_matnr type matnr
CHANGING lv_desc type maktx.
select single maktx from makt into lv_desc where matnr = i_matnr.
if sy-subrc <> 0.
clear lv_desc.
endif.
ENDFORM.
form char_desc
using i_char type PRODH_D
CHANGING lv_chardesc type BEZEI40.
select single vtext from t179t into lv_chardesc where prodh = i_char.
if sy-subrc <> 0.
clear lv_chardesc.
endif.
ENDFORM.
Program: ZFHEADTOP
*&---------------------------------------------------------------------*
*& Include ZFHEADTOP
*&---------------------------------------------------------------------*
TABLES: RMCP2,
S774,
*S774,
MAKT.
data: hlp_matnr_txt(40),
hlp_prodcat_txt(40),
hlp_prodline_txt(40),
hlp_prodhier_txt(40).