‎2011 Mar 08 7:30 AM
Hi Experts,
I have a requirement that posting of Asset values to ABZON transaction. for that i created one bdc program for ABZON transaction, but i am not able to handle page down in that program. when i trying to excute the bdc program, it is working fine for first 6 lines, after that records are over writting. so how can i solve this problem.
please see below mentioned code
loop at t_upload_item into wa_upload_item where asset = wa_upload_hd-asset.
v_indx1 = v_indx1 + 1.
v_indx = v_indx1.
v_indx = sy-tabix.
CONCATENATE 'EL1(' v_indx ')' INTO v_fnam.
perform bdc_field using v_fnam wa_upload_item-asset.
CONCATENATE 'EL2(' v_indx ')' INTO v_fnam.
perform bdc_field using v_fnam wa_upload_item-Asset_Sub.
CONCATENATE 'ELR1(' v_indx ')' INTO v_fnam.
perform bdc_field using v_fnam wa_upload_item-Amou_post.
if v_indx1 gt 6.
perform bdc_dynpro using 'SAPLAMDP' '0110'.
perform bdc_field using 'BDC_OKCODE' '=P+'.
'=TC_115_INSERT_LINE'.
clear v_indx.
clear v_indx1.
v_indx1 = v_indx1 + 1.
v_indx = v_indx1.
CONCATENATE 'EL1(' v_indx ')' INTO v_fnam.
perform bdc_field using v_fnam wa_upload_item-asset.
CONCATENATE 'EL2(' v_indx ')' INTO v_fnam.
perform bdc_field using v_fnam wa_upload_item-Asset_Sub.
CONCATENATE 'ELR1(' v_indx ')' INTO v_fnam.
perform bdc_field using v_fnam wa_upload_item-Amou_post.
endif.
endloop.
regards,
gsreddy.
‎2011 Mar 08 8:57 AM
Check that index value after pagedown wheather the INDEX is getting incremental or set to initial index.if index after 6th record is one, then you can use the MOD value to set the index counter.
‎2011 Mar 08 9:07 AM
Hi ,
it seems there is some countr problem..
Try to use below code...
clear v_indx.
loop at t_upload_item into wa_upload_item where asset = wa_upload_hd-asset.
v_indx = v_indx + 1.
CONCATENATE 'EL1(' v_indx ')' INTO v_fnam.
perform bdc_field using v_fnam wa_upload_item-asset.
CONCATENATE 'EL2(' v_indx ')' INTO v_fnam.
perform bdc_field using v_fnam wa_upload_item-Asset_Sub.
CONCATENATE 'ELR1(' v_indx ')' INTO v_fnam.
perform bdc_field using v_fnam wa_upload_item-Amou_post.
if v_indx EQ 6.
perform bdc_dynpro using 'SAPLAMDP' '0110'.
perform bdc_field using 'BDC_OKCODE' '=P+'.
clear v_indx.
ENDIF.
clear wa_upload_item .
ENDLOOP.
‎2011 Mar 08 10:37 AM
Hi Niraj,
Thanks for your reply.
i tried with your code, but it is over writting the eariler values,
i.e. when i execute the program first it displaying 6(1 to 6) rows, after when i press enter
the earlier values are overwrite and next 6 records are dispalying (7 to 12).
so please help me to reslove my issue.
regards,
suresh.
‎2011 Mar 08 12:03 PM
Hi,
Add the Enter command at the 6th line item in your BDC so that previos line gets stored.
if v_indx EQ 6.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_dynpro using 'SAPLAMDP' '0110'.
perform bdc_field using 'BDC_OKCODE' '=P+'.
clear v_indx.
ENDIF.
‎2011 Mar 08 9:09 AM
Hi Check this out,
IF v_index1 =6.
* if you press page down after filling all the rows
* then the last entry appears in the first row by default
* so we need to fill the data from the 2 row
v_index1= 1.
* Page down
PERFORM fill_bdc_field USING 'BDC_OKCODE' '=P+'
CHANGING it_bdcdata.
ENDIF.
‎2011 Mar 08 9:50 AM
Hi try this code:
v_indx1 = 0.
loop at t_upload_item into wa_upload_item where asset = wa_upload_hd-asset.
if v_indx1 gt 6.
perform bdc_dynpro using 'SAPLAMDP' '0110'.
perform bdc_field using 'BDC_OKCODE' '=P+'.
v_indx1 = 2.
perform bdc_dynpro using 'SAPLAMDP' '0110'.
perform bdc_field using 'BDC_CURSOR'
'EL1(02)'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
else.
v_indx1 = v_indx1 + 1.
endif.
CONCATENATE 'EL1(' v_indx ')' INTO v_fnam.
perform bdc_field using v_fnam wa_upload_item-asset.
CONCATENATE 'EL2(' v_indx ')' INTO v_fnam.
perform bdc_field using v_fnam wa_upload_item-Asset_Sub.
CONCATENATE 'ELR1(' v_indx ')' INTO v_fnam.
perform bdc_field using v_fnam wa_upload_item-Amou_post.
endloop.
‎2011 Mar 08 11:31 AM
Check what is the INDEX value for the 7 the record, Is it 01 or 07.
‎2011 Mar 09 4:26 AM
Hi,
index value for seventh record is 1, but it should be 7.
i am not able to handle page down, all records are coming on first page, but we need to do page down.
regards,
gsreddy.
‎2011 Mar 09 8:54 AM
If the index value is 7 for the 7th record, you can keep the counter as 7, for the 8th record keep the counter as 8 .... etc and Do the page down when remainder(MOD) value is 0 when it is dived by 6.then it can work.
‎2011 Mar 09 9:47 AM
v_indx1 = 1.
loop at t_upload_item into wa_upload_item where asset = wa_upload_hd-asset.
if v_mod = 0 and v_indx1 > 6.
perform bdc_dynpro using 'SAPLAMDP' '0110'.
perform bdc_field using 'BDC_OKCODE' '=P+'.
'=TC_115_INSERT_LINE'.
CONCATENATE 'EL1(' v_indx1 ')' INTO v_fnam.
perform bdc_field using v_fnam wa_upload_item-asset.
CONCATENATE 'EL2(' v_indx1 ')' INTO v_fnam.
perform bdc_field using v_fnam wa_upload_item-Asset_Sub.
CONCATENATE 'ELR1(' v_indx1 ')' INTO v_fnam.
perform bdc_field using v_fnam wa_upload_item-Amou_post.
endif.
if v_indx1 < 7
CONCATENATE 'EL1(' v_indx1 ')' INTO v_fnam.
perform bdc_field using v_fnam wa_upload_item-asset.
CONCATENATE 'EL2(' v_indx1 ')' INTO v_fnam.
perform bdc_field using v_fnam wa_upload_item-Asset_Sub.
CONCATENATE 'ELR1(' v_indx1 ')' INTO v_fnam.
perform bdc_field using v_fnam wa_upload_item-Amou_post.
Endif.
v_mod = v_indx1 / 6.
v_indx1 = v_indx1 + 1.
endloop.
‎2011 Mar 10 5:23 AM
Sorry, you can use the mod value as
"v_mod = v_indx1 MOD 6" instead of "v_mod = v_indx1 / 6" in the above code.
i think now it can work.
.