Posted: Mon Oct 08, 2007 4:57 pm Post subject: Batch classification update
Check this below pgm..it works fine from 3.1I to 4.6D...it uses MSC2 t-code for batch classification update..
before running this program make sure that characteristics of a class or not mandatory using CL03 and CT04 transactions..
but as per requirement uploading the qlty results to classification can be done using batch input..
change the screen sequence as required for ur requirement
Code:
REPORT z_bca.
*---------------------------------------------------------------------*
* Checkbox p_list to turn on/off the printing of *
* the already classified batches. This limits the report from *
* hundreds of pages to just one or so. *
*---------------------------------------------------------------------*
* If the same material/plant with different batch already exists then*
* the record is saved without updating screen 500. *
*---------------------------------------------------------------------*
TABLES:
mcha,
inob.
*--------------------------------------------------------------------*
* Select Option & Parameters *
*--------------------------------------------------------------------*
SELECTION-SCREEN : BEGIN OF BLOCK a WITH FRAME TITLE text-001.
PARAMETERS : p_werks LIKE mcha-werks OBLIGATORY,
*--------------------------------------------------------------------*
* Data *
*--------------------------------------------------------------------*
DATA : w_buffer(50) TYPE c.
DATA : w_last_buffer(50) TYPE c.
DATA : cpt TYPE n.
DATA : coche(1) TYPE c.
DATA : n_coche(1) TYPE c.
DATA: BEGIN OF itab_articles OCCURS 0,
matnr(1 TYPE c,
werks(4) TYPE c,
charg(10) TYPE c,
herkl(3) TYPE c,
sister(1) TYPE c,
END OF itab_articles.
DATA : BEGIN OF itab_bdc OCCURS 0.
INCLUDE STRUCTURE bdcdata.
DATA : END OF itab_bdc.
DATA: w_errors(1).
DATA: w_sister(1).
*--------------------------------------------------------------------*
SELECT * FROM mcha WHERE werks EQ p_werks
AND lvorm EQ space.
CONCATENATE mcha-matnr mcha-werks mcha-charg INTO w_buffer.
SELECT * FROM inob WHERE klart EQ '022' AND
obtab EQ 'MCHA' AND
objek EQ w_buffer.
ENDSELECT.
IF sy-subrc NE 0.
IF p_list = 'X'.
WRITE : / 'A classifier ', 20 mcha-matnr, w_buffer.
ULINE.
ENDIF.
w_errors = 'X'.
w_sister = 'Y'.
CONCATENATE mcha-matnr mcha-werks '%' INTO w_buffer.
IF w_buffer <> w_last_buffer.
SELECT * FROM inob WHERE klart EQ '022' AND
obtab EQ 'MCHA' AND
objek LIKE w_buffer.
ENDSELECT.
IF sy-subrc <> 0.
w_sister = 'N'.
ENDIF.
ENDIF.
w_last_buffer = w_buffer.
CLEAR itab_articles.
MOVE mcha-matnr TO itab_articles-matnr.
MOVE mcha-werks TO itab_articles-werks.
MOVE mcha-charg TO itab_articles-charg.
IF mcha-herkl = 'EX '.
MOVE ' ' TO itab_articles-herkl.
ELSE.
MOVE mcha-herkl TO itab_articles-herkl.
ENDIF.
MOVE w_sister TO itab_articles-sister.
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You cannot download files in this forum
All product names are trademarks of their respective companies. SAPNET.RU websites are in no way affiliated with SAP AG. SAP, SAP R/3, R/3 software, mySAP, ABAP, BAPI, xApps, SAP NetWeaver and any other are registered trademarks of SAP AG. Every effort is made to ensure content integrity. Use information on this site at your own risk.