Doing row-by-row processing when you can do it in a single SQL is not a good idea to start with. The reason why your SQL shows up as the longest running query is because it executes against a large table as many times as you have rows in the same table (it is inside the for loop created on the same table)! Trying to optimize it is no different from chasing the dog's tail.

The real problem is lack of SQL (and Pl/SQL) programming knowledge on the developer side. The entire for loop routine can be implemented as a single statement. There are only two things going on inside the loop: 1) if/elsif/else and 2) some math is implemented using about a dozen of unnecessary intermediate variables.

Here is an example of what I am talking about:
This:
IF CRDR='CR' then
op_bal1:=0-op_bal1;
select name into pname from acc_mast where ac_code=tparty;
insert into ledger_temp (sno,party,NAME,bill_dt,narration,cramt,BAL_AMT,STAT)
values (sn,TPARTY,pname,BILL_DT1,'/ OPENING BALANCE -----> ',abs(OP_BAL1),abs(OP_BAL1),'CR');
elsif crdr='DR' then
select name into pname from acc_mast where ac_code=tparty;
insert into ledger_temp (sno,party,NAME,bill_dt,narration,dramt,bal_amt,STAT)
values (sn,TPARTY,pname,bill_dt1,'/ OPENING BALANCE -----> ',ABS(OP_BAL1),abs(OP_BAL1),'DR');
end if;

... can be replaced in this:
insert into ledger_temp (sno,party,NAME,bill_dt,narration,cramt,BAL_AMT,STAT)
select sn,TPARTY,name,BILL_DT1,'/ OPENING BALANCE -----> ',abs(OP_BAL1),abs(OP_BAL1),CRDR
from acc_mast where ac_code=tparty;

... by only eliminating one unnecessary variable pname, taking crdr variable into the list as oppose to using it in the IF/ELSIF and combining select with insert statements.

Send the developer to SQL 101 class or hire a better one.

PS: believe it or not but abs(0-op_bal1) = op_bal1 !!! )