‎2011 Sep 14 1:55 AM
Hi Friends,
I am doing a BDC with Table control for Tcode CJ02.
When I reach certain number of records, say 13, the page down functionality doesnt work.I tried different ways like using the BDC_OKCODE as "=P" and "=P+".Also, I tried doing a recording by pressing the down key in the table contral, in SHDB, but none of them worked.
Refered a post in SDN as well, but it doesnt hold any solution.
Do throw some light on the same to achieve page down functionality for the bdc tcode CJ02.
Thanks in advance.
Shri.
‎2011 Sep 14 5:27 AM
Hi,
I already posted an answer to that here :
P+ (=P+ in the BDC) is not a universal function code, but only one which is defined in ABAP lists . So, 99% of time, it doesn't work for all others situations (like yours).
Scrolling a table control is not so easy to do. When you record a page down on a table control in SHDB, you'll get probably a /00 which corresponds to Enter. When you play the recording, it won't scroll. The issue is that "page down" is processed in 2 parts, it changes the "top line" of the table control, and executes Enter. But it's not possible to record/play the "top line" information.
The solution is that the program usually implements a function code:
either "add new line"
or "position at line"
Sometimes, the function code is hidden so you must look at inside the program (or search SAP notes, like here: [SAP note 187946 (No positioning on PRT overview in routing)|https://service.sap.com/sap/support/notes/187946 ])
And sometimes, there's no function code at all, and then you're stuck ! (or use SAP GUI scripting, but it may only work in dialog).
For CJ02, I can't tell how to scroll through BDC, but anyway, there is a BAPI (don't remember the name, search the forum, it will be easy to find it), so you should always prefer them over BDC.
Sandra
‎2011 Sep 14 5:47 AM
Try doing table control with wizard and just check the code used for scroll/page down , it would be helpful.
‎2012 May 29 2:56 PM
What I've done to get around this is:
This way I can get the data in its original order (since we're basically filling the BDC backwards by using the insert line method). The only caveat I have is that the maximum number of records you can do per transaction is not constant so it will take some fine tuning. I've had transactions which will let me enter an infinite number of records this way and I've had transactions which won't even let me fill up a single page.
Good luck!
Scott