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

Table updation

Former Member
0 Likes
545

Respected Gurus

Please help!!!!

My requirement is , i have one z table in which i am displaying aufnr , matnr , charg , menge. In my ztable the fifth field is to be filled by user.the name of the fifith field is Batch_output.... Now i want if the summation of the quantity is grater than or equal to the summation of the batch_outpur i.e the fifth field than i should allow the user to save those value in the ztable otherwise i have to display an error message in the ztable..

please i have to deliver this report by today , its very urgent...please help/ guide me , if possible with ABAP code...

Hoping to be favoured with an early reply...

Regards

Neeraj(9881191759)-pune

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
522

hi neeraj

loop at table .

sum = sum + batch_output.

quantity = quantity + menge.

endloop.

if quantity > sum

write save statment

else

loop at table .

batch_output = ' '

endloop.

error message

endif.

reagrds

navjot

reward if helpfull

4 REPLIES 4
Read only

Former Member
0 Likes
522

how u are updating Z tables ?

is there any program is there to do so ?

<b>maintain 2 internal tables

one --->list of orders

tw0 -


>orders with all confirmations.

loop at itab1.

loop at itab2 where aufnr = itab1-aufnr.

menge = itab1-menge + itab2-menge.

modify itab1.

endloop.

endloop.

one final internal table will have SUM ( given my user).

loop at itab3.

if itab3-menge >= sum.

move-corresping itab3 to ztable.

else.

endif.</b>

Regards

Prabhu

Read only

0 Likes
522

yeah i am dng it through insert statement..

insert ztable values wa_up_table.

regards

Neeraj

Read only

Former Member
0 Likes
523

hi neeraj

loop at table .

sum = sum + batch_output.

quantity = quantity + menge.

endloop.

if quantity > sum

write save statment

else

loop at table .

batch_output = ' '

endloop.

error message

endif.

reagrds

navjot

reward if helpfull

Read only

Former Member
0 Likes
522

Neeraj,

What my understand is for each order number we will have some line items.

Before saving this Order number we need to sum the menge and batch_putput.

If Sum(menge) >= sum(batch_output).

save the data

else.

Error message.

endif.

Take all the data which needs to store into database into ainternal table ITAB.

Take one more ITAB_TEMP like ITAB.

DATA : v_num type i,

v_menge like ztable-menge,

v_output like ztable-batch_output.

LOOP AT ITAB.

v_num = v_num + 1.

AT NEW AUFNR.

IF v_num ne 1.

IF

UPdate ztabel from ITAB_TEMP structure.

REFRESH ITAB_TEMP.

CLEAR v_menge.

clear v_batch_output.

Endif.

Endif.

ENDAT.

MOVE : ITAB-AUFNR TO ITAB-TEMP-AUFNR,

ITAB-ATNR TO ITAB-TEMP-MATNR,

ITAB-CHARGE TO ITAB-TEMP-CHARGE,

ITAB-MENGE TO v_MENGE.

ITAB-menge = itab-menge + V_MENGE.

ITAB-batch_output = itab-batch_output + V_batch_output.

ENDLOOP.

Don't forget to reward if useful.