2011 Oct 06 11:27 AM
Hi experts,
Im new to SAP and am having some problems with alv reports. Im trying to multiply these values(ekko-menge & calp-vkpne) in order to get a total value e.g.
1: ekko-menge * calp-vkpne Total
2: ekko-menge * calp-vkpne Total
My main problem i think is that i cant create a join between the two since their is no corresponding field? Any help appreciated.
2011 Oct 06 7:57 PM
Hi Mike,
My first doubt is, From where are you getting a value in the field CALP-VKPNE,which table are you referring to get this value, from the Structure or a data base table.
create an internal table with type
types: begin of ty_tab1,
menge type ekko-menge,
vkpne like calp-vkpne,
total type dmbtr,
end of ty_tab1.
populate the internal table by having a SELECT query on your relevant tables
loop at it_tab1 into wa_tab1.
wa_tab1-total = wa_tab1-menge * wa_tab1-vkpne.
modify it_tab1 from wa_tab1 transporting total.
endloopRevert for further clarification
Thanks
Sri
Hi experts,
Im new to SAP and am having some problems with alv reports. Im trying to multiply these values(ekko-menge & calp-vkpne) in order to get a total value e.g.
1: ekko-menge * calp-vkpne Total
2: ekko-menge * calp-vkpne Total
My main problem i think is that i cant create a join between the two since their is no corresponding field? Any help appreciated.
2011 Oct 06 12:33 PM
Hi
You Create an internal table with all your fields what ever is required along with fields menge,calp and total by reffering to their correspond ing data types.After that you fetch all the data related to thier fields into that internal table by using 'for all entreis'.After that you fetch data by reading all the tables with in the internal table loop and also while fetching the data into internal you can also do calculations as total etc.
Thiis is how you can fetch all the required data into an internal table along with calculations and you can display as you like.
Regards,
Adil
2011 Oct 06 1:12 PM
Thanks for the help. Is there a possibility you could put up some code examples or links to any tutorials online that wuld help me? Thanks again
2011 Oct 06 3:01 PM
Hello Mike!
Let me try help you...
For to create the internal table, you can do as follow:
TYPES: BEGIN OF TYPE ty_zzz,
menge type ekko-menge,
vkpne type calp-vkpne,
END OF ty_zzz.
TYPES: XXXX TYPE TABLE OF ty_zzz.
After that, you do your select´s into xxx table, and use for your propose.
I hope it helps you!
2011 Oct 06 7:57 PM
Hi Mike,
My first doubt is, From where are you getting a value in the field CALP-VKPNE,which table are you referring to get this value, from the Structure or a data base table.
create an internal table with type
types: begin of ty_tab1,
menge type ekko-menge,
vkpne like calp-vkpne,
total type dmbtr,
end of ty_tab1.
populate the internal table by having a SELECT query on your relevant tables
loop at it_tab1 into wa_tab1.
wa_tab1-total = wa_tab1-menge * wa_tab1-vkpne.
modify it_tab1 from wa_tab1 transporting total.
endloopRevert for further clarification
Thanks
Sri
2011 Oct 10 12:34 PM
Thanks guys. I have it working now.Really appreciate the help!
| User | Count |
|---|---|
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |