PP - User-exit for planned order

SAP 2010. 7. 21. 17:08 Posted by KindKay

User-exit for planned order  
Posted: Sep 24, 2008 4:48 AM
     
Hi,

Is there any user-exit or BADI for planned order to check the components used in planned order. In our system, user can create the planned order manually through MD11 and change the components, we need to verify the components meet certain conditions/criteria.

I did some research but could not find any user-exit for planned order. According to me, as planned order is only for planning purpose, SAP has not given any provisions for user-exits. Hence posting the query to the group.

Regards,


Hi,

As per my knowledge there is no user exit for planned order.

However you can try with following user exit :

Enhancement : PPCO0023

Function Module : EXIT_SAPLCOMK_014 which checks changes for components in order

INCLUDE ZXCO1U23

Hope it may work for you.

Regards,
Tejas



Hi,

You can try the following BAdIs:

You can use the Business Add-In (BAdI) MD_PLDORD_CHANGE to change, before posting, data from planned orders, which have been created, changed, or deleted as a result of planning a material or manual processing.

The Business Add-In allows you to fill and change fields from planned orders in the PLAF table. It also supports filling of customer-specific fields in the customer include CI_PLAFDB.

You can execute the Business Add-In in the planning run in the following areas:

Material requirements planning
Master production planning
Long-term planning
You can also carry out the Business Add-In in all applications, which execute manual planned order changes. Examples of this kind of application are:

The dialog transactions for creating and changing planned orders (MD11, MD12, MS11, MS12)
The Business Application Programming Interfaces (BAPI) for creating and changing planned orders

Regards,
R.Brahmankar


Thanks Brahmankar.

This BADI should help me in ECC 6.0. Our current version is 4.6c and we will have to wait until we upgrade to be able to use this BADI. But thanks for providing the solution.


출처: http://forums.sdn.sap.com/thread.jspa?threadID=1059414

'SAP' 카테고리의 다른 글

Frequently Used Tables  (1) 2010.09.20
MM - PR User-exit  (3) 2010.09.13
MKAL - Production Versions of Material  (1) 2010.07.15
PP - SR_PP.pdf  (1) 2010.07.15
MTO (Make To Order)  (0) 2010.07.07

cx_root - Division by zero

SAP/ABAP 개발 2010. 7. 21. 14:07 Posted by KindKay

  *&-----------------------------------------------------------*
*& Report  YRTEST0037
*&
*&----------------------------------------------------------*
*&
*&
*&-----------------------------------------------------------*

report  yrtest0037.

  data: lv_msg  type bapi_msg,
        lr_root type ref to cx_root,
        l       type i.


*------------------------------------------------------------*
end-of-selection.
*--------------------------------------------------------------*
   l = 10.

  try.
    l = l / 0.
  catch cx_root into lr_root.
    lv_msg = lr_root->get_text( ) .
    write: lv_msg.
  endtry.

Message Class 조회

SAP/ABAP 개발 2010. 7. 21. 10:30 Posted by KindKay


report yrtest0035.

  include yrtest0035top.
  include yrtest0035f01.



*-----------------------------------------------------------------*
initialization.
*-----------------------------------------------------------------*
  if s_arbgb[] is initial.
    mac_add_range s_arbgb 'I' 'CP' 'Z*' ''.
  endif.


*-----------------------------------------------------------------*
start-of-selection.
*-----------------------------------------------------------------*
  perform select_data.


*-----------------------------------------------------------------*
end-of-selection.
*-----------------------------------------------------------------*
  call method zcl_ppz_msg_util=>msg_data_found( it_table = gt_itab[] ).
  check gt_itab[] is not initial.

  perform get_event_list using gt_events 0.
  perform set_event.
  perform set_layout.
  perform set_fieldcat.
  perform display_alv.
 



*&-----------------------------------------------------------------
*& Include YRTEST0035TOP
*& User    A539
*& Date    2010.07.21
*&-----------------------------------------------------------------


*-----------------------------------------------------------------*
* type
*-----------------------------------------------------------------*
  type-pools: slis.


*----------------------------------------------------------------*
* table
*----------------------------------------------------------------*
  tables: t100a,    "T100에 대한 메세지 ID
          rsdag.

*--------------------------------------------------------------*
* internal table
*--------------------------------------------------------------*
  data: begin of gt_itab occurs 0.
          include structure t100a.
  data: end of gt_itab.

  data: itab like table of bdcmsgcoll with header line.


*--------------------------------------------------------------*
* BDC
*------------------------------------------------------------*
  data: gt_bdcdata like bdcdata    occurs with header line,
        gt_messtab like bdcmsgcoll occurs with header line,
        gs_options like ctu_params.


*----------------------------------------------------------*
* data
*--------------------------------------------------------------*
  data: gt_lvc_fcat type lvc_t_fcat,
        gs_lvc_layo type lvc_s_layo,
        gs_layout   type slis_layout_alv.

  data: gt_events type slis_t_event.

  data: gt_slis_t_fieldcat_alv type slis_t_fieldcat_alv,
        gs_slis_fieldcat_alv   type slis_fieldcat_alv.


*-------------------------------------------------------------*
* macro
*-------------------------------------------------------------*
* macro for filling select-option
  define mac_add_range.
    clear: &1.
    &1-sign    = &2.
    &1-option  = &3.
    &1-low     = &4.
    &1-high    = &5.
    append &1.
  end-of-definition.



*&-------------------------------------------------------------*
*&  Include           YRTEST00001_SEL
*&-------------------------------------------------------------*

  selection-screen begin of block b1 with frame title text-001.

    select-options: s_arbgb for t100a-arbgb.

  selection-screen end of block b1.
 



