Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

PP - Assign Batch Number on Production Order during Saving

adnanmaqbool
Contributor
0 Kudos

Dear All

I have a requirement to assign batch number on saving of Production Order.

Batch Number will be read from Sale Order and assigned to batch field in Production Order Goods Receipt Tab.

Only one user exit (PPCO0001 Application development: PP orders) is providing feature to change batch but its also not working, changing value in user exit but screen is still showing old batch or empty field.

My requirement is whenever user execute tcode CO41 to convert planned order to production order, system should read batch from sale order and store in batch field of Production Order..

1 ACCEPTED SOLUTION

adnanmaqbool
Contributor
0 Kudos

Issues Resolved by implementing an implicit enhancement at start of function module CO_BI_AFPO_READ_WITH_KEY


ENHANCEMENT ZPP_ZAM_BATCH_DETERMINATION3.    "active version

READ TABLE CAUFV_BT INDEX 1.

IF   CAUFV_BT-AUART '5001' OR CAUFV_BT-AUART '5002'

   OR CAUFV_BT-AUART '5003' OR CAUFV_BT-AUART '5004' .

LOOP AT AFPO_BT.

     SELECT SINGLE CHARG

      INTO afpo_BT-CHARG

       FROM VBAP

       WHERE VBELN = afpo_bt-KDAUF

       AND   POSNR = afpo_bt-KDPOS.

       modify afpo_bt index sy-tabix TRANSPORTING charg.

ENDLOOP.

ENDIF.

ENDENHANCEMENT.

1 REPLY 1

adnanmaqbool
Contributor
0 Kudos

Issues Resolved by implementing an implicit enhancement at start of function module CO_BI_AFPO_READ_WITH_KEY


ENHANCEMENT ZPP_ZAM_BATCH_DETERMINATION3.    "active version

READ TABLE CAUFV_BT INDEX 1.

IF   CAUFV_BT-AUART '5001' OR CAUFV_BT-AUART '5002'

   OR CAUFV_BT-AUART '5003' OR CAUFV_BT-AUART '5004' .

LOOP AT AFPO_BT.

     SELECT SINGLE CHARG

      INTO afpo_BT-CHARG

       FROM VBAP

       WHERE VBELN = afpo_bt-KDAUF

       AND   POSNR = afpo_bt-KDPOS.

       modify afpo_bt index sy-tabix TRANSPORTING charg.

ENDLOOP.

ENDIF.

ENDENHANCEMENT.