Application Development 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: 

BDC line item problem again

Former Member
0 Kudos
303

Hello ALL,

AGAIN THE SAME OLD PROBLEM EVERYONE FACING.

i am having 7 line items in my conntract cration ( VA41) but screen can accept only 6 so to accept more than seven item i used following logic....

LOOP AT it_item INTO wa_item WHERE vbeln EQ wa_header-bstkd.

COUNT = COUNT + 1.

MOVE COUNT TO w_tabix.

CONCATENATE 'VBAP-POSNR(' w_tabix ')' INTO w_posnr.

CONCATENATE 'RV45A-MABNR(' w_tabix ')' INTO w_mabnr.

CONCATENATE 'VBAP-ZMENG(' w_tabix ')' INTO w_zmeng.

CONCATENATE 'VBAP-VKAUS(' w_tabix ')' INTO w_vkaus.

CONCATENATE 'RV45A-VBAP_SELKZ(' w_tabix ')' INTO w_selkz.

IF ( w_tabix EQ 07 ) OR ( w_tabix EQ 13 ) OR ( w_tabix EQ 19 ).

  • PERFORM bdc_dynpro USING 'SAPMV45A' '4906'.

PERFORM bdc_field USING 'BDC_OKCODE'

'=POAN'.

ENDIF.

PERFORM bdc_field USING 'BDC_CURSOR'

w_MABNR.

PERFORM bdc_field USING w_mabnr

wa_item-matnr.

PERFORM bdc_field USING w_zmeng

wa_item-zmeng.

PERFORM bdc_field USING w_vkaus

wa_item-vkaus.

endloop.

inthis program i used incremental login hence once the line item no is 7 ok_code <b>POAN</b> is getting called and then next table control screen will come to accept 7 th line item come.

but in all screen mode, i can see before POAN getting called i gets message "FIELD VBAK-MATNR(07)" doesnt exist in the screen and then ok code <b>POAN</b> getting called with no input for next table control as 7 th record already been called.

i tested BDCDATA where first ok code POAN is populated and thn 7th record populated but still why 7th record get called before POAN.

2 REPLIES 2

former_member195698
Active Contributor
0 Kudos
78

Whenever you are calling the code for Index 7 , 13 etc. you have to call the

PERFORM bdc_dynpro USING 'SAPMV45A' '4906' 'X'

('X' to be passed for the field DYNBEGIN)

after the POAN command.

Regards,

Abhishek

Former Member
0 Kudos
78

Hi,

What u don't understand is how the BDC system works:

it is <b>not</b> like code processign where line2 is processesd <b>only after</b> line1 is processesd, but more like a <b>block</b>. all lines in the BDCDATA tab from one bdc_dynpro to another is processed <b>together</b>. u think of it as lines in code: 1st comes the screen, then the system activates the POAN ok_code (and the table control should change the screen) and then fill the fields. what really happens is the systems calls the screen, fills the fields and activates the ok_code in one step, so the POAN cannot be called before FIELD VBAK-MATNR(07).

What u have to do is every time u want to call a "page down" in your table control, enter these 2 lines together:

PERFORM bdc_dynpro USING 'SAPMV45A' '4906'.

PERFORM bdc_field USING 'BDC_OKCODE' '=POAN'.

after these lines u <b>must</b> have another line of dynpro (PERFORM bdc_dynpro USING 'SAPMV45A' '4906'.) again!

And BTW, if the table control contains 6 lines - i don't think a line 7 exists at all: as the BDC "looks" at it, there are always line01, line02,..., line06 line in the control table. Even after u hit page down, the 1st line is not line No. 7 but line No.1 (hit page down and then do F1->technical information in one of the fields in the 1st line. u will see at the bottom that it says in screen field ....(01) and not ....(07), no matter how many pages are filled in the table control. this does not mean u can't fill more than 6 lines, it just means that even after POAN was called (and u know u r now filling lines 7-11), u still have to number them 01-06.

I hope i made myself clear enough, if not ask further.

Pls award points if helps

Igal