5 Replies Latest reply: Oct 29, 2012 10:34 AM by santosh kumar RSS

BDC table filled but not screen in MB1B

Sham IGIT
Currently Being Moderated

Dear Mates,

 

I have written a BDC program to do transfer posting from Quotation to Sale Order in MB1B, movement type 413. Here what happens is, BDC table is filled up with all the data including Sale Order and Quotation. But while coming to screen, Sale Order and item field is not filled up. Please help me out of this issue.

 

Addition to the above, I observed something. Once it is stopped in the BDC, if I see the status and comeback to the screen, values are getting filled. Does anyone have idea on this? Or Can I simulate the that event (menu>System>Status) in my code.

 

Guyz, Please throw your views. It doesn't need to be the answer.

 

Thanks

Yasin.

  • Re: BDC table filled but not screen in MB1B
    Ahsan Majeed
    Currently Being Moderated

    Hi Yasin,

     

    Can you post your code.

     

    Thanks

     

    Ahsan

    • Re: BDC table filled but not screen in MB1B
      Sham IGIT
      Currently Being Moderated
      LOOP AT gt_batch INTO gwa_batch WHERE vbeln EQ gwa_main-vbeln AND
                                                posnr EQ gwa_main-posnr.
      
           ..... " coding for the previous screens
      
      *    POP-UP - says code block with no fields in it
            PERFORM bdc_dynpro      USING 'SAPLKACB' '0002'.
            PERFORM bdc_field       USING 'BDC_OKCODE'
                                          '=ENTE'.
            PERFORM bdc_field       USING 'BDC_CURSOR'
                                          'MSEG-KDPOS'.
      
            READ TABLE gt_vbfa INTO gwa_vbfa WITH KEY vbelv = gwa_main-vbeln
                                                      posnv = gwa_main-posnr.
            IF sy-subrc EQ 0.
              PERFORM bdc_field       USING 'MSEG-KDAUF'  gwa_vbfa-vbeln. " SO Filled here but not in the screen
              lv_posnr = gwa_vbfa-posnr.
              PERFORM bdc_field       USING 'MSEG-KDPOS'  lv_posnr.
            ENDIF.
      
            PERFORM bdc_dynpro      USING 'SAPMM07M' '0410'.
            PERFORM bdc_field       USING 'BDC_OKCODE'
                                          '=ENTE'.
      *     SCREEN 421
            PERFORM bdc_dynpro      USING 'SAPMM07M' '0421'.
            PERFORM bdc_field       USING 'BDC_CURSOR'
                                          'MSEG-ERFMG(01)'.
            PERFORM bdc_field       USING 'BDC_OKCODE'
                                          '=BU'.
            PERFORM bdc_field       USING 'DKACB-FMORE'
                                          'X'.
            PERFORM bdc_dynpro      USING 'SAPLKACB' '0002'.
            PERFORM bdc_field       USING 'BDC_OKCODE'
                                         '=ENTE'.
            CALL TRANSACTION 'MB1B' USING gt_bdcdata  MODE 'E'.
      
          ENDLOOP.
      • Re: BDC table filled but not screen in MB1B
        Ahsan Majeed
        Currently Being Moderated

        Hi Yasin,

         

        Use this recording i have set Call Transaction mode 'A' please change accordingly. Also replace fixed values with your variables. Insert this recording in loop it will work.

         

        perform bdc_dynpro      using 'SAPMM07M' '0400'.
        perform bdc_field       using 'BDC_CURSOR'
                                      'RM07M-LGORT'.
        perform bdc_field       using 'BDC_OKCODE'
                                      '=NPE'.
        perform bdc_field       using 'MKPF-BLDAT'
                                      '30.12.2008'.
        perform bdc_field       using 'MKPF-BUDAT'
                                      '30.12.2008'.
        perform bdc_field       using 'RM07M-BWARTWA'
                                      '301'.
        perform bdc_field       using 'RM07M-WERKS'
                                      '3000'.
        perform bdc_field       using 'RM07M-LGORT'
                                      '0001'.
        perform bdc_field       using 'XFULL'
                                      'X'.
        perform bdc_field       using 'RM07M-WVERS2'
                                      'X'.
        perform bdc_dynpro      using 'SAPMM07M' '0410'.
        perform bdc_field       using 'BDC_CURSOR'
                                      'MSEG-ERFME'.
        perform bdc_field       using 'BDC_OKCODE'
                                      'BU'.
        perform bdc_field       using 'MSEG-MATNR'
                                      '1500-520'.
        perform bdc_field       using 'MSEG-ERFMG'
                                      '10'.
        perform bdc_field       using 'MSEG-ERFME'
                                      'CSE'.
        perform bdc_field       using 'MSEG-WERKS'
                                      '3000'.
        perform bdc_field       using 'MSEG-LGORT'
                                      '0001'.
        perform bdc_field       using 'MSEG-UMWRK'
                                      '3100'.
        perform bdc_field       using 'MSEG-UMLGO'
                                      '0001'.
        perform bdc_transaction using 'MB1B'.
        
        CALL TRANSACTION 'MB1B' USING gt_bdcdata  MODE 'A'.

         

        Regards

         

        Ahsan

    • Re: BDC table filled but not screen in MB1B
      Ahsan Majeed
      Currently Being Moderated

      Hi Yasin,

      I'm sending you a BDC code for MB1C. use this a reference.<br>

       

      <br>

      report ZAHS_MM_MB1C_STO_NOBT_UPLOAD<br>
             no standard page heading line-size 255.<br>
      <br>
      TABLES MSEG.<br>
      
      data : begin of mtmptab occurs 10000,<br>
              fieldd01(500) type c,<br>
      end of mtmptab.<br>
      
      
      data : begin of bdcdata occurs 1000.<br>
              include structure bdcdata.<br>
      data : end of bdcdata.<br>
      <br>
      
      data: begin of mitab occurs 1000,<br>
      <br>
      fieldd01(500) type c,<br>
      <br>
      * data element: BLDAT<br>
              BLDAT(010),<br>
      * data element: BUDAT<br>
              BUDAT(010),<br>
      * data element: BWARTWA<br>
              BWARTWA(003),<br>
      * data element: WERKS_D<br>
              WERKS(004),<br>
      * data element: LGORT_D<br>
              LGORT(004),<br>
      * data element:<br>
              XFULL(001),<br>
      * data element: WVERS2<br>
              WVERS2(001),<br>
      * data element: MATNR<br>
              MATNR(018),<br>
      * data element: ERFMG<br>
              ERFMG(017),<br>
      * data element: EXBWR<br>
              EXBWR(016),<br>
      * data element: FMORE<br>
              FMORE(001),<br>
        end of mitab.<br>
      
      *** End generated data section ***<br>
      
      data : mfliename(128) type c.<br>
      
      <br>
      *********************SELECTION SCREEN**********************************<br>
      <br>
      selection-screen begin of block abc with frame title text-001.<br>
      parameters: mfname(128)  default<br>
                         'C:\MM_MB1C_ST_NoBatch.csv'.<br>
      selection-screen end of block abc.<br>
      <br>
      at selection-screen on value-request for mfname.<br>
        perform get_mfilename.<br>
      
      ***********************START-OF-SELECTION*******************************<br>
      <br>
      start-of-selection.
      <br>
      perform upload_mtmptab.<br>
      <br>
      perform open_session.
      <br>
      loop at mitab.<br>
      
      MITAB-FMORE = 'X'.<br>
      MITAB-XFULL = 'X'.<br>
      <br>
      SPLIT mitab-fieldd01 AT ',' INTO MITAB-BLDAT
                                      MITAB-BUDAT
                                      MITAB-BWARTWA
                                      MITAB-WERKS
                                      MITAB-LGORT
                                      MITAB-WVERS2
                                      MITAB-MATNR
                                      MITAB-ERFMG
                                      MITAB-EXBWR.
           <br>                           exit.
      <br>endloop.
      
      
      <br>
      
      <br>perform bdc_dynpro      using 'SAPMM07M' '0400' 'X'.
      <br>perform bdc_field       using 'BDC_CURSOR'
      <br>                              'RM07M-WERKS'.
      <br>perform bdc_field       using 'BDC_OKCODE'
      <br>                              '=NPE'.
      <br>perform bdc_field       using 'MKPF-BLDAT'
                                    mitab-BLDAT.
      <br>perform bdc_field       using 'MKPF-BUDAT'
                                    mitab-BUDAT.
      <br>perform bdc_field       using 'RM07M-BWARTWA'
                                    mitab-BWARTWA.
      <br>perform bdc_field       using 'RM07M-WERKS'
                                    mitab-WERKS.
      <br>perform bdc_field       using 'RM07M-LGORT'
                                    mitab-LGORT.
      <br>perform bdc_field       using 'XFULL'
                                    mitab-XFULL.
      <br>perform bdc_field       using 'RM07M-WVERS2'
      <br>                              mitab-WVERS2.
      
      <br>LOOP AT MITAB.
      
      <br>MITAB-FMORE = 'X'.
      <br>MITAB-XFULL = 'X'.
      
      <br>SPLIT mitab-fieldd01 AT ',' INTO MITAB-BLDAT
         <br>                             MITAB-BUDAT
        <br>                              MITAB-BWARTWA
      <br>                                MITAB-WERKS
       <br>                               MITAB-LGORT
       <br>                               MITAB-WVERS2
       <br>                               MITAB-MATNR
        <br>                              MITAB-ERFMG
         <br>                             MITAB-EXBWR.
      
      
      
      <br>perform bdc_dynpro      using 'SAPMM07M' '0410' 'X'.
      <br>perform bdc_field       using 'BDC_CURSOR'
                                    'MSEG-EXBWR'.
      <br>perform bdc_field       using 'BDC_OKCODE'
                                    '=NPE'.
      <br>perform bdc_field       using 'MSEG-MATNR'
                                    mitab-MATNR.
      <br>perform bdc_field       using 'MSEG-ERFMG'
                                    mitab-ERFMG.
      <br>perform bdc_field       using 'MSEG-WERKS'
                                    mitab-WERKS.
      <br>perform bdc_field       using 'MSEG-LGORT'
                                    mitab-LGORT.
      <br>perform bdc_field       using 'MSEG-EXBWR'
                                    mitab-EXBWR.
      <br>perform bdc_field       using 'DKACB-FMORE'
                                    mitab-FMORE.
      
      <br>perform bdc_dynpro      using 'SAPLKACB' '0002' 'X'.
      <br>perform bdc_field       using 'BDC_OKCODE'
                                    '=ENTE'.
      
      <br>*perform bdc_dynpro      using 'SAPLKACB' '0002' 'X'.
      <br>*perform bdc_field       using 'BDC_OKCODE'
      *                              '=ENTE'.
      
      
      <br>*perform bdc_dynpro      using 'SAPMM07M' '0410' 'X'.
      <br>*perform bdc_field       using 'BDC_CURSOR'
      *                              'MSEG-EXBWR'.
      <br>*perform bdc_field       using 'BDC_OKCODE'
      <br>*                              '/00'.
      <br>*perform bdc_field       using 'MSEG-MATNR'
      *                              mitab-MATNR.
      <br>*perform bdc_field       using 'MSEG-ERFMG'
      *                              mitab-ERFMG.
      <br>*perform bdc_field       using 'MSEG-WERKS'
      *                              mitab-WERKS.
      <br>*perform bdc_field       using 'MSEG-LGORT'
      *                              mitab-LGORT.
      *perform bdc_field       using 'MSEG-EXBWR'
      *                              mitab-EXBWR.
      <br>*perform bdc_field       using 'DKACB-FMORE'
      *                              mitab-FMORE.
      <br>*perform bdc_dynpro      using 'SAPLKACB' '0002' 'X'.
      <br>*perform bdc_field       using 'BDC_OKCODE'
      *                              '=ENTE'.
      
      <br>*perform bdc_dynpro      using 'SAPMM07M' '0410' 'X'.
      <br>*perform bdc_field       using 'BDC_CURSOR'
      *                              'MSEG-ERFMG'.
      <br>*perform bdc_field       using 'BDC_OKCODE'
      *                              '=BU'.
      <br>*perform bdc_field       using 'MSEG-ERFMG'
      *                              mitab-ERFMG.
      <br>*perform bdc_field       using 'MSEG-EXBWR'
      *                              mitab-EXBWR.
      <br>*perform bdc_field       using 'DKACB-FMORE'
      *                              mitab-FMORE.
      
      <br>ENDLOOP.
      
      <br>perform bdc_dynpro      using 'SAPMM07M' '0410' 'X'.
      <br>perform bdc_field       using 'BDC_OKCODE'
                                    '/E'.
      
      <br>perform bdc_dynpro      using 'SAPMM07M' '0420' 'X'.
      <br>perform bdc_field       using 'BDC_CURSOR'
                                    'MKPF-BUDAT'.
      <br>perform bdc_field       using 'BDC_OKCODE'
                                    '=BU'.
      
      <br>*perform bdc_field       using 'BDC_CURSOR'
      *                              'MSEG-ERFMG'.
      <br>*perform bdc_field       using 'MSEG-ERFMG'
      *                              mitab-ERFMG.
      <br>*perform bdc_field       using 'MSEG-EXBWR'
      *                              mitab-EXBWR.
      <br>*perform bdc_field       using 'DKACB-FMORE'
      *                              mitab-FMORE.
      
      <br>call transaction 'MB1C' using bdcdata mode 'E' update 'S'.
      
      <br>perform insert_group.
      <br>refresh bdcdata.
      
      
      
      <br>perform close_group.
      
      
      <br>*****************END START-OF-SELECTION********************************
      
      <br>
      *&---------------------------------------------------------------------*
      *&      Form  GET_MFILENAME
      *&---------------------------------------------------------------------*
      form get_mfilename.
        call function 'WS_FILENAME_GET'
                      exporting
      *                  DEF_FILENAME           = ' '
      *                  DEF_PATH               = ' '
                         mask                   = ',CSV file,*.CSV,*.TXT.'
                         mode                   = 'O'
      *                  TITLE                  = ' '
                      importing
                         filename               = mfliename
      *                  RC                     =
                      exceptions
                         inv_winsys             = 1
                         no_batch               = 2
                         selection_cancel       = 3
                         selection_error        = 4
                         others                 = 5
      .
      <br>  if sy-subrc <> 0.
      <br>    write:/ 'File not found.'.
      <br>  else.
      <br>    move mfliename to mfname.
      
      <br>  endif.
      
      <br>endform.                    " GET_MFILENAME
      
      *&---------------------------------------------------------------------
      *&      Form  upload_MTMPTAB
      *&---------------------------------------------------------------------
      
      
      <br>form upload_mtmptab.
        call function 'WS_UPLOAD'
             exporting
                  filename = mfname
                  filetype = 'DAT'
             tables
                  data_tab = mItab.
      <br>endform.
      
      *&---------------------------------------------------------------------
      *&      Form  OPEN_SESSION
      *&---------------------------------------------------------------------
      
      <br>form open_session.
        call function 'BDC_OPEN_GROUP'
             exporting
                  group    = 'Ahsan'
                  holddate = sy-datum
                  keep     = 'X'
                  user     = 'ABAPDEV'.
      
      <br>endform.                    " OPEN_SESSION
      
      *&---------------------------------------------------------------------*
      *&      Form  BDC_DYNPRO
      *&---------------------------------------------------------------------*
      <br>form bdc_dynpro using program screen dynbegin.
      
        clear bdcdata.
        move: program  to bdcdata-program,
              screen   to bdcdata-dynpro,
              dynbegin to bdcdata-dynbegin.
        append bdcdata.
      <br>endform.                    " BDC_DYNPRO
      *&---------------------------------------------------------------------*
      *&      Form  BDC_FIELD
      *&---------------------------------------------------------------------*
      <br>form bdc_field using    fname fval.
        clear bdcdata.
        move: fname to bdcdata-fnam,
              fval  to bdcdata-fval.
        append bdcdata.
      <br>endform.                    " BDC_FIELD
      
      **&---------------------------------------------------------------------
      **&      Form  INSERT_GROUP
      **&---------------------------------------------------------------------
      *
      <br>form insert_group.
        call function 'BDC_INSERT'
             exporting
                  tcode     = 'MB1C'
             tables
                  dynprotab = bdcdata.
        refresh bdcdata.
      <br>endform.                    " INSERT_GROUP
      
      **&---------------------------------------------------------------------
      **&      Form  close_group
      **&---------------------------------------------------------------------
      *
      <br>form close_group.
       <br> call function 'BDC_CLOSE_GROUP'.
      <br>
      <br>endform.                    " close_group

       

      <br>

      <br>Regards,<br>

      <br>Ahsan

  • Re: BDC table filled but not screen in MB1B
    santosh kumar
    Currently Being Moderated

    dear sir,

     

      i have the same issue . how you solved this issue.

      plz help me.

     

    santosh kumar.

Actions