Skip to Content

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

How to clear old value

Dear all ,

Here i pass the value timeticket_item-material, timeticket_item-plant, timeticket_item-stge_loc, timeticket_item-batch, timeticket_item-val_type,timeticket_item-casting_speed,

timeticket_item-metal_temp,

timeticket_item-water_temp

timeticket_item-bar_temp

timeticket_item-mill_load

timeticket_item-emulsion_temp

timeticket_item-coil_temp ,

when we pass two batch information first batch information is passed properly but when pass second value that time it will take first batch information.

How to clear first batch information.

**********************************

LOOP AT timeticket_item.

gm_item-material = timeticket_item-material.

gm_item-plant = timeticket_item-plant.

gm_item-stge_loc = timeticket_item-stge_loc.

gm_item-batch = timeticket_item-batch.

gm_item-move_type = timeticket_item-move_type.

gm_item-entry_qnt = timeticket_item-entry_qnt.

gm_item-entry_uom = timeticket_item-entry_uom.

IF gm_item-move_type = '101'.

gm_item-orderid = timeticket_item-orderid.

gm_item-order_itno = '0001'.

gm_item-reserv_no = ''.

gm_item-res_item = ''.

gm_item-mvt_ind = 'F'.

ELSE.

gm_item-orderid = ''.

gm_item-order_itno = ''.

gm_item-reserv_no = timeticket_item-reserv_no.

gm_item-res_item = timeticket_item-res_item.

gm_item-mvt_ind = ''.

ENDIF.

APPEND gm_item.

link_conf-index_confirm = '1'.

link_conf-index_goodsmov = icnt.

APPEND link_conf.

icnt = icnt + 1.

DATA: qndat LIKE mcha-qndat, lwedt LIKE mcha-lwedt.

  • CALL BDC to Update Batches

DATA : gm_code LIKE timeticket_item-gm_code.

IF timeticket_item-gm_code = '02'.

SELECT SINGLE qndat lwedt INTO (qndat, lwedt) FROM mcha

WHERE matnr = timeticket_item-material AND

werks = timeticket_item-plant AND

charg = timeticket_item-batch.

PERFORM bdc_dynpro USING 'SAPMM03S' '0105'.

PERFORM bdc_field USING 'BDC_OKCODE'

'/00'.

PERFORM bdc_field USING 'BDC_CURSOR'

'RM03S-MATNR'.

PERFORM bdc_field USING 'RM03S-MATNR'

timeticket_item-material. "'RMEC'.

PERFORM bdc_field USING 'RM03S-CHARG'

timeticket_item-batch. "'E1D14402'.

PERFORM bdc_field USING 'RM03S-WERKS'

timeticket_item-plant. "'1500'.

PERFORM bdc_dynpro USING 'SAPMM03S' '0200'.

PERFORM bdc_field USING 'BDC_CURSOR'

'MCHA-VERAB'.

PERFORM bdc_field USING 'BDC_OKCODE'

'=CLAS'.

PERFORM bdc_field USING 'MCHA-BWTAR'

timeticket_item-val_type. " 'INHOUSE'.

PERFORM bdc_dynpro USING 'SAPLCTMS' '0109'.

PERFORM bdc_field USING 'BDC_CURSOR'

'RCTMS-MWERT(08)'.

PERFORM bdc_field USING 'BDC_OKCODE'

'=BACK'.

IF NOT timeticket_item-casting_speed IS INITIAL.

PERFORM bdc_field USING 'RCTMS-MNAME(01)'

'CASTSPEED'.

ENDIF.

PERFORM bdc_field USING 'RCTMS-MNAME(02)'

'METALTEMPINTUNDISH'.

PERFORM bdc_field USING 'RCTMS-MNAME(03)'

'WATERTEMP'.

PERFORM bdc_field USING 'RCTMS-MNAME(04)'

'BARTEMPATMILLENTRY'.

PERFORM bdc_field USING 'RCTMS-MNAME(05)'

'ROLLINGMILLLOAD'.

IF NOT timeticket_item-emulsion_temp IS INITIAL.

PERFORM bdc_field USING 'RCTMS-MNAME(06)'

'EMULSIONTEMP'.

ENDIF.

IF NOT timeticket_item-coil_temp IS INITIAL.

PERFORM bdc_field USING 'RCTMS-MNAME(07)'

'COILTEMP'.

ENDIF.

IF NOT timeticket_item-casting_speed IS INITIAL.

PERFORM bdc_field USING 'RCTMS-MWERT(01)'

timeticket_item-casting_speed. " 'CSCS'.

ENDIF.

PERFORM bdc_field USING 'RCTMS-MWERT(02)'

timeticket_item-metal_temp. " 'MT'.

PERFORM bdc_field USING 'RCTMS-MWERT(03)'

timeticket_item-water_temp. " 'WT'.

PERFORM bdc_field USING 'RCTMS-MWERT(04)'

timeticket_item-bar_temp. " 'BM'.

PERFORM bdc_field USING 'RCTMS-MWERT(05)'

timeticket_item-mill_load. " 'RML'.

IF NOT timeticket_item-emulsion_temp IS INITIAL.

PERFORM bdc_field USING 'RCTMS-MWERT(06)'

timeticket_item-emulsion_temp. " 'ET'.

ENDIF.

IF NOT timeticket_item-coil_temp IS INITIAL.

PERFORM bdc_field USING 'RCTMS-MWERT(07)'

timeticket_item-coil_temp. " 'CTE'.

ENDIF.

PERFORM bdc_dynpro USING 'SAPMM03S' '0200'.

PERFORM bdc_field USING 'BDC_CURSOR'

'MCHA-VERAB'.

PERFORM bdc_field USING 'BDC_OKCODE'

'=BU'.

PERFORM bdc_field USING 'RM03S-FZUST'

'X'.

PERFORM bdc_field USING 'RM03S-CHKLJ'

'X'.

CALL TRANSACTION 'MSC1' USING bdcdata

MODE 'A'

MESSAGES INTO errmsg1.

ENDIF.

ENDLOOP.

Tags:
Former Member
Former Member replied

After this statement

LOOP AT timeticket_item.

Refresh : BDCDATA.

Regards

MD

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