6 Replies Latest reply: Feb 5, 2009 10:36 AM by srinath REDDY RSS

Data conversion program for  t-code MB1C (561 movement types)

srinath REDDY
Currently Being Moderated

hai,

 

Iam working on BDC.

iam getting message as MSEG-ERFMG(02) is not an input field after execution of BDC program ( In call Transaction method with No mode display.)

Below is recording of MB1C.

 

LOOP AT it_header INTO wa_header.

 

    REFRESH it_bdcdata.

 

    flg = space.

 

    PERFORM bdc_dynpro      USING 'SAPMM07M' '0400'.

 

    PERFORM bdc_field       USING 'BDC_OKCODE'

                                  '/00'.

    PERFORM bdc_field       USING 'MKPF-BLDAT'

                                  wa_header-bldat.

    PERFORM bdc_field       USING 'MKPF-BUDAT'

                                  wa_header-budat.

    PERFORM bdc_field       USING 'RM07M-BWARTWA'

                                  wa_header-bwartwa.

    PERFORM bdc_field       USING 'RM07M-WERKS'

                                  wa_header-werks.

    PERFORM bdc_field       USING 'RM07M-LGORT'

                                  wa_header-lgort.

 

 

    LOOP AT it_item INTO wa_item WHERE id = wa_header-id.

 

      IF flg = space.

 

        PERFORM bdc_dynpro      USING 'SAPMM07M' '0421'.

 

        PERFORM bdc_field       USING 'BDC_OKCODE'

                                      '/00'.

        PERFORM bdc_field       USING 'MSEG-MATNR(01)'

                                      wa_item-matnr.

        PERFORM bdc_field       USING 'MSEG-ERFMG(01)'

                                      wa_item-erfmg.

 

        PERFORM bdc_field       USING 'DKACB-FMORE'

                                         'X'.

        PERFORM bdc_dynpro      USING 'SAPLKACB' '0002'.

        PERFORM bdc_field       USING 'BDC_OKCODE'

                                      '=ENTE'.

        PERFORM bdc_dynpro      USING 'SAPLKACB' '0002'.

        PERFORM bdc_field       USING 'BDC_OKCODE'

                                      '=ENTE'.

        flg = 'X'.

 

      ELSEIF flg = 'X'.

 

        PERFORM bdc_dynpro      USING 'SAPMM07M' '0421'.

        PERFORM bdc_field       USING 'BDC_OKCODE'

                                      '/00'.

        PERFORM bdc_field       USING 'MSEG-MATNR(02)'

                                      wa_item-matnr.

        PERFORM bdc_field       USING 'MSEG-ERFMG(02)'

                                      wa_item-erfmg.

        PERFORM bdc_field       USING 'DKACB-FMORE'

                                         'X'.

        PERFORM bdc_dynpro      USING 'SAPLKACB' '0002'.

        PERFORM bdc_field       USING 'BDC_OKCODE'

                                      '=ENTE'.

        PERFORM bdc_dynpro      USING 'SAPLKACB' '0002'.

        PERFORM bdc_field       USING 'BDC_OKCODE'

                                      '=ENTE'.

      ENDIF.

 

    ENDLOOP.

 

    PERFORM bdc_dynpro      USING 'SAPMM07M' '0421'.

 

    PERFORM bdc_field       USING 'BDC_OKCODE'

                                  '=BU'.

 

    PERFORM bdc_dynpro      USING 'SAPLKACB' '0002'.

    PERFORM bdc_field       USING 'BDC_OKCODE'

                                  '=ENTE'.

 

    CALL TRANSACTION 'MB1C' USING it_bdcdata UPDATE 'A' MODE 'A' MESSAGES INTO it_msg.

 

  ENDLOOP.

 

if above is wrong please revert back  your suggestion immedietly.

 

with regards,

Naveen

Actions