Application Development and Automation 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: 
Read only

BDC session:not taking data properly from file during session execution?

arpita_churi3
Active Participant
0 Likes
618

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

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
585

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

5 REPLIES 5
Read only

BH2408
Active Contributor
0 Likes
585

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

Read only

0 Likes
585

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

Read only

Former Member
0 Likes
585

Hi,

Clear & Refresh BDC tables after LOOP AT GTBL_CUST INTO WA_CUST. statement.

Nag

Read only

former_member585060
Active Contributor
0 Likes
585

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

Read only

Former Member
0 Likes
586

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