Procesamiento paralelo salida mercancia

Colapsar
X
 
  • Tiempo
  • Mostrar
Limpiar Todo
nuevos mensajes
  • bajujo83
    Junior Member
    • nov
    • 4

    #1

    Procesamiento paralelo salida mercancia

    Hola a todos,

    Me han pedido un desarrollo donde me piden que procese las entregas de un transporte (VTTK/VTTP).

    Se me pide que mediante un procesamiento paralelo se haga la salida de mercancias con la bapi BAPI_OUTB_DELIVERY_CONFIRM_DEC.

    Les pongo el código para que vayan viendo:
    Código:
        LOOP AT i_telsefaz INTO s_telsefaz.
          index = sy-tabix.
          CONCATENATE c_task index INTO taskname. " generate unique task name
    
          CLEAR: i_hd, i_hc, i_hds, i_hcs.
    
          i_hd-deliv_numb  = s_telsefaz-vbele.
          i_hc-deliv_numb  = s_telsefaz-vbele.
          i_hc-post_gi_flg = c_x.
          i_hds-deliv_numb = s_telsefaz-vbele.
          i_hcs-deliv_numb = s_telsefaz-vbele.
    
          CALL FUNCTION 'BAPI_OUTB_DELIVERY_CONFIRM_DEC'
            STARTING NEW TASK taskname
            DESTINATION IN GROUP system
            PERFORMING set_function1_done ON END OF TASK
            EXPORTING
              header_data           = i_hd
              header_control        = i_hc
              delivery              = s_telsefaz-vbele
              header_data_spl       = i_hds
              header_control_spl    = i_hcs
            EXCEPTIONS
              system_failure        = 1  MESSAGE mess
              communication_failure = 2  MESSAGE mess
              resource_failure      = 3.
    
          CASE sy-subrc.
            WHEN 0.
              snd_jobs = snd_jobs + 1.
            WHEN 1 OR 2.
              MESSAGE mess TYPE 'I'.
            WHEN 3.
              IF snd_jobs >= 1 AND
                exc_flag = 0.
                exc_flag = 1.
                WAIT UNTIL rcv_jobs >= snd_jobs UP TO 1 SECONDS.
              ENDIF.
    
              IF sy-subrc = 0.
                exc_flag = 0.
              ELSE.
                MESSAGE c_resource_failure TYPE 'I'.
              ENDIF.
    
            WHEN OTHERS.
              MESSAGE c_other_error TYPE 'I'.
          ENDCASE.
    
        ENDLOOP.
    
        WAIT UNTIL rcv_jobs >= snd_jobs.
        
        
    *&---------------------------------------------------------------------*
    *&      Form  set_function1_done
    *&---------------------------------------------------------------------*
    FORM set_function1_done USING taskname.
    
      rcv_jobs = rcv_jobs + 1.
    
      CLEAR: i_ret.
      REFRESH: i_ret.
    
      RECEIVE RESULTS FROM FUNCTION 'BAPI_OUTB_DELIVERY_CONFIRM_DEC'
        TABLES
          return = i_ret.
    
      IF sy-subrc EQ 0.
    *     Se buscan errores en i_ret.
      ENDIF.
    
    ENDFORM.                    "set_function1_done
    Bueno, el problema que me he encontrado que el retorno del procesamiento paralelo hace que se procesen 1 o 2 registros y el resto se bloquee con mensajes como:
    # Los datos de centro están bloqueados por el usuario XXXXX
    # Los datos de valoración del mat. XXXXX están bloqueados por el usuario XXXXX

    Es posible hacer la salida de mercancía mediante la BAPI y el procesamiento paralelo.

    Cualquier información adicional me dicen.

    Desde ya muchas gracias.

    Juanjo
Trabajando...