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

condition1

Former Member
0 Likes
372

Hi to all experts

Doc no tax amt

01 11 100

01 12 200

02 13 25

02 13 75

Output is

Doc no tax amt

01 11 100

01 12 200

02 13 100

Process : first I check the doc no than check tax no

If both are sama as previous then I sum the amt. just

Like at 02 doc no. in first loop system check doc no = 01

Tax = 11 amt = 100.

At second loop system check doc no is same but tax is not sama.

At third time doc no = 02 tax = 13 amt = 25.

At forth time system check doc no is same, tax is also same then sum the amt.

Please help me for write the condition for checking the doc no and tax.

Please given me sample code for that.

Thanks in advance and reward also.

Regard : deep.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
351

Use SORT & Control break logic..

SORT itab BY doc_no tax.

LOOP AT itab.

AT NEW tax.

  • This will check any change in doc_no tax combination.

  • Write your logic

ENDAT.

ENDLOOP.

SORT itab BY doc_no.

LOOP AT itab.

AT NEW doc_no.

  • This will check any change in doc_no.

  • Write your logic

ENDAT.

ENDLOOP.

Hi to all experts

Doc no tax amt

01 11 100

01 12 200

02 13 25

02 13 75

Output is

Doc no tax amt

01 11 100

01 12 200

02 13 100

Process : first I check the doc no than check tax no

If both are sama as previous then I sum the amt. just

Like at 02 doc no. in first loop system check doc no = 01

Tax = 11 amt = 100.

At second loop system check doc no is same but tax is not sama.

At third time doc no = 02 tax = 13 amt = 25.

At forth time system check doc no is same, tax is also same then sum the amt.

Please help me for write the condition for checking the doc no and tax.

Please given me sample code for that.

Thanks in advance and reward also.

Regard : deep.

1 REPLY 1
Read only

Former Member
0 Likes
352

Use SORT & Control break logic..

SORT itab BY doc_no tax.

LOOP AT itab.

AT NEW tax.

  • This will check any change in doc_no tax combination.

  • Write your logic

ENDAT.

ENDLOOP.

SORT itab BY doc_no.

LOOP AT itab.

AT NEW doc_no.

  • This will check any change in doc_no.

  • Write your logic

ENDAT.

ENDLOOP.