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: 

bDC PROBLEMS

Former Member
0 Kudos

Hello I am recording xk01

I am using GUI_UPLOAD fm to fetch data from flat file

and using CALL transaction with update and mode equal to 'A'.

But when i run the program i get the following error.

'Start screen does not exist in batch input data'

I also tried setting opt-NOBINPT = SPACE.

and according changed the CALL TRANSACTION but still the same error exists

7 REPLIES 7

Former Member
0 Kudos

Hi,

while recording through SHDB transaction, did u give Start transaction as XK01 ?

and Check whether that screen has been opened already...if so, close it.

Regards,

Ram.

0 Kudos

Yes i have given XK01 and no screen is open

REPORT zxx_xk01

NO STANDARD PAGE HEADING LINE-SIZE 255.

DATA BDCDATA TYPE TABLE OF BDCDATA WITH HEADER LINE.

START-OF-SELECTION.

perform bdc_dynpro using 'SAPMF02K' '0100'.

perform bdc_field using 'BDC_CURSOR'

'RF02K-KTOKK'.

perform bdc_field using 'BDC_OKCODE'

'/00'.

perform bdc_field using 'RF02K-LIFNR'

'LFJS987'.

perform bdc_field using 'RF02K-KTOKK'

'0001'.

perform bdc_dynpro using 'SAPMF02K' '0110'.

perform bdc_field using 'BDC_CURSOR'

'LFA1-SPRAS'.

perform bdc_field using 'BDC_OKCODE'

'/00'.

perform bdc_field using 'LFA1-ANRED'

'COMPANY'.

perform bdc_field using 'LFA1-NAME1'

'NICHOLAS'.

perform bdc_field using 'LFA1-SORTL'

'NLS'.

perform bdc_field using 'LFA1-LAND1'

'AU'.

perform bdc_field using 'LFA1-SPRAS'

'EN'.

perform bdc_dynpro using 'SAPMF02K' '0120'.

perform bdc_field using 'BDC_CURSOR'

'LFA1-KUNNR'.

perform bdc_field using 'BDC_OKCODE'

'/00'.

perform bdc_dynpro using 'SAPMF02K' '0130'.

perform bdc_field using 'BDC_CURSOR'

'LFBK-BANKS(01)'.

perform bdc_field using 'BDC_OKCODE'

'=ENTR'.

perform bdc_dynpro using 'SAPMF02K' '0380'.

perform bdc_field using 'BDC_CURSOR'

'KNVK-ABTNR(01)'.

perform bdc_field using 'BDC_OKCODE'

'=ENTR'.

perform bdc_field using 'KNVK-NAMEV(01)'

'SURESH'.

perform bdc_field using 'KNVK-NAME1(01)'

'SURESH RAI'.

perform bdc_field using 'KNVK-TELF1(01)'

'99932342'.

perform bdc_field using 'KNVK-ABTNR(01)'

'0001'.

perform bdc_dynpro using 'SAPMF02K' '0380'.

perform bdc_field using 'BDC_CURSOR'

'KNVK-ABTNR(02)'.

perform bdc_field using 'BDC_OKCODE'

'=ENTR'.

perform bdc_field using 'KNVK-NAMEV(02)'

'SUYASH'.

perform bdc_field using 'KNVK-NAME1(02)'

'SUYASH'.

perform bdc_field using 'KNVK-TELF1(02)'

'23020230'.

perform bdc_field using 'KNVK-ABTNR(02)'

'0003'.

perform bdc_dynpro using 'SAPMF02K' '0380'.

perform bdc_field using 'BDC_CURSOR'

'KNVK-ABTNR(03)'.

perform bdc_field using 'BDC_OKCODE'

'=ENTR'.

perform bdc_field using 'KNVK-NAMEV(03)'

'RAKESH'.

perform bdc_field using 'KNVK-NAME1(03)'

'RAKESH SHARMA'.

perform bdc_field using 'KNVK-TELF1(03)'

'89983938'.

perform bdc_field using 'KNVK-ABTNR(03)'

'0004'.

perform bdc_dynpro using 'SAPMF02K' '0380'.

perform bdc_field using 'BDC_CURSOR'

'KNVK-NAMEV(01)'.

perform bdc_field using 'BDC_OKCODE'

'=UPDA'.

CALL TRANSACTION 'XK01' USING bdcdata

MODE 'A'

UPDATE 'A'.

FORM bdc_dynpro USING program dynpro.

CLEAR bdcdata.

bdcdata-program = program.

bdcdata-dynpro = dynpro.

APPEND bdcdata.

ENDFORM. "bdc_dynpro

FORM bdc_field USING fnam fval.

CLEAR bdcdata.

bdcdata-fnam = fnam.

bdcdata-fval = fval.

APPEND bdcdata.

ENDFORM. "bdc_field

Still get the start screen error

0 Kudos

Well i got the problem solved but another problem is how to upload two flat file in a single program.

0 Kudos

Create two separate internal tables..Call the function module WS_UPLOAD instead of GUI_UPLOAD if u prefer..Upload data into these separate internal tables..first of all y u need two separate flat files??

Are you doing table control?? You can use a single flat file to upload and can segregate the data into different internal tables later on.

0 Kudos

hi shah..

see the below code., this explains that how to upload the two flat file for a single program


