Quantcast
Channel: SCN : All Content - ABAP Development
Viewing all articles
Browse latest Browse all 8332

error in bdc table control?

$
0
0

Dear abapers,

 

after searching in scn i am posting this question

 

DATA: BEGIN OF it_xk01 OCCURS 0,
        f1(1),
        f2(5),
        f3(5),
        f4(9),
        f5(9),
      END OF it_xk01.
DATA: v_count(2) VALUE '00',
      v_koinh(14),
      v_banks(14),
      v_bankn(14),
      v_bankl(14),
      it_bdcdata TYPE STANDARD TABLE OF bdcdata WITH HEADER LINE,
      wa_ctuparams type ctu_params.
PARAMETERS: p_file TYPE rlgrap-filename OBLIGATORY.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.
  PERFORM get_f4.
START-OF-SELECTION.
  PERFORM upload_data.
END-OF-SELECTION.
  LOOP AT it_xk01.
    IF it_xk01-f1 = 'H'.
      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-KTOKK'
                                    it_xk01-f2.
    ENDIF.
    IF it_xk01-f1 = 'N'.
      PERFORM bdc_dynpro      USING 'SAPMF02K' '0110'.
      PERFORM bdc_field       USING 'BDC_CURSOR'
                                    'LFA1-PSTLZ'.
      PERFORM bdc_field       USING 'BDC_OKCODE'
                                    '=VW'.
      PERFORM bdc_field       USING 'LFA1-ANRED'
                                    'Mr'.
      PERFORM bdc_field       USING 'LFA1-NAME1'
                                    it_xk01-f2.
      PERFORM bdc_field       USING 'LFA1-SORTL'
                                    it_xk01-f3.
      PERFORM bdc_field       USING 'LFA1-PSTLZ'
                                    it_xk01-f4.
      PERFORM bdc_field       USING 'LFA1-LAND1'
                                    it_xk01-f5.
      PERFORM bdc_dynpro      USING 'SAPMF02K' '0120'.
      PERFORM bdc_field       USING 'BDC_CURSOR'
                                    'LFA1-KUNNR'.
      PERFORM bdc_field       USING 'BDC_OKCODE'
                                    '=VW'.
    ENDIF.
    IF it_xk01-f1 = 'I'.
      v_count = v_count + 1.
      IF v_count le 5.
      CONCATENATE 'LFBK-KOINH(' v_count ')' INTO v_koinh.
      CONCATENATE 'LFBK-BANKS(' v_count ')' INTO v_banks.
      CONCATENATE 'LFBK-BANKN(' v_count ')' INTO v_bankn.
      CONCATENATE 'LFBK-BANKL(' v_count ')' INTO v_bankl.
      CONDENSE v_koinh NO-GAPS.
      CONDENSE v_banks NO-GAPS.
      CONDENSE v_bankl NO-GAPS.
      CONDENSE v_bankn NO-GAPS.
      PERFORM bdc_dynpro      USING 'SAPMF02K' '0130'.
      PERFORM bdc_field       USING 'BDC_CURSOR'
                                     v_koinh.
      PERFORM bdc_field       USING 'BDC_OKCODE'
                                    '/00'.
      PERFORM bdc_field       USING  v_banks
                                    it_xk01-f2.
      PERFORM bdc_field       USING  v_bankl
                                    it_xk01-f3.
      PERFORM bdc_field       USING  v_bankn
                                    it_xk01-f4.
      PERFORM bdc_field       USING  v_koinh
                                    it_xk01-f5.
      else.
      PERFORM bdc_dynpro      USING 'SAPMF02K' '0130'.
      PERFORM bdc_field       USING 'BDC_CURSOR'
                                     v_koinh.
      PERFORM bdc_field       USING 'BDC_OKCODE'
                                    '=P+'.
      v_count = 1.
      PERFORM bdc_dynpro      USING 'SAPMF02K' '0130'.
      PERFORM bdc_field       USING 'BDC_CURSOR'
                                     v_koinh.
      PERFORM bdc_field       USING 'BDC_OKCODE'
                                    '/00'.
      CONCATENATE 'LFBK-KOINH(' v_count ')' INTO v_koinh.
      CONCATENATE 'LFBK-BANKS(' v_count ')' INTO v_banks.
      CONCATENATE 'LFBK-BANKN(' v_count ')' INTO v_bankn.
      CONCATENATE 'LFBK-BANKL(' v_count ')' INTO v_bankl.
      CONDENSE v_koinh NO-GAPS.
      CONDENSE v_banks NO-GAPS.
      CONDENSE v_bankl NO-GAPS.
      CONDENSE v_bankn NO-GAPS.
      PERFORM bdc_field       USING  v_banks
                                    it_xk01-f2.
      PERFORM bdc_field       USING  v_bankl
                                    it_xk01-f3.
      PERFORM bdc_field       USING  v_bankn
                                    it_xk01-f4.
      PERFORM bdc_field       USING  v_koinh
                                    it_xk01-f5.
      ENDIF.
    ENDIF.
    CLEAR it_xk01.
  ENDLOOP.
  PERFORM bdc_dynpro      USING 'SAPMF02K' '0130'.
  PERFORM bdc_field       USING 'BDC_CURSOR'
                                     v_koinh.
  PERFORM bdc_field       USING 'BDC_OKCODE'
                                    '/00'.
  perform bdc_dynpro      using 'SAPLSPO1' '0300'.
  perform bdc_field       using 'BDC_OKCODE'
                                '=YES'.
  wa_ctuparams-DISMODE = 'A'.
  wa_ctuparams-UPDMODE = 'S'.
  wa_ctuparams-DEFSIZE = 'X'.
  CALL TRANSACTION 'XK01' USING it_bdcdata  MODE 'A'
                                             UPDATE 'S'.
  • options from wa_ctuparams.
  • MODE 'A'
  •                                             UPDATE 'S'.
