Geschützt: Adding new line items to an Inbound delivery (with PO reference)

Dieser Inhalt ist passwortgeschützt. Um ihn anschauen zu können, bitte das Passwort eingeben:

Geschützt: Eingehende IDoc erzeugen (Staffeln/Konditionssätze)

Dieser Inhalt ist passwortgeschützt. Um ihn anschauen zu können, bitte das Passwort eingeben:

Geschützt: Iterate field values and field names of unknown table

Dieser Inhalt ist passwortgeschützt. Um ihn anschauen zu können, bitte das Passwort eingeben:

ABAP Query – clean some output entries

END-OF-SELECTION (nach Liste):

field-symbols: <g00> type table,
               <wa_g00> type any,
               <k1> type any,
               <ks> type any.
data: it_g00 type char100 value '%G00[]',
      lv_kna1land type string,
      lv_knasland type string.
assign (it_g00) to <g00>.
if <g00> is assigned.
 loop at <g00> assigning <wa_g00>.
    lv_kna1land = '<wa_g00>-kna1-land1'.
    lv_knasland = '<wa_g00>-knas-land1'.
    unassign: <k1>, <ks>.
    assign: (lv_kna1land) to <k1>,
            (lv_knasland) to <ks>.
  if <k1> is assigned.
    if <ks> is assigned.
      if <k1> eq <ks>.
        delete <g00>.
      endif.
    endif.
  endif.
 endloop.
endif.
" END-OF-SELECTION

Geschützt: EWM/ABAP – Adjust quantity

Dieser Inhalt ist passwortgeschützt. Um ihn anschauen zu können, bitte das Passwort eingeben:

Change spool request name (ewm)

To change spool request name for printing forms (they are was set up in SPPFCADM transaction) we can add next enhancement into FM /SCWM/EXECUTE_PPF_WO_PDF (warehouse order):

ENHANCEMENT 1  Y_PPF_WO_PDF.    "active version
  field-symbols: <ft> type /scwm/tt_whohu_pdf.
  assign ('LT_WHOHU_PDF') to <ft>.
  if <ft> is assigned.
    zscwm_ex_prnt_pdf_wo=>set_whohu_ref( changing ct_whohu = <ft> ).
  endif.
  data: v_text1(10)
       ,v_text2(10)
       ,v_text3(10)
       ,v_text4(20).
    xs_output_params-reqnew   = 'X'.
    xs_output_params-reqfinal = 'X'.
    split xs_output_params-covtitle at ' ' into v_text1 v_text2 v_text3 v_text4.
    clear: xs_output_params-covtitle.
 
    case iv_form.
      when 'Y_ZAKAZ_WO_MULTIPLE'.
        xs_output_params-covtitle = v_text3 && ' - Заказ на комплектование - ' &&  v_text2.
      when 'Y_ZAKAZ__WO_HUIDENT'.
        xs_output_params-covtitle = v_text3 && ' - ЕО (Handling unit) - ' &&  v_text2.
      when 'Y_BIRKA_DETALI_UZLA'.
        xs_output_params-covtitle = v_text3 && ' - Бирка №1 - ' &&  v_text2.
      when 'Y_BIRKA_DETALI_UZLA_N0'.
        xs_output_params-covtitle = v_text3 && ' - Бирка №0 - ' &&  v_text2.
    endcase.
ENDENHANCEMENT.

For HU forms (FM /SCWM/EXECUTE_PPF_HU_PDF):

ENHANCEMENT 1  YEI_PPF_HU_PDF.    "active version
  FIELD-SYMBOLS: <ft> TYPE /scwm/tt_huhdr_int.
  ASSIGN ('IT_HUHDR') TO <ft>.
  IF <ft> IS ASSIGNED.
    yscwm_ex_prnt_pdf_hu=>set_huhdr_ref( CHANGING ct_huhdr = <ft> ).
  ENDIF.
ENDENHANCEMENT.

Geschützt: Convert spool list to internal table

Dieser Inhalt ist passwortgeschützt. Um ihn anschauen zu können, bitte das Passwort eingeben:

Rename file on Application server