AT SELECTION-SCREEN ON VALUE-REQUEST FOR R_FILE1.
  PERFORM GET_FILE CHANGING  R_FILE1.

AT SELECTION-SCREEN ON VALUE-REQUEST FOR R_FILE2.
  PERFORM GET_FILE CHANGING R_FILE2.


  PERFORM  RETRIEVE_FILE TABLES IT_EXCEL USING R_FILE1  1 4 15 65536  .
  PERFORM  RETRIEVE_FILE TABLES IT_EXCEL1 USING R_FILE2  1 4 8  65536  .


  LOOP AT IT_EXCEL.
    CASE IT_EXCEL-COL.
      WHEN '001'.
        IT_TAB-AUART = IT_EXCEL-VALUE.
      WHEN '002'.
        IT_TAB-VKORG = IT_EXCEL-VALUE.
      WHEN '003'.
        IT_TAB-VTWEG = IT_EXCEL-VALUE.
      WHEN '004' .
        IT_TAB-SPART = IT_EXCEL-VALUE.
      WHEN '005' .
        IT_TAB-KUNNR = IT_EXCEL-VALUE.
      WHEN '006'.
        IT_TAB-KUNNR_1 = IT_EXCEL-VALUE.
      WHEN '007'.
        IT_TAB-BSTKD   = IT_EXCEL-VALUE.
      WHEN  '008'.
        IT_TAB-BSTDK   = IT_EXCEL-VALUE.
      WHEN  '009'.
        IT_TAB-GUEBG   = IT_EXCEL-VALUE.
      WHEN  '010'.
        IT_TAB-GUEEN   = IT_EXCEL-VALUE.
      WHEN  '011'.
        IT_TAB-LABNK   = IT_EXCEL-VALUE.
      WHEN '012'.
        IT_TAB-ABRDT   = IT_EXCEL-VALUE.
      WHEN '013'.
        IT_TAB-LABNK_1 = IT_EXCEL-VALUE.
      WHEN '014' .
        IT_TAB-ABRDT_1 = IT_EXCEL-VALUE.
      WHEN  '015'.
        IT_TAB-ABHOR  =  IT_EXCEL-VALUE.

    ENDCASE.
    AT END OF ROW.
      APPEND IT_TAB.
      CLEAR IT_TAB.
    ENDAT.

  ENDLOOP.

  LOOP AT IT_EXCEL1.
    CASE IT_EXCEL1-COL.
      WHEN '001'.
        IT_TAB1-BSTKD = IT_EXCEL1-VALUE.
      WHEN '002'.
        IT_TAB1-BSTDK  = IT_EXCEL1-VALUE.
      WHEN '003'.
        IT_TAB1-MABNR = IT_EXCEL1-VALUE.
      WHEN '004'.
        IT_TAB1-ZMENG = IT_EXCEL1-VALUE.
      WHEN '005'.
        IT_TAB1-KDMAT = IT_EXCEL1-VALUE.
      WHEN '006'.
        IT_TAB1-ETDAT = IT_EXCEL1-VALUE.
      WHEN '007'.
        IT_TAB1-WMENG = IT_EXCEL1-VALUE.
      WHEN '008'.
        IT_TAB1-ETART = IT_EXCEL1-VALUE.
    ENDCASE.
    AT END OF ROW.
      APPEND IT_TAB1.
      CLEAR IT_TAB1.
    ENDAT.
  ENDLOOP.

 

*&---------------------------------------------------------------------*
*&      Form  RETRIEVE_FILE
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
*      -->XFILE      text
*      -->V1         text
*      -->V2         text
*      -->V3         text
*      -->V4         text
*      -->X_EXCEL    text
*----------------------------------------------------------------------*
FORM RETRIEVE_FILE TABLES X_EXCEL  USING XFILE  V1 V2 V3 V4  .

  CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE'
    EXPORTING
      FILENAME                = XFILE
      I_BEGIN_COL             = V1
      I_BEGIN_ROW             = V2
      I_END_COL               = V3
      I_END_ROW               = V4
    TABLES
      INTERN                  = X_EXCEL
    EXCEPTIONS
      INCONSISTENT_PARAMETERS = 1
      UPLOAD_OLE              = 2
      OTHERS                  = 3.
*  IF X_EXCEL[] IS  INITIAL.
*    MESSAGE I000.
*  ENDIF.

ENDFORM.                    "RETRIEVE_FILE
*&---------------------------------------------------------------------*
*&      Form  get_file
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
FORM GET_FILE CHANGING XFILE.
  CALL FUNCTION 'WS_FILENAME_GET'
   EXPORTING
     DEF_FILENAME           = SPACE
     DEF_PATH               = XFILE
     MASK                   = ',*.*,*.*.'
     MODE                   = 'O '
     TITLE                  = 'BDC FILE FOR VA31 '
   IMPORTING
     FILENAME               = XFILE
*       RC                     =
   EXCEPTIONS
     INV_WINSYS             = 1
     NO_BATCH               = 2
     SELECTION_CANCEL       = 3
     SELECTION_ERROR        = 4
     OTHERS                 = 5
            .
  IF SY-SUBRC <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
  ENDIF.


ENDFORM.             

thanks and regards

suren.s

0 Kudos

Hi Ajay,

yes I am using tab control but i need two file one contains the master records and other the transaction records . Can you just clarify how to divide the flat file later on.

0 Kudos

How did you solve it?