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

regarding excel file

Former Member
0 Likes
364

Hi,

my reqirement on excelsheet.one of the condition is that file will be rejected when more than one company code or more than 200 line item per document...the comapny code in the excelsheet is col06,and the line item is col24.how can we write code for this ..?wht am i checking the coding is not working so,send me useful code.it isreally very urgent..

<b>I repeat per document not per file</b> .

Thanks In advance

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
349

Hi,

what i can understand from your question that only you want to write those records which have lt 200 items for the document.

sort it_datatab by col06.

itab[] = it_dbtab[].

loop at it_datatab into wa_datatab.

at new col06.

*<or you can use on change of it_dbtab-col06 if col06 is not your first field>

v_bukrs = wa_datatab-col06. " take the company code into a variable

clear count.

endat.

cnt = cnt + 1 .

if cnt Gt 200 .

delete itab where col06 = v_bukrs.

endif.

endloop.

now your itab contains the value which document no have lt 200 line items.

if it is also not satisfying your requirement then let me know.

regards

1 REPLY 1
Read only

Former Member
0 Likes
350

Hi,

what i can understand from your question that only you want to write those records which have lt 200 items for the document.

sort it_datatab by col06.

itab[] = it_dbtab[].

loop at it_datatab into wa_datatab.

at new col06.

*<or you can use on change of it_dbtab-col06 if col06 is not your first field>

v_bukrs = wa_datatab-col06. " take the company code into a variable

clear count.

endat.

cnt = cnt + 1 .

if cnt Gt 200 .

delete itab where col06 = v_bukrs.

endif.

endloop.

now your itab contains the value which document no have lt 200 line items.

if it is also not satisfying your requirement then let me know.

regards