form datei_umbenennen using lv_altpfad lv_neupfad type string.
  data: lv_eof_reached   type c,
        lv_buffer(20480),
        lv_buflen        type i.
 
  open dataset lv_altpfad for input in binary mode.
  if sy-subrc ne 0.
    raise open_input_file_failed.
  endif.
 
  open dataset lv_neupfad for output in binary mode.
  if sy-subrc ne 0.
    raise open_output_file_failed.
  endif.
 
  clear lv_eof_reached.
 
  do.
    clear lv_buffer.
 
    read dataset lv_altpfad
            into lv_buffer length lv_buflen.
 
    if sy-subrc = 4.
      lv_eof_reached = 'X'.
    elseif sy-subrc > 4.
      raise read_block_failed.
    endif.
 
    transfer lv_buffer to lv_neupfad
      length lv_buflen.
 
    if sy-subrc ne 0.
      raise write_block_failed.
    endif.
 
    if lv_eof_reached eq 'X'.
      exit.
    endif.
  enddo.
 
  close dataset lv_altpfad.
  close dataset lv_neupfad.
  if sy-subrc <> 0.
    raise close_output_file_failed.
  endif.
 
  delete dataset lv_altpfad.
endform.

FMs and BAPIs to create customer/vendor master

_sap

Customers:
SD_CUSTOMER_MAINTAIN_ALL – quite powerful, but has no RFC (should be wrapped for it)
BAPI_CUSTOMER_CREATEFROMDATA1 – much simple, but has RFC (a BAPI).
As an additional way – using IDocs (DEBMAS).

Vendors:
Class VMD_EI_API – methods Initialize and Maintenance
Functional group LC01.
As an additional way – IDocs (CREMAS).

On distribution – is delivery packed?

STMSIcon03 FM WS_LM_CHANGE_DLV_DISTRIB_STATE STMSIcon01

ENHANCEMENT 1  YDISTRIBUTE.
if ( sy-tcode eq 'VL06I' or sy-tcode eq 'VL06ID' ) and  ( if_d_proctype eq proctype_inbdist ).
"VL06I - do not process the enhancement if it distributes via other ways"
"proctype_inbdist - checking only inbound deliveries"
 types: begin of t_params,
  paramval like yparamconst-paramval,
 end of t_params.
 data: lt_params type standard table of t_params,
       wa_params like line of lt_params, "work area (header line)"
       is_zles type boolean.  "default abap_false."
"which delivery types for checking/processing are defined in our Z-table?"
 select paramval from yparamconst into corresponding fields of table lt_params where paramid  = 'LIEFERUNGSNUMMER'.
 if sy-subrc eq 0.
  field-symbols: <ls_lfart> type lipov.
  loop at ct_worktab assigning <ls_lfart>.
    read table lt_params with key paramval = <ls_lfart>-lfart transporting no fields.
   if sy-subrc eq 0.
    is_zles = abap_true.
"all the selected delivery [types] are in yparamconst"
   endif.
  endloop.
 if is_zles eq abap_true.
  data: lt_wahl like gs_select occurs 0 with header line,
        begin of lt_wahl2 occurs 0,
          vbeln like likp-vbeln,
          verur like likp-verur,
        end of lt_wahl2,
        l_msg type c length 50,
        ans type char1.
  field-symbols: <ls_arbeit> type lipov,
                 <ls_wahl2> like line of lt_wahl2.
  loop at ct_worktab assigning <ls_arbeit>.
    lt_wahl-vbeln = <ls_arbeit>-vbeln.
    collect lt_wahl.
  endloop.
 
  check not lt_wahl[] is initial.
  select vbeln verur from likp
               into table lt_wahl2
               for all entries in lt_wahl
               where vbeln eq lt_wahl-vbeln.
"in addition we checking if the field External ID isn't empty"
  loop at lt_wahl2 transporting no fields
    where verur eq space.
  endloop.
 
  if sy-subrc eq 0.
   message s000(Y_YSD) into l_msg.
   call function 'POPUP_TO_CONFIRM'
    exporting
      titlebar       = 'Confirm'
      text_question  = l_msg
      text_button_1  = 'Yes'
      text_button_2  = 'No'
      display_cancel_button = ''
      default_button = '2'
    importing
      answer         = ans.
   if ans eq 2.
    return.
   endif.
  endif.
 
  clear l_msg.
 
  field-symbols: <ls_vepo> type lipov.
  data lt_vepo like VEPO occurs 0.
 
  loop at ct_worktab assigning <ls_vepo>.
    select vbeln from vepo into corresponding fields of table lt_vepo where vbeln eq <ls_vepo>-vbeln.
     if sy-subrc ne 0.
       message s001(Y_YSD) into l_msg.
       call function 'POPUP_TO_CONFIRM'
        exporting
          titlebar       = 'Confirm'
          text_question  = l_msg
          text_button_1  = 'Yes'
          text_button_2  = 'No'
          display_cancel_button = ''
          default_button = '2'
        importing
          answer         = ans.
       if ans eq 2.
        return.
   endif.
   endif.
  endloop.
 
 endif. "is_zles"
 
 endif.
endif.
ENDENHANCEMENT.