MD_PEGGING_NODIALOG – Ordenes que posee una Solped

Devuelve las ordenes que están asociadas a una solped.

 

Ej:Bloque en el cual por cada solped encontrada para determinado Material-Centro busco las ordenes que están asociadas a esa solped.

DATA: lt_mdpsx TYPE STANDARD TABLE OF mdps,
      ls_mdpsx TYPE mdps,
      LT_MDRQX TYPE STANDARD TABLE OF mdrq,
      ls_mdrqx TYPE mdrq,
      l_fixkz TYPE EBAN-fixkz,
      l_msg(100),
      l_solped TYPE MDPS-DEL12,
      l_aufnr TYPE AUFK-AUFNR.

*    *** Veo todas las solicitudes de pedidos en las que se encuentra el componente
CALL FUNCTION ‘MD_STOCK_REQUIREMENTS_LIST_API’
EXPORTING
        matnr                          = ls_resbd-MATNR
        werks                          = ls_resbd-WERKS
TABLES
        MDPSX                          = lt_MDPSX[]
EXCEPTIONS
        MATERIAL_PLANT_NOT_FOUND       = 1
        PLANT_NOT_FOUND                = 2
OTHERS                         = 3.
IF sy-subrc = 0.
*    *** Veo todas las ordenes asociadas con las solpeds.
LOOP AT lt_MDPSX INTO ls_mdpsx WHERE DELKZ = ‘BA’ AND FIX01 = ‘X’.
CLEAR l_solped.
      l_solped = ls_mdpsx-DELNR.
CALL FUNCTION ‘MD_PEGGING_NODIALOG’
EXPORTING
          edelkz                      = ‘BA’
          edelnr                      = l_solped "lt_MDPSX-DELNR
          EDELPS                      = ls_mdpsx-DELPS
          ematnr                      = ls_resbd-MATNR
          ewerks                      = ls_resbd-WERKS
tables
          imdrqx                      = LT_MDRQX[]
EXCEPTIONS
         ERROR                       = 1
         NO_REQUIREMENTS_FOUND       = 2
         ORDER_NOT_FOUND             = 3
OTHERS                      = 4.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: