Application Development 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: 

Customized field for ALV and also to show value

Former Member
0 Kudos

HI All,     I need to create one ALV report in which these fields i have to show in output. Vendor No  Ven Name Cumulative Spend per PO Commitments Cumulative Spend per IR        Expiry Date Here I will get the value of Vendor no, Name , date from the LFa1 table and i can show in fieldcat but i am bit confuse regarding 3 and 4 field. These two field how to show in fieldcat.   FIELDCATALOG-FIELDNAME  = 'LFA1-LIFNR'.   FIELDCATALOG-SELTEXT_M  = 'Vendor Number'.   FIELDCATALOG-COL_POS    = 0.   APPEND FIELDCATALOG TO FIELDCATALOG.   CLEAR  FIELDCATALOG. same way how can i show the field Cumulative Spend Per PO commitments and Cumulative Spend per IR.Please help me out.Also got logic for to show value in these 2 fields. Logic/Steps for picking "Cumulative Spend per PO Commitments" The net price can be picked up from the PO Item Condition (EKPO-NETWR) This value for all items needs to be summed for the PO to get the Total Net Value for PO Get the PO number This value should be summed together for all the PO per Vendor so as to obtain the Cumulative Spend for the Vendor from Table EKKO Logic/Steps for picking "Cumulative Spend per IR" Select Table EKBE Put the PO Number Select PO Hist Category=Q Execute Select 'Amt in LC' (EKBE-DMBTR field) for the 'Cumulative Spend per IR' But not getting properly these logic in code, so please help me out for this also. Thanks and Regards Sankil Pandya

1 REPLY 1

naveen_inuganti2
Active Contributor
0 Kudos

Declare one Internal table with all output fields and populate that table with data that is required.

You just need to use Field Name of your output table to fill fieldcatlog table. (Table name is not required in general scenario).

That way, fill your fieldcatlog table with all fields and corresponding properties. Now pass this fieldcatlog table and your final internal table (with data) to Function Module or Method which can generate ALV report. If you are using SET_TABLE_FOR_FIRST_DISPLAY then you can pass output internal table to IT_OUTTAB and Fieldcat to IT_FIELDCATALOG (These two are changing parameters).

Regards,

Naveen