‎2010 Jan 19 5:28 AM
Hi all,
I have written a BDC program for z tode (zbdc_cust) in that i am entering values on screen and on click of save ,values are saved in ztable ZCUSTOMER.
Session is created sucessfully but the problem is there are 5 records in my text file but it wont take all record one by one.
It will ask me "Do you still want to keep the batch input data?" and after pressing no it will take first record and then next next record.this happens for each record.all previously processed records are taken again.
Following is my recording:
LOOP AT GTBL_CUST INTO WA_CUST.
PERFORM BDC_DYNPRO USING 'ZCUST_MPOOL_BDC' '0100'.
PERFORM BDC_FIELD USING 'BDC_OKCODE'
'=SAVE'.
PERFORM BDC_FIELD USING 'BDC_CURSOR'
'ZCUSTOMER-ZCUSTID'.
PERFORM BDC_FIELD USING 'ZCUSTOMER-ZCUSTID'
WA_CUST-ZCUSTID.
PERFORM BDC_FIELD USING 'ZCUSTOMER-ZFNAME'
WA_CUST-ZFNAME.
PERFORM BDC_FIELD USING 'ZCUSTOMER-ZLNAME'
WA_CUST-ZLNAME.
PERFORM BDC_FIELD USING 'ZCUSTOMER-ZADDR'
WA_CUST-ZADDR.
PERFORM BDC_FIELD USING 'ZCUSTOMER-ZMOBILE'
WA_CUST-ZMOBILE.
PERFORM BDC_FIELD USING 'ZCUSTOMER-ZSEX'
WA_CUST-ZSEX.
PERFORM BDC_FIELD USING 'ZCUSTOMER-ZAGE'
WA_CUST-ZAGE.
PERFORM BDC_INSERT_DATA.
ENDLOOP.
I want that all record should be taken one by one.
Thanks and Regards,
Arpita
‎2010 Jan 19 5:45 AM
Hi Arpita,
To solve your Issue,
Just Check your GTBL_CUST table, Does it contain only single record, IF yes then there is no point for applying loop on that table, If it contains more then one records then Clear and Refresh BDCDATA after PERFORM BDC_INSERT_DATA.
Thanks
Saurabh
‎2010 Jan 19 5:35 AM
Hi ,
check the GTBL_CUST table first , how many reacords are there. i think if u r entering through the Tcode only one record can be done. if it is excel or text file or csv file we have the n nunber of entries, so we can loop that.
check the BDCDATA too....
Regards,
Bharani
‎2010 Jan 19 5:41 AM
Hi,
My GTBL_CUST table has three records (Two from my notepad file and one is empty)
and BDCDATA table is filled properly for two records.
Thanks and Regards,
Arpita
‎2010 Jan 19 5:37 AM
Hi,
Clear & Refresh BDC tables after LOOP AT GTBL_CUST INTO WA_CUST. statement.
Nag
‎2010 Jan 19 5:42 AM
Hi,
WHile doing recording do it with inserting 2 records, by seeing your recording it shows that you have done recording for only one record, thats why it is inserting one record.
do the recording doing below things
Insert one record, click on new entry and insert the second entry.
Regards
Bala Krishna
‎2010 Jan 19 5:45 AM
Hi Arpita,
To solve your Issue,
Just Check your GTBL_CUST table, Does it contain only single record, IF yes then there is no point for applying loop on that table, If it contains more then one records then Clear and Refresh BDCDATA after PERFORM BDC_INSERT_DATA.
Thanks
Saurabh