‎2006 Feb 08 6:27 AM
HI ,
frineds the following is the recording code of bdc , well
table has 10 lines ia able to enter only 10 lines of record from file ..rest iam unable ..no page down is working ..the trascation is z .
PERFORM open_group.
SORT w_output BY kalsm stunr .
DESCRIBE TABLE w_output LINES w_lines.
LOOP AT w_output.
MOVE-CORRESPONDING w_output TO i_bdc.
AT NEW kalsm.
PERFORM bdc_dynpro USING 'ZEU_MP_CONDITION_PROCEDURE' '0100'.
PERFORM bdc_field USING 'BDC_CURSOR'
'WA_ZEU_TXPK-KALSM'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=CREATE'.
PERFORM bdc_dynpro USING 'ZEU_MP_CONDITION_PROCEDURE' '0100'.
PERFORM bdc_field USING 'BDC_CURSOR'
'I_DETAIL-VTEXT(01)'.
PERFORM bdc_field USING 'BDC_OKCODE'
'/00'.
PERFORM bdc_field USING 'WA_ZEU_TXPK-KALSM'
i_bdc-kalsm. "'ZTEST4'.
PERFORM bdc_field USING 'WA_ZEU_TXPK-ZTEXT'
i_bdc-ztext. " kalsm.'test rec'.
PERFORM bdc_field USING 'WA_ZEU_TXPK-DATUA'
i_bdc-datua. "'02.01.2006'.
PERFORM bdc_field USING 'WA_ZEU_TXPK-DATUB'
i_bdc-datub. "'03.02.2006'.
PERFORM bdc_field USING 'WA_ZEU_TXPK-DOCTYPE'
i_bdc-doctype. "'DB'.
ENDAT.
w_read = w_read + 1.
w_count = w_count + 1.
CONCATENATE 'I_DETAIL-STUNR(' w_count ')' INTO w_bdc1.
CONCATENATE 'i_detail-zaehk(' w_count ')' INTO w_bdc2.
CONCATENATE 'i_detail-kschl(' w_count ')' INTO w_bdc3.
CONCATENATE 'i_detail-vtext(' w_count ')' INTO w_bdc4.
*perform bdc_field using 'I_DETAIL-STUNR(01)'
'10'.
*perform bdc_field using 'I_DETAIL-ZAEHK(01)'
'2'.
*perform bdc_field using 'I_DETAIL-KSCHL(01)'
't13'.
*perform bdc_field using 'I_DETAIL-VTEXT(01)'
'hjgh'.
PERFORM bdc_field USING w_bdc1 "'I_DETAIL-STUNR(01)'
i_bdc-stunr.
PERFORM bdc_field USING w_bdc2 "'I_DETAIL-ZAEHK(01)'
i_bdc-zaehk . "'1'.
PERFORM bdc_field USING w_bdc3 " 'I_DETAIL-KSCHL(01)'
i_bdc-kschl. "'t1'.
PERFORM bdc_field USING w_bdc4 "'I_DETAIL-VTEXT(01)'
i_bdc-vtext. "'test1'.
PERFORM bdc_dynpro USING 'ZEU_MP_CONDITION_PROCEDURE' '0100'.
PERFORM bdc_field USING 'BDC_CURSOR'
'I_DETAIL-VTEXT(01)'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=ztc_cond_p+'.
PERFORM bdc_field USING 'WA_ZEU_TXPK-KALSM'
'ZTEST4'.
PERFORM bdc_field USING 'WA_ZEU_TXPK-ZTEXT'
'test rec'.
PERFORM bdc_field USING 'WA_ZEU_TXPK-DATUA'
'02.01.2006'.
PERFORM bdc_field USING 'WA_ZEU_TXPK-DATUB'
'03.02.2006'.
PERFORM bdc_field USING 'WA_ZEU_TXPK-DOCTYPE'
'DB'.
PERFORM bdc_field USING 'I_DETAIL-STUNR(01)'
'110'.
PERFORM bdc_field USING 'I_DETAIL-ZAEHK(01)'
'10'.
PERFORM bdc_field USING 'I_DETAIL-KSCHL(01)'
't2'.
PERFORM bdc_field USING 'I_DETAIL-VTEXT(01)'
'test3'.
PERFORM bdc_transaction USING 'ZETR13'.
endloop.
PERFORM close_group.
‎2006 Feb 08 6:38 AM
Hello Farukh,
When u are executing this Z transaction in normal mode and if u have more than 10 lines to be entered, how do do it?
‎2006 Feb 08 6:31 AM
hi farukh,
1. ..no page down is working
In our code, it has to be SIMULATED
manually using ok_code.
regards,
amit m.
‎2006 Feb 08 6:38 AM
Hello Farukh,
When u are executing this Z transaction in normal mode and if u have more than 10 lines to be entered, how do do it?
‎2006 Feb 08 7:07 AM
Hi Farukh,
If its a Z transaction check whats the T-code provided in the tool bar for page down/up.
Use the function module SCROLLING_IN_TABLE to find when you have to pass the OK_CODE P++ to scroll down. But for this do a sample recording using SHDB for this transaction and find out the no of lines in the table control visible during the recording in default size and provide the OK_CODE if your line items to be filled in are more than the one visible in the screen in default size as if you make the recording done at default size that will be the size with SAP program uses when its executing BDC in the background mode.
Cheers
JK
‎2006 Feb 08 7:22 AM
Hi,
1. Do you have any field which is having like Serial No / Line item no etc . Example:1,2,3,.......
If you have like this.....Look at my Example code.
LOOP AT ITAB.
LNO = itab-seqnr + 1."Calc NEXT / NEW Line.
PAGE = ITAB-seqnr DIV 10."Calc Page No.
IF LNO < 10.
Page = 0.
ENDIF.
DO PAGE TIMES."T-Control for PAGE DOWN.
***Your BDC code for page down..
ENDDO.
LNO = LNO MOD 10.
IF LNO = 0.
LNO = 10.
ENDIF.
YOUR BDC CODE FOR T-CONTROL.
IF LNO = 10.
DO 1 TIME. "Next Page.
**YOUR BDC FOR PAGE DOWN.
ENDDO.
ENDIF.
LNO = LNO + 1."Line No Incriment.
PAGE = 0.
ENDLOOP.
Thanks.
If you need any thing further revert back to forum.
If this helps you reward with points.
Message was edited by: KDeepak