Skip to Content

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

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

Add a comment
10|10000 characters needed characters exceeded

Related questions

1 Answer

  • Best Answer
    Posted on Jul 15, 2020 at 08:57 PM

    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.
    
    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.