Hi Kumar,
Please find my below understanding about your thread.
You want to update the balance of GL 3300000 as follows:
ADD Balance of GL 3300000 & all remaining P&L GLs (starting from 4000000-899999)
I have written below code to populate Balance of GL 3300000.
DATA : WA TYPE _ty_s_TG_1,
BALANCE TYPE DE_BALANCE,
NEW_INDEX TYPE SY-TABIX.
SORT RESULT_PACKAGE BY GL_AC.
loop at RESULT_PACKAGE into WA where GL_AC = '3300000'. "FIND BALANCE OF 33000000
BALANCE = WA-/BI0/BALANCE.
exit.
endloop.
NEW_INDEX = SY-TABIX. " STORE IT'S(3300000) INDEX
loop at RESULT_PACKAGE into <RESULT_FIELDS> FROM NEW_INDEX " ADD BALANCE FROM '0004000000' TO '0008999999'
where GL_AC between '0004000000' AND '0008999999'.
BALANCE = BALANCE + <RESULT_FIELDS>-/BI0/BALANCE.
ENDLOOP.
loop at RESULT_PACKAGE into <RESULT_FIELDS> FROM NEW_INDEX. " UPDATE BALANCE OF GL 3300000
<RESULT_FIELDS>-/BI0/BALANCE = BALANCE.
exit.
endloop.
Harshawardhan