Application Development and Automation 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: 
Read only

Problem with BDC program for ABZON transaction

Former Member
0 Likes
1,450

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.

11 REPLIES 11
Read only

Former Member
0 Likes
1,325

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.

Read only

nirajgadre
Active Contributor
0 Likes
1,325

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.

Read only

0 Likes
1,325

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.

Read only

0 Likes
1,325

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.

Read only

Former Member
0 Likes
1,325

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.

Read only

Former Member
0 Likes
1,325

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.

Read only

Former Member
0 Likes
1,325

Check what is the INDEX value for the 7 the record, Is it 01 or 07.

Read only

0 Likes
1,325

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.

Read only

0 Likes
1,325

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.

Read only

0 Likes
1,325

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.

Read only

0 Likes
1,325

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.

.