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

Page down functionality in table control BDC-CJ02 tcode

Former Member
0 Likes
1,008

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.

3 REPLIES 3
Read only

Sandra_Rossi
Active Contributor
0 Likes
648

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

Read only

Former Member
0 Likes
648

Try doing table control with wizard and just check the code used for scroll/page down , it would be helpful.

Read only

Former Member
0 Likes
648

What I've done to get around this is:

  • read the input file or table in reverse order
  • add a single entry
  • move the cursor to the top left and enter the record
  • insert a single line in the table
  • repeat until finished with data

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