*&----------------------------------------------------------
*& Include YRTEST0035F01
*& User    A539
*& Date    2010.07.21
*&-------------------------------------------------------------

*&-------------------------------------------------------------*
*&      Form  DISPLAY_ALV
*&--------------------------------------------------------------*
*       text
*---------------------------------------------------------------*
form display_alv .

  call function 'REUSE_ALV_GRID_DISPLAY'
    exporting
      i_callback_program       = sy-cprog
      it_fieldcat              = gt_slis_t_fieldcat_alv
      is_layout                = gs_layout
      i_default                = 'X'
      i_save                   = 'A'
      it_events                = gt_events
    tables
      t_outtab                 = gt_itab.

endform.                    " DISPLAY_ALV



*&--------------------------------------------------------------*
*&      Form  SET_FIELDCAT
*&---------------------------------------------------------------*
*       text
*----------------------------------------------------------------*
form set_fieldcat .

  call function 'REUSE_ALV_FIELDCATALOG_MERGE'
    exporting
      i_program_name         = sy-repid
      i_internal_tabname     = 'GT_ITAB'
      i_inclname             = sy-repid
    changing
      ct_fieldcat            = gt_slis_t_fieldcat_alv
    exceptions
      inconsistent_interface = 1
      program_error          = 2
      others                 3.

  loop at gt_slis_t_fieldcat_alv into gs_slis_fieldcat_alv.
    case gs_slis_fieldcat_alv-fieldname.
      when 'ARBGB'.
*        gs_slis_fieldcat_alv-hotspot = 'X'.
        gs_slis_fieldcat_alv-seltext_l = 'Message Class'.
        gs_slis_fieldcat_alv-seltext_m = 'Message Class'.
        modify gt_slis_t_fieldcat_alv from gs_slis_fieldcat_alv.
    endcase.
  endloop.

endform.                    " SET_FIELDCAT



*&-------------------------------------------------------------*
*&      Form  SELECT_DATA
*&---------------------------------------------------------------*
*       text
*----------------------------------------------------------------*
form select_data .

  select *
    into corresponding fields of table gt_itab
    from t100a
   where arbgb in s_arbgb.

  sort gt_itab by arbgb.

  read table gt_itab index transporting no fields.

endform.                    " SELECT_DATA



*&-------------------------------------------------------------*
*&      Form  SET_EVENT
*&--------------------------------------------------------------*
*       text
*-------------------------------------------------------------*
form set_event .

  data: ls_event type slis_alv_event.

* - FORM USER_COMMAND
  read table gt_events with key name = slis_ev_user_command
                       into ls_event.
  if sy-subrc eq 0.
    move   'USER_COMMAND' to ls_event-form.
    modify gt_events index sy-tabix from ls_event.
  endif.

endform.                    " SET_EVENT



*&------------------------------------------------------------------*
*&      Form  USER_COMMAND
*&------------------------------------------------------------------*
*       ##(REUSE_ALV_EVENTS_GET)## CALL# FORM ###.
*-------------------------------------------------------------------*
form user_command using  p_ucomm    like sy-ucomm
                         p_selfield type slis_selfield.

  case p_ucomm.
    when '&IC1'.
      read table gt_itab index p_selfield-tabindex.
      set parameter id 'MAG' field gt_itab-arbgb.
      call transaction 'SE91' and skip first screen.

*      perform call_transaction.
  endcase.

endform.                    "USER_COMMAND



*&-----------------------------------------------------------*
*&      FORM  EVENTTAB_BUILD
*&--------------------------------------------------------------*
form get_event_list using  p_events   type slis_t_event
                           p_alv_type type slis_list_type.

  call function 'REUSE_ALV_EVENTS_GET'
    exporting
      i_list_type = p_alv_type
    importing
      et_events   = p_events.

endform.                    " EVENTTAB_BUILD



*&-----------------------------------------------------------*
*&      Form  SET_LAYOUT
*&------------------------------------------------------------*
*       text
*--------------------------------------------------------------*
form set_layout .

  clear: gs_layout.
  gs_layout-zebra = 'X'.

endform.                    " SET_LAYOUT



*&------------------------------------------------------------*
*&      Form  CALL_TRANSACTION
*&--------------------------------------------------------------*
*       text
*--------------------------------------------------------------*
form call_transaction .

  clear: gs_options, gt_bdcdata[].
  gs_options-dismode = 'E'.
  gs_options-updmode = 'A'.

  perform bdc_dynpro using  'SAPLWBMESSAGES' '0100'.
  perform bdc_field  using  'BDC_CURSOR'     'RSDAG-ARBGB'.
  perform bdc_field  using  'BDC_OKCODE'     '=WB_DISPLAY'.
  perform bdc_field  using  'RSDAG-ARBGB'    gt_itab-arbgb.

  call transaction 'SE91'   using gt_bdcdata
                     options from gs_options
                    messages into gt_messtab.

endform.                    " CALL_TRANSACTION



*&----------------------------------------------------------*
*&      Form  bdc_DYNPRO
*&--------------------------------------------------------------*
*       text
*---------------------------------------------------------------*
form bdc_dynpro using   program dynpro.

  clear: gt_bdcdata.

  gt_bdcdata-program  = program.
  gt_bdcdata-dynpro   = dynpro.
  gt_bdcdata-dynbegin = 'X'.

  append gt_bdcdata.

endform.                    " bdc_DYNPRO



*&-----------------------------------------------------------*
*&      Form  bdc_FIELD
*&------------------------------------------------------------*
*       text
*------------------------------------------------------------*
form bdc_field using fnam fval.

  clear: gt_bdcdata.

  gt_bdcdata-fnam = fnam.
  gt_bdcdata-fval = fval.

  append gt_bdcdata.

endform.                    " bdc_FIELD