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
1,074

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.

8 REPLIES 8
Read only

Former Member
0 Likes
952

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 /bend 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
952

what exactly u mena by 'selected'.

are the records, displayed in a table control on a screen, and you want to upload only entries you select. ?

then just add an indicator for select in the internal table, and while calling bdc, do it only for thos elines where indicator is set.

els,e what exactly is ur case ? whatever it is, there must be some indicater which identifies the 'selected' records, right ?

Read only

Former Member
0 Likes
952

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.

Read only

Former Member
0 Likes
952

Hi

There should be some criteria to eliminate few records.

So set a flag to 'X' for those records.

And upload only those records where flag is initial.

Thanks,

Deepti

Read only

Former Member
0 Likes
952

Hi

Just call the transaction for those records only which satisify your criteria.

Also, with session method, you can run it in mode-'A' and cancel whichever records you want to skip since you will have the screen running infront of you for every OK-code.

Reward points if helpful

Regards

Read only

Former Member
0 Likes
952

hi,

just put one condition in the loop.

first you will have records in internal table.so put one condition depending on your requriement, i.e.for example if you want to upolad only first 20 records in that case

loop at itab where sy-tabix LE 20.

performs for upolading data.

call transaction.......

endloop.

Read only

Former Member
0 Likes
952

just give condition at loop at itab where...

Read only

Former Member
0 Likes
952

HI,

Display your report to the user using ALV function module then user will check the records which want to be uploaded then process thro' call transaction.

Regards,

Suresh