Hi Jubish
Finally I got some time to check this in a system. YES it works.
Here is what I did
1. Created a container element BKPF_OBJECT_TAB of type BO BKPF - a multiline container element
2. Created a container element BKPF_KEYS, which is a multiline element of type ZBKPF_BO_KEY - which is a structure of BKPF Key - BUKRS, BELNR, GJAHR - so I have a table of BKPF KEYS
3. Populated the key table BKPF_KEYS with existing BKPF documents in the system (I just added 4 keys for my test as INITIAL VALUES. In your case, you can add based on your workflow - maybe via a background task)
Initial Values were documents 100000001, 100000002, 100000003 and 100000004 ...all belonging to company code IN01, Fiscal Year 2008
4. Then I started a Loop - Loop until LOOP_COUNTER >= 4 ..... LOOP_COUNTER is a container type INT variable; initial value 0.
Value 4 was fixed as I had sampled 4 BKPF keys, you can count your table lines in a background step and determine the max counter threshold dynamically (maybe in the same background task as in above step)
5. First Step in the Loop -> Increment LOOP_COUNTER by 1
6. Then called a BACKGROUND task which calls METHOD GENERICINSTANTIATE of BO SYSTEM to generate the instance of the keys one by one.
7. Here is the screen shot of the Workflow Definition
8. Here is the screen shot of the BINDING between the Workflow and the Task
9. Here is the Task Definition
10. Here is the Binding between the Task And Method
11. Here is the Workflow Log
12. Here is the GOS Workflow of the Objects
CHEERS!!!!!