Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

md_pegging_nodialog

hello!

does anyone ever used fm md_pegging_nodialog?

if so what fields do i need?

for some reason i get exception.

regards

yifat

Tags:
Former Member
replied

Here is a sample program...... you can peg by production order.


report zrich_0003.

data: begin of mdrqx occurs 50.
        include structure mdrq.
data: end of mdrqx.

parameters: p_matnr type mara-matnr,
            p_werks type marc-werks,     " Planning Plant
            p_aufnr type aufk-aufnr.

data: werks type marc-werks.
data: matnr type mara-matnr.
data: delnr type mdps-del12.

perform prod_order using P_matnr
                         p_werks
                         p_aufnr.

*********************************************************************
*   PROD_ORDER
*********************************************************************
form prod_order using matnr
                      werks
                      aufnr.


* edelkz = 'FE' --  Production Order
* edelkz = 'PA' --  Planned Order

  call function 'MD_PEGGING_NODIALOG'
       exporting
            edelet                = 0000
            edelkz                = 'FE'       
            edelnr                = aufnr
            edelps                = 000001
            ematnr                = matnr
            ewerks                = werks
       tables
            imdrqx                = mdrqx
       exceptions
            error                 = 1
            no_requirements_found = 2
            order_not_found       = 3
            others                = 4.

  loop at mdrqx where DELKZ = 'VC'.    " VC is sales order
    write:/ mdrqx-DELKZ, mdrqx-matnr, mdrqx-planr+0(10),
            mdrqx-planr+10(6) .
  endloop.

endform.


Regards,

Rich Heilman

Message was edited by: Rich Heilman

1 View this answer in context
Not what you were looking for? View more on this topic or Ask a question