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: 

update routines

Former Member
0 Kudos
121

hi,

i am using the data source ec_pca_3. the balance field is showing zero for all the records. i read the oss note 577644 and tried to create the routine in the update rules.

when i inserted the code i get the error as

e:field "data_package" unknown. it is neither in one of specified tables nor defined by the "data" statement.

i have no idea about abap routines. can anybody help me with this.

the code i have got is

data: ls_data_package like DATA_PACKAGE,

lt_data_package like DATA_PACKAGE occurs 0,

lt_data_p_coll like DATA_PACKAGE occurs 0,

ld_maxper like t009-anzbp value '16', "adapt for FI-SL

ld_n_per like t009-anzbp.

data: begin of ls_fiscper,

fiscyear type /bi0/oifiscyear,

fiscper3 type /bi0/oifiscper3,

end of ls_fiscper.

refresh: lt_data_package.

loop at DATA_PACKAGE into ls_data_package.

move ls_data_package-fiscper to ls_fiscper.

ld_n_per = ld_maxper - ls_fiscper-fiscper3.

  • calculate 0BALANCE from debit and credit value

ls_data_package-balance = ls_data_package-debit

+ ls_data_package-credit.

modify DATA_PACKAGE from ls_data_package.

if ls_data_package-balance ne 0.

  • if 0BALANCE is not zero =>

  • append periods to internal table for datapackage

clear: ls_data_package-credit,

ls_data_package-debit,

ls_data_package-quantity.

do ld_n_per times.

add 1 to ls_fiscper-fiscper3.

move ls_fiscper to ls_data_package-fiscper.

collect ls_data_package into lt_data_package.

enddo.

endif.

endloop.

loop at lt_DATA_PACKAGE into ls_data_package.

collect ls_data_package into lt_data_p_coll.

endloop.

loop at DATA_PACKAGE into ls_data_package.

collect ls_data_package into lt_data_p_coll.

endloop.

free lt_data_package.

data_package[] = lt_data_p_coll[].

free lt_data_p_coll.

thanx,

Ravi.

1 ACCEPTED SOLUTION

Former Member
0 Kudos
84

Hi Ravi;

It looks like a typo to me. Try replacing DATA_PACKAGE with LT_DATA_PACKAGE; you have LT_DATA_PACKAGE defined as a table in the code.

Cheers,

John

2 REPLIES 2

Former Member
0 Kudos
85

Hi Ravi;

It looks like a typo to me. Try replacing DATA_PACKAGE with LT_DATA_PACKAGE; you have LT_DATA_PACKAGE defined as a table in the code.

Cheers,

John

Former Member
0 Kudos
84

Hi,

please have a look at the start routine, there should be the correct definition for the data_package.

Where did you put your coding in the data flow?

Cheers, Dirk