EWM: customer fields in ALV list "Stk Can Be Removed" in WT creation for Outboud Delivery

15 hours ago 2

I did immoderate debugging and I stock my solution. I anticipation I volition assistance somenone successful the future.

As I wrote before, ALV lists are managed by people /SCMB/CL_BASE.

At the opening the method CREATE_ALV is called wherever tract catalogue is build. Here we tin find the operation sanction wherever we request to adhd lawsuit fields:

rafal_matuszewski2_1-1732132487016.png

We tin adhd lawsuit fields to this operation utilizing append structure:

rafal_matuszewski2_2-1732132599914.png

In adjacent step, we indispensable capable this tract with data. We bash this successful method CONVERT_DATA_FOR_ALV. I created an implicit enhancement:

rafal_matuszewski2_3-1732132725937.png

The method is cosmopolitan and it works connected generic types truthful I needed to make my ain structures and usage MOVE-CORRESPONDING to transportation information from and to generic variables. We indispensable cheque the operation sanction which is successful tract MS_CREATE_DATA-ASPECT. Data for ALV is in interior array <lt_alv>. The logic of the enhancement:

DATABEGIN OF ls_zz_hlp,
        huident     TYPE /scwm/s_asp_todlv_od_avstkdlv-huident,
        zz_stack_id TYPE /scwm/s_asp_todlv_od_avstkdlv-zz_stack_id,
      END OF ls_zz_hlp.
DATAlt_zz_hlp LIKE TABLE OF ls_zz_hlp.
DATAlt_zz_huhdr LIKE TABLE OF ls_zz_hlp.

IF ms_create_data-aspect '/SCWM/S_ASP_TODLV_OD_AVSTKDLV'.

  MOVE-CORRESPONDING<lt_alv> TO lt_zz_hlp.
  IF lt_zz_hlp IS NOT INITIAL.
    SELECT huident zz_stack_id
      INTO TABLE lt_zz_huhdr
      FROM /scwm/huhdr
      FOR ALL ENTRIES IN lt_zz_hlp
      WHERE huident lt_zz_hlp-huident.
  ENDIF.

  LOOP AT <lt_alv> ASSIGNING <ls_alv>.
    MOVE-CORRESPONDING <ls_alv> TO ls_zz_hlp.
    READ TABLE lt_zz_huhdr ASSIGNING FIELD-SYMBOL(<ls_zz_huhdr>WITH KEY huident ls_zz_hlp-huident.
    IF sy-subrc 0.
      MOVE-CORRESPONDING <ls_zz_huhdr> TO <ls_alv>.
    ENDIF.
  ENDLOOP.
ENDIF.

Aa the result, we person a caller file filled with data:

rafal_matuszewski2_4-1732133124363.png

This solution volition enactment with different database similar Other Stock etc.

Read Entire Article