cancel
Showing results for 
Search instead for 
Did you mean: 

EWM : Adding new field to the field catalog in Handling units customizing

k_sood
Active Participant
0 Kudos

Hi All,

I have added a new field in the customizing spro -> scm Extended Warehouse Management -> Extended Warehouse management -> Cross process settings -> Handling units ->Basics -> Print -> create Field Catalog . as follows :

Field Type : I

Implementation type : 1 i.e. Default Implementation

Field name : PHU_VSBED

Virtual :C

Selection Type : B

Data element : /SCWM/VSBED

1. If I give implementation type empty i.e. badi implementation, then while maintaining the condition records in transaction

/SCWM/PRHU6 , as soon as warehouse number is selected, it dumps at some conversion routine ? Most of the existing fields in the catalog are having 2 as the implementation type , description of which is default attribute conversion. I have not tried so far 2 as the implementation type . If I give the implementation type as 1 , then in the transaction /SCWM/VASEXEC during printing the maintained condition record was not selected. what should be the correct value of the implementation type ?

2. The data element was existing for the field vsbed so I given the field name also with prefix PHU , as like the existing fields in the catalog. Is this fine or should I have the field with a z prefix ?

3. other than adding field in the field catalog in this customizing , is there any thing else which needs to be done ?

Thanks

Ketan

0 Kudos

Hi Ketan,

I have same requirement. When i try to add it gives me warning message " entry is in SAP name space". If i ignore, as a next step it asks for transport with SAP package.

I would like to understand , how it allowed you to add a new field to field catalog.

Also, how to get the field name and data element. Let say , if i have to add "shipping condition" field , May i know how to find field name and data element.

Looking forward for your reply. Thank you !!

Accepted Solutions (1)

Accepted Solutions (1)

k_sood
Active Participant
0 Kudos

Implemented Badi /SCWM/EX_PRNT_CCAT_HU . The newly added Catalog field has to be filled in this Badi .

 METHOD /scwm/if_ex_prnt_ccat_hu~change.
    DATA: lo_context         TYPE REF TO /scwm/cl_hu_cxt_ppf.
    DATA: lo_ao_hu           TYPE REF TO /scwm/cl_hu_ppf.
    DATA: lv_huident         TYPE /scwm/de_huident.
    DATA: lv_ttype           TYPE ppfdtt.
    DATA : lv_vsbed          TYPE /scwm/vsbed.
    FIELD-SYMBOLS : <request> TYPE /sapcnd/det_request .
    FIELD-SYMBOLS : <item_attr> TYPE /sapcnd/det_attrib_value .
    DATA: ls_item_attr TYPE /sapcnd/det_attrib_value .
    DATA:  ls_attribute       TYPE /sapcnd/det_attrib_value.
    DATA:      lt_huref             TYPE /scwm/tt_huref_int.
    DATA: ls_item TYPE /scdl/db_proci_o.
    DATA : ls_vbfa TYPE vbfa,
           ls_likp TYPE likp.
    DATA : lf_vsbed TYPE vsbed.

* Get context class (/SCWM/CL_HU_CXT_PPF)
    lo_context ?= io_context_hu.
* Get persistent data
    lo_ao_hu ?= io_context_hu->appl. "ref to object -> /scwm/cl_hu_ppf
    lv_huident = lo_ao_hu->get_huident( ).
*    lv_ttype = lo_ao_hu->get_ttype( ).
*
*    if lv_ttype eq 'ZELW/HU_CHPOST'.
*
*
*    endif.
*read table ct_request-ITEM_ATTRIBUTES ASSIGNING  <t_item_fields>  index 1 .
    "read the HU and the content
    CALL FUNCTION '/SCWM/HU_READ'
      EXPORTING
        iv_appl    = wmegc_huappl_wme " Constant value WME
        iv_lgnum   = iv_lgnum
        iv_huident = lv_huident
      IMPORTING
*       es_huhdr   = ls_huhdr
*       et_huhdr   = lt_huhdr
*       et_hutree  = lt_hutree
*       et_ident   = lt_ident
        et_huref   = lt_huref
*       et_huitm   = lt_huitm
      EXCEPTIONS
        deleted    = 1
        not_found  = 2
        error      = 3
        OTHERS     = 4.
    LOOP AT lt_huref ASSIGNING FIELD-SYMBOL(<ls_huref>).
      EXIT.
    ENDLOOP.
    IF <ls_huref> IS ASSIGNED.
*  read the ref document number and item number from the table /scdl/db_proci_o using the huref docid.
      SELECT SINGLE * FROM /scdl/db_proci_o INTO ls_item
      WHERE docid = <ls_huref>-docid AND itemcat = 'DLV'.
      IF sy-subrc EQ 0 AND ls_item-refitemno_so IS NOT INITIAL AND ls_item-refdocno_so IS NOT INITIAL.            "AND ls_item-service_level IS NOT INITIAL.
*  read follow on document from vbfa.
        SELECT SINGLE * FROM vbfa INTO ls_vbfa WHERE vbelv = ls_item-refdocno_so AND posnv = ls_item-refitemno_so AND vbtyp_n = 'J' .
        IF ls_vbfa IS NOT INITIAL.
*  read vsbed from likp using the follow on document.
          SELECT SINGLE * FROM likp INTO ls_likp WHERE vbeln = ls_vbfa-vbeln.
          IF ls_likp-vsart IS NOT INITIAL.
            lf_vsbed = ls_likp-vsart.
          ELSE.
            lf_vsbed =  ls_likp-vsbed.
          ENDIF.
*   If vsbed is available fill the search attribute  with this vsbed.
          IF lf_vsbed IS NOT INITIAL.
            LOOP AT ct_request ASSIGNING <request>.
              LOOP AT <request>-item_attributes ASSIGNING <item_attr>.
                IF <item_attr>-fieldname EQ 'PHU_VSBED'.
                  DELETE TABLE <request>-item_attributes FROM <item_attr>.
                  ls_attribute-fieldname = 'PHU_VSBED'.
                  ls_attribute-value = lf_vsbed.
                  INSERT ls_attribute INTO TABLE <request>-item_attributes .
                  EXIT .
                ENDIF.
              ENDLOOP.
            ENDLOOP.
          ENDIF.
        ENDIF.
      ENDIF.
    ENDIF.
  ENDMETHOD.
Ajit_Routray
Active Contributor

Hi k_sood

It would be really helpful for Community.

Thank you for sharing the code solution!

Kind Regards,

Ajit


Answers (0)