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

Amount addition

Former Member
0 Likes
846

Hi all,

My requirement is i have 850 lines in an excel.

i need to park the document only if the debit and credit amount is equal .

Actually iam parking the document for every 800 lines.

how to get the total amt i.e equal to zero for all i.e greater than 800 line items before parking.

Hi all,

My requirement is i have 850 lines in an excel.

i need to park the document only if the debit and credit amount is equal .

Actually iam parking the document for every 800 lines.

how to get the total amt i.e equal to zero for all i.e greater than 800 line items before parking.

5 REPLIES 5
Read only

Former Member
0 Likes
818

Hi Santosh,

You can get all your data into the internal table first.

The you can validate like this.

Suppose you debit amt is w_debit and w_credit just say

if w_debit = w_credit and w_linecount = 800.

parking logic..

Hope it helps!

Much Regards,

Amuktha.

Edited by: Amuktha Naraparaju on Feb 12, 2009 6:35 AM

Edited by: Amuktha Naraparaju on Feb 12, 2009 6:38 AM

Read only

Former Member
0 Likes
818

Hi,

Read the data in an internal table,and then sort the table based on some key filed that is may be unique .Then in Loop on intrenla tbale keep on adding the amount and increment the counter,whenever counter reach the line 800,simply check the sum is zero or not if it is then park the data else exit.

Pooja

Read only

Former Member
0 Likes
818

Hi,

Use thsi FM " FOR_ALL_SKC1A " to get the subtotal..

write the logic like

if lines < 800.

call function FOR_ALL_SKC1A in u r program

It will automatically performs the subtotal...

Iam just giving an example...write u r own logic and call this FM..

Regards

Kiran

Read only

Former Member
0 Likes
818

Hi,

You can do one thing in that excel file before you start parking,

at the row 65535 you give a sum for the debit and credit column in the excel sheet

now in the program be you start parking for first 800 lines also you can check the sum and then start uploading....

use the below code to check if the debit and credit total is equal or not....

data : t_itab type table of ALSMEX_TABLINE,
      fs_itab type ALSMEX_TABLINE.

data : w_credit type i,
w_debit type i.

CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE'
  EXPORTING
    filename                      = fielname
    i_begin_col                   = 1
    i_begin_row                   = 65535
    i_end_col                     = <col till where the credit and debit are totalled ie. 10 or 20 or 15>
    i_end_row                     = 65535
  tables
    intern                        = t_itab
 EXCEPTIONS
   INCONSISTENT_PARAMETERS       = 1
   UPLOAD_OLE                    = 2
   OTHERS                        = 3
          .
IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.

read table t_itab into fs_itab with key col = <column_number_debit>.
w_debit = fs_itab-value.
read table t_itab into fs_itab with key col = <column_number_credit>.
w_credit = fs_itab-value.

hope this helps you to fix the issue

Regards,

Siddarth

Read only

Former Member
0 Likes
818

Hi Santosh,

Are you still facing any problems with the amount addition, please do let us know

Regards,

Siddarth