‎2008 Feb 16 4:17 AM
How many ways to handel table controls for differennt screen resoultions .
‎2008 Feb 17 9:33 PM
Check this link.How to deal with table control in BDC?
http://arthur_ong.tripod.com/xab023.htm
Normally all the screns with table controls will have buttons to add(Insert) a Row, Delete a Row etc..
After adding data to 1st Row (it will have index 1)... press that insert button so a new Row is inserted again at 1st row..so this will have index 1.So in this way you can hard code the index to one.
The advantage is that if there are many rows then you will not have to keep a track of how many rows are inserted and when to press the page down button.
so if you have to populate the first record of table control:
BDC-FIELDNAME = <FIELDNAME>(01).
If you fill the second row:
BDC-FIELDNAME = <FIELDNAME>(02).
and so....
Now the problem is usually on how many records you have to load, because u can fill only the rows of table control available in the screen, If you have more records than it can be displayed yuo have to simulate the command to go next page.
The number of recod can be displayed can depend on pc resolution and many program haven't command to go to next page (in this case it could be impossible create a BDC program9.
A way to create a bdc program resolution indipendent is to work on the first and second row.
Place the first hit in the first row of bdc;
Place the second insert in the second row of bdc;
Place the last hit to the top of table control;
Place the next hit in the second row;
Place the last hit to the top of table control;
Place the next hit in the second row;
.... and so ...
‎2008 Feb 18 9:06 AM
Hi there
try and AVOID BDC altogether these days then you won't have the problem.
The problem with BDC's (apart from obsolete Dinosaur technology) is that for complex transactions it's almost impossible to replicate every single action that a user on a screen can input. Also screen fields, names and OK-CODES can change with each new release and the you are really hosed up.
Most stuff can be done these days using BAPI's which are SAP's preferred way of interfacing with the system. Incidentally as well as BAPI's you can also use BadI's called via a standard ABAP (rel 6 and up) so that's another possible solution to avoiding BDC's altogether.
Here's a sample mechanism of calling a user defined BadI from an Abap
*&---------------------------------------------------------------------*
*& Report Z_BADI_TEST
*&
*&---------------------------------------------------------------------*
*&
*&
*&---------------------------------------------------------------------*
REPORT Z_BADI_TEST.
* test call Badi from standard abap. (Only from rel 6.40 and above)
* do the following
* 1) define the Badi (SE18). For Abap call test uncheck multiple use
* and filter boxes
* 2) Implement the badi (SE19). Add any methods here in the implemntation
* 3) activate
*
* 4) define the standard class exithandler to the abap. This class is the "Badi caller
"
* 5) define an exit variable referring to your Badi Implementation interface
* this interface will normally be something like ZIF_EX***************
* You will see this in SE18/SE19.
*
* 6) Instantiate your instance of the badi (method call get_instance)
* 7) Now call any method(s) in the Badi.
*
class cl_exithandler definition load. "Declaration
data exit type ref to zif_ex__jimbotest. "Interface reference
data yes type c.
data: v_knvv type knvv. "Used in Fmod call in Badi methods
start-of-selection.
yes = ' '.
selection-screen begin of block b1.
parameters: r1 radiobutton group rad1,
r2 radiobutton group rad1,
r3 radiobutton group rad1.
selection-screen end of block b1.
parameters: p_kunnr type knvv-kunnr.
select single * into v_knvv
from knvv
where kunnr eq p_kunnr.
export v_knvv to memory id 'CUST6A'. "Save customer data for the function module
call method cl_exithandler=>get_instance "Factory method call
exporting "Method
exit_name = 'Z_JIMBOTEST' "Name of your BADI
changing instance = exit.
if not exit is initial.
if r1 = 'X'.
call method exit->dispord "Add-In call
exporting kunnr = p_kunnr.
endif.
if r2 = 'X'.
call method exit->dispfakt.
endif.
if r3 = 'X'.
call method exit->dispmat.
endif.
endif.