2008 May 08 7:01 AM
Ive prepard BDC for FB60, in case of line items exceeding 10 (total visible rows in table control), i need to make use of "p+" okcode. But for some reasons, its not working.
my BDCDATA table gets filled up perfectly with P+ okcode for the rows exceeding 10.
But when i execute, on reaching 11th row,it works fine (moves the table one up too), but ahead, doesn't show any okcode after 'P+', so I am unable to proceed ahead... If anyone has faced any such situation, plese let me know if im missing any statement.
This bdc is a very urgent requirement, so would (give points) appreciate help on this asap.
I will paste my code here, the main parts tht can b problematic. So that you all get rough idea of it. Meanwhile im tryin few other ways out if it works.
Code is:
DESCRIBE TABLE ITAB LINES TOTAL_ITEMS.
L_DIFF = TOTAL_ITEMS - 10.
LOOP AT itab.
PERFORM bdc_dynpro USING 'SAPMF05A' '1100'.
PERFORM bdc_field USING 'BDC_OKCODE'
'/00'.
ON CHANGE OF itab-accnt.
L_COUNT = 1.
PERFORM bdc_dynpro USING 'SAPMF05A' '1100'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=MORE'.
*********here code for entry of header data comes...**
ENDON.
IF L_COUNT GT 10 AND L_DIFF GT 0.
PERFORM bdc_dynpro USING 'SAPMF05A' '1100'.
PERFORM bdc_field USING 'BDC_OKCODE'
'P+'.
ELSE.
PERFORM bdc_dynpro USING 'SAPMF05A' '1100'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=PI'.
ENDIF.
****Entry of line items starts here..
CONCATENATE 'ACGL_ITEM-HKONT(' l_count ')' INTO l_temp.
PERFORM bdc_field USING 'BDC_CURSOR'
l_temp.
PERFORM bdc_field USING l_temp
itab-hkont.
CONCATENATE 'ACGL_ITEM-SHKZG(' l_count ')' INTO l_temp.
PERFORM bdc_field USING l_temp
itab-shkzg.
CONCATENATE 'ACGL_ITEM-PRCTR(' l_count ')' INTO l_temp.
PERFORM bdc_field USING l_temp
itab-prctr.
PERFORM bdc_dynpro USING 'SAPMF05A' '0300'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=ZK'.
l_amt = itab-wrbtr1.
CONDENSE l_amt NO-GAPS.
PERFORM bdc_field USING 'BSEG-WRBTR'
l_amt.
PERFORM bdc_field USING 'BSEG-SGTXT'
itab-sgtxt1.
PERFORM bdc_field USING 'DKACB-FMORE'
'X'.
PERFORM bdc_dynpro USING 'SAPLKACB' '0002'.
if l_count GE 10.
PERFORM bdc_dynpro USING 'SAPMF05A' '1100'.
PERFORM bdc_field USING 'BDC_OKCODE'
'/00'.
endif.
L_COUNT = L_COUNT + 1.
ENDLOOP.
PERFORM bdc_field USING 'BDC_OKCODE'
'=BU'.
CALL TRANSACTION 'FB60' USING bdcdata MODE call_mode.
Whenever the 11th row comes, my table control shows 11th row perfectly, but its not able to catch okcode '=ZK' after that.
2008 May 08 7:07 AM
Hi,
U have to include the code of P+ in the BDCDATA depending upon the number of lines which are more than 10.
eg. DESCRIBE table itab lines lv_lin.
lv_loop = lv_lin - 10. and fill the P+ ok code lv_loop times.
Hope this helps
Thank you.
Reward points if found useful.
2008 May 08 7:09 AM
Hi Divya,
I think I can help you out, but could u plz post your code in here atleast the recording part.
Regards,
Kiran
2008 May 08 7:26 AM
I will paste my code here, the main parts tht can b problematic. So that you all get rough idea of it. Meanwhile im tryin few other ways out if it works.
Code is:
DESCRIBE TABLE ITAB LINES TOTAL_ITEMS.
L_DIFF = TOTAL_ITEMS - 10.
LOOP AT itab.
PERFORM bdc_dynpro USING 'SAPMF05A' '1100'.
PERFORM bdc_field USING 'BDC_OKCODE'
'/00'.
ON CHANGE OF itab-accnt.
L_COUNT = 1.
PERFORM bdc_dynpro USING 'SAPMF05A' '1100'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=MORE'.
*********here code for entry of header data comes...**
ENDON.
IF L_COUNT GT 10 AND L_DIFF GT 0.
PERFORM bdc_dynpro USING 'SAPMF05A' '1100'.
PERFORM bdc_field USING 'BDC_OKCODE'
'P+'.
ELSE.
PERFORM bdc_dynpro USING 'SAPMF05A' '1100'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=PI'.
ENDIF.
****Entry of line items starts here..
CONCATENATE 'ACGL_ITEM-HKONT(' l_count ')' INTO l_temp.
PERFORM bdc_field USING 'BDC_CURSOR'
l_temp.
PERFORM bdc_field USING l_temp
itab-hkont.
CONCATENATE 'ACGL_ITEM-SHKZG(' l_count ')' INTO l_temp.
PERFORM bdc_field USING l_temp
itab-shkzg.
CONCATENATE 'ACGL_ITEM-PRCTR(' l_count ')' INTO l_temp.
PERFORM bdc_field USING l_temp
itab-prctr.
PERFORM bdc_dynpro USING 'SAPMF05A' '0300'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=ZK'.
l_amt = itab-wrbtr1.
CONDENSE l_amt NO-GAPS.
PERFORM bdc_field USING 'BSEG-WRBTR'
l_amt.
PERFORM bdc_field USING 'BSEG-SGTXT'
itab-sgtxt1.
PERFORM bdc_field USING 'DKACB-FMORE'
'X'.
PERFORM bdc_dynpro USING 'SAPLKACB' '0002'.
if l_count GE 10.
PERFORM bdc_dynpro USING 'SAPMF05A' '1100'.
PERFORM bdc_field USING 'BDC_OKCODE'
'/00'.
endif.
L_COUNT = L_COUNT + 1.
ENDLOOP.
PERFORM bdc_field USING 'BDC_OKCODE'
'=BU'.
CALL TRANSACTION 'FB60' USING bdcdata MODE call_mode.
Whenever the 11th row comes, my table control shows 11th row perfectly, but its not able to catch okcode '=ZK' after that.
2008 May 08 9:54 AM
Hi all! thanks for your posts...
I've made few changes in the code n got it workin the way i wantd.
2008 May 22 7:17 AM
hi divya
can u send this BDC for fb60 complete code.
i got the same problem
reply
jigar p
2011 May 05 6:34 AM
Hi,
we too are facing the same problem. please send the code .
Regards,
Srinivas.
9849376675
2008 May 08 7:10 AM
Hi Divya,
While recording the BDC, press the + Button provided at the bottom of the table control , see what is the code for that button .
After that , when you are inserting the rows in the table control , instead of inserting 10 rows at one go and then pressing page up , loop at your internal table and for every row in your internal table, execute the code for + button and assign the values to the internal table field.
By doing this , the code will insert first one row in the table control and then assign the values to it , so you will not face the problem you are facing .
Hope this will help.
| User | Count |
|---|---|
| 3 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |