Skip to Content

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

help with BDC for XD02 bank detail processing

Hello,

I having a problem getting a BDC to work correctly. I am writing  a program that will delete bank details based on data from an input file. the data will several lines of data with each line containing the customer number and the bank details that are to be deleted. my program will loop thru the data and create the BDCDATA file to be used in the BDC. below is the recording that I did and the code that I have in my program. what is happening is the first record is processed correctly an then the BDC ends. the remaining records are not processed. I have looked at the recording and the code and I cannot figure out what I need to code to get this to process the entire file.

I would appreciate any help that you have

thanks


program      screen      start id      field name                field value
                                      T             XD02                         BS AA X  F
SAPMF02D 0101           X
                                                       BDC_CURSOR      USE_SAV
                                                       BDC_OKCODE      /00
                                                       RF02D-KUNNR      1010078
                                                       RF02D-D0130           X
                                                       USE_ZAV                 X
SAPMF02D 0130           X   
                                                       BDC_CURSOR      KNBK-BANKL(03)
                                                       BDC_OKCODE      =BDEL
SAPMF02D 0130           X   
                                                       BDC_CURSOR      KNBK-BANKL(03)
                                                       BDC_OKCODE      =UPDA


  PERFORM bdc_load_dynpro USING 'SAPMF02D'    '0101'.
  PERFORM bdc_load_field  USING 'RF02D-KUNNR'  ws_bankdetl-kunnr.
  PERFORM bdc_load_field  USING 'RF02D-D0130' 'X'.
  PERFORM bdc_load_field  USING 'USE_ZAV'     'X'.

  DO. 
    WHILE ws_tabix > 10.
      PERFORM bdc_load_field  USING 'BDC_OKCODE' '=P+'.
      ws_tabix = ws_tabix - 10.
    ENDWHILE.
  ENDDO.  

  CONCATENATE: 'KNBK-BANKS(' ws_bankdetl-record_no ')'  INTO l_char1,  "DE1K938146
               'KNBK-BANKL(' ws_bankdetl-record_no ')'  INTO l_char2,  "DE1K938146
               'KNBK-BANKN(' ws_bankdetl-record_no ')'  INTO l_char3.  "DE1K938146
  CONDENSE: l_char1, l_char2, l_char3.                                 "DE1K938146

  PERFORM bdc_load_field  USING 'BDC_OKCODE' '/00'.         
  PERFORM bdc_load_dynpro USING 'SAPMF02D'    '0130'.
  PERFORM bdc_load_field  USING 'BDC_CURSOR' l_char1.                             
  PERFORM bdc_load_field  USING l_char1  ws_bankdetl-ctry.                        
  PERFORM bdc_load_field  USING l_char2  ws_bankdetl-bankkey.                     
  PERFORM bdc_load_field  USING l_char3  ws_bankdetl-bankacct.                    

  PERFORM bdc_load_field  USING 'BDC_OKCODE' '=BDEL'.

  PERFORM bdc_load_dynpro USING 'SAPMF02D'    '0130'.
                      
  PERFORM bdc_load_field  USING 'BDC_OKCODE' '=UPDA'.

this is the BDCDATA file that was created

row program       dynpro      dynbegin f     nam                      fval
1      SAPMF02D      0101      X
2                                0000                       RF02D-KUNNR                 0001010078
3                                0000                       RF02D-D0130                 X
4                                0000                       USE_ZAV                          X
5                                0000                       BDC_OKCODE                 /00
6 SAPMF02D           0130 X
7                                0000                       BDC_CURSOR                      KNBK-BANKS(000005)
8                                0000                       KNBK-BANKS(000005)      US
9                                0000                       KNBK-BANKL(000005)      103000855
10                                0000                       KNBK-BANKN(000005)      98765432
11                                0000                       BDC_OKCODE                 =BDEL
12 SAPMF02D           0130 X
13                                0000                  BDC_OKCODE                 =UPDA
14 SAPMF02D           0101 X
15                                0000                  RF02D-KUNNR                 0001010078
16                                0000                  RF02D-D0130                      X
17                                0000                  USE_ZAV                               X
18                                0000                  BDC_OKCODE                 /00
19 SAPMF02D           0130 X
20                                0000                  BDC_CURSOR                 KNBK-BANKS(000003)
21                                0000                  KNBK-BANKS(000003)           US
22                                0000                  KNBK-BANKL(000003)      103000855
23                                0000                  KNBK-BANKN(000003)           1235
24                                0000                  BDC_OKCODE                 =BDEL
25 SAPMF02D            0130 X
26                                0000                  BDC_OKCODE                      =UPDA

replied

BDC_OKCODE = UPDA

This will trigger a commit and so close the current transaction, following data in BDC are discarded,

So either remove it or break into multiple transaction call.

Hint: have you considered  to make the switch and use method CMD_EI_AP => MAINTAIN_BAPI?

Regards,

Raymond

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