&----
*&      Form  upload_data&----
  •       text
----
FORM upload_data .  DATA: lv_infile TYPE string.  lv_infile = p_file.  CALL FUNCTION 'GUI_UPLOAD'    EXPORTING      filename            = lv_infile      filetype            = 'ASC'      has_field_separator = 'X'    TABLES      data_tab            = it_xk01.  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.                    " upload_data &----
*&      Form  get_f4&----
  •       text
----
FORM get_f4 .  CALL FUNCTION 'F4_FILENAME'   EXPORTING     program_name        = syst-cprog     dynpro_number       = syst-dynnr
  •     FIELD_NAME          = ' '
   IMPORTING     file_name           = p_file.ENDFORM.                                                    " get_f4----
  •        Start new screen                                              *
----
FORM bdc_dynpro USING program dynpro.  CLEAR it_bdcdata.  it_bdcdata-program  = program.  it_bdcdata-dynpro   = dynpro.  it_bdcdata-dynbegin = 'X'.  APPEND it_bdcdata.ENDFORM.                    "BDC_DYNPRO ----
  •        Insert field                                                  *
----
FORM bdc_field USING fnam fval.
  • IF FVAL <> NODATA.
  CLEAR it_bdcdata.  it_bdcdata-fnam = fnam.  it_bdcdata-fval = fval.  APPEND it_bdcdata.
  • ENDIF.
ENDFORM.                    "BDC_FIELD
*******************************************************************************************************************************************flat file:
*H     0302
*N     Sahana     Raj     500020     IN
*I     IN     ICICI     734897597     sam
*I     IN     SBH     768346687     sekhar
*I     IN     SBI     345687346     satish
*I     IN     SBH     763846878     Phani
*I     IN     HSBC     797893778     Prakash
*I     IN     HDFC     723678638     Rajsekhar
*I     IN     4444     435645646     Shiva
*I     IN     3400     763468768     Ramana
the transaction is XK01.
*******************************************************************************************************************************
for my above source code i am getting the following error?
after "'LFBK-KOINH(",there must be a space or equivalent character(".",",",".")...

Viewing all articles
Browse latest Browse all 8332

Trending Articles