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

tricky question???

Former Member
0 Likes
589

Hi ALL,

Hope all are doing fine!!!

This is an interview question ,,,this is as follows:-

<b>if there are some records in internal table ,,,,,i want to upload only selected records ,not all records into the database tables via transaction...thru BDC..how is it possible in session and call transaction methods?? pls remember that only selected records should be uploaded </b>

Pls provide the answer

Quick solutions are highly appreciated and points wil sure be rewarded.

Regards,

ABC XYZ.

4 REPLIES 4
Read only

Former Member
0 Likes
558

Hi,

Once you have the internal table with all the records, since you said it is a selectable data, there must be some single chracter field which would be set to 'X' if selected.

So, you can upload onlt those recrods which have an 'X' in that field.

loop at itab where sel = 'X'.

*Build bdcdata structure.

*Call transaction or bdc_insert..

endloop.

Regards,

Ravi

Read only

0 Likes
558

Hi,

Thanx Ravi,,,,

but but i want to select records while uploading in the transaction,,,that means i shud provide an option so that user can select the record(s) while uploading online..

pls provide solution ..

Regards,

ABC XYZ

Read only

0 Likes
558

HI..,

Use the <b>BDC SESSION method</b> with <b>FOREGROUND Processing</b> ( all screens )...

Now u can watch each and every session and if u dont want a particular record (transaction) to get updated then just give<b> /N</b> in the <b>BDC_OKCODE</b> and press enter.. then this particular record will not get updated and it starts the next record..

if u enter<b> /bend </b>and press enter the whole session ( total records will not get updated )

This works only with BDC SESSION METHOD.

regards,

sai ramesh

Read only

Former Member
0 Likes
558

first upload the records and display the same in an ALV report. Also, give a checkbox to teh ALV report. Now, user can select the records.

loop at itab where checkbox = 'X'.

here u need to use these records to upload to SAP using BDC.

endloop.

hope it clears.

reward points and avoid duplicate threads.